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

Link error when using PayPal app #28

Closed
dentex opened this issue Nov 7, 2015 · 6 comments
Closed

Link error when using PayPal app #28

dentex opened this issue Nov 7, 2015 · 6 comments
Labels

Comments

@dentex
Copy link

dentex commented Nov 7, 2015

Hi,
it seems that with the PayPal official app installed, when prompted to choose a "browser", if you click on it, the PayPal app redirects anyway to the browser but the page gets a 404 error.
Instead, if you choose a browser in the app chooser, the link works and one can log in and make the donation.

@dschuermann
Copy link
Member

I just tested this. You are right, If I choose Paypal and then the Browser, a 404 page is shown. I am using the official links from PayPal's developer documentation, so not sure how to fix this. If anyone has an idea I am open for pull requests!

@dschuermann dschuermann added the bug label Dec 3, 2015
@dschuermann dschuermann changed the title PayPal link error Link error when using PayPal app Feb 11, 2016
@liudongmiao
Copy link

        String paypalLink = "";
        Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(paypalLink));
        intent.addCategory(Intent.CATEGORY_BROWSABLE);
        // get default browser
        Intent browser = new Intent(Intent.ACTION_VIEW, Uri.parse("http://"));
        ResolveInfo resolveInfo = getPackageManager().resolveActivity(browser, PackageManager.MATCH_DEFAULT_ONLY);
        if (resolveInfo != null) {
            // set package to browser
            intent.setPackage(resolveInfo.activityInfo.packageName);
        }
        startActivity(intent);

@dschuermann
Copy link
Member

I now force the intent chooser in d743327

@dentex
Copy link
Author

dentex commented Mar 5, 2018 via email

@juanjhb1894
Copy link

I used to have a paypal option in my apps, reading the google support information they say that web cannot open a Paypal link a WebBrowser requesting for donations because can be used for tricking user to donate an amount they don't agree with. So, after some days trying I figured a way around.

Easy instead of launching Paypal Fragment to manage Paypal just command your app to open the phone default WebBrowser in your paypal.me link. I'll leave an example below.

Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://paypal.me/juanjshb"));
startActivity(browserIntent);

Hope it help. It works for me

@dentex
Copy link
Author

dentex commented Mar 12, 2020

Yes that's exactly how I'm doing:
String url = getActivity().getString(R.string.paypal_me_link);
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);

Thanks :)

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

No branches or pull requests

4 participants