Skip to content

losmicar/CakePHP-Braintree-Subscription

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cake PHP Braintree Plugin for Subscriptions

This CakePHP Braintree plugin is in Beta Testing Phase.

It is tested and developed using Cake PHP ver. 2.4.5.

Plugin is developed for creating subscriptions, not common transactions (that will come in future). All credit card (paypall) account info is stored in Braintreee Vault, nothing of these sensitive data is not stored on your server.

Webhooks management is implemented, but you'll need to create and verify your webhook URL from Braintree Control Panel.

#Requirements

#Preview

=======

#Instalation instructions

  • Create subscriptions table from subscriptions.sql file.

  • Create routes in your app/Config/route.php file.

Router::connect(
   "/subscriptions/:action/*", array('plugin' => 'braintree', 'controller'=>'subscriptions')
);

Router::connect(
   "/subscriptions/", array('plugin' => 'braintree', 'controller'=>'subscriptions', 'action'=>'orders')
);

Router::connect(
   "/paymentmethods/:action/*", array('plugin' => 'braintree', 'controller'=>'paymentmethods')
);
  • Import plugin in your app/Config/bootstrap.php
CakePlugin::load('Braintree');
  • For a propper HTML rendering please download Foundation HTML Framework and put it in Braintree Plugins webroot folders (css and js) E.g app/Plugin/Braintree/webroot/css/foundation.min.css etc.

  • For working with Braintree Api download Braintree Php Linrary and put it into plugins app/Plugin/Vendor/Braintree/Braintree folder.

  • Here you can create your sandbox credentials Braintree Sandbox

  • In your app/Config/core.php (NOT IN PLUGIN) setup your Braintree Credentials for testing.

Configure::write('Braintree', array(
	    'plan_id' => 'your_plan_id',
	    'env' => 'sandbox',
	    'merchantId' => 'your_merchant_id',
	    'publicKey' => 'your_public_key',
	    'privateKey' => 'your_private_key',

    ));
  • Use PaymentsController.php to implement your own logic for subscription actions.

Enjoy.

About

Cake PHP Plugin for easy creating Braintree Subscriptions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published