Skip to content

Implementation of Google TapAndPay methods for Google Pay

Notifications You must be signed in to change notification settings

raphaelgodoi/google-tapandpay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cordova-android-googlepay-issuer

Cordova/Phonegap plugin for Android for Google Pay - Issuers

Requirements

This plugin requires cordova@8+ (CLI) and cordova-android@8+ (Android platform).

Installation

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" }
        }
    }
}

How to use

    declare var GooglePayIssuer: any;

    var googlePay = new GooglePayIssuer();

    googlePay.getActiveWalletID((walletID)=>{
        console.log(walletID);
    },(error)=>{
        console.log(error);
    });
    

Functions

GetTokenStatus

Return the token status for a token in the active wallet.

    let tsp = "VISA";
    let tokenReferenceId = "dP4Pwaq7WQY:APA9";

    getTokenStatus(tsp,tokenReferenceId,onSuccess,onError);

GetEnvironment

Return the current environment Google Pay is configured to use.

    getEnvironment(onSuccess,onError);

GetActiveWalletID

Returns the Wallet ID of the active wallet. If there is no active wallet, a error is throw.

    getActiveWalletID(onSuccess,onError);

GetStableHardwareId

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);

PushProvision

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);

Credits

Thanks to Raphael Godoi Guilherme Rodrigues

About

Implementation of Google TapAndPay methods for Google Pay

Resources

Stars

Watchers

Forks

Packages

No packages published