1.0.5 • Published 2 years ago

iranmultipay v1.0.5

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

node_multi_payment_gateway

simple node js module, support multiple payment gateways. to change your payment gateway you just need to change driver name.

Install

npm i iranmultipay

How to use

const PaymentGateway = require('iranmultipay');
const zarin_key = 'ab123ab12-ca46-40b8-aca3-0c1234567890';
const gateway = new PaymentGateway(zarin_key, 'zarinpal', { sandbox: true });

Request Payment

// Request Payment
gateway.request_payment({
  amount: 100000,
  callback: 'callback_url',
  description: 'desciprion',
  order_id: 'order_id', // required for IDPay
});
/*
returns:
  Promise<{
      error,
      payment_url,
      payment_id,
  }>
*/

Verify Payment

// Verify Payment (in callback route)
gateway.verify_payment(get_params, {
  amount: '10000', // required for Zarinpal
});
/*
returns:
  Promise<{
      error,
      verified_transaction_id,
      complete_response,
  }>
*/

Available methods

  • request_payment
  • verify_payment

Supports

  • Zarinpal
  • IDPay
1.0.5

2 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago