razor payment giving 找不到合适的付款方式错误

razor payment giving No appropriate payment method found error

所以我正在实施这个简单的剃​​须刀支付集成。但它给我一个“没有找到合适的付款方式”的错误。之前我也试过选择付款方式,也没用。

val razorpay = RazorpayClient("my key", "my secret key")
       val orderRequest = JSONObject()
       orderRequest.put("amount", 50000); // amount in the smallest currency unit
       orderRequest.put("currency", "INR");
       orderRequest.put("receipt", "order_rcptid_11")
       try {
           val order: Order = razorpay.Orders.create(orderRequest)
           Timber.d("order : $order")
           startPayment(order)
       } catch (e: RazorpayException) {
           Timber.e(e)
       } 
private fun startPayment(order: Order) {
       val checkout = Checkout()

       checkout.setKeyID("my key my secret key")
       /*
       *  You need to pass current activity in order to let Razorpay create CheckoutActivity
       * */
       val activity: Activity = this
       try {
           checkout.open(activity, order.toJson())
       } catch (e: Exception) {
           Toast.makeText(activity, "Error in payment: " + e.message, Toast.LENGTH_LONG).show()
           e.printStackTrace()
       }
   }

这是我的错误

checkout.setKeyID("my key my secret key")

我在这里只需要提供“我的密钥”。 方法名称字面意思是“setKeyID”。

有时密钥不起作用使用其他项目的另一个测试密钥

checkout.setKeyID("rzp_test_--------")