Skip to content

Send idempotency key when purchasing new subscription

What does this MR do and why?

Sends idempotency key to the API when purchasing new subscription for a group

Related to https://gitlab.com/gitlab-org/customers-gitlab-com/-/issues/7448

Screenshots or screen recordings

Scenario Screenshot
Idempotency key regeneration
Screen recordingScreen_Recording_2023-10-09_at_12.06.30_PM
Successful purchase
Screen recordingScreen_Recording_2023-10-05_at_10.45.44_AM
Successful purchase after using a card with insufficient funds
Screen recordingScreen_Recording_2023-10-05_at_11.03.36_AM
Unprocessable Content - 422
Screen recordingScreen_Recording_2023-10-05_at_10.34.57_AM
Internal Server Error - 500
Screen recordingScreen_Recording_2023-10-05_at_10.58.09_AM

How to set up and validate locally

Application setup

  1. Customers Dot needs to be setup in order to view the billing page for a group
  2. Start GDK in SaaS mode GITLAB_SIMULATE_SAAS=1 gdk start

Subscription purchase

  1. Create a Group
  2. Go to Settings > Billing
  3. Click on Upgrade CTA

Error scenarios

  1. Unprocessable content - 422
    • Update create method here to be:
      def create
        respond_422
      end
  2. Internal server error - 500
    • Update create method here to be:
      def create
        render status: :service_unavailable
      end
  3. Card with insufficient funds - 4000000000009995. More cards which will result in declined payment can be found here - https://stripe.com/docs/testing#declined-payments

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Vamsi Vempati

Merge request reports