Adding payment to your app
Draft Disclaimer: Please note that this article is currently in draft form and may undergo revisions before final publication. The content, including information, opinions, and recommendations, is subject to change and may not represent the final version. We appreciate your understanding and patience as we work to refine and improve the quality of this article. Your feedback is valuable in shaping the final release.
Why you need a payment provider
Using a service means you are paying a fee, usually 0.8 - 4%
Local payment methods when not in US or EU context but Africa
- no paddle
- No lemonsqueezy
- Local audience as test market
- Local payments Wave OM see them as a cashapp venmo alternative but b2c instead of p2p
Adding payment
- payment occurence (one or many)
- webhook implementation
- know when payment done
- update payment to completed
- emit event
- capture event for fulfillment (delivery of product, email of digital assets)
- job to be queued
- idempotent
- verify signature to prevent tempering from unauthorized sources
- verify call is fresh
One time payment
Recurring payment - Subscription
Subscription management when stripe is not an option
Architecture
-
buyer: User or team
-
order
-
order item
-
product
-
payment
-
Before we talk about subscription we need to talk about payment
-
Possibility to add a new payment method
-
Payment has status: pending completed canceled refunded
-
Payment creates a transaction for accounting purposes
-
Might be specific to my case
-
For subscription I went the ecom like route
-
Selling service can fit the ecom use case
-
Order
-
Order has order items
-
Order has Metadata that will be used with the payment we hook to completed to do the fulfillment
-
Order fulfillment will
- buy airtime
- enable back device
- update subscription expiration dates
- subscription upgrades if any
-
stripe payment not too far out of reach
-
prepaid cards becoming main steam
-
more digital wallet apps and fintech solutions for every day use
-
ie Djamo, Keyzen, FreeMoney, Postcash