Skip to content
This repository has been archived by the owner on Jul 20, 2020. It is now read-only.
/ paypal-bttn Public archive

A super-cool proof of concept of bttn + Braintree APIs that allow for you to buy something at the push of a bttn!

License

Notifications You must be signed in to change notification settings

paypal/paypal-bttn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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";

About

A super-cool proof of concept of bttn + Braintree APIs that allow for you to buy something at the push of a bttn!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published