gpt4 book ai didi

javascript - 如何进行 nativescript paytm 集成

转载 作者:行者123 更新时间:2023-11-30 06:18:02 26 4
gpt4 key购买 nike

我已经检查了 native-script-paytm 集成插件。但是两个 git-hub 存储库都没有运行,而是给出了堆栈异常。所以我创建了自己的项目以及一些它是如何做的。但在这里我有很多关于如何获得“中间”、“订单 ID”等的问题。

任何人都可以为此提供详细的步骤吗?

const createViewModel = require("./main-view-model").createViewModel;
const Paytm = require("@nstudio/nativescript-paytm").Paytm;
const paytm = new Paytm();

exports.pageLoaded = function (args) {
const page = args.object;
page.bindingContext = createViewModel();
}


exports.onPayWithPaytm = function (args) {
console.log("Paying");

paytm.setIOSCallbacks({
didFinishedResponse: function (response) {
console.log("got response");
console.log(response);
},
didCancelTransaction: function () {
console.log("User cancelled transaction");
},
errorMissingParameterError: function (error) {
console.log(error);
}
});

const order = {
// This will fail saying duplicate order id
// generate your own order to test this.
MID: "Tomcas09769922377481",
ORDER_ID: "ORDER8874",
CUST_ID: "CUST6483",
INDUSTRY_TYPE_ID: "Retail",
CHANNEL_ID: "WAP",
TXN_AMOUNT: "10.00",
WEBSITE: "APP_STAGING",
CALLBACK_URL: "https://pguat.paytm.com/paytmchecksum/paytmCallback.jsp",
CHECKSUMHASH:
"NDspZhvSHbq44K3A9Y4daf9En3l2Ndu9fmOdLG+bIwugQ6682Q3JiNprqmhiWAgGUnNcxta3LT2Vtk3EPwDww8o87A8tyn7/jAS2UAS9m+c="
};

paytm.createOrder(order);

paytm.initialize("STAGING");

paytm.startPaymentTransaction({
someUIErrorOccurred: function (inErrorMessage) {
console.log(inErrorMessage);
},
onTransactionResponse: function (inResponse) {
console.log(inResponse);
},
networkNotAvailable: function () {
console.log("Network not available");
},
clientAuthenticationFailed: function (inErrorMessage) {
console.log(inErrorMessage);
},
onErrorLoadingWebPage: function (
iniErrorCode,
inErrorMessage,
inFailingUrl
) {
console.log(iniErrorCode, inErrorMessage, inFailingUrl);
},
onBackPressedCancelTransaction: function () {
console.log("User cancelled transaction by pressing back button");
},
onTransactionCancel: function (inErrorMessage, inResponse) {
console.log(inErrorMessage, inResponse);
}
});
}

供引用 enter image description here

最佳答案

如插件的 ReadMe 中所述文件,

You will need a working backend server to generate paytm orders. Do not generate the order or checksum in the app.

关于javascript - 如何进行 nativescript paytm 集成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54997698/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com