[英]How to set Multiple Option of Payment In PayUMoney Payment Gateway in Android
我的依賴文件在這里
implementation 'com.payumoney.sdkui:plug-n-play:1.6.1'
payUmoney代碼
private fun 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(pro_merchantkey) // Merchant key
.setMerchantId(pro_merchantId);
try {
paymentParam = builder.build()
getHashkey()
} catch (e: Exception) {
Log.d("afkafbakabkab", " errors $e")
}
}
付款流程從這里說明
private fun getHashkey() {
paymentParam!!.setMerchantHash(CreateHash())
PayUmoneyFlowManager.startPayUMoneyFlow(paymentParam, this as PaymentGateways, R.style.AppTheme_default, true);
}
從此代碼生成 hash 密鑰
private fun CreateHash(): String {
var hashSequence: String = pro_merchantkey + "|" + txnid + "|" + amount + "|" + prodname + "|" + firstname + "|" + email + "|" +
udf1 + "|" + udf2 + "|" + udf3 + "|" + udf4 + "|" + udf5 +"||||||"+ pro_salt;
val hash = hashcal("SHA-512", hashSequence)
return hash
}
注意:- 我只有一種付款方式,我想獲得多種付款方式,例如 netbanking、Upi
您已將setIsDebug()
設置為 true; 對於某些原因,PayU 僅提供用於測試目的的測試卡。 因此,發布版本將具有所有選項。 簡單來說,設置setIsDebug(false)
,您將獲得所有選項。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.