Android
Android is an open-source operating system based on the Linux kernel and primarily designed for mobile devices such as smartphones, tablets, and smartwatches. It is developed by Google and offers a wide range of features and applications to enhance user experience.
You can download the XPay SDK for Android provided by Nexi from the following GitHub repository:
ATTENTION: Merchants are responsible for the proper and secure storage of their API keys. These should not be stored within the client app but must be securely requested and exchanged between the app and the merchant's server.
Installation
To use the XPay SDK, you need to add it as a dependency to your application and create the XPay client:
Hosted Payment Page
The following method refers to the API POST /orders/hpp.
A WebView is opened containing the XPay checkout page.
In order to use this functionality you must declare a request code to intercept the ActivityResult inside your desired Activity:
Handle the ActivityResult inside your Activity:
To independently choose the WebView for displaying the checkout page, you need to use the following method: it returns the link to the XPay checkout page to be displayed in the WebView.
In order to use this functionality you must declare a request code to intercept the ActivityResult inside your desired Activity:
Handle the ActivityResult inside your Activity:
Get Payments Methods
The following method refers to the API POST /payment_methods.
The list of payment methods supported by the merchant's terminal is returned along with their associated attributes.
In order to use this functionality you must declare a request code to intercept the ActivityResult inside your desired Activity:
Handle the ActivityResult inside your Activity:
Handle the ActivityResult inside your Activity:
3 Step payment
The following method refers to the Payment 3 Steps solution.
It allows making payments through card with 3D Secure authentication, in Server-to-Server mode.
Server-to-Server solutions are subject to obtaining PCI DSS security certification (SAQ D questionnaire).
In order to use this functionality you have to instantiate a derived instance of CardForm either it be CardFormFull or CardFormInline in order to send the customer card data that must be declared inside your layout xml:
Handle the ActivityResult inside your Activity:
Card Verification
The following method refers to the Card Verification solution.
It performs a card verification operation, without any charge, solely to confirm the validity of the card data entered by the customer.
Server-to-Server solutions are subject to obtaining PCI DSS security certification (SAQ D questionnaire).
In order to use this functionality you must declare a request code to intercept the ActivityResult inside your desired Activity:
Handle the ActivityResult inside your Activity:
M.O.T.O.
The following method refers to the API POST /orders/moto.
It performs a M.O.T.O payment: a payment made in Server-to-Server mode, where the cardholder's 3D Secure authentication is not required. It is intended for those who want to integrate the authorization request function for credit card payments, where the cardholder's data has been communicated to the merchant via email, phone, etc.
Server-to-Server solutions are subject to obtaining PCI DSS security certification (SAQ D questionnaire).
In order to use this functionality you must declare a request code to intercept the ActivityResult inside your desired Activity:
Handle the ActivityResult inside your Activity: