From 15bbcbb508cddbfcdcc1caeb74f4d698a3b9f7cd Mon Sep 17 00:00:00 2001 From: Krishan Koenig Date: Thu, 7 Mar 2024 13:18:19 +0100 Subject: [PATCH] wip --- README.md | 41 ++++++++++++----------------------------- 1 file changed, 12 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 51b11ef..f6cca68 100644 --- a/README.md +++ b/README.md @@ -16,20 +16,18 @@ Accepting [iDEAL](https://www.mollie.com/en/payments/ideal/), [Apple Pay](https: [![Latest Stable Version](https://poser.pugx.org/mollie/laravel-mollie/v/stable)](https://packagist.org/packages/mollie/laravel-mollie) [![Total Downloads](https://poser.pugx.org/mollie/laravel-mollie/downloads)](https://packagist.org/packages/mollie/laravel-mollie) -## Requirements +## **Requirements** * Get yourself a free [Mollie account](https://www.mollie.com/signup). No sign up costs. * Now you're ready to use the Mollie API client in test mode. * Follow [a few steps](https://www.mollie.com/dashboard/?modal=onboarding) to enable payment methods in live mode, and let us handle the rest. * Up-to-date OpenSSL (or other SSL/TLS toolkit) -* PHP >= 7.0 -* [Laravel](https://www.laravel.com) (or [Lumen](https://lumen.laravel.com)) >= 5.5 -* [Laravel Socialite](https://github.com/laravel/socialite) >= 3.0 (if you intend on using [Mollie Connect](https://docs.mollie.com/oauth/overview)) +* PHP >= 8.1 +* [Laravel](https://www.laravel.com) >= 10.0 +* [Laravel Socialite](https://github.com/laravel/socialite) >= 5.0 (if you intend on using [Mollie Connect](https://docs.mollie.com/oauth/overview)) -## Upgrading from v1.x? -To support the enhanced Mollie API, some breaking changes were introduced. Make sure to follow the instructions in the [package migration guide](docs/migration_instructions_v1_to_v2.md). - -Not ready to upgrade? The Laravel-Mollie client v1 will remain supported for now. +## Upgrading from v2.x? +To support the enhanced Mollie API, some breaking changes were introduced. Make sure to follow the instructions in the [upgrade guide](UPGRADE.md). Fresh install? Continue with the installation guide below. @@ -45,19 +43,12 @@ Or add it to `composer.json` manually: ```json "require": { - "mollie/laravel-mollie": "^2.0" + "mollie/laravel-mollie": "^3.0" } ``` Laravel-Mollie's service providers will be automatically registered using Laravel's auto-discovery feature. -Note: For Lumen you have to add the Mollie facade and service provider manually to: `bootstrap/app.php` : -```php -$app->withFacades(true, ['Mollie\Laravel\Facades\Mollie' => 'Mollie']); - -$app->register(Mollie\Laravel\MollieServiceProvider::class); -``` - ## Configuration You'll only need to add the `MOLLIE_KEY` variable to your `.env` file. @@ -77,7 +68,7 @@ use Mollie\Laravel\Facades\Mollie; public function preparePayment() { - $payment = Mollie::api()->payments->create([ + $payment = Mollie::payments->create([ "amount" => [ "currency" => "EUR", "value" => "10.00" // You must send the correct number of decimals, thus we enforce the use of strings @@ -102,7 +93,7 @@ public function preparePayment() */ public function handleWebhookNotification(Request $request) { $paymentId = $request->input('id'); - $payment = Mollie::api()->payments->get($paymentId); + $payment = Mollie::payments->get($paymentId); if ($payment->isPaid()) { @@ -112,14 +103,6 @@ public function handleWebhookNotification(Request $request) { } ``` -### Global helper method -For your convencience we've added the global `mollie()` helper function. It's an easy shortcut to the `Mollie::api()` facade accessor. - -```php -// Using facade accessor -$payment = \Mollie\Laravel\Facades\Mollie::api()->payments->get($payment_id); -``` - ## Other examples - [Process realtime status updates with a webhook](docs/webhook.md) @@ -144,6 +127,6 @@ But how would you like to contribute to a [technology oriented organization](htt Contact: [www.mollie.com](https://www.mollie.com) — info@mollie.com — +31 20-612 88 55 -* [More information about Mollie Connect](https://www.mollie.com/en/connect) -* [Documentation for the Mollie API](https://www.mollie.com/en/docs/overview) -* [Documentation for Mollie OAuth](https://www.mollie.com/en/docs/oauth/overview) +* [More information about Mollie Connect](https://www.mollie.com/products/connect) +* [Documentation for the Mollie API](https://docs.mollie.com/) +* [Documentation for Mollie OAuth](https://docs.mollie.com/connect/getting-started)