Skip to content

Move Confirm Order API call from store to component

What does this MR do and why?

Move Confirm Order API call from store to component in new subscription purchase flow.

  • No functionality or UI changes, purely a refactor

Related to #427094 (closed)

Screenshots or screen recordings

Scenario Screenshot
Successful purchase
ScreenshotSuccessScreenshot_2023-10-04_at_10.54.43_AMScreenshot_2023-10-03_at_6.45.14_PMScreenshot_2023-10-04_at_10.23.25_AM
Subscription created - https://apisandbox.zuora.com/platform/subscriptions/8ad083528adb8ef3018af410337769f1
Successful purchase with new group creation
ScreenshotScreen_Recording_2023-10-04_at_10.14.14_AMScreenshot_2023-10-04_at_10.16.18_AMScreenshot_2023-10-04_at_10.19.44_AMScreenshot_2023-10-04_at_10.21.00_AM
Subscription created - https://apisandbox.zuora.com/platform/subscriptions/8ad093fb8adba1d9018af76452b878d9
Successful purchase as a new user
ScreenshotScreen_Recording_2023-10-04_at_10.56.09_AMScreenshot_2023-10-04_at_10.56.38_AMScreenshot_2023-10-04_at_10.57.03_AMScreenshot_2023-10-04_at_10.57.36_AM
Subscription created - https://apisandbox.zuora.com/platform/subscriptions/8ad087d28adb8ef3018af78aa40d115fhttps://apisandbox.zuora.com/platform/subscriptions/8ad093fb8adba1d9018af76452b878d9
Email already taken error (with error attribute)
ScreenshotScreenshot_2023-10-03_at_6.16.42_PMScreenshot_2023-10-03_at_6.16.59_PM
Server error (caught in catch block)
ScreenshotScreenshot_2023-10-03_at_6.19.34_PMScreenshot_2023-10-03_at_6.19.26_PM
Error response with name key
ScreenshotScreenshot_2023-10-03_at_6.26.30_PMScreenshot_2023-10-03_at_6.26.24_PM
Invalid promo code error
ScreenshotScreenshot_2023-10-03_at_6.34.05_PMScreenshot_2023-10-03_at_6.34.13_PM
Loading state while confirming
ScreenshotScreenshot_2023-10-03_at_6.37.50_PM

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. Email already taken
    • Unlink GitLab sign in for a customer on Customers Dot and sign in with that customer's email id on GitLab.com
    • (or) Update create method here to be:
      def create
        render json: {
          error_attribute_map: { email: ["taken"] },
          errors: "Email has already been taken"
        }
      end
  2. Promo code invalid
    • Update create method here to be:
      def create
        render json: {
          errors: {
            message: 'Promo code is invalid',
            attributes: ['promo_code'],
            code: 'INVALID',
          }
        }
      end
  3. Response with name attribute
    • Update create method here to be:
      def create
        render json: { name: ['Error_1', "Error ' 2"] }
      end
  4. 404 error when group not found

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