{"id":19217122,"url":"https://github.com/8ctopus/paypal-rest-api","last_synced_at":"2026-01-04T08:46:48.449Z","repository":{"id":207748207,"uuid":"719990374","full_name":"8ctopus/paypal-rest-api","owner":"8ctopus","description":"PayPal REST API implementation using PSR-7, PSR-17 and PSR-18","archived":false,"fork":false,"pushed_at":"2024-05-22T05:36:02.000Z","size":116,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-05-22T13:08:40.858Z","etag":null,"topics":["paypal","paypal-checkout","paypal-rest-api","paypal-subscriptions","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/8ctopus.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-17T10:41:43.000Z","updated_at":"2024-05-28T13:26:20.214Z","dependencies_parsed_at":"2024-05-13T06:23:55.219Z","dependency_job_id":"fabe4747-7330-49e3-bcb1-decc3401e346","html_url":"https://github.com/8ctopus/paypal-rest-api","commit_stats":null,"previous_names":["8ctopus/paypal-rest-api"],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/8ctopus%2Fpaypal-rest-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/8ctopus%2Fpaypal-rest-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/8ctopus%2Fpaypal-rest-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/8ctopus%2Fpaypal-rest-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/8ctopus","download_url":"https://codeload.github.com/8ctopus/paypal-rest-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245144021,"owners_count":20568049,"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","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":["paypal","paypal-checkout","paypal-rest-api","paypal-subscriptions","php"],"created_at":"2024-11-09T14:20:10.374Z","updated_at":"2026-01-04T08:46:48.444Z","avatar_url":"https://github.com/8ctopus.png","language":"PHP","funding_links":["https://developer.paypal.com/api/rest/","https://www.sandbox.paypal.com/checkoutnow?token="],"categories":[],"sub_categories":[],"readme":"# PayPal REST API\n\n[![packagist](https://poser.pugx.org/8ctopus/paypal-rest-api/v)](https://packagist.org/packages/8ctopus/paypal-rest-api)\n[![downloads](https://poser.pugx.org/8ctopus/paypal-rest-api/downloads)](https://packagist.org/packages/8ctopus/paypal-rest-api)\n[![min php version](https://poser.pugx.org/8ctopus/paypal-rest-api/require/php)](https://packagist.org/packages/8ctopus/paypal-rest-api)\n[![license](https://poser.pugx.org/8ctopus/paypal-rest-api/license)](https://packagist.org/packages/8ctopus/paypal-rest-api)\n[![tests](https://github.com/8ctopus/paypal-rest-api/actions/workflows/tests.yml/badge.svg)](https://github.com/8ctopus/paypal-rest-api/actions/workflows/tests.yml)\n![code coverage badge](https://raw.githubusercontent.com/8ctopus/paypal-rest-api/image-data/coverage.svg)\n![lines of code](https://raw.githubusercontent.com/8ctopus/paypal-rest-api/image-data/lines.svg)\n\nA php implementation of the PayPal REST API using `PSR-7`, `PSR-17` and `PSR-18`.\n\nThe package is a work in progress and contributions are welcome. For now, it covers `Orders` (one-time payments), subscriptions (`Products`, `Plans` and `Subscriptions`), `Webhooks` (receive notifications from PayPal when certain events occur) and `Payments`. That's all that's needed to create a store, be it one-time payment or subscription based.\n\n_NOTE_: If you're just starting to use PayPal think twice, as I have found that their apis are unstable, bugs are introduced all the time in production and despite contacting Merchant Technical Support the issues take forever to get fixed. Save yourself the hassle and use a more reliable payment provider.\n\n## install package\n\n    composer require 8ctopus/paypal-rest-api\n\n## before you get started\n\nCopy `.env.example` to `.env` and fill in your PayPal REST API credentials. If you don't have credentials yet, follow the guide:\n\n    https://developer.paypal.com/api/rest/\n\n## demo\n\nHere's a code sample that shows how to make a one-time payment. To see all possibilites run `php demo.php`. There is also a demo store using this package, check out [PayPal sandbox](https://github.com/8ctopus/paypal-sandbox).\n\n```php\nuse HttpSoft\\Message\\RequestFactory;\nuse HttpSoft\\Message\\StreamFactory;\nuse Nimbly\\Shuttle\\Shuttle;\nuse Oct8pus\\PayPal\\Orders;\nuse Oct8pus\\PayPal\\Orders\\Intent;\nuse Oct8pus\\PayPal\\OAuth;\nuse Oct8pus\\PayPal\\HttpHandler;\n\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$handler = new HttpHandler(\n    // PSR-18 http client\n    new Shuttle(),\n    // PSR-17 request factory\n    new RequestFactory(),\n    // PSR-7 stream factory\n    new StreamFactory()\n);\n\n$sandbox = true;\n\n// get authorization token\n$auth = new OAuth($sandbox, $handler, 'rest.id', 'rest.secret');\n\n$orders = new Orders($sandbox, $handler, $auth);\n\n// create order\n$response = $orders-\u003ecreate(Intent::Capture, 'USD', 10.0);\n\n// you must redirect the user to approve the payment before you can capture\n$redirectUrl = \"https://www.sandbox.paypal.com/checkoutnow?token={$response['id']}\";\n\n...\n\n// once the user has approved the payment, capture it\n$response = $orders-\u003ecapture($args['id']);\n\nif ($response['status'] === 'COMPLETED') {\n    echo 'payment processed!';\n}\n```\n\n## run tests\n\n    composer test\n\n# references\n\n- PayPal REST API official documentation: https://developer.paypal.com/api/rest/\n- PayPal REST archived php SDK https://github.com/paypal/PayPal-PHP-SDK/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F8ctopus%2Fpaypal-rest-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F8ctopus%2Fpaypal-rest-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F8ctopus%2Fpaypal-rest-api/lists"}