-
Notifications
You must be signed in to change notification settings - Fork 2
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
Cancelling Worldpay payment returns error message #232
Conversation
https://eaflood.atlassian.net/browse/WC-394 Rather than showing a more informative message when cancelling a Worldpay payment, we get an 'Invalid response' error. This is caused because we are unable to build a valid MAC for a cancelled order if the user chooses to cancel their payment. In that case, the parameters we get back do not include the paymentAmount, the paymentCurrency or the paymentStatus. Instead we have orderAmount and orderCurrency. We need to modify the params we receive for a cancelled payment so we can properly validate them, including the MAC.
- If paymentCurrency is blank, replace with orderCurrency - If paymentAmount is blank, replace with orderAmount - If paymentStatus is blank, replace with 'CANCELLED' - Leave 'CANCELLED' status out of the MAC when generating it Plus tests to cover all this.
@@ -4,8 +4,9 @@ en: | |||
failure: | |||
invalid_response: "Invalid WorldPay failure response" | |||
message: | |||
REFUSED: "Your payment has been refused. Please try again or select a different payment method." | |||
CANCELLED: "Your payment has been cancelled. Please try again or select a different payment method." |
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.
Not a content bod, but should this read more along the lines
Your attempt to pay was cancelled.
To my ears it currently sounds like payment was completed, and then subsequently cancelled. What do you 🤔 💭 ?
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.
Good point. Will change it now!
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.
@Cruikshanks Aaaand updated.
Build is failing because VCR cassettes are out of date. Fixing now: #235 |
https://eaflood.atlassian.net/browse/WC-394
Rather than showing a more informative message when cancelling a Worldpay payment, we get an 'Invalid response' error. This is caused because we are unable to build a valid MAC for a cancelled order if the user chooses to cancel their payment. In that case, the parameters we get back do not include the paymentAmount, the paymentCurrency or the paymentStatus. Instead we have orderAmount and orderCurrency.
We need to modify the params we receive for a cancelled payment so we can properly validate them, including the MAC.