简体   繁体   English

Flutterwave Android 支付集成 - 无法处理支付 - 错误无法检索交易费用

[英]Flutterwave Android payment integration - cannot process payment - error unable to retrieve transaction fee

I'm using Rave for the first time, it looked so flexible and easier to integrate, but along the line.我是第一次使用 Rave,它看起来非常灵活且易于集成,但也顺理成章。 I got stuck with testing, I'm using only card and bank payments methods.我被测试卡住了,我只使用卡和银行支付方式。

  1. when I choose the card to and enter some test cards from the test card link https://developer.flutterwave.com/reference#test-cards-1 I get 2 errors, => "unable to retrieve transaction fees" but in my logcat I see => " only test cards ree allowed," of which were using the test cards.当我选择卡并从测试卡链接https://developer.flutterwave.com/reference#test-cards-1输入一些测试卡时,我收到 2 个错误,=>“无法检索交易费用”但在我的logcat我看到=>“只允许测试卡ree ”,其中正在使用测试卡。 And am also on staging mode which I assume is correct while testing with test keys.而且我还处于暂存模式,我认为在使用测试键进行测试时是正确的。

  2. When I use the bank tab I get some error in JSON toasted, but display later => "parents_limit not defined".当我使用银行选项卡时,我在JSON烤制中遇到一些错误,但稍后显示 =>“parents_limit 未定义”。 Not just that I give this errors, I still found transactions of the bank payment types recorded on my dashboard.不仅仅是我给出了这个错误,我仍然发现我的仪表板上记录了银行支付类型的交易。 This confuses me more since I didn't get the payment success message so I can verify and give value to the customer.这让我更加困惑,因为我没有收到付款成功消息,因此我可以验证并为客户提供价值。

I have integrated everything as per guideline in Rave docs, which calls my make payment.我已经按照 Rave 文档中的指南整合了所有内容,这称为我的付款。 from https://github.com/Flutterwave/rave-android来自https://github.com/Flutterwave/rave-android

variable for implementation执行变量

 //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;

the payment method付款方式

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();
    }

//called from below //从下面调用

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


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

// expecting result of payment here either fail or success // 此处期望支付的结果要么失败要么成功

 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();
            }
        }
    }

I want when this event is triggered, it will make the payment to using the value set in the amount and return status in the onActivityResult above where I can check and give value to the user我希望当这个事件被触发时,它会使用金额中设置的值进行支付,并在上面的onActivityResult返回状态,在那里我可以检查并为用户提供价值

First of all make sure you are using the api keys which are for testing and if you are on staging mode(testing) then set this to true .首先确保您使用的是用于测试的 api 密钥,如果您处于暂存模式(测试),则将其设置为 true 。 onStagingEnv(true) and test after that. onStagingEnv(true)并在此之后进行测试。

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

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