Skip to content
This repository has been archived by the owner on May 23, 2022. It is now read-only.

menavita/node-webpayby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-webpayby

Node module for Webpay signature.

var Webpay = require('node-webpayby');

Functions

Create signature.

Return string.

var signature = Webpay.createSignature({
  '*scart': '',
  wsb_version: 2,
  wsb_storeid: 'store_id',
  wsb_order_num: '3',
  wsb_currency_id: 'BYN',
  wsb_seed: Date.now(),
  wsb_test: 1,
  wsb_invoice_item_name: ['test'],
  wsb_invoice_item_quantity: [1],
  wsb_invoice_item_price: [10],
  wsb_total: 10,
  wsb_notify_url: 'http://notify.url.by/',
}, 'secret_key');

Check signature.

Return boolean.

var check = Webpay.checkSignature({
  batch_timestamp, 
  currency_id, 
  amount,
  payment_method, 
  order_id,
  site_order_id,
  transaction_id, 
  payment_type, 
  rrn,
  wsb_signature, 
}, 'secret_key');

Test

npm run test

License

MIT

Releases

No releases published

Packages

No packages published