1. Home
  2. Interswitch Payment Gateway – Mobile InApp/SDK Implementation
  3. Android

Android

Payment SDK for Android

Interswitch payment SDK allows you to accept payments from customers within your mobile application. Please Note: The current supported currency is naira (NGN), support for other currencies would be added later The first step to using the Android SDK is to register as a merchant. This is described [here] (merchantxuat.interswitchng.com)

Download the latest SDK

Download the latest SDK from the link below

https://github.com/techquest/isw-payment-sdk-android/releases

It consists of a library:

  1. deviceprint-release-2.2.0.aar

Use Android Studio’s dependency management tool (Gradle) to add the library to your project.

Creating a Project and Adding Library Using Android Studio

  1. Download Android Studio 1.2.2 or later
  2. Create a New Project
  3. Put deviceprint-release-2.2.0.aar in the libs folder of the app.
  4. To add the deviceprint-release-2.2.0.aar library to your project, navigate to File -> New -> New Module -> Import .JAR/.AAR Package option in Android Studio.
  5. Select the deviceprint-release-2.2.0.aar in libs folder
  6. To add the jar files, edit the build.gradle file of your app and add
  1. Finally, rebuild the project

Using The SDK in Sandbox Mode

During development of your app, you should use the SDK in sandbox mode to enable testing. Different Client Id and Client Secret are provided for Production and Sandbox mode. The procedure to use the SDK on sandbox mode is just as easy:

  • Use Sandbox Client Id and Client Secret got from the Sandbox Tab of the Developer Console after signup(usually you have to wait for 5 minutes after signup for you to see the Sandbox details) everywhere you are required to supply Client Id and Client Secret in the remainder of this documentation
  • In your code, override the api base as follows
  • Follow the remaining steps in the documentation.
  • NOTE: When going into Production mode, use the Client Id and the Client Secret got from the Production Tab of Developer Console instead.

Using the SDK with UI (In PCI-DSS Scope: No )

Pay with Card

  • To allow for Payment with Card
  • Create a Pay button
  • In the onClick listener of the Pay button, use this code.Note: Supply your Client Id and Client Secret you got after registering as a Merchant

Note: Supply your Client Id and Client Secret you got after registering as a Merchant Please Note: If you are providing your own transaction reference number, ensure you use the other PayWithCard constructor that accept transaction reference number

Pay with Card

  • To allow for Payment with Card only
  • Create a Pay button
  • In the onClick listener of the Pay button, use this code.Note: Supply your Client Id and Client Secret you got after registering as a Merchant

Note: Supply your Client Id and Client Secret you got after registering as a Merchant Please Note: If you are providing your own transaction reference number, ensure you use the other PayWithCard constructor that accept transaction reference number

Validate Card

  • Validate card is used to check if a card is a valid card, it returns the card balance and token
  • To call validate card, use this code.Note: * Supply your Client Id and Client Secret you got after registering as a Merchant Please Note: Balance is not returned for VISA Card

Note: * Supply your Client Id and Client Secret you got after registering as a Merchant Please Note: If you are providing your own transaction reference number, ensure you use the other ValidateCard constructor that accept transaction reference number Please Note: Balance is not returned for VISA Card

Pay with Token

  • To allow for Payment with Token only
  • Create a Pay button
  • In the onClick listener of the Pay button, use this code.Note: Supply your Client Id and Client Secret you got after registering as a Merchant

Note: Supply your Client Id and Client Secret you got after registering as a Merchant Please Note: If you are providing your own transaction reference number, ensure you use the other PayWithToken constructor that accept transaction reference number

Using the SDK without UI (In PCI-DSS Scope: Yes)

Pay with Card/Token

  • To allow for Payment with Card or Token
  • Create a UI to collect amount and card details
  • Create a Pay button
  • In the onClick listener of the Pay button, use this code.

Note: Supply your Client Id and Client Secret you got after registering as a Merchant

Validate Card and Get Token

  • To check if a card is valid and get a token
  • Create a UI to collect card details
  • Create a Validate/Add Card button
  • In the onClick listener of the Validate/Add Card button, use this code.

Note: Supply your Client Id and Client Secret you got after registering as a Merchant Please Note: Balance is not returned for VISA Card

Authorize PayWithCard using OTP

Authorize Card Validation using OTP

Authorize PayWithWallet using OTP

Checking Payment Status

To check the status of a payment made, use the code below

Articles

Was this article helpful to you? Yes No

How can we help?