2017 © Pedro Peláez
 

kohana-module paypal

PayPal module for the Kohana framework

image

hete/paypal

PayPal module for the Kohana framework

  • Friday, May 8, 2015
  • by arteymix
  • Repository
  • 8 Watchers
  • 10 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 30 Forks
  • 1 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

PayPal module for the Kohana framework

This module supports classic NVP PayPal api along with an IPN endpoint., (*1)

NVP api is being deprecated by the new RESTful api. You can use it with PayPal-PHP-SDK., (*2)

Basic usage

You need to obtain credentials from PayPal website in order to use this module. Once you have them, set them in the configuration file., (*3)

If you would like to use a certificate, do not set the signature and provide your certificate path to cURL. It is documented in the module configuration file., (*4)

You only need to factory an external Request object, (*5)

$setexpresscheckout = PayPal::factory('SetExpressCheckout');

It returns a prepared Request object that you can parametrize and execute:, (*6)

$response = $setexpresscheckout
    ->query('AMT', 33.23)
    ->query('RETURNURL', Route::url('default', array(
        'controller' => 'payment', 
        'action' => 'complete'), 'https')) // use your own return url
    ->query('CANCELURL', Route::url('default', array(
        'controller' => 'payment', 
        'action' => 'cancel'), 'https')) // use your own cancel url
    ->execute();

Do not pass an array to Request::query, it will erase the initial configuration which contains the credentials and method., (*7)

Redirection are handled for requests that requires user interaction., (*8)

$url = PayPal_SetExpressCheckout::redirect_url($response);
$query = PayPal_SetExpressCheckout::redirect_query($response);

HTTP::redirect($url . URL::query($query));

Or simply, (*9)

PayPal_SetExpressCheckout::redirect($response);

PayPal class provides a method for parsing the Response into an associative array so that you can work with data efficiently., (*10)

$response = PayPal::parse_response($response);

If you need the raw PayPal array:, (*11)

$arr = PayPal::parse_response($response, FALSE);

Then you can expand it, (*12)

$expanded = PayPal::expand($arr);

Validation

Validation rules are given for some requests. One way to contribute is to provide more validations for the request and responses objects., (*13)

$request_validation = PayPal_SetExpressCheckout::get_request_validation($request);

$response_validation = PayPal_SetExpressCheckout::get_response_validation($response);

IPN

To enable IPN, set the ipn_enabled option in your configuration. It will create an endpoint for PayPal's request., (*14)

example.com/ipn

Requests are automatically verified against PayPal in the live environment. You only need to overload Kohana_Controller_IPN and set supported action. If not specified, a 404 error will be triggered., (*15)

In your application, you only need to override the IPN controller and implement the appropriate action. Action name will match the txn_type key in PayPal's query., (*16)

class Controller_PayPal_IPN extends Kohana_Controller_PayPal_IPN {

    public function action_express_checkout() 
    {
        // Put your code here...
    }
}

The Versions

08/05 2015

dev-3.3/master

dev-3.3/master http://github.com/Hete/kohana-paypal

PayPal module for the Kohana framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

framework paypal kohana ipn

01/04 2015

dev-3.2/master

dev-3.2/master http://github.com/Hete/kohana-paypal

PayPal module for the Kohana framework

  Sources   Download

BSD-3-Clause

The Requires

 

framework paypal kohana ipn

10/12 2014

dev-3.4/develop

dev-3.4/develop http://github.com/Hete/kohana-paypal

PayPal module for the Kohana framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

framework paypal kohana ipn

10/12 2014

dev-3.3/develop

dev-3.3/develop http://github.com/Hete/kohana-paypal

PayPal module for the Kohana framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

framework paypal kohana ipn

24/06 2014

dev-3.1/master

dev-3.1/master http://github.com/Hete/kohana-paypal

PayPal module for the Kohana framework

  Sources   Download

BSD-3-Clause

The Requires

 

framework paypal kohana ipn