Cordova/Phonegap plugin for Android for Google Pay - Issuers
This plugin requires cordova@8+
(CLI) and cordova-android@8+
(Android platform).
cordova plugin add path_to_plugin
Update main build.gradle file with Google TapAndPay SKD path, e.g.:
{
allprojects {
repositories {
google()
jcenter()
maven { url "path_to_tap_and_pay_sdk" }
}
}
}
declare var GooglePayIssuer: any;
var googlePay = new GooglePayIssuer();
googlePay.getActiveWalletID((walletID)=>{
console.log(walletID);
},(error)=>{
console.log(error);
});
Return the token status for a token in the active wallet.
let tsp = "VISA";
let tokenReferenceId = "dP4Pwaq7WQY:APA9";
getTokenStatus(tsp,tokenReferenceId,onSuccess,onError);
Return the current environment Google Pay is configured to use.
getEnvironment(onSuccess,onError);
Returns the Wallet ID of the active wallet. If there is no active wallet, a error is throw.
getActiveWalletID(onSuccess,onError);
Returns the stable hardware ID of the device. Each physical Android device has a stable hardware ID which is consistent between wallets for a given device. This ID will change as a result of a factory reset.
getStableHardwareId(onSuccess,onError);
Starts the push tokenization flow in which the issuer provides most or all card details needed for Google Pay to get a valid token. Tokens added using this method are added to the active wallet.
let opc = "eyJhb...0zfF20w";
let tsp = "VISA";
let clientName = "My name";
let lastDigits = "1234";
let address = {
name:"My address name on Google",
address: "Rua 1 Casa 2",
locality: "São Paulo",
administrativeArea: "SP",
countryCode:"BR",
postalCode: "19999",
phoneNumber: "1199999999"
};
googlePay.pushProvision(opc,tsp,clientName,lastDigits,address,onSuccess,onError);
Thanks to Raphael Godoi Guilherme Rodrigues