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

Chrome tab remains open in background when pay with paypal #244

Closed
straltest opened this issue Feb 15, 2019 · 5 comments
Closed

Chrome tab remains open in background when pay with paypal #244

straltest opened this issue Feb 15, 2019 · 5 comments

Comments

@straltest
Copy link

straltest commented Feb 15, 2019

General information

  • SDK/Library version: 2.+
  • Environment: Sandbox
  • Android Version and Device: Motorola Moto G4 plus with Android 7.0
  • Braintree dependencies:
    com.braintreepayments.api:braintree:2.+

Android :
minSdkVersion 21
targetSdkVersion 27
compileSdkVersion 27

Issue description

I am working on flutter application. I have made plugin to pay with paypal. I can able to pay successfully using paypal and returning to my application but paypal tab still remains in background and it is not destroyed.

I have also tried using 'com.braintreepayments.api:braintree:3.0.0' but still facing same issue.

I have also downloaded https://github.com/quinnjn/braintree-android-drop-in-paypal-androidx this demo from this link braintree/braintree-android-drop-in#101. Run it in Android simulator API level 28 but same issue is occurring.

Here is my code :

try {
mBraintreeFragment = BraintreeFragment.newInstance(this, tokenizationkey);
} catch (InvalidArgumentException e) {
Log.d(getClass().getSimpleName(), e.getLocalizedMessage());
}
PayPal.requestOneTimePayment(mBraintreeFragment, getPayPalRequest(amount));

private PayPalRequest getPayPalRequest(@nullable String amount) {
PayPalRequest request = new PayPalRequest(amount);
request.currencyCode("EUR");
return request;
}

@OverRide
public void onPaymentMethodNonceCreated(PaymentMethodNonce paymentMethodNonce) {
Log.d(getClass().getSimpleName(), "Payment Method Nonce received: " + paymentMethodNonce.getNonce());
}

After successful payment I am getting nonce and returning to application. Chrome paypal tab not destroyed.

Requesting help to resolve this issue. Let me know if anything I am missing.

@Epreuve
Copy link
Contributor

Epreuve commented Feb 15, 2019

Hey @straltest thanks for the report. This is actually an issue with Chrome Custom Tabs in that there currently isn't a way to programatically close a tab.

There is an open issue for Chromium here that we've weighed in on, in hopes that they will add a method for us to use to resolve this. Unfortunately at current, this is expected behavior.

We will leave this issue open so we can update you or anyone else that comes across this issue with any updates based on the Chromium issue above.

@straltest
Copy link
Author

Hello, @Epreuve,
Thank you for your reply. Let me know about any updates regarding this in future.

@crazecdwn
Copy link

I'll close all my tabs

@skauss
Copy link
Contributor

skauss commented Oct 5, 2020

Same problem since 2019

@sarahkoop
Copy link
Contributor

Fixed in 4.0.0-beta1

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

5 participants