1.5. Android SDK Core Systems Interaction - Aigul-Irgalina/personal_test GitHub Wiki

SDK Core Systems Interaction

If you are implementing SDK Core then you need to do following integrations. Please find SDK Core API Description in Code Documentation.

Card binding

Step Requirement text
1 HostApp (merchant mobile application) sends request to MerchantServer (merchant backend) to get mobile token (requestMobileToken).
2 MerchantServer sends POST request (JSON) with valid access token to UnlimintServer (API v3 endpoint https://cardpay.com/api/mobile/token) to get mobile token .Request header: valid access_token for merchant. Request parameters: request.id - request ID, should be unique for 30 minutes time period, request.time - request attempt date and time up to milliseconds in ISO 8601 format (milliseconds are optional part).Example: {"request": {"id": "{{$guid}}","time": "{'yyyy-MM-dd'T'HH:mm:ss.SSS'Z'}"}}
3 UnlimintServer returns response to MerchantServer with requested mobile token:- mobile_token (string, unique identifier, 128 symbols),- expires (date and time of mobile token expiration in ISO 8601 format, format example - yyyy-MM-dd'T'HH:mm:ss.SSS'Z').Mobile token is only one-time use for payment operations.
4 MerchantServer sends mobile token to the HostApp.
5 HostApp sends request to MerchantServer to create a payment.
6 MerchantServer creates a payment record and unique order id (aka merchantOrderId).
7 MerchantServer responds to HostApp with generated merchantOrderId.
8 Customer fills in card data in card data form (HostApp manages the screen).
9 HostApp calls UnlimintBindingCardInteractor(mobileToken, merchantOrderId) method of the mobile SDK Core.
10 Mobile SDK Core sends a request with customer data, card data, mobile token, merchantOrderId to UnlimintServer to bind a card.
11 UnlimintServer sends a card binding response with recurring id and redirect URL to the mobile SDK Core.
12 Mobile SDK Core returns recurring id, redirect URL and last 4 digits of card PAN to the HostApp.
13 HostApp sends recurring id to the MerchantServer.
14 HostApp presents a webview with redirect URL to the customer for 3-D Secure verification.
15 Every time customer is beign redirected to another web page within a webView, HostApp should send this url to SdkCore for status check.
16 SdkCore responds with status:- continue - if 3DS process isn't finished yet,- success or declined - if 3DS process is finished,- security alert.
17 UnlimintServer sends callback to the MerchantServer (with recurring id and filing id).
18, 19 MerchantServer compares received recurring id's from the HostApp and callback and saves a received filing id for a future use (recommended to do).

Checkout

Step Requirement text
1-4 Similar to the binding scenario.
5 HostApp calls checkout(mobileToken) method of the mobile SDK Core and transmits a list of required payment methods.
6 Mobile SDK Core requests UnlimintServer for available payment methods.
7 UnlimintServer responds with a list of available payment methods.
8 Mobile SDk Core calculates intersection of required and available methods.If intersection is empty, SDK will return an exception.
9 Mobile SDK Core returns this intersection to the HostApp.

Payment with bank card

Step Requirement text
1-7 Similar to the binding scenario.
8 Customer fills in card data in card data form (HostApp manages the screen).HostApp collects PAN, expiry date and cvc in case of new bank card. If payment with token is performed, customer submits cvc only.
9 HostApp calls UnlimintPaymentCardInteractor(mobileToken) of the mobile SDK Core.
10 Mobile SDK Core sends request with customer data, card data, mobile token to UnlimintServer to make a payment.
11 UnlimintServer sends a payment response with transaction id and redirect URL (for 3DS verification) to the mobile SDK Core.
12 Mobile SDK Core returns transaction id, redirect URL and last 4 digits of card PAN to the HostApp.
13 HostApp sends transaction id to the MerchantServer.
14 HostApp presents a webview with redirect URL. This redirect URL could be for 3DS verification or for payment result.
15-16 Similar to the binding scenario.
17 UnlimintServer sends callback to the MerchantServer (with transaction id, merchantOrderId and card token).
18, 19 MerchantServer compares order id from point 6 with received merchantOrderId and saves a received card token for a future use (recommended to do).

Payment with PayPal

Step Requirement text
1-7 Similar to the binding scenario.
8 Customer fills in email for PayPal in a form. HostApp collects it.
9 HostApp calls UnlimintPaymentPayPalInteractor(mobileToken) of the mobile SDK Core.
10 Mobile SDK Core sends request with customer data, email, mobile token to UnlimintServer to make a payment.
11 UnlimintServer sends a payment response with transaction id and redirect URL to the mobile SDK Core.
12 Mobile SDK Core returns transaction id, redirect URL to the HostApp.
13 HostApp sends transaction id to the MerchantServer.
14 HostApp presents a webview with redirect URL to the customer for payment with PayPal.
15-16 Similar to the binding scenario.
17 UnlimintServer sends callback to the MerchantServer (with transaction id and merchantOrderId).
18 MerchantServer compares order id from point 6 with received merchantOrderId.