https://github.com/patrickkerrigan/paypal-ewp
A PHP library for generating encrypted PayPal buttons (EWP)
https://github.com/patrickkerrigan/paypal-ewp
encryption ewp paypal paypal-button php
Last synced: 7 months ago
JSON representation
A PHP library for generating encrypted PayPal buttons (EWP)
- Host: GitHub
- URL: https://github.com/patrickkerrigan/paypal-ewp
- Owner: patrickkerrigan
- License: bsd-3-clause
- Created: 2017-12-30T13:14:57.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-11-25T14:24:30.000Z (over 1 year ago)
- Last Synced: 2025-11-28T01:47:19.946Z (7 months ago)
- Topics: encryption, ewp, paypal, paypal-button, php
- Language: PHP
- Size: 39.1 KB
- Stars: 8
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/patrickkerrigan/paypal-ewp/actions/workflows/tests.yml) [](https://codeclimate.com/github/patrickkerrigan/paypal-ewp/maintainability) [](https://codeclimate.com/github/patrickkerrigan/paypal-ewp/test_coverage) [](http://php.net/) [](https://packagist.org/packages/pkerrigan/paypal-ewp)
# paypal-ewp
A PHP library for generating encrypted PayPal buttons (EWP)
## Prerequisites
To use this library you should first follow the [instructions given by PayPal](https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/encryptedwebpayments/#id08A3I0P20E9) on generating a merchant certificate and key pair and obtaining PayPal's public certificate.
You'll need the following data to generate a button:
* Your Certificate ID issued by PayPal after you uploaded your certificate
* The path to your certificate in PEM format on disk
* The path to your private key in PEM format on disk
* The passphrase for your private key (if you set one)
* The path to PayPal's public certificate in PEM format on disk
* The [HTML Variables](https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/) you wish to add to your button
## Installation
The recommended way to install this library is via Composer:
```bash
composer require pkerrigan/paypal-ewp ^1
```
## Usage
Below is a complete example which generates an encrypted button for submitting a shopping cart:
```php
'_cart',
'upload' => '1',
'amount_1' => '1.00',
'item_name_1' => 'Test Item',
'business' => 'test@example.org',
'currency_code' => 'GBP'
];
$encryptedCart = $buttonGenerator->encrypt($paypalCert, $merchantCert, $buttonVariables);
?>
```