当我调用doPayment()方法进行无现金支付时,什么都不会发生



我用正确的参数调用了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();
}
}));`

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

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

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

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

最新更新