Skip to content

Commit

Permalink
Merge pull request #168 from FikretCin/master
Browse files Browse the repository at this point in the history
Akbank (Payten) parametre talebine istinaden 'refreshtime' parametresi eklendi.
  • Loading branch information
nuryagdym authored Dec 14, 2023
2 parents bbc487e + ab20175 commit 5ff8f20
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/DataMapper/EstPosRequestDataMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ public function create3DFormData(AbstractPosAccount $account, $order, string $tx
*/
public function create3DFormDataCommon(AbstractPosAccount $account, $order, string $txType, string $gatewayURL, ?AbstractCreditCard $card = null): array
{

$inputs = [
'clientid' => $account->getClientId(),
'storetype' => $this->secureTypeMappings[$account->getModel()],
Expand All @@ -270,6 +271,7 @@ public function create3DFormDataCommon(AbstractPosAccount $account, $order, stri
'failUrl' => $order->fail_url,
// musteri 3D onay sayfasinda islemleri tamamlamadan kapatirsa, banka bu sayfaya bir istek gonderecek.
'callbackUrl' => $order->fail_url,
'refreshTime' => '10', //callbackUrl sisteminin doğru çalışması için eklenmesi gereken parametre
'rnd' => $order->rand,
'lang' => $this->getLang($account, $order),
'currency' => $this->mapCurrency($order->currency),
Expand Down
4 changes: 4 additions & 0 deletions tests/DataMapper/EstPosRequestDataMapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ public function testGet3DFormData()
'okUrl' => $this->order['success_url'],
'failUrl' => $this->order['fail_url'],
'callbackUrl' => $this->order['fail_url'],
'refreshTime' => '10',
'rnd' => $this->order['rand'],
'lang' => 'tr',
'currency' => 949,
Expand Down Expand Up @@ -407,6 +408,7 @@ public function testGet3DHostFormData()
'okUrl' => $this->order['success_url'],
'failUrl' => $this->order['fail_url'],
'callbackUrl' => $this->order['fail_url'],
'refreshTime' => '10',
'rnd' => $this->order['rand'],
'lang' => 'tr',
'currency' => '949',
Expand Down Expand Up @@ -525,6 +527,7 @@ public static function threeDFormDataProvider(): iterable
'okUrl' => 'https://domain.com/success',
'failUrl' => 'https://domain.com/fail_url',
'callbackUrl' => 'https://domain.com/fail_url',
'refreshTime' => '10',
'rnd' => 'rand',
'lang' => 'tr',
'currency' => '949',
Expand Down Expand Up @@ -567,6 +570,7 @@ public static function threeDFormDataProvider(): iterable
'okUrl' => 'https://domain.com/success',
'failUrl' => 'https://domain.com/fail_url',
'callbackUrl' => 'https://domain.com/fail_url',
'refreshTime' => '10',
'rnd' => 'rand',
'lang' => 'tr',
'currency' => '949',
Expand Down
10 changes: 6 additions & 4 deletions tests/DataMapper/EstV3PosRequestDataMapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,14 @@ public function testGet3DFormData()
'callbackUrl' => $this->order['fail_url'],
'rnd' => $this->order['rand'],
'hashAlgorithm' => 'ver3',
'refreshTime' => '10',
'lang' => 'tr',
'currency' => 949,
'currency' => '949',
'TranType' => 'Auth',
'taksit' => '',
];

$hash = '7MGmDH2CY9jlFd4kVHwdvlyt07hIqkiBWVR8bkjAiaaRhK2XUHyvrDLqv0vlG6YY8bXChDkLfnDwVLi3Pvg5lQ==';
$hash = '06DYVTzCUae0u99v6uO08kih+3ADmTkqbGYakt30kNQj+5Hrt26701fXWMS+TFrqtsU1ongDfukk9fjTq5mZTQ==';
$inputs['hash'] = $hash;
$form = [
'gateway' => $gatewayURL,
Expand All @@ -124,7 +125,7 @@ public function testGet3DFormData()
$form['inputs']['cv2'] = $card->getCvv();

unset($form['inputs']['hash']);
$form['inputs']['hash'] = '7EgK2aMhS848ZMEkl2d0s1dFXlMhCy4LS5FFk+k/FbEmmVqBqx6TtQ1Yg7aW0KQa/5hrQODwBVT3SCUwfXHEsg==';
$form['inputs']['hash'] = 'jXlIRQn+vHyvQ9Byxk0v2pGGwnoBc1bPEJaYkcDNOq9JOn7MJr0+l5olODtjYy2KsHMZwjKWLpQevXVIHLtYyw==';

$this->assertEquals($form, $this->requestDataMapper->create3DFormData(
$this->pos->getAccount(),
Expand Down Expand Up @@ -167,6 +168,7 @@ public function testGet3DHostFormData()
'callbackUrl' => $this->order['fail_url'],
'rnd' => $this->order['rand'],
'hashAlgorithm' => 'ver3',
'refreshTime' => '10',
'lang' => 'tr',
'currency' => '949',
'TranType' => 'Auth',
Expand All @@ -178,7 +180,7 @@ public function testGet3DHostFormData()
'inputs' => $inputs,
];

$form['inputs']['hash'] = 'pxvr9oG9G6v2AU/Lci3qs7OiBAwcvAaLotG5rorJVe31DJN/wlVDReWpqFSJojTLPs6pPiS1L1U+QkE0dJJBKw==';
$form['inputs']['hash'] = 'vAxgy0o5YS3CdmqblwAOCuZTpNQ6p6XdhPn3WZqT3LfZoCf2un/Vhr+NlGV5yZiJZYZgZ8l20UAUfH+dhakKAA==';

$this->assertEquals($form, $this->requestDataMapper->create3DFormData(
$pos->getAccount(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ public static function threeDHostPaymentDataProvider(): array
'firmaadi' => 'John Doe',
'islemtipi' => 'Auth',
'campaignOptions' => '000001',
'refreshtime' => '300',
'refreshTime' => '300',
'lang' => 'tr',
'merchantID' => '700655000200',
'maskedCreditCard' => '4355 08** **** 4358',
Expand Down Expand Up @@ -823,7 +823,7 @@ public static function threeDHostPaymentDataProvider(): array
'firmaadi' => 'John Doe',
'islemtipi' => 'Auth',
'campaignOptions' => '000002',
'refreshtime' => '300',
'refreshTime' => '300',
'lang' => 'tr',
'merchantID' => '700655000200',
'maskedCreditCard' => '4355 08** **** 4358',
Expand Down

0 comments on commit 5ff8f20

Please sign in to comment.