A super-cool proof of concept of bttn + Braintree APIs that allow for you to buy something at the push of a bttn!
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
web
.gitignore
CONTRIBUTING.md
LICENSE.md
Procfile
README.md
app.json
composer.json

README.md

PayPal Logo

Deploy

PayPal bt.tn

Demo site for PayPal/bt.tn: https://ppbttn.herokuapp.com/

bt.tn

  1. Purchase a bttn and fill out this form to enable the beta PayPal integration. You will receive an email from bttn with your BTTN_API_KEY and BTTN_API_MERCHANT_NAME. Update config.php with these details.
  2. When you receive your button, register it.
  3. Login and select action for your bttn.

set action

  1. Select new action.

new action selection

  1. Select "pressed" for "EXECUTE ACTION IF BTTN IS".
  2. Select "PayPal bttn for commerce" as the action.

new action

  1. Select the "save" button.

Braintree

API keys

Update config.php with your Braintree API details

Braintree_Configuration::environment('sandbox');
Braintree_Configuration::merchantId('');
Braintree_Configuration::publicKey('');
Braintree_Configuration::privateKey('');

Custom Fields

You will need to setup the following customFields:

  1. bttn_status - One of ACTIVE (button has been fully registered and is ready for use), ONBOARDED (user has requested to be sent a button), UNREGISTERED (user once had a button, but is no longer associated to one).

  2. bttn_code - The code of the button associated to the user.

  3. cart_details - Records unique product identifiers for the items purchased in a comma-delimited format.

  4. cart_detail_text - Records the type of transaction this is: website purchase, bttn reorder, bttn fixed price, bttn selection.

Braintree Custom Fields

Setup

MySQL Database

We specifically wrote our code to not need a database, but you will get some functionality and additional performance improvements if you use one.

Set $settings["USE_DATABASE"] = true;

Update config.php with your database connection details.

DB::$user = 'button';
DB::$password = 'button1';
DB::$dbName = 'button';
DB::$host = '127.0.0.1';

Email

Update config.php with your email settings.

$settings["MAIL_SMTP_HOST"] = "some.smtp.server";
$settings["MAIL_SMTP_PORT"] = 587;
$settings["MAIL_FROM_NAME"] = "William's Widgets";
$settings["MAIL_FROM_EMAIL"] = "noreply@someone.com";
$settings["MAIL_BCC"] = "informational_bcc@someone.com";