# Braintree PHP library
The Braintree PHP library provides integration access to the Braintree Gateway.
## Please Note
> **The Payment Card Industry (PCI) Council has [mandated](https://blog.pcisecuritystandards.org/migrating-from-ssl-and-early-tls) that early versions of TLS be retired from service. All organizations that handle credit card information are required to comply with this standard. As part of this obligation, Braintree is updating its services to require TLS 1.2 for all HTTPS connections. Braintree will also require HTTP/1.1 for all connections. Please see our [technical documentation](https://github.com/paypal/tls-update) for more information.**
## Dependencies
PHP version >= 5.4.0 is required.
The following PHP extensions are required:
* curl
* dom
* hash
* openssl
* xmlwriter
## Quick Start Example
```php
<?php
require_once 'PATH_TO_BRAINTREE/lib/Braintree.php';
// Instantiate a Braintree Gateway either like this:
$gateway = new Braintree_Gateway([
'environment' => 'sandbox'
'merchantId' => 'your_merchant_id',
'publicKey' => 'your_public_key',
'privateKey' => 'your_private_key'
]);
// or like this:
$config = new Braintree_Configuration([
'environment' => 'sandbox'
'merchantId' => 'your_merchant_id',
'publicKey' => 'your_public_key',
'privateKey' => 'your_private_key'
]);
$gateway = new Braintree\Gateway($config)
// Then, create a transaction:
$result = $gateway->transaction()->sale([
'amount' => '1000.00',
'paymentMethodNonce' => 'nonceFromTheClient',
'options' => [ 'submitForSettlement' => true ]
]);
if ($result->success) {
print_r("success!: " . $result->transaction->id);
} else if ($result->transaction) {
print_r("Error processing transaction:");
print_r("\n code: " . $result->transaction->processorResponseCode);
print_r("\n text: " . $result->transaction->processorResponseText);
} else {
print_r("Validation errors: \n");
print_r($result->errors->deepAll());
}
```
Both PSR-0 and PSR-4 namespacing are supported. If you are using composer with `--classmap-authoritative` or
`--optimize-autoloader` enabled, you'll have to reference classes using PSR-4 namespacing:
```php
$gateway = new Braintree\Gateway([
'environment' => 'sandbox'
'merchantId' => 'your_merchant_id',
'publicKey' => 'your_public_key',
'privateKey' => 'your_private_key'
]);
// or
$config = new Braintree\Configuration([
'environment' => 'sandbox'
'merchantId' => 'your_merchant_id',
'publicKey' => 'your_public_key',
'privateKey' => 'your_private_key'
]);
$gateway = new Braintree\Gateway($config)
```
## HHVM Support
The Braintree PHP library will run on HHVM >= 3.4.2.
## Google App Engine Support
When using Google App Engine include the curl extention in your `php.ini` file (see [#190](https://github.com/braintree/braintree_php/issues/190) for more information):
```ini
extension = "curl.so"
```
and turn off accepting gzip responses:
```php
$gateway = new Braintree\Gateway([
'environment' => 'sandbox'
// ...
'acceptGzipEncoding' => false,
]);
```
## Legacy PHP Support
Version [2.40.0](https://github.com/braintree/braintree_php/releases/tag/2.40.0) is compatible with PHP 5.2 and 5.3. You can find it on our releases page.
## Documentation
* [Official documentation](https://developers.braintreepayments.com/php/sdk/server/overview)
## Developing (Docker)
The `Makefile` and `Dockerfile` will build an image containing the dependencies and drop you to a terminal where you can run tests.
```
make
```
## Testing
The unit specs can be run by anyone on any system, but the integration specs are meant to be run against a local development server of our gateway code. These integration specs are not meant for public consumption and will likely fail if run on your system. To run unit tests use rake: `rake test:unit`.
The benefit of the `rake` tasks is that testing covers default `hhvm` and `php` interpreters. However, if you want to run tests manually simply use the following command:
```
phpunit tests/unit/
```
## License
See the LICENSE file.
没有合适的资源?快使用搜索试试~ 我知道了~
【WordPress插件】2022年最新版完整功能demo+插件v1.3.1.zip
共499个文件
php:327个
js:67个
png:30个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 129 浏览量
2022-04-01
09:44:58
上传
评论
收藏 1.31MB ZIP 举报
温馨提示
"【WordPress插件】2022年最新版完整功能demo+插件v1.3.1 YITH WooCommerce PayPal Braintree Yith WoomMerce PayPal Braintre" ---------- 泰森云每天更新发布最新WordPress主题、HTML主题、WordPress插件、shopify主题、opencart主题、PHP项目源码、安卓项目源码、ios项目源码,更有超10000个资源可供选择,如有需要请站内联系。
资源推荐
资源详情
资源评论
收起资源包目录
【WordPress插件】2022年最新版完整功能demo+插件v1.3.1.zip (499个子文件)
api_braintreegateway_com.ca.crt 14KB
yith-fields.css 61KB
jquery-ui.min.css 29KB
yith-select2-no-wc.css 21KB
yit-plugin-panel.css 19KB
yit-licence.css 16KB
metaboxes.css 15KB
select2.css 15KB
admin.css 7KB
codemirror.css 6KB
colorbox.css 4KB
yith-icon-font.css 3KB
yith-braintree-frontend.css 2KB
yith-license-banner.css 2KB
yit-upgrade-to-pro.css 2KB
style-index.css 2KB
elementor.css 1KB
yit-upgrader.css 412B
yit-upgrader.css 412B
yith-braintree-backend.css 117B
Dockerfile 432B
yith-icon.eot 9KB
loading.gif 6KB
halloween.jpg 117KB
black.jpg 71KB
cyber.jpg 55KB
codemirror.js 221KB
selectWoo.full.js 164KB
selectWoo.js 144KB
selectWoo.full.min.js 75KB
selectWoo.min.js 67KB
select2.min.js 65KB
jquery.colorbox.js 28KB
yith-fields.js 28KB
yith-braintree-frontend.js 26KB
javascript.js 23KB
index.js 20KB
yit-licence.js 18KB
yith-fields.min.js 15KB
jquery.colorbox.min.js 12KB
yith-enhanced-select.js 10KB
yith-braintree-frontend.min.js 10KB
wc-enhanced-select.js 9KB
multisite-updater.js 9KB
multisite-updater.js 8KB
yit-licence.min.js 8KB
edit.js 7KB
yith-enhanced-select-wc-2.6.js 7KB
yith-colorpicker.min.js 7KB
yit-plugin-panel.js 6KB
wc-enhanced-select.min.js 5KB
metabox.js 5KB
index.js 4KB
md5.min.js 4KB
yith-enhanced-select.min.js 4KB
yit-wp-pointer.js 3KB
yit-plugin-panel.min.js 3KB
yit-cpt-unlimited.js 2KB
yith-enhanced-select-wc-2.6.min.js 2KB
metabox.min.js 2KB
index.js 2KB
multisite-updater.min.js 2KB
yith-system-info.js 2KB
multisite-updater.min.js 2KB
yith-braintree-admin.js 2KB
yith-update-plugins.js 2KB
yith-update-plugins.js 2KB
yith-date-format.js 2KB
icons.js 2KB
index.js 2KB
yith-dashboard.js 1KB
generateShortcode.js 1KB
yith-braintree-admin.min.js 1KB
index.js 1KB
yit-wp-pointer.min.js 1KB
yith-date-format.min.js 1KB
yith-system-info.min.js 1KB
ajaxFetch.js 879B
wp-pages.js 852B
yith-update-plugins.min.js 832B
yith-update-plugins.min.js 822B
yit-cpt-unlimited.min.js 788B
checkForDeps.js 734B
yith-promo.js 725B
yith-dashboard.min.js 619B
actions-to-jquery-events.js 534B
yit-license-utils.js 495B
yith-promo.min.js 329B
yit-license-utils.min.js 279B
wp-pages.min.js 276B
how-to.js 193B
index.js 125B
how-to.min.js 100B
installed.json 1KB
LICENSE 1KB
LICENSE 1KB
Makefile 351B
CHANGELOG.md 19KB
README.md 4KB
ACKNOWLEDGEMENTS.md 174B
共 499 条
- 1
- 2
- 3
- 4
- 5
资源评论
Lee达森
- 粉丝: 969
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功