Created
November 29, 2016 23:22
-
-
Save mttjohnson/58920ae77c0f11b1530c251884daaa09 to your computer and use it in GitHub Desktop.
Braintree manual transaction settlement
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Setup local directory with braintree example and libraries | |
git clone [email protected]: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