Create an API design for third-party integration for payments.
- Natasha Martin
Clarifications/Product description:-
So is it like I am the product manager of a payment instrument product and now I need to design a API for 3rd party applications (like online storefronts) for integrating our payment instrument so that users who try to purchase products from the online storefront can pay via this payment instrument? Yes the understanding is correct.
Now there can be many 3rd party applications like POS, on line storefronts – for the scope of the question lets focus on Storefronts as in POS usecase mostly card based payments are used.
Also now from payment instrument perspective it can be a credit card/ debit card kind of instrument or a independent new payment. Considering debit card/ credit card call goes via networks and quite a std process, I ll focus on an independent payment instrument like pay later or wallet –> as these are upcoming in the market.
Also by API design : we are focusing on the deisgn of the way the payment instrument and 3rd party application can interact? Yes
Users of this payment integration:
Online storefront : who are integrating this API
End users: who are paying for the service / product via this payment instruement
Product attributes imp for a payment integration:
?Success rates: Every storefront wants a payment instrument that has high success rates so that customers don’t abandon the cart as there payment failed. Also users want the payment experience to smooth.
Consistency: The usecase details with money and thus at all times it is important that the accurate user information is taken for debiting the right amount.
Availability:
Time taken to confirm the payment/ Steps should be minimum.
Easy to integrate: merchants want a integration that is quick to integrate with minimum steps
Scalable
Goal: any specific goal u want me to focus on? No u choose. Ok considering we are focusing on payments and there is high competition in payment space, focus on retaining users who transact via the payment instrument.
Prio of attributes: Compliance (as it is about payment), Impact on merchants , Relevance to the goal
?Success rate: compliance: low, impact on merchant: high, goal: high
Consistency : Compliance: high, merchant: med, goal: high
Availability: compliance: med merchant: med (they have other alternatives), goal: med
Time taken to confirm the payment: Compliance: low, merchant: med, goal: high
Ease to integrate compliance: low, merchant: high, high
Scalable complaince: low, merchant: high, goal: high
Secure: compliance: high, merchant: high, goal: high
So would prioritize a design that has:
?High success rates
Consistent
Scalable
Secure
Design:
?Scalable and consistent design would like to go for a distributed system design where focus is on CP (consistent partition tolerance)
For ensuring high success rate: to build fault tolerence via retry mechanisms
Secure: will implement hashing to ensure data integrity and encryption to keep the information confidential and private.
API suite:-
?Eligibility : to determine if the customer is eligible for this payment instrument
Request details
Phone number
Amount
Unique id
Hash
Response
Eligibility code
unique id
Hash
Authentication call : via OTP (encrypted call)
Request details
Phone number
unique id
Hash
Response
OTP
unique id
Hash
Session id
Debit call (encrypted call)
Request details
Phone number
session id
amount
hash
unique id
Response
response code
unique id
hash
Refund API
Inquiry API:
Design:

Microsoft