2017 © Pedro Peláez
 

cakephp-plugin cakephp-paypalbuttons

CakePHP webservice implementation for PaypalButtons

image

tresorg/cakephp-paypalbuttons

CakePHP webservice implementation for PaypalButtons

  • Tuesday, September 5, 2017
  • by visualex
  • Repository
  • 1 Watchers
  • 1 Stars
  • 17 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 5 Versions
  • 6 % Grown

The README.md

PaypalButtons plugin

Software License, (*1)

Installation

Install the plugin with composer, (*2)

$ composer require tresorg/cakephp-paypalbuttons

Manual install is discouraged but you can check the composer.json file for package requirements., (*3)

Add the following configuration to Datasources in your config/app.php file., (*4)

'Datasources' => [
   ...
   'paypal_buttons' => [
      'className' => 'Muffin\Webservice\Connection',
      'service' => 'Tresorg/PaypalButtons.PaypalButtons',
      'endpoint' => 'https://api-3t.paypal.com/nvp',
      'credentials' => [
         'USER'      => 'paypal.username',
         'PWD'       => 'pass***word',
         'SIGNATURE' => 'your-signature-here-012345678900123456789001234567890',
         'VERSION'   => 94,
      ],
      // these options can be overridden upon button creation, per button
      'defaults' => [
         'notify_url'   => 'http://exmpl.com/ipn.php',      // IPN calls get called here
         'return'       => 'http://exmpl.com/thanks.php',   // Successful Sales Page
         'cancel_return'=> 'http://exmpl.com/tryagain.php', // Unsuccessful Sale URL
      ],
   ],
],

Usage

If you are loading this plugin from within an object that is not a CakePHP Controller or Shell, use the ModelAwareTrait in your class to get the methods: modelFactory & loadModel., (*5)

// use the Muffin Webservice
$this->modelFactory('Endpoint', ['Muffin\Webservice\Model\EndpointRegistry', 'get']);
// load your remote Webservice:
$paypalButtonsRemoteWebservice = $this->loadModel('PaypalButtons.PaypalButtons', 'Endpoint');
// sends the data to paypal
subscription = $this->PaypalButtonsRemote->save( new Entity([
   'item_number' => 'yourInventoryNumber',
   'item_name' => 'MyCoolProductName',
   'price' => 9.99,
   'subscription_type' => 'M', //monthly subscription
   'subscription_recurring' => '1', //recurring subscription
]));
// receive the paypal button ID add it to your form, etc
$buttonId = $buttonCreated->id;

Contribute

This Plugin works great with all currencies, subscriptions, trial periods. Shipping is not implemented yet., (*6)

Feel free to contribute, fork and PR., (*7)

🍺, (*8)

The Versions

05/09 2017

dev-master

9999999-dev

CakePHP webservice implementation for PaypalButtons

  Sources   Download

MIT

The Requires

 

The Development Requires

05/09 2017

0.0.3

0.0.3.0

CakePHP webservice implementation for PaypalButtons

  Sources   Download

MIT

The Requires

 

The Development Requires

31/07 2017

0.0.2

0.0.2.0

CakePHP webservice implementation for PaypalButtons

  Sources   Download

MIT

The Requires

 

The Development Requires

13/04 2017

0.0.1

0.0.1.0

CakePHP webservice implementation for PaypalButtons

  Sources   Download

MIT

The Requires

 

The Development Requires

13/04 2017

0.0.0

0.0.0.0

CakePHP webservice implementation for PaypalButtons

  Sources   Download

MIT

The Requires

 

The Development Requires