-
Notifications
You must be signed in to change notification settings - Fork 12
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
PW-4139 Hide Adyen payment methods for 0 amount transactions #146
Conversation
@@ -52,6 +52,8 @@ | |||
var me = this; | |||
if (!$.isEmptyObject(me.opts.adyenSetSession)) { | |||
me.sessionStorage.setItem(me.paymentMethodSession, JSON.stringify(me.opts.adyenSetSession)); | |||
} else { | |||
me.sessionStorage.removeItem(me.paymentMethodSession); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is necessary to clear the sessionStorage data when it is not sent from the backend, otherwise this widget might still attempt to pay with Adyen (in onPlaceOrder
) and fail.
{ | ||
/** @var Shopware_Controllers_Frontend_Checkout $subject */ | ||
$subject = $args->getSubject(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of re-declaring the $subject
in all these methods, just pass it through
Summary
From issue #139
This PR hides Adyen payment methods when the total amount in the basket is 0.
Resets the selected payment method to the shopware5 default when the amount has changed, e.g after applying a voucher.
Tested scenarios
Pay for item that costs nothing
Apply voucher that sets total price to 0
Fixed issue: #139