teknoo / paypal-exprss
Library to perform quickly sales with the service Paypal Express Checkout
Fund package maintenance!
Patreon
TeknooSoftware
Installs: 13 972
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 5
Forks: 1
Open Issues: 0
Requires
- php: ^8.1
- psr/http-factory: ^1.0.1
- psr/http-message: ^1.0.1
Requires (Dev)
- icanhazstring/composer-unused: ^0.8.10
- nyholm/psr7: ^1.8
- php-http/client-common: ^2.6.1
- php-http/curl-client: ^2.3
- php-http/discovery: ^1.19.1
- php-http/message: ^1.16
- phpstan/phpstan: ^1.10.46
- phpunit/phpunit: ^10.4.2
- roave/security-advisories: dev-latest
- squizlabs/php_codesniffer: ^3.7.2
- symfony/property-access: ^6.3||^7.0
- dev-master
- 3.0.7
- 3.0.6
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 2.0.14
- 2.0.13
- 2.0.12
- 2.0.11
- 2.0.10
- 2.0.9
- 2.0.8
- 2.0.7
- 2.0.6
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 2.0.0-beta1
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.1.0-beta4
- 1.1.0-beta3
- 1.1.0-beta2
- 1.1.0-beta1
- 1.0.2
- 1.0.1
- 1.0.0
- 0.8.5-beta
- 0.8.4-beta
- 0.8.3-beta
- 0.8.2-beta
This package is auto-updated.
Last update: 2024-10-22 10:31:21 UTC
README
This library allows you to integrate quickly and easily the service "Paypal Express Checkout", using NVP, in your website.
This library is deprecated, please consider the official Paypal PHP SDK.
Quick Example
<?php
declare(strict_types=1);
require_once 'vendor/autoload.php';
use Http\Discovery\HttpClientDiscovery;
use Http\Discovery\Psr17FactoryDiscovery;
use Teknoo\Paypal\Express\Service\ExpressCheckout;
use Teknoo\Paypal\Express\Transport\PsrTransport;
//Initialize Paypal library
//Transport object to communicate with curl
$transport = new PsrTransport(
HttpClientDiscovery::find(),
Psr17FactoryDiscovery::findUrlFactory(),
Psr17FactoryDiscovery::findRequestFactory(),
Psr17FactoryDiscovery::findStreamFactory(),
'https://api-3t.sandbox.paypal.com/nvp',
'93',
'user id',
'password',
'paypal signature',
'PP-ECWizard'
);
//Paypal service
$service = new ExpressCheckout(
$transport,
'https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token={token}'
);
//Prepare demo purchase
$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();
}
Support this project
This project is free and will remain free. It is fully supported by the activities of the EIRL. If you like it and help me maintain it and evolve it, don't hesitate to support me on Patreon or Github.
Thanks :) Richard.
Credits
EIRL Richard Déloge - https://deloge.io - Lead developer. SASU Teknoo Software - https://teknoo.software
About Teknoo Software
Teknoo Software is a PHP software editor, founded by Richard Déloge, as part of EIRL Richard Déloge. Teknoo Software's goals : Provide to our partners and to the community a set of high quality services or software, sharing knowledge and skills.
License
This library is licensed under the MIT License - see the licenses folder for details.
Installation & Requirements
To install this library with composer, run this command :
composer require teknoo/paypal-exprss
This library requires :
* PHP 8.1+
* A psr/http-message implementation (PSR 7)
* A psr/http-factory implementation (PSR 17)
Example
An example of using this library is available in the folder : Demo.
Contribute :)
You are welcome to contribute to this project. Fork it on Github