QA Billing Service and Stripe #8678
anamarn
started this conversation in
Engineering vision
Replies: 1 comment
-
@anamarn thanks a lot for this doc as it clears some of unknowns from Lucas' comment, I tried to test it on my own but couldn't progress further as Stripe requires creating account for company, not for person, I'll take care of it in the future after discussing how to test it properly without risking additional costs |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Why?
This discussion has been created in order to create an internal document wich resumes how to test Billing Service. Because we use an external service (Stripe) and each error will be expensive it is necessary to create an extensive Manual test suit case. We syncronize our data with the stripe webhook, however we need to be careful when we write to our database and how we process the information.
Set Up for manual testing
REMEMBER TO ALWAYS USE TEST MODE IN STRIPE
Stripe Webhook:
Billing:
On twenty Site:
Ideas of Situations
Considerations
Entitlements:
The data from the Entitlement table is updated based on the stripe webhook responses, and we use the customerActiveEntitlemet response to update the info on the table, however this event doesn't have the metadata containing the workspaceId. Because we cannot control at witch order the webhook send events, we force a server error if the entitlements are updated before the BillingSubscription Table. Stripe resends the event based on a exponential backoff (for more info see https://docs.stripe.com/webhooks#retries ) because we are in test mode Stripe retries three times over a few hours. So if the BillingEntitlement is not updated it is completely normal and it will be updated when stripe resends the event. Normally the customerActiveEntitlement Event only gives us the customerId, so we need to fetch the workspaceId associated from the BillingSubscription Table.
Beta Was this translation helpful? Give feedback.
All reactions