Skip to content
This repository was archived by the owner on Jul 28, 2024. It is now read-only.

Conversation

@1orZero
Copy link
Collaborator

@1orZero 1orZero commented May 31, 2024

  • removed the meta data support in Stripe (plan_code / planGivenWeeks)
  • Re-factor the Stripe webhook implementation
  • Allow user to Upgrade or Downgrade plan (Show modal popup and operate manually by us)
  • All production/staging stripe payment links has been created
  • We now have a central configuration file to manage all Stripe products stripe_config.ts

1orZero added 30 commits May 27, 2024 14:47
… handleCustomerSubscriptionDeleted and handleCustomerSubscriptionUpdated
… handleCustomerSubscriptionDeleted and handleCustomerSubscriptionUpdated
Update the payment links for the Pro and Ultra plans in the stripe_config.ts file. Add separate links for the monthly plans in USD and TWD currencies. Also, add links for the yearly Ultra plan in USD and TWD currencies. Remove the unused constant in the file.
@1orZero
Copy link
Collaborator Author

1orZero commented Jul 12, 2024

Test Payment Flow for Cypress

Steps

  1. Make sure the user is on Free plan.
  2. Cypress calls the /api/cypress/test-payment-event endpoint to start the test.
    • The endpoint will send a stripe webhook to the /api/webhooks/stripe endpoint.
  3. The webhook will update the user's subscription plan to pro-monthly.
  4. Cypress refreshes the page and checks if the user is on Pro plan.
  5. After each test, Cypress call a /api/cypress/reset-test-payment-user-subscription endpoint to reset the user's subscription plan to free.

TODOs

  • Pass the current vercel url to the cypress test
  • create api endpoint to trigger stripe webhook api/cypress/test-payment-event
  • create api endpoint to reset user's subscription plan
  • create the test

Changes

  • Add new API route api/cypress/test-payment-event to trigger stripe webhook
  • Add new API route api/cypress/reset-test-payment-user-subscription to reset user's subscription plan
  • Add new test cypress/e2e/payment.cy.ts to test the payment flow

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants