Skip to content

VinID-lab/vinidpay-app2app-cordova-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cordova Plugin for VinID Pay's app-to-app payment

Installation

This Cordova Plugin adds support for the app-to-app payment on iOS and Android platforms. It uses the native VinIDPay Mobile SDK libraries, which you must also download.

OutSystems

For OutSystems user, follow the official guideline to integrate with the plugin. This is a sample JSON file for the Extensibility Configuration module property:

{
    "plugin": {
        "url": "https://github.com/VinID-lab/vinidpay-app2app-cordova-plugin.git#1.0.0"
    }
}

Methods

  • window.plugins.checkoutPlugin.checkout
  • window.plugins.checkoutPlugin.setSandboxMode
  • window.plugins.checkoutPlugin.setReturnURLScheme

CheckoutPlugin.checkout

Request a payment with an orderId and signature, return the status of the transaction (success/failed) with corresponding callback.

CheckoutPlugin.setSandboxMode

Enable Sandbox Mode for testing. Default value is false, equavalent to PRODUCTION Mode.

CheckoutPlugin.setReturnURLScheme

This function helps Setup for app switch for iOS platform. It has been setup properly by default, use it if you want to customize the scheme.

Usage

Follow the native library guideline(iOS, Android) for more information about params and how it works.

Here is a sample code for making a checkout request and receiving response:

  function onCheckoutPress(){
    var orderId = document.getElementById('orderId').value;
    var signature = document.getElementById('signature').value;
    window.plugins.checkoutPlugin.checkout(
       orderId,
       signature,
       function(data) {alert('Checkout successfull!');},
       function(err) { alert('Checkout errror ' + err);});
  }