Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 7, 2024 via composer

braintree/braintree_php 6.15.0

Braintree PHP Client Library
Package summary
Share
0
issues
1
license
1
MIT
Package created
30 Jul 2012
Version published
8 Nov 2023
Maintainers
1
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
braintree/braintree_php@6.15.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
ⓘ This is a list of braintree/braintree_php 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does braintree/braintree_php do?

The Braintree PHP library, also known as braintree/braintree_php, enables developers to integrate their PHP applications with the Braintree Gateway for online payment processing. This essential tool makes it easier to facilitate secure transactions, which complies with the Payment Card Industry's (PCI) mandate for retiring early versions of TLS. The library is compatible with PHP version 7.3 and onwards, ensuring secure interactions with Braintree’s services.

How do you use braintree/braintree_php?

The most straightforward way to use the braintree/braintree_php library starts with adding it to your project. Once it's part of your codebase, you can instantiate a Braintree Gateway using your credentials. Here's an example in PHP:

<?php

require_once 'PATH_TO_BRAINTREE/lib/Braintree.php';

$gateway = new Braintree\Gateway([
    'environment' => 'sandbox', // change to 'production' when you are ready to transact
    'merchantId' => 'your_merchant_id',
    'publicKey' => 'your_public_key',
    'privateKey' => 'your_private_key'
]);

$result = $gateway->transaction()->sale([
    'amount' => '10.00',
    'paymentMethodNonce' => $nonceFromTheClient,
    'deviceData' => $deviceDataFromTheClient,
    'options' => [ 'submitForSettlement' => True ]
]);

if ($result->success) {
    print_r("success!: " . $result->transaction->id);
} else {
    print_r("Error processing transaction: ". $result->message);
}
?>

In this example, a Braintree Gateway instance is created, then that instance is used to initiate a transaction. The response from Braintree is then checked for a success flag. If the transaction was successful, the transaction ID is printed. Otherwise, the error message is printed.

Where are the braintree/braintree_php docs?

The official Braintree PHP library documentation, which provides more installation instructions, code examples, and API reference, can be found at this URL: Braintree PHP Documentation. If you're upgrading from an older version of the SDK, you might also find the Migration Guide useful. It's essential to check these resources to ensure smooth integration of the Braintree Gateway into your PHP application.