From 8df4a6e858407bc7732bd88e850cd18ff14853f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fikret=20=C3=87=C4=B0N?= Date: Fri, 8 Dec 2023 14:53:33 +0300 Subject: [PATCH 1/5] EstPos ve EstV3Pos callbackUrl sisteminin gereksinimi refreshtime parametresi EstPosRequestDataMapper::create3DFormDataCommon methoda eklendi --- src/DataMapper/EstPosRequestDataMapper.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/DataMapper/EstPosRequestDataMapper.php b/src/DataMapper/EstPosRequestDataMapper.php index 130809d6..bb1f3fab 100644 --- a/src/DataMapper/EstPosRequestDataMapper.php +++ b/src/DataMapper/EstPosRequestDataMapper.php @@ -270,6 +270,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), From 86bd4ebb6899e1688aa61ce6315da9c889b270eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fikret=20=C3=87=C4=B0N?= Date: Fri, 8 Dec 2023 15:02:22 +0300 Subject: [PATCH 2/5] refreshed time int to string --- src/DataMapper/EstPosRequestDataMapper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DataMapper/EstPosRequestDataMapper.php b/src/DataMapper/EstPosRequestDataMapper.php index bb1f3fab..a8352f80 100644 --- a/src/DataMapper/EstPosRequestDataMapper.php +++ b/src/DataMapper/EstPosRequestDataMapper.php @@ -270,7 +270,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 + '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), From ebee42e2f25ab5d98d6c796171b8a88ac14881ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fikret=20=C3=87=C4=B0N?= Date: Fri, 8 Dec 2023 15:04:38 +0300 Subject: [PATCH 3/5] =?UTF-8?q?Unit=20test=20d=C3=BCzenlendi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/DataMapper/EstV3PosRequestDataMapperTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/DataMapper/EstV3PosRequestDataMapperTest.php b/tests/DataMapper/EstV3PosRequestDataMapperTest.php index 22168d8f..4bdea209 100644 --- a/tests/DataMapper/EstV3PosRequestDataMapperTest.php +++ b/tests/DataMapper/EstV3PosRequestDataMapperTest.php @@ -167,6 +167,7 @@ public function testGet3DHostFormData() 'callbackUrl' => $this->order['fail_url'], 'rnd' => $this->order['rand'], 'hashAlgorithm' => 'ver3', + 'refreshtime' => '10', 'lang' => 'tr', 'currency' => '949', 'TranType' => 'Auth', From e9ab69cbdfecc195d426b8cda2efbcfd0b3fd431 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fikret=20=C3=87=C4=B0N?= Date: Fri, 8 Dec 2023 15:35:51 +0300 Subject: [PATCH 4/5] tests ok --- src/DataMapper/EstPosRequestDataMapper.php | 1 + tests/DataMapper/EstPosRequestDataMapperTest.php | 4 ++++ tests/DataMapper/EstV3PosRequestDataMapperTest.php | 9 +++++---- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/DataMapper/EstPosRequestDataMapper.php b/src/DataMapper/EstPosRequestDataMapper.php index a8352f80..7ecef742 100644 --- a/src/DataMapper/EstPosRequestDataMapper.php +++ b/src/DataMapper/EstPosRequestDataMapper.php @@ -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()], diff --git a/tests/DataMapper/EstPosRequestDataMapperTest.php b/tests/DataMapper/EstPosRequestDataMapperTest.php index 06c4da8a..ba33ab96 100644 --- a/tests/DataMapper/EstPosRequestDataMapperTest.php +++ b/tests/DataMapper/EstPosRequestDataMapperTest.php @@ -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, @@ -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', @@ -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', @@ -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', diff --git a/tests/DataMapper/EstV3PosRequestDataMapperTest.php b/tests/DataMapper/EstV3PosRequestDataMapperTest.php index 4bdea209..e2784622 100644 --- a/tests/DataMapper/EstV3PosRequestDataMapperTest.php +++ b/tests/DataMapper/EstV3PosRequestDataMapperTest.php @@ -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, @@ -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(), @@ -179,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(), From ab20175265ef9459ac9bfabb7c7e42ce2c45cd2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fikret=20=C3=87=C4=B0N?= Date: Wed, 13 Dec 2023 23:20:03 +0300 Subject: [PATCH 5/5] refreshtime to refreshTime --- src/DataMapper/EstPosRequestDataMapper.php | 2 +- tests/DataMapper/EstPosRequestDataMapperTest.php | 8 ++++---- tests/DataMapper/EstV3PosRequestDataMapperTest.php | 4 ++-- .../ResponseDataMapper/EstPosResponseDataMapperTest.php | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/DataMapper/EstPosRequestDataMapper.php b/src/DataMapper/EstPosRequestDataMapper.php index 7ecef742..a492f52b 100644 --- a/src/DataMapper/EstPosRequestDataMapper.php +++ b/src/DataMapper/EstPosRequestDataMapper.php @@ -271,7 +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 + '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), diff --git a/tests/DataMapper/EstPosRequestDataMapperTest.php b/tests/DataMapper/EstPosRequestDataMapperTest.php index ba33ab96..b1771a9e 100644 --- a/tests/DataMapper/EstPosRequestDataMapperTest.php +++ b/tests/DataMapper/EstPosRequestDataMapperTest.php @@ -322,7 +322,7 @@ public function testGet3DFormData() 'okUrl' => $this->order['success_url'], 'failUrl' => $this->order['fail_url'], 'callbackUrl' => $this->order['fail_url'], - 'refreshtime' => '10', + 'refreshTime' => '10', 'rnd' => $this->order['rand'], 'lang' => 'tr', 'currency' => 949, @@ -408,7 +408,7 @@ public function testGet3DHostFormData() 'okUrl' => $this->order['success_url'], 'failUrl' => $this->order['fail_url'], 'callbackUrl' => $this->order['fail_url'], - 'refreshtime' => '10', + 'refreshTime' => '10', 'rnd' => $this->order['rand'], 'lang' => 'tr', 'currency' => '949', @@ -527,7 +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', + 'refreshTime' => '10', 'rnd' => 'rand', 'lang' => 'tr', 'currency' => '949', @@ -570,7 +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', + 'refreshTime' => '10', 'rnd' => 'rand', 'lang' => 'tr', 'currency' => '949', diff --git a/tests/DataMapper/EstV3PosRequestDataMapperTest.php b/tests/DataMapper/EstV3PosRequestDataMapperTest.php index e2784622..313bd006 100644 --- a/tests/DataMapper/EstV3PosRequestDataMapperTest.php +++ b/tests/DataMapper/EstV3PosRequestDataMapperTest.php @@ -95,7 +95,7 @@ public function testGet3DFormData() 'callbackUrl' => $this->order['fail_url'], 'rnd' => $this->order['rand'], 'hashAlgorithm' => 'ver3', - 'refreshtime' => '10', + 'refreshTime' => '10', 'lang' => 'tr', 'currency' => '949', 'TranType' => 'Auth', @@ -168,7 +168,7 @@ public function testGet3DHostFormData() 'callbackUrl' => $this->order['fail_url'], 'rnd' => $this->order['rand'], 'hashAlgorithm' => 'ver3', - 'refreshtime' => '10', + 'refreshTime' => '10', 'lang' => 'tr', 'currency' => '949', 'TranType' => 'Auth', diff --git a/tests/DataMapper/ResponseDataMapper/EstPosResponseDataMapperTest.php b/tests/DataMapper/ResponseDataMapper/EstPosResponseDataMapperTest.php index 5650ef21..d95bb086 100644 --- a/tests/DataMapper/ResponseDataMapper/EstPosResponseDataMapperTest.php +++ b/tests/DataMapper/ResponseDataMapper/EstPosResponseDataMapperTest.php @@ -736,7 +736,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', @@ -822,7 +822,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',