我试图在我的Flutter应用程序中设置paytm,我在firebase云函数上创建了txn令牌,其中我传递给它的回调url是paytm的静态URL https://securegw.paytm.in/theia/paytmCallback?ORDER_ID=order_id。当支付流程在客户端工作时,我不确定一旦交易完成(成功或失败),我如何在后端获取支付的响应?在创建事务令牌以调用order status API之后,是否立即设置轮询?我尝试在仪表板>开发人员> Webhooks >支付通知中设置webhook,但在交易后没有来自paytm服务器的请求(退款webhook也是如此)。
发布于 2020-11-20 13:50:38
有一个名为paytmkaro的插件可以做这件事,你可以使用这个插件,但它只适用于生产密钥。
在开始上传服务器端代码之前,请不要在服务器端代码上做任何更改,它是用来在paytm服务器上生成here令牌的。
将sdk的最低版本更改为19
然后复制粘贴这段代码
` try {
PaytmResponse paymentResponse = await _paytmKaro.startTransaction(
url: serverside code url e.g. https://arcane-temple-61754.herokuapp.com/intiateTansection.php,
mid: your Production merchant id,
mkey: your merchant key,
customerId:customer id (must be unique for every customer),
amount: transection amount,
orderId: Order Id (Order id must be unique Everytime for every order),
);
if(paymentResponse.status=="TXN_SUCCESS"){
Navigator.push(context, MaterialPageRoute(builder: (context)=>txnSuccessful(paytmResponse: paymentResponse,)));
}
else if(paymentResponse.status=="TXN_FAILURE"){
Navigator.push(context, MaterialPageRoute(builder: (context)=>txnFailed(paytmResponse: paymentResponse,)));
}
}
catch(e){
print(e);
key.currentState.showSnackBar(SnackBar(content: Text(e.toString()))); // platformVersion = 'Failed to get platform version.'
}`你就完了。
发布于 2021-01-12 20:04:24
请向paytm -> Open paytm开发人员门户提出查询,然后进入常见问题解答部分,然后单击send a Query。
https://stackoverflow.com/questions/64924401
复制相似问题