Skip to content

Commit

Permalink
Update GarantiPosRequestDataMapper.php
Browse files Browse the repository at this point in the history
  • Loading branch information
nuryagdym authored Oct 2, 2023
1 parent ca29768 commit a8c51be
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/DataMapper/GarantiPosRequestDataMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
class GarantiPosRequestDataMapper extends AbstractRequestDataMapperCrypt
{
/** @var string */
public const API_VERSION = 'v0.01';

/** @var string */
public const API_3D_VERSION = '512';
public const API_VERSION = '512';

/** @var string */
public const CREDIT_CARD_EXP_DATE_FORMAT = 'my';
Expand Down Expand Up @@ -74,13 +71,13 @@ public function create3DPaymentRequestData(AbstractPosAccount $account, $order,
$hashData = [
'id' => $order->id,
'amount' => self::amountFormat($order->amount),
'currency' => $responseData['txncurrencycode'],
'currency' => $this->mapCurrency($order->currency),
];
$hash = $this->crypt->createHash($account, $hashData);

$result = [
'Mode' => $this->getMode(),
'Version' => self::API_3D_VERSION,
'Version' => self::API_VERSION,
'Terminal' => $this->getTerminalData($account, $hash),
'Customer' => [
'IPAddress' => $responseData['customeripaddress'],
Expand Down Expand Up @@ -123,6 +120,7 @@ public function createNonSecurePaymentRequestData(AbstractPosAccount $account, $
$hashData = [
'id' => $order->id,
'amount' => self::amountFormat($order->amount),
'currency' => $this->mapCurrency($order->currency),
];
$hash = $this->crypt->createHash($account, $hashData, $this->mapTxType($txType), $card);

Expand Down Expand Up @@ -166,6 +164,7 @@ public function createNonSecurePostAuthPaymentRequestData(AbstractPosAccount $ac
$hashData = [
'id' => (string) $order->id,
'amount' => self::amountFormat($order->amount),
'currency' => $this->mapCurrency($order->currency),
];
$hash = $this->crypt->createHash($account, $hashData, $this->mapTxType(AbstractGateway::TX_POST_PAY), $card);

Expand Down Expand Up @@ -199,6 +198,7 @@ public function createStatusRequestData(AbstractPosAccount $account, $order): ar
$hashData = [
'id' => $order->id,
'amount' => self::amountFormat($order->amount),
'currency' => $this->mapCurrency($order->currency),
];
$hash = $this->crypt->createHash($account, $hashData, $this->mapTxType(AbstractGateway::TX_STATUS));

Expand Down Expand Up @@ -234,6 +234,7 @@ public function createCancelRequestData(AbstractPosAccount $account, $order): ar
$hashData = [
'id' => $order->id,
'amount' => self::amountFormat($order->amount),
'currency' => $this->mapCurrency($order->currency),

Check failure on line 237 in src/DataMapper/GarantiPosRequestDataMapper.php

View workflow job for this annotation

GitHub Actions / test (7.2, prefer-stable)

Ignored error pattern #^Access to an undefined property object\:\:\$currency\.$# in path /home/runner/work/pos/pos/src/DataMapper/GarantiPosRequestDataMapper.php is expected to occur 1 time, but occurred 2 times.

Check failure on line 237 in src/DataMapper/GarantiPosRequestDataMapper.php

View workflow job for this annotation

GitHub Actions / test (8.0, prefer-stable)

Ignored error pattern #^Access to an undefined property object\:\:\$currency\.$# in path /home/runner/work/pos/pos/src/DataMapper/GarantiPosRequestDataMapper.php is expected to occur 1 time, but occurred 2 times.
];
$hash = $this->crypt->createHash($account, $hashData, $this->mapTxType(AbstractGateway::TX_CANCEL));

Expand Down Expand Up @@ -270,6 +271,7 @@ public function createRefundRequestData(AbstractPosAccount $account, $order): ar
$hashData = [
'id' => $order->id,
'amount' => self::amountFormat($order->amount),
'currency' => $this->mapCurrency($order->currency),
];
$hash = $this->crypt->createHash($account, $hashData, $this->mapTxType(AbstractGateway::TX_REFUND));

Expand Down Expand Up @@ -306,6 +308,7 @@ public function createHistoryRequestData(AbstractPosAccount $account, $order, ar
$hashData = [
'id' => $order->id,
'amount' => self::amountFormat($order->amount),
'currency' => $this->mapCurrency($order->currency),
];
$hash = $this->crypt->createHash($account, $hashData, $this->mapTxType(AbstractGateway::TX_HISTORY));

Expand Down Expand Up @@ -343,7 +346,7 @@ public function create3DFormData(AbstractPosAccount $account, $order, string $tx
$inputs = [
'secure3dsecuritylevel' => $this->secureTypeMappings[$account->getModel()],
'mode' => $this->getMode(),
'apiversion' => self::API_3D_VERSION,
'apiversion' => self::API_VERSION,
'terminalprovuserid' => $account->getUsername(),
'terminaluserid' => $account->getUsername(),
'terminalmerchantid' => $account->getClientId(),
Expand Down

0 comments on commit a8c51be

Please sign in to comment.