Android Native SDK- Merchant's Checkout
#
SDK Integration prerequisitesIn build.gradle (:app), add the PortOne SDK as a dependency.
Add the PortOne authorization key to gradle.properties.
To access the library, add the following snippets to build.gradle (:Project) or settings.gradle.
To access the library, add the following snippets to build.gradle (:Project).
To access checkout methods, initialize the
PortOne
instance in your checkout activity. You will also require to pass the environmentAdd the following Intent Filter to the Activity to which you want the user to be directed after payment completion. Checkout Activity should be the default. The parameters 'host' and 'scheme' in the data tag will be set according to the redirection url.
#
CheckoutMake a signature hash to include in the payload.
The methods listed below are explained using examples.
The app needs to obtain its payment status following checkout, which must be handled using intent, and it will give that state to the updatePaymentStatus() method.
To receive the checkout status in HashMap format after the checkout action has been completed, the following method must be added to the checkout activity.
Things to be taken care while generating payload:
Mandatory params in payload:
If items are provided, please double-check that the values match the total amount:
sum(items price * items quantity) + shipping charge - discount = amount
#
Merchant Centric Card VaultThe following functions can be used once a user has been created and has access to this feature.
#
Failover RoutingThe Request Model introduces the following two parameters to support failover routing:
isRoutingEnabled= true
Routing Param type should be failover.
Pass the Routing Ref which is set in the merchnat portal.
#
PreAuth and Capture PaymentTo implement PreAuth one parameter has to be set: transactionType= PREAUTH || PURCHASE