Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

braintree/braintree_slim_example

Repository files navigation

This repo is archived. Use the PHP Example Repo instead.

Braintree Slim Example

Build Status

An example Braintree integration for PHP in the Slim framework.

Setup Instructions

  1. Install composer and project dependencies:
curl -sS https://getcomposer.org/installer | php
php composer.phar install
  1. Copy the contents of example.env into a new file named .env and fill in your Braintree API credentials. Credentials can be found by navigating to Account > My User > View Authorizations in the Braintree Control Panel. Full instructions can be found on our support site.

  2. Start server:

php -S 0.0.0.0:3000

Running tests

Integration tests make API calls to Braintree and require that you set up your Braintree credentials. You can run this project's integration tests by adding your sandbox API credentials to .env and calling vendor/bin/phpunit on the command line.

Testing Transactions

Sandbox transactions must be made with sample credit card numbers, and the response of a Braintree_Transaction::sale() call is dependent on the amount of the transaction.

Pro Tips

Help

Disclaimer

This code is provided as is and is only intended to be used for illustration purposes. This code is not production-ready and is not meant to be used in a production environment. This repository is to be used as a tool to help merchants learn how to integrate with Braintree. Any use of this repository or any of its code in a production environment is highly discouraged.