{"id":13828475,"url":"https://github.com/srmklive/laravel-paypal","last_synced_at":"2025-11-03T17:41:12.257Z","repository":{"id":42437205,"uuid":"43671533","full_name":"srmklive/laravel-paypal","owner":"srmklive","description":"Laravel plugin for processing payments through PayPal.","archived":false,"fork":false,"pushed_at":"2025-03-08T09:49:59.000Z","size":5058,"stargazers_count":1099,"open_issues_count":9,"forks_count":329,"subscribers_count":31,"default_branch":"v3.0","last_synced_at":"2025-04-24T01:52:14.099Z","etag":null,"topics":["ipn","laravel-paypal","laravel-plugin","paypal","php","process-payments"],"latest_commit_sha":null,"homepage":"https://laravel-paypal-demo.srmk.info/","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/srmklive.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,"zenodo":null}},"created_at":"2015-10-05T07:52:07.000Z","updated_at":"2025-04-21T07:10:28.000Z","dependencies_parsed_at":"2023-09-27T14:40:26.309Z","dependency_job_id":"55bb490a-4a2b-4b5a-a6e4-f6e72271184c","html_url":"https://github.com/srmklive/laravel-paypal","commit_stats":{"total_commits":152,"total_committers":16,"mean_commits":9.5,"dds":0.09868421052631582,"last_synced_commit":"e5d5d91b21b38922c8130eedf0ee2d3a64527a4e"},"previous_names":[],"tags_count":111,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srmklive%2Flaravel-paypal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srmklive%2Flaravel-paypal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srmklive%2Flaravel-paypal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srmklive%2Flaravel-paypal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/srmklive","download_url":"https://codeload.github.com/srmklive/laravel-paypal/tar.gz/refs/heads/v3.0","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253990466,"owners_count":21995774,"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":["ipn","laravel-paypal","laravel-plugin","paypal","php","process-payments"],"created_at":"2024-08-04T09:02:48.448Z","updated_at":"2025-11-03T17:41:12.220Z","avatar_url":"https://github.com/srmklive.png","language":"PHP","funding_links":[],"categories":["PHP","Packages"],"sub_categories":["E-commerce"],"readme":"# Laravel PayPal\n\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/srmklive/paypal.svg?style=flat-square)](https://packagist.org/packages/srmklive/paypal)\n[![Total Downloads](https://img.shields.io/packagist/dt/srmklive/paypal.svg?style=flat-square)](https://packagist.org/packages/srmklive/paypal)\n[![StyleCI](https://github.styleci.io/repos/43671533/shield?branch=v2.0)](https://github.styleci.io/repos/43671533?branch=v2.0)\n![Tests](https://github.com/srmklive/laravel-paypal/workflows/TestsV3/badge.svg)\n[![Coverage Status](https://coveralls.io/repos/github/srmklive/laravel-paypal/badge.svg?branch=v3.0)](https://coveralls.io/github/srmklive/laravel-paypal?branch=v3.0)\n[![Code Quality](https://scrutinizer-ci.com/g/srmklive/laravel-paypal/badges/quality-score.png?b=v3.0)](https://scrutinizer-ci.com/g/srmklive/laravel-paypal/?branch=v3.0)\n\n- [Documentation](#introduction)\n- [Usage](#usage)\n- [Support](#support)\n\n\u003e [!IMPORTANT]\n\u003e Laravel 11 will be the last version supported for v3.0. v4 is being actively worked on, and will be released by end of October 2024. For v4, following are the changes being introduced:\n\u003e * PHP 8.1+ required.\n\u003e * Laravel 10 \u0026 onwards required.\n\u003e * Integration of PayPal JS SDK.\n\u003e * Symfony plugin. \n    \n\u003ca name=\"introduction\"\u003e\u003c/a\u003e\n## Documentation\n\nThe documentation for the package can be viewed by clicking the following link:\n\n[https://laravel-paypal.readthedocs.io/en/latest/](https://laravel-paypal.readthedocs.io/en/latest/)\n\nThe old documentation can be found at the following link:\n\n[https://srmklive.github.io/laravel-paypal/docs.html](https://srmklive.github.io/laravel-paypal/docs.html)\n\n\u003ca name=\"usage\"\u003e\u003c/a\u003e\n## Usage\n\nFollowing are some ways through which you can access the paypal provider:\n\n```php\n// Import the class namespaces first, before using it directly\nuse Srmklive\\PayPal\\Services\\PayPal as PayPalClient;\n\n$provider = new PayPalClient;\n\n// Through facade. No need to import namespaces\n$provider = \\PayPal::setProvider();\n```\n\n\u003ca name=\"usage-paypal-api-configuration\"\u003e\u003c/a\u003e\n## Configuration File\n\nThe configuration file **paypal.php** is located in the **config** folder. Following are its contents when published:\n\n```php\nreturn [\n    'mode'    =\u003e env('PAYPAL_MODE', 'sandbox'), // Can only be 'sandbox' Or 'live'. If empty or invalid, 'live' will be used.\n    'sandbox' =\u003e [\n        'client_id'         =\u003e env('PAYPAL_SANDBOX_CLIENT_ID', ''),\n        'client_secret'     =\u003e env('PAYPAL_SANDBOX_CLIENT_SECRET', ''),\n        'app_id'            =\u003e 'APP-80W284485P519543T',\n    ],\n    'live' =\u003e [\n        'client_id'         =\u003e env('PAYPAL_LIVE_CLIENT_ID', ''),\n        'client_secret'     =\u003e env('PAYPAL_LIVE_CLIENT_SECRET', ''),\n        'app_id'            =\u003e env('PAYPAL_LIVE_APP_ID', ''),\n    ],\n\n    'payment_action' =\u003e env('PAYPAL_PAYMENT_ACTION', 'Sale'), // Can only be 'Sale', 'Authorization' or 'Order'\n    'currency'       =\u003e env('PAYPAL_CURRENCY', 'USD'),\n    'notify_url'     =\u003e env('PAYPAL_NOTIFY_URL', ''), // Change this accordingly for your application.\n    'locale'         =\u003e env('PAYPAL_LOCALE', 'en_US'), // force gateway language  i.e. it_IT, es_ES, en_US ... (for express checkout only)\n    'validate_ssl'   =\u003e env('PAYPAL_VALIDATE_SSL', true), // Validate SSL when creating api client.\n];\n```\n\n## Override PayPal API Configuration\n\nYou can override PayPal API configuration by calling `setApiCredentials` method:\n\n```php\n$config = [\n    'mode'    =\u003e 'live',\n    'live' =\u003e [\n        'client_id'         =\u003e 'PAYPAL_LIVE_CLIENT_ID',\n        'client_secret'     =\u003e 'PAYPAL_LIVE_CLIENT_SECRET',\n        'app_id'            =\u003e 'PAYPAL_LIVE_APP_ID',\n    ],\n\n    'payment_action' =\u003e 'Sale',\n    'currency'       =\u003e 'USD',\n    'notify_url'     =\u003e 'https://your-site.com/paypal/notify',\n    'locale'         =\u003e 'en_US',\n    'validate_ssl'   =\u003e true,\n];\n$provider-\u003esetApiCredentials($config);\n```\n\n\n\u003ca name=\"usage-paypal-get-access-token\"\u003e\u003c/a\u003e\n## Get Access Token\n\nAfter setting the PayPal API configuration by calling `setApiCredentials` method. You need to get access token before performing any API calls\n\n```php\n$provider-\u003egetAccessToken();\n```\n\n\n\u003ca name=\"usage-currency\"\u003e\u003c/a\u003e\n## Set Currency\n\nBy default, the currency used is `USD`. If you wish to change it, you may call `setCurrency` method to set a different currency before calling any respective API methods:\n\n```php\n$provider-\u003esetCurrency('EUR');\n```\n\n\u003ca name=\"usage-helpers\"\u003e\u003c/a\u003e\n## Helper Methods\n\n\u003e Please note that in the examples below, the call to `addPlanTrialPricing` is optional and it can be omitted when you are creating subscriptions without trial period.\n\n\u003e `setReturnAndCancelUrl()` is optional. If you set urls you have to use real domains. e.g. localhost, project.test does not work.\n\n### Create Recurring Daily Subscription\n\n```php\n$response = $provider-\u003eaddProduct('Demo Product', 'Demo Product', 'SERVICE', 'SOFTWARE')\n            -\u003eaddPlanTrialPricing('DAY', 7)\n            -\u003eaddDailyPlan('Demo Plan', 'Demo Plan', 1.50)\n            -\u003esetReturnAndCancelUrl('https://example.com/paypal-success', 'https://example.com/paypal-cancel')\n            -\u003esetupSubscription('John Doe', 'john@example.com', '2021-12-10');\n```\n\n### Create Recurring Weekly Subscription\n\n```php\n$response = $provider-\u003eaddProduct('Demo Product', 'Demo Product', 'SERVICE', 'SOFTWARE')\n            -\u003eaddPlanTrialPricing('DAY', 7)\n            -\u003eaddWeeklyPlan('Demo Plan', 'Demo Plan', 30)\n            -\u003esetReturnAndCancelUrl('https://example.com/paypal-success', 'https://example.com/paypal-cancel')\n            -\u003esetupSubscription('John Doe', 'john@example.com', '2021-12-10');\n```\n\n### Create Recurring Monthly Subscription\n\n```php\n$response = $provider-\u003eaddProduct('Demo Product', 'Demo Product', 'SERVICE', 'SOFTWARE')\n            -\u003eaddPlanTrialPricing('DAY', 7)\n            -\u003eaddMonthlyPlan('Demo Plan', 'Demo Plan', 100)\n            -\u003esetReturnAndCancelUrl('https://example.com/paypal-success', 'https://example.com/paypal-cancel')\n            -\u003esetupSubscription('John Doe', 'john@example.com', '2021-12-10');\n```\n\n### Create Recurring Annual Subscription\n\n```php\n$response = $provider-\u003eaddProduct('Demo Product', 'Demo Product', 'SERVICE', 'SOFTWARE')\n            -\u003eaddPlanTrialPricing('DAY', 7)\n            -\u003eaddAnnualPlan('Demo Plan', 'Demo Plan', 600)\n            -\u003esetReturnAndCancelUrl('https://example.com/paypal-success', 'https://example.com/paypal-cancel')\n            -\u003esetupSubscription('John Doe', 'john@example.com', '2021-12-10');\n```\n\n### Create Recurring Subscription with Custom Intervals\n\n```php\n$response = $provider-\u003eaddProduct('Demo Product', 'Demo Product', 'SERVICE', 'SOFTWARE')\n            -\u003eaddCustomPlan('Demo Plan', 'Demo Plan', 150, 'MONTH', 3)\n            -\u003esetReturnAndCancelUrl('https://example.com/paypal-success', 'https://example.com/paypal-cancel')\n            -\u003esetupSubscription('John Doe', 'john@example.com', '2021-12-10');\n```\n\n### Create Subscription by Existing Product \u0026 Billing Plan\n\n```php\n$response = $this-\u003eclient-\u003eaddProductById('PROD-XYAB12ABSB7868434')\n    -\u003eaddBillingPlanById('P-5ML4271244454362WXNWU5NQ')\n    -\u003esetReturnAndCancelUrl('https://example.com/paypal-success', 'https://example.com/paypal-cancel')\n    -\u003esetupSubscription('John Doe', 'john@example.com', $start_date);\n```\n\n\u003ca name=\"support\"\u003e\u003c/a\u003e\n## Support\n\nThis version supports Laravel 6 or greater.\n* In case of any issues, kindly create one on the [Issues](https://github.com/srmklive/laravel-paypal/issues) section.\n* If you would like to contribute:\n  * Fork this repository.\n  * Implement your features.\n  * Generate pull request.\n \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrmklive%2Flaravel-paypal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsrmklive%2Flaravel-paypal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrmklive%2Flaravel-paypal/lists"}