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

bkmexpress-ext

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

bkmexpress-ext

Nodejs api for bkm express payment system (Turkey)

  • 0.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-57.14%
Maintainers
1
Weekly downloads
 
Created
Source

BKM Express NPM version Downloads Build Status Dependency Status

BKM Express payment system api (Turkey) for node.js

Not fully tested yet, use your own risk.

Node.js api for BKM Express

Install

Install with npm:

 npm install bkmexpress-ext

Usage

var BKM = require("bkmexpress-ext");

You can find full express.js example in example/response.js

How to debug? Set environment DEBUG=bkmexpress (more info)

initPaymentAction (Start payment)

Create your bank and installment options

var akbank = {
    "bank": [{
        "id": "0046",
        "name": "AKBANK",
        "expBank": "AKBANK",
        "bins": {
            "bin": [{
                "value": "557113",
                "insts": {
                    "inst": [
                        {
                            "nofInst": "2",
                            "amountInst": "7,75",
                            "cAmount": "",
                            "tAmount": "15,50",
                            "cPaid1stInst": "false",
                            "expInst": "2 taksit"
                        },
                        {
                            "nofInst": "3",
                            "amountInst": "5,30",
                            "cAmount": "",
                            "tAmount": "15,90",
                            "cPaid1stInst": "false",
                            "expInst": "3 taksit"
                        }
                    ]
                }
            }]
        }
    }]
};

Setup initPaymentAction

var paymentBankOptions = [akbank];
var paymentSiteUrl = "http://localhost:3000/bkm_express";
var paymentMerchantId = "7b928290-b6d2-469e-ac10-29eb36b8c1f6";
var paymentSuccesUrl = paymentSiteUrl + "" + "/success";
var paymentCancelUrl = paymentSiteUrl + "" + "/fail";
var paymentSaleAmount = "15,00";
var paymentCargoAmount = "";
var paymentMobilSuccessURL = "mobil success url";
var paymentMobilCancelURL = "mobil cancel url";
var paymentRequestSource = "1";
var paymentDeviceType = "3";
var paymentOsSource = "4.4.2";
var paymentUserAgent = "2.0";

var initPaymentAction = new BKM.InitPayment(
    paymentMerchantId,
    paymentSuccesUrl,
    paymentCancelUrl,
    paymentSaleAmount,
    paymentCargoAmount,
    paymentMobilSuccessURL,
    paymentMobilCancelURL,
    paymentRequestSource,
    paymentDeviceType,
    paymentOsSource,
    paymentUserAgent);

Get your private key (You should share your public key with BKM first)

var myKeyFile = BKM.Utilities.ReadFile("bkm_client_sign_certificate_test.pem");

initPaymentAction.initPayment(paymentBankOptions , myKeyFile, callback)

initPaymentAction.initPayment(paymentBankOptions, myKeyFile,
    function () {
        BKM.Utilities.inspect("initPayment response", arguments);
    }
);

this will return something like

{ state: true,
  redirect: 
   { 
     t: '04df4319-f1b2-4988-9cc9-a5e7a28b98f6',
     actionUrl: 'https://preprod.bkmexpress.com.tr/BKMExpress/pub/purchase/init.bkm',
     ts: '20150417-22:10:50',
     s: 'h++5K0jdvcdJJgI3e+szQ9nDQjkwuH7ubTQdZz4e1klamZubNjpaLjtAWMmiOQPvO92201fq1zU+X3k9t/K9mi5tkNBbquamDu1uITxRzEcTAqm2VXH/1pZnJAbFsCC1OmTOyLIVor1VR80gKBrZo4dC7XwQVFtOq2/KuQIJcko='
   } 
}

then you just need to redirect your client browser.

Contributors

Keywords

FAQs

Package last updated on 10 Jul 2016

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