You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: knowledge_base/_payments.md
+16Lines changed: 16 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,22 @@ The WCA website primarily uses Stripe for its payment processing, but WST is in
28
28
29
29
## Stripe Implementation
30
30
31
+
This is a very broad overview of how Stripe payments are initiated from the frontend - it is not an exhaustive explanation of our payments sytem.
32
+
33
+
- A Stripe `Element` component is imported from Stripe's React SDK - this is a context which stores the following data
34
+
-`stripe` which is essentially the authenticated API interface
35
+
- information relating to the amount to be charged (amount and currency) - this will be validated against the payment intent
36
+
- This payment information is populated by an amount returned from the `payment_denomination` endpoint - which takes an amount and currency, and returns a Stripe-API compatible amount/currency code
37
+
- When the user clicks "Pay now", the following actions take place
38
+
-`payment_ticket` on our backend is called, with parameters which include the donation amount
39
+
-`payment_ticket` adds the given donation amount to the currency code and base registration fee (queried from the `competition` object in our database - ie, not passed by the frontend) and creates a `payment_intent` object in our code
40
+
- Upon being created, our `payment_intent` creates a `PaymentIntent` on Stripe's server
41
+
- Stripe returns a `clientSecret` upon the creation of a payment intent in its server
42
+
- This clientSecret will allow our frontend to securely reference the payment intent via Stripe's React SDK
43
+
-`payment_ticket` returns the `clientSecret` to the frontend
44
+
- Upon receiving the `clientSecret` from the `payment_ticket` endpoint, the frontend initiates the payment using Stripe's React SDK
45
+
- We will receive a notification (via webhook or, more likely, the return_url) of the payment's status once it reaches a terminal state (failure, success, etc)
46
+
31
47
## Paypal Implementation
32
48
33
49
_Paypal is currently in a proof-of-concept phase in its implementation - the following reflects expedient design rather than good design, and there is room for improvement._
0 commit comments