Skip to content

Commit

Permalink
Merge pull request Credit-Jeeves#26 from Lampelk/master
Browse files Browse the repository at this point in the history
Adding storedCredential to authorize method
  • Loading branch information
francoisneron authored Jun 22, 2018
2 parents 35d6f58 + 0aa6cee commit 2087935
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
1 change: 1 addition & 0 deletions source/Paysafe/CardPaymentService.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public function authorize(CardPayments\Authorization $auth)
'accordD',
'description',
'splitpay',
'storedCredential'
));

$request = new Request(array(
Expand Down
4 changes: 3 additions & 1 deletion source/Paysafe/CardPayments/Authorization.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
* @property \Paysafe\Error $error
* @property \Paysafe\Link[] $links
* @property \Paysafe\CardPayments\SplitPay[] $splitpay
* @property \Paysafe\CardPayments\StoredCredential $storedCredential
*/
class Authorization extends \Paysafe\JSONObject implements \Paysafe\Pageable
{
Expand Down Expand Up @@ -114,7 +115,8 @@ public static function getPageableArrayKey()
'settlements' => 'array:\Paysafe\CardPayments\Settlement',
'error' => '\Paysafe\Error',
'links' => 'array:\Paysafe\Link',
'splitpay' => 'array:\Paysafe\CardPayments\SplitPay',
'splitpay' => 'array:\Paysafe\CardPayments\SplitPay',
'storedCredential' => '\Paysafe\CardPayments\StoredCredential'
);

}
25 changes: 25 additions & 0 deletions source/Paysafe/CardPayments/StoredCredential.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php
/*
* TODO insert appropriate copyright notice
*/

namespace Paysafe\CardPayments;

/**
* @property string $type
* @property number $occurrence
*/
class StoredCredential extends \Paysafe\JSONObject
{
protected static $fieldTypes = array(
'type' => array(
'ADHOC',
'TOPUP',
'RECURRING'
),
'occurrence' => array(
'INITIAL',
'SUBSEQUENT'
)
);
}
4 changes: 4 additions & 0 deletions tests/paysafe/CardPayments/AuthorizationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,10 @@ public function testAllFieldsValidValues()
'linkedAccount' => 'link_account_id',
'amount' => 500,
]],
'storedCredential' => [
'type' => 'RECURRING',
'occurrence' => 'SUBSEQUENT'
]
];
$auth = new Authorization($auth_array);

Expand Down

0 comments on commit 2087935

Please sign in to comment.