简体   繁体   English

Razorpay android SDK集成问题

[英]Razorpay android SDK integration issue

When order_id is used in the JSON of checkout object error is occurred 在checkout对象的JSON中使用order_id发生错误

The error that I am getting is this: 06-23 14:08:44.132 E/PaymentActivity:166: The id provided does not exist 我得到的错误是:06-23 14:08:44.132 E / PaymentActivity:166: 提供的ID不存在

This comes in: 这进来:

onPaymentError(code: Int, response: String?, data: PaymentData?) 

method of PaymentResultWithDataListener PaymentResultWithDataListener方法

startPayment method is: startPayment方法是:

private fun startPayment(orderId: Long, paymentGateway: PaymentGateway) {
        val checkout = Checkout()
        checkout.setImage(R.drawable.lifcare_logo)
        checkout.setFullScreenDisable(true)
        try {
            val options = JSONObject()
            options.put("name", "Name")
            options.put("description", orderId.toString())
            options.put("currency", "INR")
            options.put("amount", paymentGateway.amount.times(100))
            options.put("order_id", paymentGateway.refTransactionId)

            val prefill = JSONObject()
            prefill.put("email", "EmailID")
            prefill.put("contact", "Number")
            prefill.put("method", paymentGateway.subMethod?.name)

            options.put("prefill", prefill)
            options.put("theme", JSONObject("{color: '#7cb342'}"))
            checkout.open(this, options)
        } catch (e: Exception) {
            Timber.e(e, "Cannot pay right now!!")
        }
    }

ref_transaction_id is: "ref_transaction_id": "order_AQjijq5Fj4lg8m" ref_transaction_id是: "ref_transaction_id": "order_AQjijq5Fj4lg8m"

When order_id is not used then the SDK is working fine. 如果不使用order_id则SDK可以正常工作。 order_id somehow is creating the issue. order_id以某种方式造成了问题。

May i know what number are you using? 我可以知道你用什么号码吗?
It does not work for default number like '9999999999'. 它不适用于默认数字,例如“ 9999999999”。

The number should be a valid number. 该数字应为有效数字。

Try to add notes key in option parameter as given below: 尝试在选项参数中添加注释键,如下所示:

jsonObject.put("order_id", "12345")
jsonObject.put("subscription_id", "50214")
jsonObject.put("user_id", "101")
options.put("notes", jsonObject)                 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM