{"id":33996684,"url":"https://github.com/patrickkerrigan/paypal-ewp","last_synced_at":"2025-12-13T08:38:12.546Z","repository":{"id":57042280,"uuid":"115797863","full_name":"patrickkerrigan/paypal-ewp","owner":"patrickkerrigan","description":"A PHP library for generating encrypted PayPal buttons (EWP)","archived":false,"fork":false,"pushed_at":"2024-11-25T14:24:30.000Z","size":40,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-28T01:47:19.946Z","etag":null,"topics":["encryption","ewp","paypal","paypal-button","php"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/patrickkerrigan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-30T13:14:57.000Z","updated_at":"2024-11-25T14:24:33.000Z","dependencies_parsed_at":"2023-01-30T13:45:33.452Z","dependency_job_id":null,"html_url":"https://github.com/patrickkerrigan/paypal-ewp","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/patrickkerrigan/paypal-ewp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickkerrigan%2Fpaypal-ewp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickkerrigan%2Fpaypal-ewp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickkerrigan%2Fpaypal-ewp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickkerrigan%2Fpaypal-ewp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patrickkerrigan","download_url":"https://codeload.github.com/patrickkerrigan/paypal-ewp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickkerrigan%2Fpaypal-ewp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27702660,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-13T02:00:09.769Z","response_time":147,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["encryption","ewp","paypal","paypal-button","php"],"created_at":"2025-12-13T08:38:11.864Z","updated_at":"2025-12-13T08:38:12.532Z","avatar_url":"https://github.com/patrickkerrigan.png","language":"PHP","funding_links":["https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/encryptedwebpayments/","https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/","https://www.paypal.com/cgi-bin/webscr"],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://img.shields.io/github/actions/workflow/status/patrickkerrigan/paypal-ewp/tests.yml?branch=master\u0026style=flat-square)](https://github.com/patrickkerrigan/paypal-ewp/actions/workflows/tests.yml) [![Maintainability](https://api.codeclimate.com/v1/badges/6e655a8a9e3f3d9522f5/maintainability)](https://codeclimate.com/github/patrickkerrigan/paypal-ewp/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/6e655a8a9e3f3d9522f5/test_coverage)](https://codeclimate.com/github/patrickkerrigan/paypal-ewp/test_coverage) [![PHP \u003e=7.1](https://img.shields.io/badge/php-%3E%3D7.1-blue.svg?style=flat-square)](http://php.net/) [![Packagist](https://img.shields.io/packagist/v/pkerrigan/paypal-ewp.svg?style=flat-square)](https://packagist.org/packages/pkerrigan/paypal-ewp)\n\n# paypal-ewp\nA PHP library for generating encrypted PayPal buttons (EWP)\n\n## Prerequisites\nTo 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.\n\nYou'll need the following data to generate a button:\n* Your Certificate ID issued by PayPal after you uploaded your certificate\n* The path to your certificate in PEM format on disk\n* The path to your private key in PEM format on disk\n* The passphrase for your private key (if you set one)\n* The path to PayPal's public certificate in PEM format on disk\n* The [HTML Variables](https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/) you wish to add to your button\n\n## Installation\nThe recommended way to install this library is via Composer:\n\n```bash\ncomposer require pkerrigan/paypal-ewp ^1\n```\n\n## Usage\nBelow is a complete example which generates an encrypted button for submitting a shopping cart:\n\n```php\n\u003c?php\n \nuse Pkerrigan\\PaypalEwp\\PaypalCertificate;\nuse Pkerrigan\\PaypalEwp\\MerchantCertificate;\nuse Pkerrigan\\PaypalEwp\\ButtonGenerator;\n \n$buttonGenerator = new ButtonGenerator();\n \n$paypalCert = new PaypalCertificate('/path/to/certs/paypal-cert.pem');\n \n$merchantCert = new MerchantCertificate(\n    'MY_CERTIFICATE_ID',\n    '/path/to/certs/merchant-cert.pem',\n    '/path/to/certs/merchant-key.pem',\n    'MY_KEY_PASSPHRASE' //This argument can be omitted if you have no passphrase\n);\n \n$buttonVariables = [\n    'cmd' =\u003e '_cart',\n    'upload' =\u003e '1',\n    'amount_1' =\u003e '1.00',\n    'item_name_1' =\u003e 'Test Item',\n    'business' =\u003e 'test@example.org',\n    'currency_code' =\u003e 'GBP'\n];\n \n$encryptedCart = $buttonGenerator-\u003eencrypt($paypalCert, $merchantCert, $buttonVariables);\n \n?\u003e\n \n\u003cform action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\"\u003e\n    \u003cinput type=\"hidden\" name=\"cmd\" value=\"_s-xclick\"\u003e\n    \u003cinput type=\"hidden\" name=\"encrypted\" value=\"\u003c?= $encryptedCart; ?\u003e\"\u003e\n    \u003cinput type=\"submit\" value=\"Proceed to checkout\"\u003e\n\u003c/form\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickkerrigan%2Fpaypal-ewp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatrickkerrigan%2Fpaypal-ewp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickkerrigan%2Fpaypal-ewp/lists"}