简体   繁体   English

如何配置PayPal PHP SDK

[英]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. 我正在使用PayPal PHP SDK创建电子商务商店,但在配置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? 它是否需要存在于使用API​​的每个类中,还是仅存在于一个中心位置?

PS I noticed in the samples that they used the alternative way of configuring the SDK; PS我在示例中注意到,他们使用了另一种配置SDK的方式; use a setConfig() method. 使用setConfig()方法。 However, I only found this used in the sample/bootstrap.php file in the repoisitory. 但是,我只在仓库中的sample / bootstrap.php文件中找到了此文件。 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. 我可能会缺少我在SDK 存储库中寻找的东西,但是我想问问曾经做过此事的人。

If you set your define rule on top of your eCommerce software config file, it will be available to the Paypal SDK. 如果您在电子商务软件配置文件上设置define规则,则Paypal SDK可以使用该规则。

define d values are usually globally accessible by any file includ ing the original. define d值通常可由includ原始文件includ的任何文件全局访问。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM