如何在项目中包含php库? [开发网站] [关闭]

问题描述 投票:-5回答:2

我试图在我的项目中包括braintree(在线接受支付api)php库。有没有办法我可以将库复制到服务器。因为我不熟悉整个作曲家的事情!

php braintree
2个回答
2
投票

GolezTrol已经回答了这个问题,因为文档说的第一件事就是如何在没有作曲家的情况下使用它,但如果你下载:https://developers.braintreepayments.com/client_libraries/php/braintree-php-3.7.0.tgz

将其上传到您的服务器并将以下内容写入您的网站:

require_once 'PATH_TO_BRAINTREE/lib/Braintree.php';

Braintree\Configuration::environment('sandbox');
Braintree\Configuration::merchantId('your_merchant_id');
Braintree\Configuration::publicKey('your_public_key');
Braintree\Configuration::privateKey('your_private_key');

然后,您可以按照API完成此过程。我希望11个月后你已经解决了这个问题。


1
投票

这个链接将启动并运行作曲家https://getcomposer.org/doc/01-basic-usage.md

只需创建一个composer.json文件并添加以下内容

{
  "require" : {
    "braintree/braintree_php" : "2.35.2"
  }
}

然后运行:

php composer.phar install

或者你可以下载https://www.braintreepayments.com/assets/client_libraries/php/braintree-php-2.35.2.tgz

© www.soinside.com 2019 - 2024. All rights reserved.