Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Zinchenko committed Nov 7, 2018
2 parents 6c18381 + 569d2c3 commit af0b664
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/drivers/cnp/CnpDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,11 @@ public function getPaymentLink($orderId,
$receipt = null)
{
$params = [
'orderId' => $orderId,
'currencyCode' => $currency,
'totalAmount' => $amount * 100,
'description' => $description,
'merchantAdditionalInformationList' => $extraParams,
'returnURL' => $successReturnUrl,
'orderId' => $orderId,
'currencyCode' => $currency,
'totalAmount' => $amount * 100,
'description' => $description,
'returnURL' => $successReturnUrl,
];
if (isset($extraParams['locale'])) {
$params['languageCode'] = $extraParams['locale'];
Expand All @@ -88,6 +87,17 @@ public function getPaymentLink($orderId,
'currencyCode' => $currency,
];
}
unset($extraParams['products']);
}

if (!empty($extraParams)) {
$params['merchantAdditionalInformationList'] = [];
foreach ($extraParams as $key => $value) {
$params['merchantAdditionalInformationList'][] = [
'Key' => $key,
'Value' => (string)$value,
];
}
}

return $this->getTransport()->getPaymentUrl($params);
Expand Down

0 comments on commit af0b664

Please sign in to comment.