{"id":18772881,"url":"https://github.com/protonemedia/laravel-paddle","last_synced_at":"2025-04-04T17:10:08.922Z","repository":{"id":43710914,"uuid":"224811522","full_name":"protonemedia/laravel-paddle","owner":"protonemedia","description":"Paddle.com API integration for Laravel with support for webhooks/events","archived":false,"fork":false,"pushed_at":"2024-03-13T18:51:26.000Z","size":114,"stargazers_count":200,"open_issues_count":6,"forks_count":18,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-08-04T09:07:44.341Z","etag":null,"topics":["laravel","laravel-package","laravel-paddle","paddle","payment","payment-gateway","payment-integration","payments"],"latest_commit_sha":null,"homepage":"https://protone.media/en/blog/a-new-laravel-package-to-handle-payments-and-subscriptions-with-paddle","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/protonemedia.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","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},"funding":{"github":["pascalbaljet"]}},"created_at":"2019-11-29T08:34:32.000Z","updated_at":"2024-07-23T15:27:38.000Z","dependencies_parsed_at":"2024-07-18T01:55:57.969Z","dependency_job_id":"a26275a5-9587-4d54-a5fa-b65f8e7bce79","html_url":"https://github.com/protonemedia/laravel-paddle","commit_stats":{"total_commits":73,"total_committers":6,"mean_commits":"12.166666666666666","dds":0.5342465753424658,"last_synced_commit":"2cd473dc6511798bc4b79d191949b9a34af0566b"},"previous_names":["pascalbaljetmedia/laravel-paddle"],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/protonemedia%2Flaravel-paddle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/protonemedia%2Flaravel-paddle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/protonemedia%2Flaravel-paddle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/protonemedia%2Flaravel-paddle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/protonemedia","download_url":"https://codeload.github.com/protonemedia/laravel-paddle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247217222,"owners_count":20903009,"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":["laravel","laravel-package","laravel-paddle","paddle","payment","payment-gateway","payment-integration","payments"],"created_at":"2024-11-07T19:31:31.169Z","updated_at":"2025-04-04T17:10:08.893Z","avatar_url":"https://github.com/protonemedia.png","language":"PHP","funding_links":["https://github.com/sponsors/pascalbaljet"],"categories":[],"sub_categories":[],"readme":"\u003e :warning: I'm unsure about the future of this package. I might be abandoning it, so please consider using [Laravel Cashier (Paddle)](https://laravel.com/docs/10.x/cashier-paddle).\n\n# Laravel Paddle\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/protonemedia/laravel-paddle.svg?style=flat-square)](https://packagist.org/packages/protonemedia/laravel-paddle)\n![run-tests](https://github.com/protonemedia/laravel-paddle/workflows/run-tests/badge.svg)\n[![Quality Score](https://img.shields.io/scrutinizer/g/protonemedia/laravel-paddle.svg?style=flat-square)](https://scrutinizer-ci.com/g/protonemedia/laravel-paddle)\n[![Total Downloads](https://img.shields.io/packagist/dt/protonemedia/laravel-paddle.svg?style=flat-square)](https://packagist.org/packages/protonemedia/laravel-paddle)\n\nThis package provides an integration with [Paddle.com](https://paddle.com) for Laravel. Read the [blogpost](https://protone.media/en/blog/a-new-laravel-package-to-handle-payments-and-subscriptions-with-paddle) about the introduction of the package!\n\n## Features\n* Super easy wrapper around the [Paddle.com API](https://developer.paddle.com/api-reference/intro)\n* Built-in support for Webhooks and Event handling\n* Blade directive to use [Paddle.js](https://paddle.com/docs/paddle-js-overlay-checkout/) in your front-end\n* Support for [Paddle Sandbox](https://developer.paddle.com/getting-started/sandbox)\n\n## Sponsor Us\n\n[\u003cimg src=\"https://inertiaui.com/visit-card.jpg\" /\u003e](https://inertiaui.com/inertia-table?utm_source=github\u0026utm_campaign=laravel-paddle)\n\n❤️ We proudly support the community by developing Laravel packages and giving them away for free. If this package saves you time or if you're relying on it professionally, please consider [sponsoring the maintenance and development](https://github.com/sponsors/pascalbaljet) and check out our latest premium package: [Inertia Table](https://inertiaui.com/inertia-table?utm_source=github\u0026utm_campaign=laravel-paddle). Keeping track of issues and pull requests takes time, but we're happy to help!\n\n## Installation\n\nOnly the master branch and version 2.0 of this package are compatible with Laravel 8.0 and higher. If you're still using an older version of Laravel (or PHP \u003c 7.3), please use the chart below to find out which version you should use. Mind that older versions are no longer supported.\n\n| Laravel Version | Package Version |\n| --------------- | --------------- |\n| 8.0-11.0        | 2.0             |\n| 6.0-7.0         | 1.0             |\n\nYou can install the package via composer:\n\n```bash\ncomposer require protonemedia/laravel-paddle\n```\n\n## Configuration\n\nPublish the config file:\n\n```bash\nphp artisan vendor:publish --provider=\"ProtoneMedia\\LaravelPaddle\\PaddleServiceProvider\" --tag=config\n```\n\nSet your [Vendor ID and Code](https://vendors.paddle.com/authentication) and the [Public Key](https://vendors.paddle.com/public-key) settings in your `.env` file or in the `config/paddle.php` file. The Public Key is used to verify incoming webhooks from Paddle.\n\n```bash\nPADDLE_SANDBOX=false\nPADDLE_VENDOR_ID=123\nPADDLE_VENDOR_AUTH_CODE=456\nPADDLE_PUBLIC_KEY=\"-----BEGIN PUBLIC KEY-----\n...\n-----END PUBLIC KEY-----\"\n```\n\n### Paddle Sandbox\n\nAs of version 2.2.0, this package supports the [Paddle Sandbox](https://developer.paddle.com/getting-started/sandbox) environment. To use this environment, set the `sandbox_environment` configuration key to `true`. This will configure the API URLs, as well as the Paddle JavaScript library. If you've published the Blade View while using a previous version of this package, make sure you republish the view:\n\n```bash\nphp artisan vendor:publish --provider=\"ProtoneMedia\\LaravelPaddle\\PaddleServiceProvider\" --tag=views\n```\n\n## Usage\n\nThe API calls are available with the `Paddle` facade. Check out the [the documentation](https://developer.paddle.com/api-reference/intro) to learn all about the Paddle API. You can build your API calls fluently or you could simply pass an array which holds the data. This package has some basic validation rules for the given data and this might result in an `InvalidDataException` if your data is invalid. Whenever an API call fails it will throw a `PaddleApiException`.\n\n``` php\n// Fluent:\n$paddleResponse = Paddle::product()\n    -\u003egeneratePayLink()\n    -\u003eproductId($paddlePlanId)\n    -\u003ecustomerEmail($team-\u003eowner-\u003eemail)\n    -\u003epassthrough(['team_id' =\u003e $team-\u003eid])\n    -\u003esend();\n\n// Array with payload:\n$payload = [\n    'product_id' =\u003e $paddlePlanId,\n    'customer_email' =\u003e $team-\u003eowner-\u003eemail,\n    'passthrough' =\u003e ['team_id' =\u003e $team-\u003eid],\n];\n\n$paddleResponse = Paddle::product()\n    -\u003egeneratePayLink($payload)\n    -\u003esend();\n\nreturn Redirect::to($paddleResponse['url']);\n```\n\n## Available API calls\n\n```php\n// alerts\nPaddle::alert()-\u003egetWebhookHistory();\n\n// checkouts\nPaddle::checkout()-\u003egetOrderDetails();\nPaddle::checkout()-\u003egetUserHistory();\nPaddle::checkout()-\u003egetPrices();\n\n// products\nPaddle::product()-\u003elistCoupons();\nPaddle::product()-\u003ecreateCoupon();\nPaddle::product()-\u003eupdateCoupon();\nPaddle::product()-\u003edeleteCoupon();\n\nPaddle::product()-\u003elistProducts();\nPaddle::product()-\u003egenerateLicense();\nPaddle::product()-\u003egeneratePayLink();\nPaddle::product()-\u003elistTransactions($entity, $id);\n\n// subscriptions\nPaddle::subscription()-\u003elistPlans();\nPaddle::subscription()-\u003ecreatePlan();\n\nPaddle::subscription()-\u003elistUsers();\nPaddle::subscription()-\u003eupdateUser();\nPaddle::subscription()-\u003epreviewUpdate();\nPaddle::subscription()-\u003ecancelUser();\n\nPaddle::subscription()-\u003elistModifiers();\nPaddle::subscription()-\u003ecreateModifier();\nPaddle::subscription()-\u003edeleteModifier();\n\nPaddle::subscription()-\u003elistPayments();\nPaddle::subscription()-\u003ereschedulePayment();\nPaddle::subscription()-\u003ecreateOneOffCharge($subscriptionId);\n```\n\n## Webhooks and Laravel Events\n\nYou can configure your webhook URI in the `paddle.php` config file. Update your [webhook settings](https://vendors.paddle.com/alerts-webhooks) at Paddle accordingly. By default the URI is `paddle/webhook`. This means that the webhook calls will be posted to `https://your-domain.com/paddle/webhook`.\n\nEvery webhook will be mapped to an Event and contains the payload of the webhook. For example when the [Subscription Created](https://developer.paddle.com/webhook-reference/subscription-alerts/subscription-created) webhook is called, the request is verified and a `SubscriptionCreated` event will be fired.\n\nEvents:\n* `ProtoneMedia\\LaravelPaddle\\Events\\HighRiskTransactionCreated`\n* `ProtoneMedia\\LaravelPaddle\\Events\\HighRiskTransactionUpdated`\n* `ProtoneMedia\\LaravelPaddle\\Events\\LockerProcessed`\n* `ProtoneMedia\\LaravelPaddle\\Events\\NewAudienceMember`\n* `ProtoneMedia\\LaravelPaddle\\Events\\PaymentDisputeClosed`\n* `ProtoneMedia\\LaravelPaddle\\Events\\PaymentDisputeCreated`\n* `ProtoneMedia\\LaravelPaddle\\Events\\PaymentRefunded`\n* `ProtoneMedia\\LaravelPaddle\\Events\\PaymentSucceeded`\n* `ProtoneMedia\\LaravelPaddle\\Events\\SubscriptionCancelled`\n* `ProtoneMedia\\LaravelPaddle\\Events\\SubscriptionCreated`\n* `ProtoneMedia\\LaravelPaddle\\Events\\SubscriptionPaymentFailed`\n* `ProtoneMedia\\LaravelPaddle\\Events\\SubscriptionPaymentRefunded`\n* `ProtoneMedia\\LaravelPaddle\\Events\\SubscriptionPaymentSucceeded`\n* `ProtoneMedia\\LaravelPaddle\\Events\\SubscriptionUpdated`\n* `ProtoneMedia\\LaravelPaddle\\Events\\TransferCreated`\n* `ProtoneMedia\\LaravelPaddle\\Events\\TransferPaid`\n* `ProtoneMedia\\LaravelPaddle\\Events\\UpdateAudienceMember`\n\nSome webhooks, like the [Fulfillment Webhook](https://developer.paddle.com/webhook-reference/product-fulfillment/fulfillment-webhook), don't have an `alert_name` key. Those webhooks will be mapped to a `ProtoneMedia\\LaravelPaddle\\Events\\GenericWebhook` event.\n\nWhen you register a listener to handle the event, the payload is easily accessible. You also have access to the original HTTP request.\n\n```php\n\u003c?php\n\nnamespace App\\Listeners;\n\nuse ProtoneMedia\\LaravelPaddle\\Events\\SubscriptionCreated;\n\nclass CreateSubscriptionModel\n{\n    public function handle(SubscriptionCreated $event)\n    {\n        $status = $event-\u003estatus;\n\n        $nextBillDate = $event-\u003enext_bill_date;\n\n        // or\n\n        $webhookData = $event-\u003eall();\n\n        //\n\n        $request = $event-\u003egetRequest();\n    }\n}\n```\n\n## Blade directive\n\nThis directive imports the Paddle JavaScript library and configures it with your Vendor ID.\n\n```php\n\u003cbody\u003e\n    {{-- your app --}}\n\n    @paddle\n\u003c/body\u003e\n```\n\n### Testing\n\n``` bash\ncomposer test\n```\n\n### Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## Other Laravel packages\n\n* [`Inertia Table`](https://inertiaui.com/inertia-table?utm_source=github\u0026utm_campaign=laravel-paddle): The Ultimate Table for Inertia.js with built-in Query Builder.\n* [`Laravel Blade On Demand`](https://github.com/protonemedia/laravel-blade-on-demand): Laravel package to compile Blade templates in memory.\n* [`Laravel Cross Eloquent Search`](https://github.com/protonemedia/laravel-cross-eloquent-search): Laravel package to search through multiple Eloquent models.\n* [`Laravel Eloquent Scope as Select`](https://github.com/protonemedia/laravel-eloquent-scope-as-select): Stop duplicating your Eloquent query scopes and constraints in PHP. This package lets you re-use your query scopes and constraints by adding them as a subquery.\n* [`Laravel FFMpeg`](https://github.com/protonemedia/laravel-ffmpeg): This package provides an integration with FFmpeg for Laravel. The storage of the files is handled by Laravel's Filesystem.\n* [`Laravel MinIO Testing Tools`](https://github.com/protonemedia/laravel-minio-testing-tools): Run your tests against a MinIO S3 server.\n* [`Laravel Mixins`](https://github.com/protonemedia/laravel-mixins): A collection of Laravel goodies.\n* [`Laravel Task Runner`](https://github.com/protonemedia/laravel-task-runner): Write Shell scripts like Blade Components and run them locally or on a remote server.\n* [`Laravel Verify New Email`](https://github.com/protonemedia/laravel-verify-new-email): This package adds support for verifying new email addresses: when a user updates its email address, it won't replace the old one until the new one is verified.\n* [`Laravel XSS Protection`](https://github.com/protonemedia/laravel-xss-protection): Laravel Middleware to protect your app against Cross-site scripting (XSS). It sanitizes request input, and it can sanatize Blade echo statements.\n\n### Security\n\nIf you discover any security related issues, please email pascal@protone.media instead of using the issue tracker.\n\n## Credits\n\n- [Pascal Baljet](https://github.com/protonemedia)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprotonemedia%2Flaravel-paddle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprotonemedia%2Flaravel-paddle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprotonemedia%2Flaravel-paddle/lists"}