PHPackages                             pkerrigan/paypal-ewp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. pkerrigan/paypal-ewp

ActiveLibrary[Payment Processing](/categories/payments)

pkerrigan/paypal-ewp
====================

A PHP library for generating encrypted PayPal buttons (EWP)

v1.0.1(8y ago)83.7k1BSD-3-ClausePHPPHP &gt;=7.0

Since Dec 30Pushed 1y ago1 watchersCompare

[ Source](https://github.com/patrickkerrigan/paypal-ewp)[ Packagist](https://packagist.org/packages/pkerrigan/paypal-ewp)[ RSS](/packages/pkerrigan-paypal-ewp/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (5)Used By (0)

[![Build Status](https://camo.githubusercontent.com/6b449fd2ae384e182d4be56988c73f5deecdc844e03aea4f9d9c09aa1d644119/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7061747269636b6b6572726967616e2f70617970616c2d6577702f74657374732e796d6c3f6272616e63683d6d6173746572267374796c653d666c61742d737175617265)](https://github.com/patrickkerrigan/paypal-ewp/actions/workflows/tests.yml) [![Maintainability](https://camo.githubusercontent.com/bef96f5e0c5058111dcdf6aa7a1c3904adecd5e92f64573978cc6cd1e227a28e/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f36653635356138613965336633643935323266352f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/patrickkerrigan/paypal-ewp/maintainability) [![Test Coverage](https://camo.githubusercontent.com/42e1478db786d306b9f43c76a86bd5f5ecdb062131e8edef5e69b83dd3fc48b0/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f36653635356138613965336633643935323266352f746573745f636f766572616765)](https://codeclimate.com/github/patrickkerrigan/paypal-ewp/test_coverage) [![PHP >=7.1](https://camo.githubusercontent.com/e124089bc37f05fb115a7d92e727786b6a3622beb3bb9512619757c46c6c6579/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344372e312d626c75652e7376673f7374796c653d666c61742d737175617265)](http://php.net/) [![Packagist](https://camo.githubusercontent.com/24ec61f7082a4d9f2d268769af92966b6c354f71927a2a8cc0f2173050efe306/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f706b6572726967616e2f70617970616c2d6577702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/pkerrigan/paypal-ewp)

paypal-ewp
==========

[](#paypal-ewp)

A PHP library for generating encrypted PayPal buttons (EWP)

Prerequisites
-------------

[](#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
------------

[](#installation)

The recommended way to install this library is via Composer:

```
composer require pkerrigan/paypal-ewp ^1
```

Usage
-----

[](#usage)

Below is a complete example which generates an encrypted button for submitting a shopping cart:

```
