Search code examples
phppaypalpaypal-rest-sdk

Paypal PHP SDK going from sandbox to live


Hey guys I followed this tutorial

http://www.sanwebe.com/2014/09/paypal-rest-api-payment-system

I have the paypal sandbox mode working perfect. It's time to launch the site & I want to switch it to live. I've been messing with it for hours and cannot figure out how to direct this to the live mode.

Any help at all will be greatly appreciated.


Solution

  • If you are using PayPal-PHP-SDK,

    Step 1: You need to set the mode to live to point the SDK to live endpoints. To do that, there are multiple ways:

    • sdk_config.ini
      • you need to set this there
      • enter image description here
    • dynamically using ApiContext
      • you could do that by setting it similar to this
      • enter image description here

    Step 2:, Please update the clientId and secret for Live environment, as they are different based on sandbox or live. Visit PayPal Developer and check on live select box as shown below:

    enter image description here

    These two steps should get you going with the live API endpoint.