[英]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.