Skip to content

Commit

Permalink
tests ok
Browse files Browse the repository at this point in the history
  • Loading branch information
FikretCin committed Dec 8, 2023
1 parent ebee42e commit e9ab69c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 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 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
9 changes: 5 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 @@ -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(),
Expand Down

0 comments on commit e9ab69c

Please sign in to comment.