Mobile version of of Template C in PayPal Hosted Checkout - paypal

I am using PayFlow Pro hosted checkout Template C. I cannot get a mobile version of the template. I have tried putting the template, mobile in the key / values pairs on the initial request for the token and also putting the template='mobile' in the iframe request.
Neither seems to work.
Thanks for any help.

For Layout C, PayPal does not automatically redirect mobile users to a mobile-optimized flow. The reason is that if PayPal automatically showed a mobile optimized embedded template, within a merchant web page that may not be mobile optimized, this can create unexpected and undesirable results. To display the mobile checkout pages for Layout C, the Partner or Merchant must detect the supported mobile browser and then explicitly pass the form post parameter: template=mobile...however...I was just informed that there may be an issue with this feature on our end. I'll update this answer via comment shortly.

Related

How to move PayPal Checkout to live production?

I've set up a PayPal Checkout button with my sandbox account, which works, and now I want to change it to use my live business account. There seems to be conflicting information out there on what to do next:
The docs say that I need to submit my app for approval (but it doesn't say how)
This stack question says that with PayPal Checkout you don't need to submit your app for approval
In paypal.php (I'm using laravel) there is a parameter called PAYPAL_LIVE_APP_ID, which I didn't need with the sandbox and I've been trying to find. This stack question from 2016 tries to find the app id but all links provided there are broken. Do I need the app id for PayPal Checkout?
I don't know what I'm doing wrong but when I set the PAYPAL_MODE in .env from sandbox to live, the PayPal button in my app stops working and shows:
Uncaught Error: INVALID_RESOURCE_ID
at https://www.sandbox.paypal.com/smart/buttons?style.layout=vertical&style.color=gold&style.shape=rect&style.tagline=false&style.height=45&style.menuPlacement=below&sdkVersion=5.0.332&components.0=buttons&locale.country=GB&locale.lang=en&sdkMeta=eyJ1cmwiOiJodHRwczovL3d3dy5wYXlwYWwuY29tL3Nkay9qcz9jbGllbnQtaWQ9QVNWTnlaeTZ0TkdYTnJ4aFhzSXdGLUhKckN4U1NZb1VHVlozd3NqNXVRN3FmMGp4RFAtLXBmTHlUcjUxUnNGVzh0bXFtcnNtYlB4N0VBUWYmZGlzYWJsZS1mdW5kaW5nPWNhcmQsZ2lyb3BheSxzZXBhLHNvZm9ydCZjdXJyZW5jeT1FVVIiLCJhdHRycyI6eyJkYXRhLXVpZCI6InVpZF93cXN2eHlzd3lwcmp6YWdpc21haWduaGlxZXdyZmkifX0&clientID=ASVNyZy6tNGXNrxhXsIwF-HJrCxSSYoUGVZ3wsj5uQ7qf0jxDP--pfLyTr51RsFW8tmqmrsmbPx7EAQf&sdkCorrelationID=f374804ab30b1&storageID=uid_9a4b452c76_mdc6mdi6mjm&sessionID=uid_7aec7bdf11_mdk6nda6nde&buttonSessionID=uid_79a5ce6aa1_mdk6nda6nde&env=sandbox&buttonSize=medium&fundingEligibility=eyJwYXlwYWwiOnsiZWxpZ2libGUiOnRydWUsInZhdWx0YWJsZSI6dHJ1ZX0sInBheWxhdGVyIjp7ImVsaWdpYmxlIjpmYWxzZSwicHJvZHVjdHMiOnsicGF5SW4zIjp7ImVsaWdpYmxlIjpmYWxzZSwidmFyaWFudCI6bnVsbH0sInBheUluNCI6eyJlbGlnaWJsZSI6ZmFsc2UsInZhcmlhbnQiOm51bGx9LCJwYXlsYXRlciI6eyJlbGlnaWJsZSI6ZmFsc2UsInZhcmlhbnQiOm51bGx9fX0sImNhcmQiOnsiZWxpZ2libGUiOmZhbHNlLCJicmFuZGVkIjp0cnVlLCJpbnN0YWxsbWVudHMiOmZhbHNlLCJ2ZW5kb3JzIjp7InZpc2EiOnsiZWxpZ2libGUiOnRydWUsInZhdWx0YWJsZSI6dHJ1ZX0sIm1hc3RlcmNhcmQiOnsiZWxpZ2libGUiOnRydWUsInZhdWx0YWJsZSI6dHJ1ZX0sImFtZXgiOnsiZWxpZ2libGUiOnRydWUsInZhdWx0YWJsZSI6dHJ1ZX0sImRpc2NvdmVyIjp7ImVsaWdpYmxlIjpmYWxzZSwidmF1bHRhYmxlIjp0cnVlfSwiaGlwZXIiOnsiZWxpZ2libGUiOmZhbHNlLCJ2YXVsdGFibGUiOmZhbHNlfSwiZWxvIjp7ImVsaWdpYmxlIjpmYWxzZSwidmF1bHRhYmxlIjp0cnVlfSwiamNiIjp7ImVsaWdpYmxlIjpmYWxzZSwidmF1bHRhYmxlIjp0cnVlfX0sImd1ZXN0RW5hYmxlZCI6ZmFsc2V9LCJ2ZW5tbyI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJpdGF1Ijp7ImVsaWdpYmxlIjpmYWxzZX0sImNyZWRpdCI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJhcHBsZXBheSI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJzZXBhIjp7ImVsaWdpYmxlIjpmYWxzZX0sImlkZWFsIjp7ImVsaWdpYmxlIjpmYWxzZX0sImJhbmNvbnRhY3QiOnsiZWxpZ2libGUiOmZhbHNlfSwiZ2lyb3BheSI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJlcHMiOnsiZWxpZ2libGUiOmZhbHNlfSwic29mb3J0Ijp7ImVsaWdpYmxlIjpmYWxzZX0sIm15YmFuayI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJwMjQiOnsiZWxpZ2libGUiOmZhbHNlfSwiemltcGxlciI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJ3ZWNoYXRwYXkiOnsiZWxpZ2libGUiOmZhbHNlfSwicGF5dSI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJibGlrIjp7ImVsaWdpYmxlIjpmYWxzZX0sInRydXN0bHkiOnsiZWxpZ2libGUiOmZhbHNlfSwib3h4byI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJtYXhpbWEiOnsiZWxpZ2libGUiOmZhbHNlfSwiYm9sZXRvIjp7ImVsaWdpYmxlIjpmYWxzZX0sImJvbGV0b2JhbmNhcmlvIjp7ImVsaWdpYmxlIjpmYWxzZX0sIm1lcmNhZG9wYWdvIjp7ImVsaWdpYmxlIjpmYWxzZX0sIm11bHRpYmFuY28iOnsiZWxpZ2libGUiOmZhbHNlfX0&platform=mobile&experiment.enableVenmo=false&experiment.enableVenmoAppLabel=false&flow=purchase&currency=EUR&intent=capture&commit=true&vault=false&disableFunding.0=card&disableFunding.1=giropay&disableFunding.2=sepa&disableFunding.3=sofort&renderedButtons.0=paypal&debug=false&applePaySupport=false&supportsPopups=true&supportedNativeBrowser=true&experience=&allowBillingPayments=true:1320:46529
at n.dispatch (https://www.sandbox.paypal.com/smart/buttons?style.layout=vertical&style.color=gold&style.shape=rect&style.tagline=false&style.height=45&style.menuPlacement=below&sdkVersion=5.0.332&components.0=buttons&locale.country=GB&locale.lang=en&sdkMeta=eyJ1cmwiOiJodHRwczovL3d3dy5wYXlwYWwuY29tL3Nkay9qcz9jbGllbnQtaWQ9QVNWTnlaeTZ0TkdYTnJ4aFhzSXdGLUhKckN4U1NZb1VHVlozd3NqNXVRN3FmMGp4RFAtLXBmTHlUcjUxUnNGVzh0bXFtcnNtYlB4N0VBUWYmZGlzYWJsZS1mdW5kaW5nPWNhcmQsZ2lyb3BheSxzZXBhLHNvZm9ydCZjdXJyZW5jeT1FVVIiLCJhdHRycyI6eyJkYXRhLXVpZCI6InVpZF93cXN2eHlzd3lwcmp6YWdpc21haWduaGlxZXdyZmkifX0&clientID=ASVNyZy6tNGXNrxhXsIwF-HJrCxSSYoUGVZ3wsj5uQ7qf0jxDP--pfLyTr51RsFW8tmqmrsmbPx7EAQf&sdkCorrelationID=f374804ab30b1&storageID=uid_9a4b452c76_mdc6mdi6mjm&sessionID=uid_7aec7bdf11_mdk6nda6nde&buttonSessionID=uid_79a5ce6aa1_mdk6nda6nde&env=sandbox&buttonSize=medium&fundingEligibility=eyJwYXlwYWwiOnsiZWxpZ2libGUiOnRydWUsInZhdWx0YWJsZSI6dHJ1ZX0sInBheWxhdGVyIjp7ImVsaWdpYmxlIjpmYWxzZSwicHJvZHVjdHMiOnsicGF5SW4zIjp7ImVsaWdpYmxlIjpmYWxzZSwidmFyaWFudCI6bnVsbH0sInBheUluNCI6eyJlbGlnaWJsZSI6ZmFsc2UsInZhcmlhbnQiOm51bGx9LCJwYXlsYXRlciI6eyJlbGlnaWJsZSI6ZmFsc2UsInZhcmlhbnQiOm51bGx9fX0sImNhcmQiOnsiZWxpZ2libGUiOmZhbHNlLCJicmFuZGVkIjp0cnVlLCJpbnN0YWxsbWVudHMiOmZhbHNlLCJ2ZW5kb3JzIjp7InZpc2EiOnsiZWxpZ2libGUiOnRydWUsInZhdWx0YWJsZSI6dHJ1ZX0sIm1hc3RlcmNhcmQiOnsiZWxpZ2libGUiOnRydWUsInZhdWx0YWJsZSI6dHJ1ZX0sImFtZXgiOnsiZWxpZ2libGUiOnRydWUsInZhdWx0YWJsZSI6dHJ1ZX0sImRpc2NvdmVyIjp7ImVsaWdpYmxlIjpmYWxzZSwidmF1bHRhYmxlIjp0cnVlfSwiaGlwZXIiOnsiZWxpZ2libGUiOmZhbHNlLCJ2YXVsdGFibGUiOmZhbHNlfSwiZWxvIjp7ImVsaWdpYmxlIjpmYWxzZSwidmF1bHRhYmxlIjp0cnVlfSwiamNiIjp7ImVsaWdpYmxlIjpmYWxzZSwidmF1bHRhYmxlIjp0cnVlfX0sImd1ZXN0RW5hYmxlZCI6ZmFsc2V9LCJ2ZW5tbyI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJpdGF1Ijp7ImVsaWdpYmxlIjpmYWxzZX0sImNyZWRpdCI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJhcHBsZXBheSI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJzZXBhIjp7ImVsaWdpYmxlIjpmYWxzZX0sImlkZWFsIjp7ImVsaWdpYmxlIjpmYWxzZX0sImJhbmNvbnRhY3QiOnsiZWxpZ2libGUiOmZhbHNlfSwiZ2lyb3BheSI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJlcHMi
and:
GET https://b.sbox.stats.paypal.com/v2/counter.cgi?p=uid_7aec7bdf11_mdk6nda6nde&s=SMART_PAYMENT_BUTTONS net::ERR_ADDRESS_UNREACHABLE
The information on that doc page is out of date. An "app id" is only used by Adaptive Payments integrations, which are obsolete and cannot be used for new integrations anyway.
For REST applications, a live "client id" and "secret" can be created in the dashboard My Apps & Credentials. They do not require any additional approval/registration unless you are using partner (multi-party) or log in with PayPal features.
The error "INVALID_RESOURCE_ID" is usually caused by mixing things from sandbox and live. Ensure that:
The <script> element with src https://www.paypal.com/sdk/js?client-id= specifies a live client ID, not a sandbox/test one.
Any fetch calls the button code might make (if using a server integration pattern) retrieve a newly-created and valid live order ID or classic API EC token, not a sandbox one. The browser dev tools "Network" tab is useful for debugging and verifying such an XHR is working.
Any plan_id (if using a Subscription button) was created with the corresponding live client ID .. not a different client ID nor a sandbox one.

Why are my PayPal Checkout buttons not opening a link to the PayPal Sandbox?

I am trying for the first time to implement a PayPal Checkout solution (aka PayPal Commerce Platform for Business) in an ASP.NET Web Application, using Web Forms. I've set up a new REST API for the Sandbox and followed PayPal's Set up server-side SDK guidance to install the SDK in my .NET project. PayPal's button demo now lets me log into the Sandbox with a newly created Sandbox user name and make a test payment, which is confirmed as being successful. So far, so good.
My next step was to create a PayPalButton.aspx page containing exactly the same code as used on Paypal's button demo page. All my updated code was then uploaded to my live site. That's when I hit a problem, as the PayPal buttons don't work on my live site (the PayPal log in window just briefly flashes and then disappears). Being a total newbie to the Paypal Checkout process, it's highly likely that I have made some very basic error.
The only thing I can think of is that my problem might have something to do with the section in Set up server-side SDK that refers to modifying HTTP request headers? I didn't understand what that section was asking me to do.
What routes/paths did you implement the create order and capture order functions at? What data do they return? Update your question with this information. For the create order route, is the data a valid JSON object with a PayPal order ID in the id key?
Have you set the paths in your "PayPalButton.aspx" HTML/JS code to call the aforementioned routes? Your question does not include any specific information about what is going on, i.e. your button code and the result (Response body) of the fetch calls from the browser's developer tools 'Network' tab.
This morning, I managed to resolve the problem with my PayPalButton.aspx page just briefly flashing the PayPal login page. As previously mentioned, it contains a script copied from PayPal's button demo. I then realised that it was different from the sample script provided on the Integrate Checkout page.
I created a new PayPalButton2.aspx page containing this alternative script and, unlike PayPalButton.aspx, it worked fine. In both cases, I had substituted my own Sandbox ClientID.

Rendering an official PayPal button that uses REST APIs

I am beginning an integration using the PayPal REST API as I need full control over the checkout process.
I assumed that I'd be coding everything server side, so I cannot see how I should be adding the PayPal button which essentially should just call my own code which will set up the order via the API and redirect to the PayPal URL?
There is lots of online help on how to add the smart buttons etc but these look to initiate the quick checkout process via the Javascrip SDK.
Essentially I want to render an official PayPal button, but have it call a local server side page.
Follow the Set up standard payments guide, particularly #5 of "Add and modify the code".
Be sure to read that section and click through to the demo code sample for the approval flow, https://developer.paypal.com/demo/checkout/#/pattern/server
That's for a pure HTML/JS client -- there are also some framework-specific options..
react-paypal-js Storybook
Angular and Vue, see here
A package manager such as NPM, paypal-js

Why not always use _express-checkout-mobile for Paypal Express Checkout?

In PayPal Express Checkout, _express-checkout-mobile seems to auto-detect the browser and show the correct page at all times.
Are there scenarios where the mobile UI will be improperly displayed? Is there a reason to ever pass _express-checkout instead?
I've always used _express-checkout and it automatically detects which experience to use. I think if you use _express-checkout-mobile it will use the mobile experience regardless of the platform the user is on, but I haven't tested that specifically.
I've just tested it with _express_checkout, and on my mobile phone I am forwarded to the mobile payment design.
There does not seem to be a difference.

Not receiving custom value from Paypal on mobile devices

I have a paypal button on my site and I have a custom value that is returned from paypal to my site on completion of the transaction.
It works fine on desktops but for some reason it wont work on mobile devices like an android phone or an Ipad. the payment goes through but the value doesn't seem to be passed to my page.
thanks
Thank you for reaching out to me. We found there was an issue with the mobile flow not returning data when using RM=2. To retrieve the data you opted to switch to Payment Data Transfer (PDT) to collect the information.
We'll continue working on the issue of returning no Post data while using RM=2 in the mobile flow but at least we got your goal accomplished.
It looks like when payments are coming back through from mobile.paypal.com, any get parameters on the 'return' url are being unencoded first, so if there's a %2B in the url I pass to paypal, when it comes back, it's a + (meaning, you're decoding them on your side after the post, then encoding them, instead of simply encoding them). Same for %3D coming back as =, and I'd assume all sorts of other invalid stuff. This is not true if the 'return' comes from www.paypal.com. I'll report a bug, but I'm assuming others will want to know this information.
Chris
Update: I just got one of these malformed urls from www.paypal.com/ca/cgi-bin/webscr, so it's not just the mobile site...