Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merchant accounts for different shops are not used #70

Closed
jakeworrall opened this issue Oct 21, 2020 · 1 comment
Closed

Merchant accounts for different shops are not used #70

jakeworrall opened this issue Oct 21, 2020 · 1 comment

Comments

@jakeworrall
Copy link

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

  1. Setup two shops with different Adyen merchant accounts.
  2. Proceed to checkout in the second (non-default) shop
  3. The incorrect merchant account is used as the request parameter inside \AdyenPayment\Components\Adyen\PaymentMethodService::getPaymentMethods
  4. The incorrect payment methods are returned

Expected behavior

  1. Setup two shops with different Adyen merchant accounts.
  2. Proceed to checkout in the second (non-default) shop
  3. The correct merchant account is used as the request parameter inside \AdyenPayment\Components\Adyen\PaymentMethodService::getPaymentMethods
  4. The correct payment methods are returned
wannevancamp pushed a commit to wannevancamp/adyen-shopware5 that referenced this issue Oct 22, 2020
msilvagarcia pushed a commit that referenced this issue Oct 22, 2020
@acampos1916
Copy link
Member

Closed by #71

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants