Skip to main content

Generic Card Payment

Prerequisites

  • Please create a Tappay account and get the app ID from Tappay Dashboard.
  • Integrate your Merchant with Tappay Dashboard.
  • Please add the following config in your app.json
{
"expo": {
"plugins": [
[
"expo-tappay", {
"generic": {
"enable": true
},
// other payment methods...
}
]
]
}
}
ParameterTypeDescription
enablebooleanWhether to enable Line Pay

Usage

Setup Tappay

This method configures the Tappay instance. This setup must be completed before any Apple Pay transaction can be processed.

ParameterTypeDescription
appIdnumberYour Tappay App ID
appKeystringYour Tappay App Key
serverTypeServerTypeYour Tappay Server Type

Server Type

  • sandbox: for testing
  • production: for production
import Tappay from "expo-tappay";

const tappay = new Tappay({
appId: 11340, // replace with your Tappay App ID
appKey: "app_whdEWBH8e8Lzy4N6BysVRRMILYORF6UxXbiOFsICkz0J9j1C0JUlCHv1tVJC", // replace with your Tappay App Key
serverType: "sandbox",
});

Checking Generic Card Payment Availability

Checks if Generic Card Payment is available and properly configured on the device

return: boolean


if (tappay.generic.isAvailable) {
console.log("Generic Card Payment is available");
} else {
console.log("Generic Card Payment is not available");
}

Get Prime Token

Call getPrimeToken() to get the prime token.

Parameters:

ParameterTypeDescription
cardNumberstringThe card number
ccvstringThe card verification code
expiryMonthstringThe expiry month
expiryYearstringThe expiry year

PrimeResult

return: Promise<PrimeResult>

tappay.generic.getPrime({
cardNumber: "4242424242424242",
ccv: "123",
expiryMonth: "01",
expiryYear: "28",
});

Example

Generic Card Payment Example

Type

Prime Result

PropertyTypeDescription
primestringThe prime token
binCodestringThe bin code (first 6 digits of the card)
lastFourstringThe last four digits of the card
issuerstringThe issuer of the card
typeCardTypeThe type of the card
fundingCardFundingThe funding of the card
cardIdentifierstringThe card identifier

Version

  • TPDirect: v2.17.0