Subscription example
This example details the flow for a merchant selling memberships to their club with three tiers of memberships:
- Tier 3: Yearly 500,-
- Tier 2: Yearly 300,-
- Tier 1: Yearly 150,-
Since these are paid in regular intervals, we will use our recurring/subscription support.
Managing subscriptions for this club encompasses three different scenarios:
- Creating subscription for new customer
- Receive payment for subsequent periods
- Upgrading the subscription from one tier to another
Creating subscription for a new customer
- Create a payment session with the subscription amount, and specifies that a recurrence token should be created .
- The customer pays
- The merchant is notified about the successful payment.
- The merchant fetches and stores the token
Receive payment for subsequent periods
- Create a recurrence transaction with the previously acquired token
- The merchant will receive a synchronous response about the payment status, but should also implement a callback in case the request failed, but the payment succeeded in the background.
Upgrading the subscription
Let's say the customer has been a tier 2 member for 6 months, but now they want to upgrade to tier 3.
They paid 300 for the full year, and the price for tier 3 is 500.
- Repeat the steps from Creating subscription for a new customer for the customer to pay 500.
- Refund the money for the remaining 6 months of the tier 2 membership, 150,-
- The merchant stops using the old recurrence token and starts using the new for subsequent payments.