gpt4 book ai didi

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"

转载 作者:行者123 更新时间:2023-11-30 07:42:30 25 4
gpt4 key购买 nike

我正在我的 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);

}
}
}

Webpage not available

最佳答案

请将此行保留在您的 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/

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