作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在我的 Android 应用程序上集成 payumoney 支付网关。但是当我尝试通过测试借记卡进行测试交易时。它显示一个错误。当我联系 payumoney 客户服务时,他们说将服务器的 URL 列入白名单。我不知道如何将 url ito 服务器列入白名单。
public void startpay() {
builder.setAmount(amount) // Payment amount
.setTxnId(txnid) // Transaction ID
.setPhone(phone) // User Phone number
.setProductName(prodname) // Product Name or description
.setFirstName(firstname) // User First name
.setEmail(email) // User Email ID
.setsUrl("https://www.payumoney.com/mobileapp/payumoney/success.php") // Success URL (surl)
.setfUrl("https://www.payumoney.com/mobileapp/payumoney/failure.php") //Failure URL (furl)
.setUdf1("")
.setUdf2("")
.setUdf3("")
.setUdf4("")
.setUdf5("")
.setUdf6("")
.setUdf7("")
.setUdf8("")
.setUdf9("")
.setUdf10("")
.setIsDebug(true) // Integration environment - true (Debug)/ false(Production)
.setKey(merchantkey) // Merchant key
.setMerchantId(merchantId);
try {
paymentParam = builder.build();
// generateHashFromServer(paymentParam );
getHashkey();
} catch (Exception e) {
Log.e(TAG, " error s " + e.toString());
}
}
public void getHashkey() {
ServiceWrapper service = new ServiceWrapper(null);
Call<String> call = service.newHashCall(merchantkey, txnid, amount, prodname,
firstname, email);
call.enqueue(new Callback<String>() {
@Override
public void onResponse(Call<String> call, Response<String> response) {
Log.e(TAG, "hash res " + response.body());
String merchantHash = response.body();
if (merchantHash.isEmpty() || merchantHash.equals("")) {
Toast.makeText(StartPaymentActivity.this, "Could not generate hash", Toast.LENGTH_SHORT).show();
Log.e(TAG, "hash empty");
} else {
// mPaymentParams.setMerchantHash(merchantHash);
paymentParam.setMerchantHash(merchantHash);
// Invoke the following function to open the checkout page.
// PayUmoneyFlowManager.startPayUMoneyFlow(paymentParam, StartPaymentActivity.this,-1, true);
PayUmoneyFlowManager.startPayUMoneyFlow(paymentParam, StartPaymentActivity.this, R.style.AppTheme_default, false);
}
}
@Override
public void onFailure(Call<String> call, Throwable t) {
Log.e(TAG, "hash error " + t.toString());
}
});
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
//PayUMoneySdk: Success -- merchantResponse438104
// on successfull txn
// request code 10000 resultcode -1
// Result Code is -1 send from Payumoney activity
Log.e("StartPaymentActivity", "request code " + requestCode + " resultcode " + resultCode);
if (requestCode == PayUmoneyFlowManager.REQUEST_CODE_PAYMENT && resultCode == RESULT_OK && data != null) {
TransactionResponse transactionResponse = data.getParcelableExtra(PayUmoneyFlowManager.INTENT_EXTRA_TRANSACTION_RESPONSE);
if (transactionResponse != null && transactionResponse.getPayuResponse() != null) {
if (transactionResponse.getTransactionStatus().equals(TransactionResponse.TransactionStatus.SUCCESSFUL)) {
//Success Transaction
Toast.makeText(this, "Payment successful", Toast.LENGTH_SHORT).show();
} else {
//Failure Transaction
Toast.makeText(this, "Payment failed", Toast.LENGTH_SHORT).show();
}
// Response from Payumoney
//String payuResponse = transactionResponse.getPayuResponse();
// Response from SURl and FURL
//String merchantResponse = transactionResponse.getTransactionDetails();
//Log.e(TAG, "tran " + payuResponse + "---" + merchantResponse);
} /* else if (resultModel != null && resultModel.getError() != null) {
Log.d(TAG, "Error response : " + resultModel.getError().getTransactionResponse());
} else {
Log.d(TAG, "Both objects are null!");
}*/
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
//PayUMoneySdk: Success -- merchantResponse438104
// on successfull txn
// request code 10000 resultcode -1
// Result Code is -1 send from Payumoney activity
Log.e("StartPaymentActivity", "request code " + requestCode + " resultcode " + resultCode);
if (requestCode == PayUmoneyFlowManager.REQUEST_CODE_PAYMENT && resultCode == RESULT_OK && data != null) {
TransactionResponse transactionResponse = data.getParcelableExtra(PayUmoneyFlowManager.INTENT_EXTRA_TRANSACTION_RESPONSE);
if (transactionResponse != null && transactionResponse.getPayuResponse() != null) {
if (transactionResponse.getTransactionStatus().equals(TransactionResponse.TransactionStatus.SUCCESSFUL)) {
//Success Transaction
Toast.makeText(this, "Payment successful", Toast.LENGTH_SHORT).show();
} else {
//Failure Transaction
Toast.makeText(this, "Payment failed", Toast.LENGTH_SHORT).show();
}
// Response from Payumoney
//String payuResponse = transactionResponse.getPayuResponse();
// Response from SURl and FURL
//String merchantResponse = transactionResponse.getTransactionDetails();
//Log.e(TAG, "tran " + payuResponse + "---" + merchantResponse);
}
}
}
最佳答案
请将此行保留在您的 Android list 文件中的应用程序标签 android:usesCleartextTraffic="true"
下,如下所示
AndroidManifest.xml
<application
android:usesCleartextTraffic="true">
</application>
关于java - "Webpage not available, the webpage at http://xxx.xxx.xxx.xx:3000/pgSimulator/axis/redirect could not be loaded.net::ERR_CLEARTEXT_NOT_PERMITTED",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54586733/
我正在我的 Android 应用程序上集成 payumoney 支付网关。但是当我尝试通过测试借记卡进行测试交易时。它显示一个错误。当我联系 payumoney 客户服务时,他们说将服务器的 URL
我是一名优秀的程序员,十分优秀!