{"id":28559883,"url":"https://github.com/mortenebak/laravel-quickpay","last_synced_at":"2025-08-16T17:04:38.790Z","repository":{"id":215973133,"uuid":"740158156","full_name":"mortenebak/laravel-quickpay","owner":"mortenebak","description":"A fluent API for Laravel around the Quickpay Client.","archived":false,"fork":false,"pushed_at":"2025-08-09T18:26:33.000Z","size":102,"stargazers_count":22,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-09T20:29:43.637Z","etag":null,"topics":["laravel-package","quickpay-api","subscription-api"],"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/mortenebak.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"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,"zenodo":null},"funding":{"github":"Netbums"}},"created_at":"2024-01-07T17:37:48.000Z","updated_at":"2025-08-09T18:26:30.000Z","dependencies_parsed_at":"2024-04-15T11:41:50.819Z","dependency_job_id":"78bd6915-4225-411e-905c-f0e349f222ab","html_url":"https://github.com/mortenebak/laravel-quickpay","commit_stats":null,"previous_names":["mortenebak/laravel-quickpay"],"tags_count":10,"template":false,"template_full_name":"spatie/package-skeleton-laravel","purl":"pkg:github/mortenebak/laravel-quickpay","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mortenebak%2Flaravel-quickpay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mortenebak%2Flaravel-quickpay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mortenebak%2Flaravel-quickpay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mortenebak%2Flaravel-quickpay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mortenebak","download_url":"https://codeload.github.com/mortenebak/laravel-quickpay/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mortenebak%2Flaravel-quickpay/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270742043,"owners_count":24637504,"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-08-16T02:00:11.002Z","response_time":91,"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":["laravel-package","quickpay-api","subscription-api"],"created_at":"2025-06-10T09:06:30.113Z","updated_at":"2025-08-16T17:04:38.671Z","avatar_url":"https://github.com/mortenebak.png","language":"PHP","funding_links":["https://github.com/sponsors/Netbums","https://github.com/sponsors/mortenebak/"],"categories":[],"sub_categories":[],"readme":"# A fluent api around the quickpay api for Laravel applications\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/netbums/laravel-quickpay.svg?style=flat-square)](https://packagist.org/packages/netbums/laravel-quickpay)\n[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/mortenebak/laravel-quickpay/run-tests.yml?branch=main\u0026label=tests\u0026style=flat-square)](https://github.com/mortenebak/laravel-quickpay/actions?query=workflow%3Arun-tests+branch%3Amain)\n[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/mortenebak/laravel-quickpay/fix-php-code-style-issues.yml?branch=main\u0026label=code%20style\u0026style=flat-square)](https://github.com/mortenebak/laravel-quickpay/actions?query=workflow%3A\"Fix+PHP+code+style+issues\"+branch%3Amain)\n[![Total Downloads](https://img.shields.io/packagist/dt/netbums/laravel-quickpay.svg?style=flat-square)](https://packagist.org/packages/netbums/laravel-quickpay)\n \nThis laravel package will help you utilize the Quickpay API Client, without knowing too much about the endpoints. It provides a fluent api for using the API. See examples below.\n\n## Support me\n[Consider supporting me by sponsoring my work](https://github.com/sponsors/mortenebak/)\n\n## Installation\n\n1. You can install the package via composer:\n\n```bash\ncomposer require netbums/laravel-quickpay\n```\n\n[//]: # (2. Add the Provider to your `config/app.php` providers array:)\n\n[//]: # ()\n[//]: # (```php)\n\n[//]: # (// config/app.php)\n\n[//]: # ('providers' =\u003e [)\n\n[//]: # (    //...)\n\n[//]: # (    Netbums\\Quickpay\\QuickpayServiceProvider::class,)\n\n[//]: # (],)\n\n[//]: # (```)\n\n[//]: # (3. Add the facade to your `config/app.php` aliases array:)\n\n[//]: # ()\n[//]: # (```php)\n\n[//]: # (// config/app.php)\n\n[//]: # ('aliases' =\u003e [)\n\n[//]: # (    //...)\n\n[//]: # (    'Quickpay' =\u003e Netbums\\Quickpay\\Facades\\Quickpay::class,)\n\n[//]: # (],)\n\n[//]: # (```)\n\n2. Publish the config file with:\n\n```bash\nphp artisan vendor:publish\n```\nSearch for \"quickpay\", and publish both the **config** and `Netbums\\Quickpay\\QuickpayServiceProvider`\n\nThis is the contents of the published config file:\n\n```php\n// config/quickpay.php\nreturn [\n    'api_key' =\u003e env('QUICKPAY_API_KEY'),\n    'login' =\u003e env('QUICKPAY_LOGIN'),\n    'password' =\u003e env('QUICKPAY_PASSWORD'),\n    'merchant_id' =\u003e env('QUICKPAY_MERCHANT_ID'),\n];\n```\n\n3. Add the environment variables to your `.env` file:\n\n```bash\nQUICKPAY_API_KEY=\n```\nAnd alternatively, you can add the following environment variables to your `.env` file instead of the `QUICKPAY_API_KEY`:\n\n```bash\nQUICKPAY_LOGIN=\nQUICKPAY_PASSWORD=\nQUICKPAY_MERCHANT_ID=\n```\n---\n## Usage\n\n### Payments\n\n#### Get all payments\n\n```php\nuse \\Netbums\\Quickpay\\Facades\\Quickpay;\n\n$payments = Quickpay::payments()-\u003eall();\n```\n\n#### Get a payment\nGetting a single payment by id\n```php\nuse \\Netbums\\Quickpay\\Facades\\Quickpay;\n\n$payment = Quickpay::payments()-\u003efind($paymentId);\n```\n\n#### Create a payment\nFirst create a basket with items, and then create a payment with the basket and a unique order id.\n```php\n\nuse \\Netbums\\Quickpay\\DataObjects\\Basket;\nuse \\Netbums\\Quickpay\\DataObjects\\BasketItem;\nuse \\Netbums\\Quickpay\\DataObjects\\Payment;\nuse \\Netbums\\Quickpay\\Facades\\Quickpay;\n\n$basket = new Basket(\n    items: [\n        new BasketItem(\n            qty: 1,\n            item_name: 'Test item',\n            item_no: 'sku-1234',\n            item_price: 100, // in smallest currency unit\n            vat_rate: 0.25, // 25%\n        )\n    ]\n);\n\n$paymentData = new Payment(\n    currency: 'DKK',\n    order_id: '1234',\n    basket:  $basket,\n);\n\n\n$createdPayment = Quickpay::payments()-\u003ecreate(\n    payment: $paymentData\n);\n```\nAfter a payment is created you can create a payment link for it, and redirect the user to the payment link.\n\n#### Create a payment link\n```php\nuse \\Netbums\\Quickpay\\Facades\\Quickpay;\nuse \\Netbums\\Quickpay\\DataObjects\\PaymentLink;\n\n$paymentLinkData = new PaymentLink(\n    id: $createdPayment['id'], \n    amount: 100\n);\n\n$paymentLink = Quickpay::payments()-\u003ecreateLink($paymentLinkData);\n```\nThis will return a URL, that you can redirect the user to.\n\n#### Update a payment\n```php\n```\n\n#### Capture a payment\nCapture a payment. This will capture the amount of the payment specified.\n```php\nuse \\Netbums\\Quickpay\\Facades\\Quickpay;\n\n$payment = Quickpay::payments()-\u003ecapture(\n    id: $paymentId,\n    amount: 100, // in smallest currency unit\n);\n```\n\n#### Refund a payment\nRefund a payment. This will refund the amount of the payment specified.\n```php\nuse \\Netbums\\Quickpay\\Facades\\Quickpay;\n\n$payment = Quickpay::payments()-\u003erefund(\n    id: $paymentId,\n    amount: 100, // in smallest currency unit\n);\n```\n\n#### Authorize a payment\nAuthorize a payment. This will reserve the amount on the card, but not capture it.\n```php\nuse \\Netbums\\Quickpay\\Facades\\Quickpay;\n\n$payment = Quickpay::payments()-\u003eauthorize(\n    id: $paymentId,\n    amount: 100, // in smallest currency unit\n);\n```\n\n#### Renew authorization of a payment\nRenew the authorization of a payment. This will reserve the amount on the card, but not capture it.\n```php\nuse \\Netbums\\Quickpay\\Facades\\Quickpay;\n\n$payment = Quickpay::payments()-\u003erenew(\n    id: $paymentId,\n);\n```\n\n#### Cancel a payment\nCancel a payment. This will cancel the payment, and release the reserved amount on the card.\n```php\nuse \\Netbums\\Quickpay\\Facades\\Quickpay;\n\n$payment = Quickpay::payments()-\u003ecancel(\n    id: $paymentId,\n);\n```\n\n#### Create a payment link\nCreate a payment link for a payment. Optional parameters are: `language`, `continue_url`, `cancel_url`, `callback_url`:\n```php\nuse \\Netbums\\Quickpay\\Facades\\Quickpay;\nuse \\Netbums\\Quickpay\\DataObjects\\PaymentLink;\n\n$paymentLinkData = new PaymentLink(\n    id: $paymentId,\n    amount: 100, // in smallest currency unit\n    language: 'da',\n    continue_url: 'https://example.com/continue',\n    cancel_url: 'https://example.com/cancel',\n    callback_url: 'https://example.com/callback',\n);\n\n$paymentLink = Quickpay::payments()-\u003ecreatePaymentLink(\n    paymentLink: $paymentLinkData,\n);\n```\n\n#### Create a payment session\n```php\nuse \\Netbums\\Quickpay\\Facades\\Quickpay;\n\n$session = Quickpay::payments()-\u003esession(\n    id: $paymentId,\n    amount: 100, // in smallest currency unit\n);\n```\n\n#### Create Fraud Report\nCreate a fraud report for a payment. Optional parameters are: `description`:\n```php\nuse \\Netbums\\Quickpay\\Facades\\Quickpay;\n\n$fraudReport = Quickpay::payments()-\u003ecreateFraudReport(\n    id: $paymentId,\n    description: 'Fraudulent payment',\n);\n```\n\n## Subscriptions\n\nThe `Quickpay::subscriptions()` facade provides a fluent API for interacting with Quickpay Subscription endpoints.\n\n#### Get all subscriptions\n\n```php\nuse \\Netbums\\Quickpay\\Facades\\Quickpay;\n\n$subscriptions = Quickpay::subscriptions()-\u003eall();\n```\n\n#### Get a subscription\n\nGet a single subscription by id.\n\n```php\nuse \\Netbums\\Quickpay\\Facades\\Quickpay;\n\n$subscriptionId = 'your_subscription_id';\n$subscription = Quickpay::subscriptions()-\u003efind($subscriptionId);\n```\n\n#### Create a subscription link\n\nCreate a payment link for a subscription. Requires a `SubscriptionLink` DataObject.\n\n```php\nuse \\Netbums\\Quickpay\\Facades\\Quickpay;\nuse \\Netbums\\Quickpay\\DataObjects\\SubscriptionLink;\n\n$subscriptionLinkData = new SubscriptionLink(\n    id: $createdSubscription['id'],\n    amount: 100, // in smallest currency unit\n    order_id: 'link_'.uniqid(),\n    language: 'en',\n    continue_url: 'https://example.com/continue',\n    cancel_url: 'https://example.com/cancel',\n    callback_url: 'https://example.com/callback' // API\n);\n\n$subscriptionLink = Quickpay::subscriptions()-\u003ecreateSubscriptionLink($subscriptionLinkData);\n```\n\n#### Delete a subscription payment link\n\nDelete the payment link for a subscription.\n\n```php\nuse \\Netbums\\Quickpay\\Facades\\Quickpay;\n\n$subscriptionId = 'your_subscription_id';\nQuickpay::subscriptions()-\u003edeletePaymentLink($subscriptionId);\n```\n\n#### Create a subscription\n\nCreate a new subscription. Requires a `Subscription` DataObject.\n\n```php\nuse \\Netbums\\Quickpay\\Facades\\Quickpay;\nuse \\Netbums\\Quickpay\\DataObjects\\Subscription;\n\n$subscriptionData = new Subscription(\n    currency: 'DKK',\n    order_id: 'order_'.uniqid(),\n    description: 'Subscription description', // Example description\n    // Add other relevant Subscription properties based on Quickpay docs if known\n    // e.g., frequency: 30\n);\n\n$createdSubscription = Quickpay::subscriptions()-\u003ecreate($subscriptionData);\n```\n\n#### Update a subscription\n\nUpdate a subscription. Requires the subscription ID and an array of data.\n\n```php\nuse \\Netbums\\Quickpay\\Facades\\Quickpay;\n\n$subscriptionId = 'your_subscription_id';\n$updateData = [\n    'state' =\u003e 'active',\n    // ... other update properties\n];\n$updatedSubscription = Quickpay::subscriptions()-\u003eupdate($subscriptionId, $updateData);\n```\n\n#### Authorize a subscription\n\nAuthorize a subscription.\n\n```php\nuse \\Netbums\\Quickpay\\Facades\\Quickpay;\n\n$subscriptionId = 'your_subscription_id';\n$authorizedSubscription = Quickpay::subscriptions()-\u003eauthorize($subscriptionId);\n```\n\n#### Cancel a subscription\n\nCancel a subscription.\n\n```php\nuse \\Netbums\\Quickpay\\Facades\\Quickpay;\n\n$subscriptionId = 'your_subscription_id';\n$canceledSubscription = Quickpay::subscriptions()-\u003ecancel($subscriptionId);\n```\n\n#### Create a recurring payment\n\nCreate a recurring payment for a subscription.\n\n```php\nuse \\Netbums\\Quickpay\\Facades\\Quickpay;\nuse \\Netbums\\Quickpay\\DataObjects\\SubscriptionRecurring;\n\n$subscriptionRecurringData = new SubscriptionRecurring(\n    id: $subscriptionId,\n    amount: 100 // in smallest currency unit\n    // ... other SubscriptionRecurring properties\n);\n\n$recurringPayment = Quickpay::subscriptions()-\u003ecreateRecurring($subscriptionRecurringData);\n```\n\n#### Create a fraud report\n\nCreate a fraud report for a subscription.\n\n```php\nuse \\Netbums\\Quickpay\\Facades\\Quickpay;\n\n$subscriptionId = 'your_subscription_id';\n$fraudReport = Quickpay::subscriptions()-\u003efraudReport($subscriptionId);\n```\n\n#### Get subscription payments\n\nGet payments associated with a subscription.\n\n```php\nuse \\Netbums\\Quickpay\\Facades\\Quickpay;\n\n$subscriptionId = 'your_subscription_id';\n$payments = Quickpay::subscriptions()-\u003egetPayments($subscriptionId);\n```\n\n### Exception Handling\n\nDedicated exception classes are provided for handling errors during subscription operations. These include:\n\n- `FetchSubscriptionFailed`\n- `FetchSubscriptionsFailed`\n- `CreateRecurringFailed`\n- `CreateSubscriptionFailed`\n- `CreateSubscriptionLinkFailed`\n- `DeletePaymentLinkFailed`\n- `UpdateSubscriptionFailed`\n- `AuthorizeSubscriptionFailed`\n- `CancelSubscriptionFailed`\n- `FraudReportSubscriptionFailed`\n- `GetSubscriptionPaymentsFailed`\n\nYou should wrap your Quickpay subscription calls in try-catch blocks to handle these specific exceptions.\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## Security Vulnerabilities\n\nPlease review [our security policy](../../security/policy) on how to report security vulnerabilities.\n\n## Credits\n\n- [Morten Bak](https://github.com/mortenebak)\n- [Anders Grønborg](https://latego.dk)\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%2Fmortenebak%2Flaravel-quickpay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmortenebak%2Flaravel-quickpay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmortenebak%2Flaravel-quickpay/lists"}