【问题标题】:Nothing Happens when i call doPayment() method for Cashfree Payment当我为 Cashfree Payment 调用 doPayment() 方法时什么也没有发生
【发布时间】:2020-08-26 07:29:48
【问题描述】:

我使用正确的参数调用了 doPayment() 方法,但没有任何反应。 生成令牌和“OK”状态。 这是我的代码`

compositeDisposable.add(iCloudFunction.getToken(orderId,total_game_amount.getText().toString())
        .subscribeOn(Schedulers.io())
        .observeOn(AndroidSchedulers.mainThread())
        .subscribe(new Consumer<CashFreeToken>()
        {
            @Override
            public void accept(CashFreeToken cashFreeToken) throws Exception {

                if(cashFreeToken.getStatus().equals("OK"))
                {
                    CFPaymentService.getCFPaymentServiceInstance().doAmazonPayment(CartActivity.this,dataSend,cashFreeToken.getCftoken(),"TEST");
                }
                else
                {
                    Toast.makeText(CartActivity.this,cashFreeToken.getMessage(),Toast.LENGTH_LONG).show();
                }

            }
        }, new Consumer<Throwable>() {
            @Override
            public void accept(Throwable throwable) throws Exception {
                Toast.makeText(CartActivity.this,""+throwable.getMessage(),Toast.LENGTH_LONG).show();
            }
        }));`

【问题讨论】:

    标签: android payment-gateway payment


    【解决方案1】:

    您正在调用 doAmazonPayment() 方法而不是 doPayment() 方法。

    doAmazonPayment() 方法需要额外的配置才能工作。

    对于普通的支付网关,使用 doPayment() 方法。

    【讨论】:

      【解决方案2】:

      您正在后台线程上调用该函数,但它会打开一个需要主线程的支付活动。 请将函数移出disposible函数,在主线程调用是安全的。

      【讨论】:

        猜你喜欢
        • 2014-05-18
        • 2015-10-29
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-05-09
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多