Fix(Confirm Order): handle 3DS failure
What does this MR do and why?
Fix(Confirm Order): handle 3DS errors
This MR applies a similar approach to handling 3DS errors in the confirm order API call as when adding a credit card.
Related issue: https://gitlab.com/gitlab-org/gitlab/-/issues/455267+
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Ensure you have customers.gitlab.com set up and working: https://gitlab.com/gitlab-org/customers-gitlab-com/-/blob/main/doc/setup/installation_steps.md?ref_type=heads
- Enable the <code data-sourcepos="47:17-47:44">gitlab_purchase_3ds_payments</code> for you local customers.gitlab.com environment (you can find your user id in the rails console by running
User.find_by_username('root').id
) - Add the key
zuora_paid_signup_flow_with_3ds_payment_page_id
to thesecret.yml
file by copying it from here (documentation update and announcement coming in https://gitlab.com/gitlab-org/customers-gitlab-com/-/issues/9171 so that we can enable the feature flag forcustomers-development
once the key is present for everyone). - Navigate to purchase a subscription: http://localhost:3000/-/subscriptions/new?plan_id=2c92a00d76f0d5060176f2fb0a5029ff (or to a group with Compute minutes or storage, navigate to "Settings > Usage quotas" and click "Buy storage" or "Buy minutes")
- Enter an invalid coupon code, e.g.
dummy
and click apply - See the
Promo code is invalid
form validation message - Go through the flow and use the "always authenticate" card from the stripe test cards and submit the card (this will trigger the 3DS flow)
- Scroll down and click complete in the 3D secure flow
- Check "accept" and click "Confirm purchase"
- See the
Promo code is invalid
error message - Remove the coupon code and click "Confirm purchase"
- See the 3DS error not supported displayed
Related to #459980
Edited by Michael Lunøe