1.0.0 • Published 2 years ago

vub-ecard v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

vub.sk

VUB eCard nodejs

Package to use VUB eCard payment platform easily in nodejs application

Installation

Using npm:

npm i @forbestclients/vub-ecard

Usage

In Node.js:

Initialization

const VubEcard = require('@forbestclients/vub-ecard').default;

const vub = new VubEcard('CLIENT_ID', 'STORE_KEY');

Initialize with config object

The package can be initialized with several options:

const VubEcard = require('@forbestclients/vub-ecard').default;

const vub = new VubEcard('CLIENT_ID', 'STORE_KEY', {
    test: true,
    currency: 978,
    transactionType: 'Auth',
    language: 'sk',
    storeType: '3d_pay_hosting'
});
OptionDefaultDescription
testfalseTells if you want to use production or test interface of payment gateway
currency978Currency ISO 4217 numeric code
transactionTypeTransactionTypes.AuthTransaction type (authorization or pre-autuhorization)
languageLanguages.SKLanguage used on payment gateway
storeTypeStoreTypes.Secure3DPayHostingPayment model od merchant

Generate payment button

vub.setOrder('ORD123456' /* ORDER ID */, 10.99 /* ORDER PRICE */);
vub.setCallbackSuccessUrl('http://yourpage.domain/ok');
vub.setCallbackErrorUrl('http://yourpage.domain/fail');

vub.generateForm();

Change button text

vub.generateForm([], {}, { value: 'proceed to payment' })

Validate response

vub.validateResponse(POST_DATA)

Note: you can get validation errors by calling vub.getError()

Package created by

forbestclients.com \ eshops, programming, consultations