Paypal Integration kit for DIRECT PAYMENT method and EXPRESS CHECKOUT method.
Demo is given in the pages testDirectPayment.php
and testExpressCheckout.php
respectively.
For Use simply configure the merchant details in the page PaymentGateway/PaypalAbstract.php
then
For DirectPayment
-
Set the return urls and create a
DirectPayment
object which takes the amount as the param.$Paypal = new DirectPayment(23);
-
Set the credit card details
setCreditCardNumber("4539644852839411");
setCVV("123")
setCardType("VISA")
setExpDate("MMYYYY")
-
Set the optional billing information. Then the method
doPayment()
will return the parsed paypal response as an array.
For ExpressCheckout
-
Set the Expresscheckout by
`$Paypal = new ExpressCheckout($amount);//Amount` `$Paypal->doPayment();`
-
The page will be redirected to paypal
-
In the return page call the method
DoExpressCheckoutPayment
`$Paypal = new ExpressCheckout($amount);//Amount` `$response = $Paypal->DoExpressCheckoutPayment($_REQUEST);`
NOTE: For lesser versions of php remove the namespaces before using.
TODO: Implement Paypal Parallel Payments Using Express Checkout and Recurring payment