Coder Social home page Coder Social logo

kleopatra999 / paypal-bttn Goto Github PK

View Code? Open in Web Editor NEW

This project forked from paypal/paypal-bttn

0.0 2.0 0.0 3.94 MB

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

Home Page: https://ppbttn.herokuapp.com/

License: MIT License

CSS 11.52% PHP 55.25% JavaScript 5.98% HTML 27.25%

paypal-bttn's Introduction

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"] = "[email protected]";
$settings["MAIL_BCC"] = "[email protected]";

paypal-bttn's People

Contributors

gregv avatar

Watchers

rosa maria palacios juncosa avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.