Send correct idempotency_key during add-on purchase
What does this MR do and why?
Relates to https://gitlab.com/gitlab-org/customers-gitlab-com/-/issues/6977 – with this MR, we are providing an idempotency_key
param to the BE. The key helps avoiding duplicate orders cases. Read more here.
The key depends on, and will be refreshed when changes happen to, the following:
- payment method ID (generated by Zuora)
- selected plan ID
- selected quantity
- selected namespace
Additionally, to force refresh on all 4xx
error code cases, an idempotencyKeyAttempts
is also considered.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
- Make sure to have the following env variables set up, before starting
gdk
-
CUSTOMER_PORTAL_URL
tohttps://customers.staging.gitlab.com
-
GITLAB_SIMULATE_SAAS
totrue
-
GITLAB_LICENSE_MODE
totest
-
- Create a Group
- Buy a Subscription
- Visit
-/subscriptions/buy_minutes?selected_group=<your-group-id>
- Cases:
-
4xx
and5xx
are done by manually returning them from thecreate
action ofgitlab/ee/app/controllers/subscriptions_controller.rb
- Invalid CC numbers are available at Stripe
-
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Angelo Gulina