QuickPay node.js REST api

我的梦境 提交于 2019-12-12 03:44:40

问题


Has someone worked on worked on QuickPay REST api, I went through internet to find some useful resource but it was not enough. I tested on Postman and it worked well


回答1:


var _ = require('underscore');
var quickPay = require('quick-pay');

var version = {
    "Accept-Version": "v10",
    "Authorization": "your basic authentication"};


var transaction_id ={};

function processCreatePayment(req, res, next) {
    var random_order_id = _.random(1000, 99999999999999999999);

    var parameters = {
        "currency": "INR",
        "order_id": random_order_id 
    };
    quickPay.post("payments/", version, parameters)
        .then(function(result) {
            console.log(result);
            res.send(result);
            transaction_id = result.id;
            console.log(transaction_id);
        })
        .catch(function(err) {

            console.log(err.response);
            res.send(err.response);

        });
}

Use put method with amount for payment



来源:https://stackoverflow.com/questions/37428834/quickpay-node-js-rest-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!