Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

webpay-bahamta

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpay-bahamta

This a lib to handle payment from bahamta

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

GitHub tag (latest by date) GitHub GitHub contributors

webpay-bahamta

This is a lib to handle payment from bahamta

Installing

Using npm:

$ npm install webpay-bahamta

Using yarn:

$ yarn add webpay-bahamta

Example

const webpay = require('webpay-bahamta');

Performing a Payment request

let api_key = WEB_TOKEN; 
let reference = 'order#1';
let amount_irr = 100000 * 10;
let callback_url = 'https://example.com/chechout/success';
let payer_mobile = '0912*******';

let payment_response = await webpay.payment(api_key, reference, amount_irr, callback_url, payer_mobile);
if(! payment_response.ok) {
	throw new Error(payment_response.error);
}

let { payment_url } = payment_response.result;
console.log(payment_url);


let verify_response = await webpay.verify(api_key, reference, amount_irr);
if(! verify_response.ok) {
	throw new Error(verify_response.error);
}
let payment_info = verify_response.result;
console.log(payment_info);

payment_url will be like:

https://webpay.bahamta.com/api/…

payment_info will be like:

{
	"state": "paid",
	"total": 1000000,
	"wage": 5000,
	"gateway": "sep",
	"terminal": "11223344",
	"pay_ref": "GmshtyjwKSu5lKOLquYrzO9BqjUMb/TPUK0qak/iVs",
	"pay_trace": "935041",
	"pay_pan": "123456******1234",
	"pay_cid": "77CB1B455FB5F60415A7A02E4502134CFD72DBF6D1EC8FA2B48467DFB124AA75A",
	"pay_time": "2019-11-12T16:39:57.686436+03:30"
}

API Documentation

https://webpay.bahamta.com/doc/api

Keywords

FAQs

Package last updated on 20 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc