Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Naoray committed Mar 7, 2024
1 parent e8c0206 commit 15bbcbb
Showing 1 changed file with 12 additions and 29 deletions.
41 changes: 12 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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.
Expand All @@ -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
Expand All @@ -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())
{
Expand All @@ -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)
Expand All @@ -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)[email protected] — +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)

0 comments on commit 15bbcbb

Please sign in to comment.