Northstar Native SDK Client Spec
BT SDK Card Client
- initized with an API client
- Two top level functions
- params: card object and completion
- flow:
- merchant uses SDK to create a of the input card
- merchant passes nonce to their server, which creates and executes the transcation
- params: card request and completion
- internally invoked by the other
tokenizeCard
function
Northstar implementation
Example integration
1. Create CardClient
The config object passed in here should live in Core and contain all the shared parameters that a merchant would need to give the SDK in order to perform its operations. Some values that should live in this config:
- ClientID
- Environment
- Access token?
2a. Execute transaction passing in an OrderRequest
2b. Execute transaction passing in an OrderID
Issues and Questions
Token Source
- The desire is for a merchant to be able to pass us a token generated from any source (
v1/payments
, v2/orders
, others?)
-
v2/checkout/orders/<order_id>/authorize
v2/checkout/orders/<order_id>/capture
- In order to satisfy #1 natively, we would need some ability to determine the token source AND properly handle / type the responses from the different potential token sources (ie
INTENT
values are different between v1
and v2
APIs)
- Possible solution:
Since this is a problem that will need to be solved by all three platforms (JS, Android, iOS), does it make sense to put this logic and response formatting behind a GraphQL layer that is universally targeted instead of targeting the orders API directly?
Authorization Intent
- Using the v2 API, does an intent
value of authorize
make sense for unbranded card transactions?
Merchant usecase for card validation
- Currently, the validation endpoint is marked INTERNAL
. Is there a reason we would want this exposed? Without this endpoint, there wouldn't be a way for a merchant to do card validation using the orders API
Possible implementation of card validation (if it becomes externally available)
Create transaction and capture separately
- /v2/checkout/orders/:orderId/validate-payment-method
- Order created, then captured or authorized separately
- Documentation: https://hackmd.io/oo00FrwyQEe3aT4NI8WcuA?view#Option-3-Createโauthorizecapture
- Questions:
What is the format of the capture / authorization response, and what should be vended to the user?