/paypal_lib

Unofficial Lithium framework PayPal plugin

Primary LanguagePHP

PayPal Plugin for Li3

payapl_lib is a Lithium plugin, NOT a Lithium app. This plugin is written to work only with Li3 and is based on code from PayPal PHP SDK (PayPal API: Name-Value Pair Interfacecode) samples.

Usage

  • Install paypal_lib plugin in your existing application using git submodule in libraries/paypal_lib folder
git submodule add git://github.com/matuag/paypal_lib.git libraries/paypal_lib
git submodule init
git submodule update
  • add plugin reference to config/bootstrap/libraries.php
Libraries::add('paypal_lib');
  • by default the configuration files contains PayPal API Signature for making API calls to the PayPal sandbox. To override the default configuration create app/config/bootstrap/paypal.php similar to paypal_lib/config/bootstrap/paypal.php

  • include the plugin in the php file which will use the library

use paypal_lib\extensions\net\http\PaypalService;
  • create an instance of class PaypalService
$paypalService = new PaypalService();
  • following services are supported

DirectPayment

$resArray = $paypalService->paypalPayment($postData, 'doDirectPayment');

CreateRecurringPaymentsProfile

$resArray = $paypalService->paypalPayment($postData, 'createRecurringPaymentsProfile');

GetRecurringPaymentsProfileDetails

$resArray = $paypalService->paypalPayment($postData, 'getRecurringPaymentsProfileDetails');

ManageRecurringPaymentsProfileStatus

$resArray = $paypalService->paypalPayment($postData, 'manageRecurringPaymentsProfileStatus');

GetTransactionDetails

$resArray = $paypalService->paypalPayment($postData, 'getTransactionDetails');