【发布时间】:2020-11-05 16:07:50
【问题描述】:
完整的错误信息是: 无法加载https://merchant.com/callback 的网页,因为:net::ERR_CONNECTION_TIME_OUT
我的启动 paytm 的代码并在应用调用中得到同样的错误:
private void startPayTMCall(InitiateAPIResponse apiResponse, PaytmInitRequestBody paytmInitRequestBody) {
String orderIdString = paytmInitRequestBody.getOrderId();
String MID = getString(R.string.MID);
String amount = String.valueOf(paytmInitRequestBody.getAmount());
/*
On completion of transaction, Paytm payment gateway will send the response on this URL. This can be a static response URL as mentioned below:
Staging Environment: "https://securegw-stage.paytm.in/theia/paytmCallback?ORDER_ID=<order_id>"
Production Environment: "https://securegw.paytm.in/theia/paytmCallback?ORDER_ID=<order_id>"*/
// for test mode use it
// String host = "https://securegw-stage.paytm.in/";
// for production mode use it
String host = "https://securegw.paytm.in/";
String callBackUrl = host + "theia/paytmCallback?ORDER_ID=" + orderIdString;
PaytmOrder order = new PaytmOrder(orderIdString, MID, apiResponse.getBody().getTxnToken(), amount, callBackUrl);
TransactionManager transactionManager = new TransactionManager(order, new PaytmPaymentTransactionCallback() {
@Override
public void onTransactionResponse(Bundle bundle) {
Toast.makeText(getApplicationContext(), "Payment Transaction response " + bundle.toString(), Toast.LENGTH_LONG).show();
}
@Override
public void networkNotAvailable() {
Toast.makeText(MainActivity.this, "networkNotAvailable", Toast.LENGTH_SHORT).show();
}
@Override
public void onErrorProceed(String s) {
Toast.makeText(MainActivity.this, "onErrorProceed "+s, Toast.LENGTH_SHORT).show();
}
@Override
public void clientAuthenticationFailed(String s) {
Toast.makeText(MainActivity.this, "clientAuthenticationFailed : "+s, Toast.LENGTH_SHORT).show();
}
@Override
public void someUIErrorOccurred(String s) {
Toast.makeText(MainActivity.this, "someUIErrorOccurred : "+s, Toast.LENGTH_SHORT).show();
}
@Override
public void onErrorLoadingWebPage(int i, String s, String s1) {
Toast.makeText(MainActivity.this, "onErrorLoadingWebPage : "+s+" : "+s1, Toast.LENGTH_SHORT).show();
}
@Override
public void onBackPressedCancelTransaction() {
Toast.makeText(MainActivity.this, "onBackPressedCancelTransaction : ", Toast.LENGTH_SHORT).show();
}
@Override
public void onTransactionCancel(String s, Bundle bundle) {
Toast.makeText(MainActivity.this, "onTransactionCancel : "+s, Toast.LENGTH_SHORT).show();
}
});
transactionManager.setAppInvokeEnabled(false);
transactionManager.setEnableAssist(true);
transactionManager.startTransaction(this, REQ_CODE_ORDER);
}
我认为回调 url 有问题,可能会被磨损,但我遵循 paytm 官方多合一 SDK 文档。 https://developer.paytm.com/docs/all-in-one-sdk/
【问题讨论】:
-
复制粘贴编码?回调 url 不应该指向 你的 后端吗?
-
您有任何示例或博客参考吗,我正在学习 paytm 支付网关,文档不是很清楚。
-
我还从我的 PHP 后端生成了令牌。
标签: android payment-gateway paytm