You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have tried to configure the plugin to work with different merchant accounts for different Shopware shops but only the default merchant account is used when fetching payment methods from Adyen. Different merchant accounts have different payment methods so this means the wrong payment methods are returned.
Inside the method \AdyenPayment\Components\Adyen\PaymentMethodService::getPaymentMethods a call to get the merchant account from the configuration is made on line 79: $this->configuration->getMerchantAccount()
This always returns the merchant account of the default Shopware shop. The getMerchantAccount method has the following signature: public function getMerchantAccount($shop = false): string
If the call on line 79 is changed to include the shop, $this->configuration->getMerchantAccounts(Shopware()->Shop()), this returns the correct merchant account meaning the correct payment methods are returned from Adyen.
The getMerchantAccount method is called from two other sites so I would guess that the shop also needs to be an argument in these places.
To Reproduce
Setup two shops with different Adyen merchant accounts.
Proceed to checkout in the second (non-default) shop
The incorrect merchant account is used as the request parameter inside \AdyenPayment\Components\Adyen\PaymentMethodService::getPaymentMethods
The incorrect payment methods are returned
Expected behavior
Setup two shops with different Adyen merchant accounts.
Proceed to checkout in the second (non-default) shop
The correct merchant account is used as the request parameter inside \AdyenPayment\Components\Adyen\PaymentMethodService::getPaymentMethods
The correct payment methods are returned
The text was updated successfully, but these errors were encountered:
wannevancamp
pushed a commit
to wannevancamp/adyen-shopware5
that referenced
this issue
Oct 22, 2020
Describe the bug
I have tried to configure the plugin to work with different merchant accounts for different Shopware shops but only the default merchant account is used when fetching payment methods from Adyen. Different merchant accounts have different payment methods so this means the wrong payment methods are returned.
Inside the method
\AdyenPayment\Components\Adyen\PaymentMethodService::getPaymentMethods
a call to get the merchant account from the configuration is made on line 79:$this->configuration->getMerchantAccount()
This always returns the merchant account of the default Shopware shop. The
getMerchantAccount
method has the following signature:public function getMerchantAccount($shop = false): string
If the call on line 79 is changed to include the shop,
$this->configuration->getMerchantAccounts(Shopware()->Shop())
, this returns the correct merchant account meaning the correct payment methods are returned from Adyen.The
getMerchantAccount
method is called from two other sites so I would guess that the shop also needs to be an argument in these places.To Reproduce
\AdyenPayment\Components\Adyen\PaymentMethodService::getPaymentMethods
Expected behavior
\AdyenPayment\Components\Adyen\PaymentMethodService::getPaymentMethods
The text was updated successfully, but these errors were encountered: