本文介绍了Paytm与离子框架集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用此插件进行与离子的paytm集成()

i am using this plugin for paytm integration with ionic (https://github.com/samyam-a/PayTM-PhoneGap-Plugin)

cordova plugin add https://github.com/samyam-a/PayTM-PhoneGap-Plugin.git --variable GENERATE_URL=<Checksum Generation URL> --variable VERIFY_URL=<Checksum Validation Url> --variable MERCHANT_ID=<MerchantID> --variable INDUSTRY_TYPE_ID=<IndustryType> --variable WEBSITE=<WAPWebsiteName>

//I am using this function to start transaction inside controller

window.plugins.paytm.startPayment(txn_id, customer_id, email, phone, amount, successCallback, failureCallback);

//Also i have defined successCallback and failureCallback

function successCallback(response)
{
    alert("response=="+JSON.stringify(response))
}  

function failureCallback(error)
{
    alert(error)  
}

由于没有得到任何回复而且无法知道此插件是否正常工作

As am not getting any response and not able to know that this plugin is working or not

推荐答案

传递回调的方式不正确,回调是作为函数参数传递的函数。所以问题的解决方案是 -

Your way of passing callbacks is incorrect, callback is a function passed as an argument of a function. So the solution of your problem will be -

window.plugins.paytm.startPayment(txn_id, customer_id, email, phone, amount, 
function(response) {
    //success callback
}, function(error) {
    //failure callback
});

这篇关于Paytm与离子框架集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-23 09:58