Skip to content

Commit db3f87c

Browse files
committed
Remove deprecated cards fixes #6
1 parent 39582b2 commit db3f87c

File tree

4 files changed

+10
-68
lines changed

4 files changed

+10
-68
lines changed

README.md

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -62,24 +62,15 @@ $authorization = $client->authorizations->authorize([
6262
'currency' => 'EUR',
6363
'ip' => '1.1.1.1',
6464
'card' => [
65-
'number' => '4111111111111111',
65+
'pan' => '4111111111111111',
6666
'expire_month' => '06',
6767
'expire_year' => '2018',
6868
'csc' => '123',
69+
'pares' => '<some-pares-value>',
6970
],
7071
]);
7172
```
7273

73-
You can also use a card previously tokenized.
74-
75-
```php
76-
$authorization = $client->authorizations->authorizeFromCardId($cardId, [
77-
'amount' => 2050,
78-
'currency' => 'EUR',
79-
'ip' => '1.1.1.1',
80-
]);
81-
```
82-
8374
### Captures
8475

8576
To transfer money from a cardholder’s bank account to your merchant bank account you make a new capture resource. You can make multiple captures for an authorization transaction.
@@ -127,21 +118,6 @@ $client->credits->credit($card['id'], [
127118
]);
128119
```
129120

130-
### Cards
131-
132-
A card resource (token) corresponds to a payment card and can be used to make a credit or authorization transaction without providing sensitive card data. A card resource must be used to make subsequent recurring authorization transactions.
133-
134-
```php
135-
$card = $client->cards->createCard([
136-
'card' => [
137-
'number' => '4111111111111111',
138-
'expire_month' => '06',
139-
'expire_year' => '2018',
140-
'csc' => '123',
141-
],
142-
]);
143-
```
144-
145121
### Accounts
146122

147123
The account resource holds basic merchant account information.
@@ -162,12 +138,10 @@ $authorization = $client->authorizations->authorize([
162138
'currency' => 'EUR',
163139
'ip' => '1.1.1.1',
164140
'card' => [
165-
'number' => '4111111111111111',
141+
'pan' => '4111111111111111',
166142
'expire_month' => '06',
167143
'expire_year' => '2018',
168144
'csc' => '123',
169-
],
170-
'threed_secure' => [
171145
'pares' => '<some-pares-value>',
172146
],
173147
]);

src/Api/Authorizations.php

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,18 @@ class Authorizations extends AbstractApi
99
{
1010
public function authorize(array $params) : array
1111
{
12-
if (!isset($params['amount'], $params['currency'], $params['card'])) {
13-
throw new MissingArgumentException(['amount', 'currency', 'card']);
12+
if (!isset($params['amount'], $params['currency'])) {
13+
throw new MissingArgumentException(['amount', 'currency']);
1414
}
1515

16-
if (isset($params['threed_secure']['pares'])) {
17-
$params['threed_secure']['pares'] = urlencode($params['threed_secure']['pares']);
16+
if (isset($params['card']['pares'])) {
17+
$params['card']['pares'] = urlencode($params['card']['pares']);
1818
}
19-
20-
return $this->post('/authorizations', $params);
21-
}
22-
23-
public function authorizeFromCardId(string $cardId, array $params) : array
24-
{
25-
if (!isset($params['amount'], $params['currency'])) {
26-
throw new MissingArgumentException(['amount', 'currency']);
19+
if (isset($params['mobilepayonline']['pares'])) {
20+
$params['mobilepayonline']['pares'] = urlencode($params['mobilepayonline']['pares']);
2721
}
2822

29-
return $this->post(sprintf('/cards/%s/authorizations', $cardId), $params);
23+
return $this->post('/authorizations', $params);
3024
}
3125

3226
public function getAuthorization(string $id) : array

src/Api/Cards.php

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/Client.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
* @method Api\Accounts accounts()
2121
* @method Api\Authorizations authorizations()
2222
* @method Api\Captures captures()
23-
* @method Api\Cards cards()
2423
* @method Api\Credits credits()
2524
* @method Api\Refunds refunds()
2625
* @method Api\Voids voids()
@@ -84,8 +83,6 @@ public function api($name) : Api\AbstractApi
8483
return new Api\Authorizations($this);
8584
case 'captures':
8685
return new Api\Captures($this);
87-
case 'cards':
88-
return new Api\Cards($this);
8986
case 'credits':
9087
return new Api\Credits($this);
9188
case 'refunds':

0 commit comments

Comments
 (0)