Search code examples
paypalpaypal-sandboxpaypal-rest-sdk

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:

  1. The docs say that I need to submit my app for approval (but it doesn't say how)

  2. This stack question says that with PayPal Checkout you don't need to submit your app for approval

  3. 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=eyJwYXlwYWwiOnsiZWxpZ2libGUiOn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GUiOmZhbHNlfSwiZ2lyb3BheSI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJlcHMiOnsiZWxpZ2libGUiOmZhbHNlfSwic29mb3J0Ijp7ImVsaWdpYmxlIjpmYWxzZX0sIm15YmFuayI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJwMjQiOnsiZWxpZ2libGUiOmZhbHNlfSwiemltcGxlciI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJ3ZWNoYXRwYXkiOnsiZWxpZ2libGUiOmZhbHNlfSwicGF5dSI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJibGlrIjp7ImVsaWdpYmxlIjpmYWxzZX0sInRydXN0bHkiOnsiZWxpZ2libGUiOmZhbHNlfSwib3h4byI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJtYXhpbWEiOnsiZWxpZ2libGUiOmZhbHNlfSwiYm9sZXRvIjp7ImVsaWdpYmxlIjpmYWxzZX0sImJvbGV0b2JhbmNhcmlvIjp7ImVsaWdpYmxlIjpmYWxzZX0sIm1lcmNhZG9wYWdvIjp7ImVsaWdpYmxlIjpmYWxzZX0sIm11bHRpYmFuY28iOnsiZWxpZ2libGUiOmZhbHNlfX0&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

Solution

  • 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.