We will be off from 27/1 (Monday) to 31/1 (Friday) (GMT +7) for our Tet Holiday (Lunar New Year) in our country

Commit 1e74f228 authored by rikterbeek's avatar rikterbeek

Fixes #44 add storeId in retrieve correct configuration for the specific store...

Fixes #44 add storeId in retrieve correct configuration for the specific store where the order is made
parent 126c2065
...@@ -262,7 +262,7 @@ class PaymentRequest extends DataObject ...@@ -262,7 +262,7 @@ class PaymentRequest extends DataObject
if ($paymentMethodCode == \Adyen\Payment\Model\Method\Cc::METHOD_CODE || if ($paymentMethodCode == \Adyen\Payment\Model\Method\Cc::METHOD_CODE ||
$paymentMethodCode == \Adyen\Payment\Model\Method\Oneclick::METHOD_CODE) { $paymentMethodCode == \Adyen\Payment\Model\Method\Oneclick::METHOD_CODE) {
// If cse is enabled add encrypted card date into request // If cse is enabled add encrypted card date into request
if ($this->_adyenHelper->getAdyenCcConfigDataFlag('cse_enabled')) { if ($this->_adyenHelper->getAdyenCcConfigDataFlag('cse_enabled', $storeId)) {
$request['additionalData']['card.encrypted.json'] = $request['additionalData']['card.encrypted.json'] =
$payment->getAdditionalInformation("encrypted_data"); $payment->getAdditionalInformation("encrypted_data");
} else { } else {
...@@ -303,7 +303,8 @@ class PaymentRequest extends DataObject ...@@ -303,7 +303,8 @@ class PaymentRequest extends DataObject
public function authorise3d($payment) public function authorise3d($payment)
{ {
$order = $payment->getOrder(); $order = $payment->getOrder();
$merchantAccount = $this->_adyenHelper->getAdyenAbstractConfigData("merchant_account"); $storeId = $order->getStoreId();
$merchantAccount = $this->_adyenHelper->getAdyenAbstractConfigData("merchant_account", $storeId);
$shopperIp = $order->getRemoteIp(); $shopperIp = $order->getRemoteIp();
$md = $payment->getAdditionalInformation('md'); $md = $payment->getAdditionalInformation('md');
...@@ -338,8 +339,9 @@ class PaymentRequest extends DataObject ...@@ -338,8 +339,9 @@ class PaymentRequest extends DataObject
*/ */
public function capture(\Magento\Payment\Model\InfoInterface $payment, $amount) public function capture(\Magento\Payment\Model\InfoInterface $payment, $amount)
{ {
$storeId = $payment->getOrder()->getStoreId();
$pspReference = $this->_getPspReference($payment); $pspReference = $this->_getPspReference($payment);
$merchantAccount = $this->_adyenHelper->getAdyenAbstractConfigData("merchant_account"); $merchantAccount = $this->_adyenHelper->getAdyenAbstractConfigData("merchant_account", $storeId);
$currency = $payment->getOrder()->getBaseCurrencyCode(); $currency = $payment->getOrder()->getBaseCurrencyCode();
//format the amount to minor units //format the amount to minor units
...@@ -385,8 +387,9 @@ class PaymentRequest extends DataObject ...@@ -385,8 +387,9 @@ class PaymentRequest extends DataObject
*/ */
public function cancelOrRefund(\Magento\Payment\Model\InfoInterface $payment) public function cancelOrRefund(\Magento\Payment\Model\InfoInterface $payment)
{ {
$storeId = $payment->getOrder()->getStoreId();
$pspReference = $this->_getPspReference($payment); $pspReference = $this->_getPspReference($payment);
$merchantAccount = $this->_adyenHelper->getAdyenAbstractConfigData("merchant_account"); $merchantAccount = $this->_adyenHelper->getAdyenAbstractConfigData("merchant_account", $storeId);
$request = [ $request = [
"merchantAccount" => $merchantAccount, "merchantAccount" => $merchantAccount,
...@@ -424,8 +427,9 @@ class PaymentRequest extends DataObject ...@@ -424,8 +427,9 @@ class PaymentRequest extends DataObject
*/ */
public function refund(\Magento\Payment\Model\InfoInterface $payment, $amount) public function refund(\Magento\Payment\Model\InfoInterface $payment, $amount)
{ {
$storeId = $payment->getOrder()->getStoreId();
$pspReference = $this->_getPspReference($payment); $pspReference = $this->_getPspReference($payment);
$merchantAccount = $this->_adyenHelper->getAdyenAbstractConfigData("merchant_account"); $merchantAccount = $this->_adyenHelper->getAdyenAbstractConfigData("merchant_account", $storeId);
$currency = $payment->getOrder()->getBaseCurrencyCode(); $currency = $payment->getOrder()->getBaseCurrencyCode();
//format the amount to minor units //format the amount to minor units
...@@ -536,12 +540,13 @@ class PaymentRequest extends DataObject ...@@ -536,12 +540,13 @@ class PaymentRequest extends DataObject
* *
* @param $recurringDetailReference * @param $recurringDetailReference
* @param $shopperReference * @param $shopperReference
* @param $storeId
* @return bool * @return bool
* @throws \Magento\Framework\Exception\LocalizedException * @throws \Magento\Framework\Exception\LocalizedException
*/ */
public function disableRecurringContract($recurringDetailReference, $shopperReference) public function disableRecurringContract($recurringDetailReference, $shopperReference, $storeId)
{ {
$merchantAccount = $this->_adyenHelper->getAdyenAbstractConfigData("merchant_account"); $merchantAccount = $this->_adyenHelper->getAdyenAbstractConfigData("merchant_account", $storeId);
$request = [ $request = [
"merchantAccount" => $merchantAccount, "merchantAccount" => $merchantAccount,
......
...@@ -108,7 +108,8 @@ class Oneclick extends \Adyen\Payment\Model\Method\Cc ...@@ -108,7 +108,8 @@ class Oneclick extends \Adyen\Payment\Model\Method\Cc
try { try {
$this->_paymentRequest->disableRecurringContract( $this->_paymentRequest->disableRecurringContract(
$agreement->getReferenceId(), $agreement->getReferenceId(),
$agreement->getCustomerReference() $agreement->getCustomerReference(),
$agreement->getStoreId()
); );
} catch(Exception $e) { } catch(Exception $e) {
throw new \Magento\Framework\Exception\LocalizedException(__('Failed to disable this contract')); throw new \Magento\Framework\Exception\LocalizedException(__('Failed to disable this contract'));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment