【问题标题】:Flutterwave Android payment integration - cannot process payment - error unable to retrieve transaction feeFlutterwave Android 支付集成 - 无法处理支付 - 错误无法检索交易费用
【发布时间】:2019-12-07 21:46:23
【问题描述】:

我是第一次使用 Rave,它看起来很灵活,也更容易集成,但是顺其自然。我无法进行测试,我只使用信用卡和银行付款方式。

  1. 当我从测试卡链接https://developer.flutterwave.com/reference#test-cards-1选择卡并输入一些测试卡时 我收到 2 个错误,=>“无法检索交易费用”,但在我的 logcat 中,我看到 =>“只允许测试卡 ree”,其中正在使用测试卡。而且我还处于暂存模式,我认为在使用测试密钥进行测试时是正确的。

  2. 当我使用银行选项卡时,JSON toasted 出现一些错误,但稍后显示 =>“parents_limit 未定义”。不仅我给出了这个错误,我还发现我的仪表板上记录了银行支付类型的交易。这让我更加困惑,因为我没有收到付款成功消息,因此我可以验证并为客户提供价值。

我已按照 Rave 文档中的指南整合了所有内容,这称为我的付款。来自https://github.com/Flutterwave/rave-android

实现变量

 //online payment
    String[] fullname;
    String email = "";
    String fName = "";
    String lName = "";
    String narration = "Payment for Riidit App activation";
    String txRef;
    String country = "NG";
    String currency = "NGN";
    private String mUsername, userID, mEmail;

付款方式

private void makePayment(int amount) {
        txRef = email + " " + UUID.randomUUID().toString();

        try {
            fullname = mUsername.split(" ");
            fName = fullname[0];
            lName = fullname[1];

        } catch (NullPointerException ex) {
            ex.printStackTrace();
        }

        /*
        Create instance of RavePayManager
         */
        new RavePayManager(this).setAmount(amount)
                .setCountry(country)
                .setCurrency(currency)
                .setEmail(email)
                .setfName(fName)
                .setlName(lName)
                .setNarration(narration)
                .setPublicKey(RiiditUtilTool.getPublicKey())
                .setEncryptionKey(RiiditUtilTool.getEncryptionKey())
                .setTxRef(txRef)
                .acceptAccountPayments(true)
                .acceptCardPayments(true)
                .acceptMpesaPayments(false)
                .acceptGHMobileMoneyPayments(false)
                .onStagingEnv(false)
                .allowSaveCardFeature(true)
                .withTheme(R.style.DefaultTheme)
                .initialize();
    }

//从下面调用

 private void payOnline() 
{
    makePayment(amount);
}


public void onActivateOnlineClick(View v) {
        payOnline();
    }

//这里的支付结果期待失败或成功

 protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);

        if (requestCode == RaveConstants.RAVE_REQUEST_CODE && data != null) {
            String message = data.getStringExtra("response");
            if (resultCode == RavePayActivity.RESULT_SUCCESS) {
                Toast.makeText(this, "SUCCESS " + message, Toast.LENGTH_LONG).show();

                // get a PIN and SERIAL no when payment succeeds
                getGetPinAndSerialForPaidUser();

            } else if (resultCode == RavePayActivity.RESULT_ERROR) {
                Toast.makeText(this, "ERROR " + message, Toast.LENGTH_LONG).show();
            } else if (resultCode == RavePayActivity.RESULT_CANCELLED) {
                Toast.makeText(this, "Payment CANCELLED " + message, Toast.LENGTH_LONG).show();
            }
        }
    }

我希望当这个事件被触发时,它会使用上面onActivityResult中设置的金额和返回状态中的值进行支付,我可以在这里检查并为用户提供价值

【问题讨论】:

标签: android payment flutterwave


【解决方案1】:

首先确保您使用的是用于测试的 api 密钥,如果您处于暂存模式(测试),则将其设置为 true。onStagingEnv(true) 并在此之后进行测试。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-12-22
    • 2010-11-20
    • 2015-11-27
    • 2021-05-03
    • 2012-03-17
    • 1970-01-01
    • 2013-04-30
    • 2014-05-11
    相关资源
    最近更新 更多