Skip to content

Instantly share code, notes, and snippets.

@mttjohnson
Created November 29, 2016 23:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mttjohnson/58920ae77c0f11b1530c251884daaa09 to your computer and use it in GitHub Desktop.
Save mttjohnson/58920ae77c0f11b1530c251884daaa09 to your computer and use it in GitHub Desktop.
Braintree manual transaction settlement
# Setup local directory with braintree example and libraries
git clone git@github.com:braintree/braintree_php_example.git
cd braintree_php_example
composer install
# Create and define configuration options
echo '
BT_ENVIRONMENT=sandbox
BT_MERCHANT_ID=xxxxxxxxxxxx
BT_PUBLIC_KEY=xxxxxxxxxxxx
BT_PRIVATE_KEY=xxxxxxxxxxxx
' > .env
# Create the testing script for settling transactions
mkdir -p utility
cd utility
echo '<?php
require_once("../includes/braintree_init.php");
$transactionId = $argv[1];
echo "sending request to settle (" . $transactionId . ")";
$transaction = Braintree_Test_Transaction::settle($transactionId);
echo print_r($transaction);
' > settle.php
# run the example code to settle a transaction manually from the command line
php settle.php xxxxxxxxxxxx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment