{"id":37010121,"url":"https://github.com/sudiptpa/paypal-rest","last_synced_at":"2026-01-14T00:58:54.842Z","repository":{"id":195031627,"uuid":"692327306","full_name":"sudiptpa/paypal-rest","owner":"sudiptpa","description":"PayPal payment gateway integration made easier. A PHP SDK for Omnipay PayPal library, use it for easier payment gateway integration with your PHP project.","archived":false,"fork":false,"pushed_at":"2025-01-05T09:18:16.000Z","size":29,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-20T08:41:42.243Z","etag":null,"topics":["hacktoberfest","hacktoberfest-accepted","payment-gateway","payment-integration","paypal","paypal-api","paypal-button","paypal-checkout","paypal-express-checkout","paypal-ipn","paypal-payment-gateway","paypal-php-sdk","paypal-rest-api","paypal-rest-sdk","php","rest-api"],"latest_commit_sha":null,"homepage":"https://sujipthapa.com/blog/how-to-integrate-paypal-rest-api-for-online-payments","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/sudiptpa.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}},"created_at":"2023-09-16T06:20:09.000Z","updated_at":"2025-02-27T10:59:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"45bdd463-902d-4a31-8542-c1cdb9a1edb7","html_url":"https://github.com/sudiptpa/paypal-rest","commit_stats":null,"previous_names":["sudiptpa/paypal-rest"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/sudiptpa/paypal-rest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudiptpa%2Fpaypal-rest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudiptpa%2Fpaypal-rest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudiptpa%2Fpaypal-rest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudiptpa%2Fpaypal-rest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sudiptpa","download_url":"https://codeload.github.com/sudiptpa/paypal-rest/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudiptpa%2Fpaypal-rest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28407627,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T00:40:43.272Z","status":"ssl_error","status_checked_at":"2026-01-14T00:40:42.636Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["hacktoberfest","hacktoberfest-accepted","payment-gateway","payment-integration","paypal","paypal-api","paypal-button","paypal-checkout","paypal-express-checkout","paypal-ipn","paypal-payment-gateway","paypal-php-sdk","paypal-rest-api","paypal-rest-sdk","php","rest-api"],"created_at":"2026-01-14T00:58:52.093Z","updated_at":"2026-01-14T00:58:54.775Z","avatar_url":"https://github.com/sudiptpa.png","language":"PHP","funding_links":["https://developer.paypal.com/docs/api/orders/v2/","https://developer.paypal.com/docs/api/webhooks/v1/"],"categories":[],"sub_categories":[],"readme":"# Omnipay: PayPal REST API\n\n**PayPal REST API driver for the Omnipay PHP payment processing library**\n\n[Omnipay](https://github.com/thephpleague/omnipay) is a framework agnostic, multi-gateway payment\nprocessing library for PHP. This package implements PayPal REST API support for Omnipay.\n\n[![Latest Stable Version](http://poser.pugx.org/sudiptpa/paypal-rest/v)](https://packagist.org/packages/sudiptpa/paypal-rest) [![Total Downloads](http://poser.pugx.org/sudiptpa/paypal-rest/downloads)](https://packagist.org/packages/sudiptpa/paypal-rest) [![Latest Unstable Version](http://poser.pugx.org/sudiptpa/paypal-rest/v/unstable)](https://packagist.org/packages/sudiptpa/paypal-rest) [![License](http://poser.pugx.org/sudiptpa/paypal-rest/license)](https://packagist.org/packages/sudiptpa/paypal-rest) [![PHP Version Require](http://poser.pugx.org/sudiptpa/paypal-rest/require/php)](https://packagist.org/packages/sudiptpa/paypal-rest)\n\n## Installation\n\nOmnipay is installed via [Composer](http://getcomposer.org/). To install, simply add it\nto your `composer.json` file:\n\n```json\n{\n    \"require\": {\n        \"sudiptpa/paypal-rest\": \"~3.0\"\n    }\n}\n```\n\nAnd run composer to update your dependencies:\n\n    $ curl -s http://getcomposer.org/installer | php\n    $ php composer.phar update\n\n## Usage\n\nThe library follows PayPal REST Orders v2 API, and below are the supported features.\n\n #### Orders API v2\n\n- [Create Order](https://developer.paypal.com/docs/api/orders/v2/#orders_create)\n- [Show Order Details](https://developer.paypal.com/docs/api/orders/v2/#orders_get)\n- [Capture Payment for Order](https://developer.paypal.com/docs/api/orders/v2/#orders_capture)\n- [Add Tracking for an Order](https://developer.paypal.com/docs/api/orders/v2/#orders_track_create)\n- [Verify Webhook Signature](https://developer.paypal.com/docs/api/webhooks/v1/#verify-webhook-signature_post)\n- [List Webhooks](https://developer.paypal.com/docs/api/webhooks/v1/#webhooks_list)\n- [Delete Webhook](https://developer.paypal.com/docs/api/webhooks/v1/#webhooks_delete)\n\nIf you want the features other than mentioned above, then feel free to submit a PR by following the coding standard.\n\n#### Initiate Gateway Request\n\n```php\nuse Omnipay\\Omnipay;\n\n$gateway = Omnipay::create('PayPalRest_Rest');\n\n$gateway-\u003esetClientId('xxxxxxxxxxx');\n$gateway-\u003esetSecret('xxxxxxxxxxx');\n$gateway-\u003esetTestMode('xxxxxxxxxxx');\n```\n\n#### Access Token\n\n```php\n$accessToken = $gateway-\u003egetToken();\n or\n$accessToken = $gateway-\u003ecreateToken()-\u003esend();\n```\n\nNote, the Access Token is not stored in the gateway at this point.\n\nManagement of the Access Token is not (yet) included in this library.\nYou should implement your own method for saving and reusing the Access Token until expired to avoid hitting PayPal query limits by generating a token for each API call.\n\nYou can set a previously retrieved Access Token in the gateway as follows:\n\n```php\n$gateway-\u003esetToken($accessToken);\n```\n\n#### API Calls\n\n```php\n$payload = [\n    'amount' =\u003e 20,\n    'transactionId' =\u003e '1001',\n    'transactionReference' =\u003e 'INV-1001',\n    'currency' =\u003e 'USD',\n    'items' =\u003e [\n        [\n            'name' =\u003e 'Test Product 1',\n            'description' =\u003e 'A sample description',\n            'quantity' =\u003e 1,\n            'price' =\u003e 20,\n            'sku' =\u003e 'ITEM-CODE1',\n            'category' =\u003e 'PHYSICAL_GOODS',\n            'reference' =\u003e 'ITEM',\n        ]\n    ],\n    'cancelUrl' =\u003e 'https://example.com/cancel/url',\n    'returnUrl' =\u003e 'https://example.com/return/url',\n];\n\n$response = $gateway-\u003epurchase($payload)-\u003esend();\n\nif ($response \u0026\u0026 $response-\u003eisSuccessful()) {\n    // handle the success\n\n    if ($response-\u003eisRedirect()) {\n        $response-\u003eredirect();\n    }\n\n    // do something else\n}\n\n// handle the failure\n```\n\n#### Capture\n\n```php\n$response = $gateway-\u003ecompletePurchase([\n    'transactionReference' =\u003e 'PAYPAL-ORDER-ID',\n])-\u003esend();\n\nif ($response \u0026\u0026 $response-\u003eisSuccessful() \u0026\u0026 $response-\u003eisCaptured()) {\n    // handle success\n}\n\n// handle failure\n```\n\n#### Fetch PayPal Order\n\n```php\n$response = $gateway-\u003efetchPurchase([\n    'transactionReference' =\u003e 'PAYPAL-ORDER-ID',\n])-\u003esend();\n\nif ($response \u0026\u0026 $response-\u003eisSuccessful()) {\n    // handle success\n}\n\n// handle failure\n```\n\nFor general usage instructions, please see the main [Omnipay](https://github.com/thephpleague/omnipay)\nrepository.\n\n## Support\n\nIf you are having general issues with Omnipay, we suggest posting on\n[Stack Overflow](http://stackoverflow.com/). Be sure to add the\n[omnipay tag](http://stackoverflow.com/questions/tagged/omnipay) so it can be easily found.\n\nIf you want to keep up to date with release anouncements, discuss ideas for the project,\nor ask more detailed questions, there is also a [mailing list](https://groups.google.com/forum/#!forum/omnipay) which\nyou can subscribe to.\n\nIf you believe you have found a bug, please report it using the [GitHub issue tracker](https://github.com/sudiptpa/paypal-rest/issues),\nor better yet, fork the library and submit a pull request.\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsudiptpa%2Fpaypal-rest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsudiptpa%2Fpaypal-rest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsudiptpa%2Fpaypal-rest/lists"}