Reputation: 2804
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.
Upvotes: 1
Views: 6292
Reputation: 301
You can set manualy to go live without creating config.ini file
Just set in the value you want
\PayPal\Core\PayPalConfigManager::getInstance()->addConfigs(['mode' => 'live' /*or "sandbox" */]) ;
then set your live Credential id/secret with the live information
$credential = new \PayPal\Auth\OAuthTokenCredential($paypal_id, $paypal_secret);
Upvotes: 0
Reputation: 779
Can't comment to H Patel, but there's another sdk_config.ini file in the PayPal PHP SDK files which includes an endpoint and mode.
I've noticed I had to change the service.EndPoint
in this other config file to https://api.paypal.com
, change the mode
in both config files to live
, set the log.LogLevel
to INFO
, AND dynamically set the mode
to live
in my PHP script. I ALSO changed the acct1.ClientId
and acct1.ClientSecret
in both of these config ini files and it seems like maybe I've got it working now.
So it's not a matter of choosing how you want to do it, you have to do all of it and then some beyond what PayPal tells you to do.
Upvotes: 1
Reputation: 1489
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:
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:
These two steps should get you going with the live API endpoint.
Upvotes: 14