superviretest
v1.0.8
Published
The Client SDK is used to securely collect payment details in the browser. It seamlessly integrates into your existing payment page.
Readme
VivaPay Client SDK
The Client SDK is used to securely collect payment details in the browser. It seamlessly integrates into your existing payment page.
When initialized, the SDK securely loads an iframe hosted by VivaPay. This iframe collects the payment details, which are then submitted to VivaPay and converted to a payment token. The payment token is added as a hidden input to the form. For PayPal or Buy Now Pay Later payments, the payment details are converted to a transactionId, which is also added as a hidden input to the form. Payment detail collection is triggered when the form is submitted.
Installation
Use npm to install the VivaPay Client SDK:
npm install @vivapay/client-sdkImport the SDK into your application:
import vivapay from '@vivapay/client-sdk';Usage
To initialize the SDK, use the following code:
import vivapay from '@vivapay/client';
const pf = vivapay.init(
"sandbox", // environment name
"<public-key>", // your public key
true // enable debug mode
);To create a drop-in UI:
pf.addPaymentUI('<id-of-div-container>', 20, 'AUD');For more thorough documentation, visit the VivaPay Client SDK docs.
