...

Paypal

Integrate the Paypal Express Checkout on your website.


Thanks to Paypal API, you are able to sell some products and services easily via the Express Checkout Service.

Framework free, can be easily integrated with your existent platforms thanks to interface to implement to represent a basket, products and users

Features


Framework Free

Not dependent to a framework or a tool.

cURL compatible

Need only cUrl to perform request.

Easily integrable

Implement only interfaces on your classes.

GitHub


Fork the project on GitHub

It is open source! It's hosted, developed, and maintained on GitHub by folks like you.


View GitHub Project

Example



<?php

//Request generator to communicate with paypal via curl
$requestGenerator = new Teknoo\Curl\RequestGenerator();

//Transport object to communicate with curl
$transport = new Teknoo\Paypal\Express\Transport\Curl93(
'User Id from Paypal',
'Password from Paypal',
'Signature from Paypal',
'https://api-3t.sandbox.paypal.com/nvp',
'https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token={token}',
93,
'PP-ECWizard',
60,
$requestGenerator
);

//Api client
$service = new ExpressCheckout($transport);

$purchase = new class implementing Teknoo\Paypal\Express\Entity\PurchaseInterface {
// ...
};

//In your html, purchase is an custom object implementing the interface PurchaseInterface
<a href="<?php echo $service->prepareTransaction($purchase); ?>">Process to checkout to paypal</a>

//On the result page
$result $service->getTransactionResult($_GET['token']);
if (
$result->isSuccessful()) {
/* ... */
} else {
$errors $result->getErrors();
}
1