-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #59 from TransactPRO/A2A_transactions_added_to_lib
A2A transactions added to lib
- Loading branch information
Showing
9 changed files
with
227 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -287,6 +287,43 @@ $response = $gateClient->doCredit(array( | |
)); | ||
``` | ||
|
||
|
||
#### Init A2A transactions | ||
```php | ||
$response = $gateClient->initA2A(array( | ||
'rs' => 'AAAA', | ||
'merchant_transaction_id' => microtime(true), | ||
'user_ip' => '127.0.0.1', | ||
'description' => 'Test description', | ||
'amount' => '100', | ||
'currency' => 'LVL', | ||
'name_on_card' => 'Vasyly Pupkin', | ||
'street' => 'Main street 1', | ||
'zip' => 'LV-0000', | ||
'city' => 'Riga', | ||
'country' => 'LV', | ||
'state' => 'NA', | ||
'email' => '[email protected]', | ||
'phone' => '+371 11111111', | ||
'card_bin' => '511111', | ||
'bin_name' => 'BANK', | ||
'bin_phone' => '+371 11111111', | ||
'merchant_site_url' => 'http://www.example.com', | ||
'save_card' => '1', | ||
'cardname' => 'John Doe', | ||
'client_birth_date' => '29061988', | ||
)); | ||
``` | ||
|
||
#### Do A2A transactions | ||
```php | ||
$response = $gateClient->doA2A(array( | ||
'f_extended' => '5', | ||
'init_transaction_id' => '13hpf5rp1e0ss72dypjnhalzn1wmrkfmsjtwzocg', | ||
'cc_2' => '5111111111111111', | ||
)); | ||
``` | ||
|
||
#### Init store card for further SMS transactions without card | ||
```php | ||
$response = $gateClient->initStoreCardSms(array( | ||
|
@@ -383,6 +420,9 @@ For P2P recurrent use: | |
For Credit recurrent use: | ||
- initRecurrentP2P | ||
|
||
For Credit recurrent use: | ||
- initRecurrentA2A | ||
|
||
``Fields in these requests are same, read documetation for details.`` | ||
|
||
Example: | ||
|
@@ -405,6 +445,9 @@ For P2P recurrent use: | |
For Credit recurrent use: | ||
- doRecurrentP2P | ||
|
||
For A2A recurrent use: | ||
- doRecurrentA2A | ||
|
||
Example: | ||
```php | ||
$response = $gateClient->chargeRecurrent(array( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace TransactPRO\Gate\Builders; | ||
|
||
class DoA2ADataBuilder extends ChargeDataBuilder | ||
{ | ||
public function build() | ||
{ | ||
return array( | ||
'cc_2' => $this->getField('cc_2'), | ||
'init_transaction_id' => $this->getField('init_transaction_id'), | ||
'f_extended' => $this->getField('f_extended', 5), | ||
'expire2' => $this->getField('expire2'), | ||
'merchant_referring_url' => $this->getField('merchant_referring_url'), | ||
); | ||
} | ||
|
||
protected function checkData() | ||
{ | ||
$this->checkMandatoryField('cc_2'); | ||
$this->checkMandatoryField('init_transaction_id'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
namespace TransactPRO\Gate\Builders; | ||
|
||
class DoRecurrentA2ADataBuilder extends ChargeRecurrentDataBuilder | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
namespace TransactPRO\Gate\Builders; | ||
|
||
class InitA2ADataBuilder extends InitDataBuilder | ||
{ | ||
public function build() | ||
{ | ||
return array( | ||
'rs' => $this->getField('rs'), | ||
'merchant_transaction_id' => $this->getField('merchant_transaction_id'), | ||
'user_ip' => $this->getField('user_ip', $this->getRemoteAddress()), | ||
'description' => $this->getField('description'), | ||
'amount' => $this->getField('amount'), | ||
'currency' => $this->getField('currency'), | ||
'name_on_card' => $this->getField('name_on_card'), | ||
'street' => $this->getField('street'), | ||
'zip' => $this->getField('zip'), | ||
'city' => $this->getField('city'), | ||
'country' => $this->getField('country'), | ||
'state' => $this->getField('state', 'NA'), | ||
'email' => $this->getField('email'), | ||
'phone' => $this->getField('phone'), | ||
'card_bin' => $this->getField('card_bin'), | ||
'bin_name' => $this->getField('bin_name'), | ||
'bin_phone' => $this->getField('bin_phone'), | ||
'merchant_site_url' => $this->getField('merchant_site_url'), | ||
'save_card' => $this->getField('save_card'), | ||
'cardname' => $this->getField('cardname'), | ||
'recipient_name' => $this->getField('recipient_name'), | ||
'client_birth_date' => $this->getField('client_birth_date'), | ||
); | ||
} | ||
|
||
protected function checkData() | ||
{ | ||
$this->checkMandatoryField('rs'); | ||
$this->checkMandatoryField('merchant_transaction_id'); | ||
$this->checkMandatoryField('amount'); | ||
$this->checkMandatoryField('currency'); | ||
$this->checkMandatoryField('name_on_card'); | ||
$this->checkMandatoryField('client_birth_date'); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
lib/TransactPRO/Gate/Builders/InitRecurrentA2ADataBuilder.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
namespace TransactPRO\Gate\Builders; | ||
|
||
class InitRecurrentA2ADataBuilder extends InitRecurrentDataBuilder | ||
{ | ||
} |
Oops, something went wrong.