Flutterwave / AndroidSDK

Rave's Android Drop In UI
7 stars 8 forks source link

Unable to complete charge #212

Closed nacojohn closed 4 years ago

nacojohn commented 4 years ago

After entering card pin, I keep getting error Cannot read property charge_last_auth of undefined

bolaware commented 4 years ago

Hello @nacojohn, Is this on staging or live transaction, have you tried with another card?

nacojohn commented 4 years ago

Hello @bolaware,

This is a staging transaction, still trying to implement it and I am using the test card on the API website.

jeremiahAI commented 4 years ago

@nacojohn Please check that your parameters are being passed to the Rave pay manager correctly, especially the email. If you check this and it still persists, please share your code for the payment initialization here.

nacojohn commented 4 years ago

Hi @jeremiahAI

All required parameters were passed to the Rave pay manager. Had to comment out some features to ensure that isn't the cause.

Here is the code initialization:

RaveUiManager raveUiManager = new RaveUiManager(Subscribe.this); raveUiManager.setAmount(myAmount) .setCurrency("NGN") .setEmail(edtEmail.getText().toString()) .setfName(edtFirstName.getText().toString()) .setlName(edtLastName.getText().toString()) .setPublicKey(getResources().getString(R.string.flutter_wave_key)) .setEncryptionKey(getResources().getString(R.string.flutter_encryption_key)) .setPhoneNumber(edtPhone.getText().toString(), false) .acceptAccountPayments(true) .acceptCardPayments(true) .acceptBankTransferPayments(true) .acceptUssdPayments(true) .acceptBarterPayments(true) // .acceptMpesaPayments(true) // .acceptAchPayments(true) // .acceptGHMobileMoneyPayments(true) // .acceptUgMobileMoneyPayments(true) // .acceptZmMobileMoneyPayments(true) // .acceptRwfMobileMoneyPayments(true) // .acceptSaBankPayments(true) // .acceptUkPayments(true) // .acceptFrancMobileMoneyPayments(true) .withTheme(R.style.DefaultTheme) .shouldDisplayFee(true) // .isPreAuth(false) // .showStagingLabel(false) .initialize();

Here is a screenshot of error I always get, after I have entered Card details and pin - https://drive.google.com/file/d/1ZOdSPRApBnTA9kG6ml5MrQvLiOE9KVbO/view?usp=sharing

Regards.

jeremiahAI commented 4 years ago

Hi @nacojohn Please replace all of the values with hardcoded strings and numbers and test again. You can also share here so we can look through it together (Test details only).

nacojohn commented 4 years ago

Hi @nacojohn Please replace all of the values with hardcoded strings and numbers and test again. You can also share here so we can look through it together (Test details only).

All values has been replaced with hardcoded strings/number and issue persists. Here is what I have:

RaveUiManager raveUiManager = new RaveUiManager(Subscribe.this); raveUiManager.setAmount(200) .setCurrency("NGN") .setEmail("emmanueldavis***@gmail.com") .setfName("David") .setlName("Emmanuel") .setPublicKey("FLWPUBK_TEST-3dfed6e20777***44e849e5d145597f-X") .setEncryptionKey("FLWSECK_TEST5e643***c5a") .setPhoneNumber("07068589978", false) .acceptAccountPayments(true) .acceptCardPayments(true) .acceptBankTransferPayments(true) .acceptUssdPayments(true) .acceptBarterPayments(true) // .acceptMpesaPayments(true) // .acceptAchPayments(true) // .acceptGHMobileMoneyPayments(true) // .acceptUgMobileMoneyPayments(true) // .acceptZmMobileMoneyPayments(true) // .acceptRwfMobileMoneyPayments(true) // .acceptSaBankPayments(true) // .acceptUkPayments(true) // .acceptFrancMobileMoneyPayments(true) .withTheme(R.style.DefaultTheme) .shouldDisplayFee(true) // .isPreAuth(false) // .showStagingLabel(false) .initialize();

What can be the issue? Thanks so far for the support.

jeremiahAI commented 4 years ago

@nacojohn Noticed you're not passing a txRef. That seems to be the problem. Please pass a reference for the transaction.

nacojohn commented 4 years ago

Hi @jeremiahAI That was exactly the issue. Thank you! You saved the day.