Zach443
Zach443

Reputation: 311

How to configure PayPal PHP SDK

I am making an eCommerce store with the PayPal PHP SDK and I am having difficulties configuring the SDK. In the documentation, it says to use a dedicated config file you have to define the path of it with this line:

    define('PP_CONFIG_PATH', /path/to/your/sdk_config.ini);

I am confused about where I would put that line. Does it need to be in every class that uses the API, or just one central place?

P.S. I noticed in the samples that they used the alternative way of configuring the SDK; use a setConfig() method. However, I only found this used in the sample/bootstrap.php file in the repoisitory. So my question is the same: What would be the use-case of either of those two methods? I am probably missing what I am looking for in the SDK repository, but I thought I would ask people who have done this before.

Upvotes: 0

Views: 492

Answers (1)

Anoosh
Anoosh

Reputation: 26

If you set your define rule on top of your eCommerce software config file, it will be available to the Paypal SDK.

defined values are usually globally accessible by any file including the original.

Upvotes: 1

Related Questions