Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

could not invoke rnpaypal.requestonetimepayment #49

Closed
danielzzz opened this issue Sep 7, 2020 · 11 comments
Closed

could not invoke rnpaypal.requestonetimepayment #49

danielzzz opened this issue Sep 7, 2020 · 11 comments

Comments

@danielzzz
Copy link

hello, I've been trying to use your module on android, but when following your example I am getting

could not invoke rnpaypal.requestonetimepayment

null

No static method newInstance(Landroid/app/Activity;Ljava/lang/String;)...

I was checking if it was something with mostly automatic installation, but when I try to do it manually I am getting a warrning it's being imported twice, so I gues this is not the problem

please advice
thanks, dan

@nzankich
Copy link
Contributor

nzankich commented Sep 8, 2020

Hi @danielzzz
Which android sdk do you have set?
implementation "com.braintreepayments.api:braintree:3.13.0"

If it's 3.13.0 please set it to 2.17.0 or use the master branch. I'm in the middle of working on it but haven't published the new version yet. Still want to do a little testing

@danielzzz
Copy link
Author

I think it was 3.13.0 (got it from the docs)
I ended up using a webview with their js web api, but I will have it in mind when implementing it again.

thanks!
dan

@nzankich
Copy link
Contributor

Of course! lmk if there are more issues and I can reopen

@thomasonweb
Copy link

Hi @nzankich

I'm also getting this error in the latest release (3.1.1). Very basic setup on Android and calling 'requestOneTimePayment' gives us this error.

Screenshot_20201021-163353 Debug

@nzankich
Copy link
Contributor

@thomasonweb did you update your gradle file?

from readme:
[Android] Add implementation "com.braintreepayments.api:braintree:3.14.1" in android/app/build.gradle.

Upgrading to the new braintree sdk broken some backward compatibility

@thomasonweb
Copy link

Hi @nzankich,

This issue is resolved when adding the implementation you suggested. I was indeed still using an older one.

However, now a new issue is in place. After confirming the Payment on the PayPal website, this screen shows and the screen does not close. And after closing it by pressing the "X" button, the requestOneTimePayment does not seem to resolve.

In the older implementation (previously I was using 2.1.0) I saw the same behaviour but after pressing the "X" button the requestOneTimePayment was resolving and we could complete payment.

Any idea?

Screenshot_20201022-141756_Chrome

@nzankich
Copy link
Contributor

@thomasonweb Ugh, yea. There's a comment in a closed issue that mentions this issue with Android as well

#37 (comment)

Looks like it's a braintree sdk issue braintree/braintree_android#244

@nzankich
Copy link
Contributor

I can reopen that one

@thomasonweb
Copy link

Hi nzankick,

It is not a new issue. It happened already in v2. But the difference between v2 and v3 is that if you close the webview yourself after payment it would resolve with a nonce while in v3 it does not resolve at all.
So on Android it is not really usable right now.

Summary:

V2 (worked, but not ideal flow)

  1. Start payment flow
  2. Complete payment on Paypal
  3. You end up on a Paypal page that does not close.
  4. Click the "X" button
  5. requestOneTimePayment resolved with a nonce that could be sent to the server

V3 (not working)

  1. Start payment flow
  2. Complete payment on Paypal
  3. You end up on a Paypal page that does not close.
  4. Click the "X" button
  5. requestOneTimePayment does not resolve/reject

So even with the Chrome window not closing automatically it was still somewhat usable in V2 as a user close would still resolve the promise. In v3 nothing happens.

@nzankich
Copy link
Contributor

@thomasonweb which version of android is this? I'm not able to reproduce in the example app

@SaqibNytro
Copy link

Hello Guys ! I am Facing Same Issue . I am Using oneTimePaymentMethod . i am able to login through sandbox account . then also pay the payment . the webview just closes and no promise function is being run . i.e-> .catch or . then ,

i am using "react-native-paypal": "^3.1.1", ->
@nzankich @thomasonweb @danielzzz @jasontrost @miyabi
Any Help is really appreciable . THANKS IN ADVANCE GUYS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants