Skip to content

Commit

Permalink
Updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabian de Laender committed May 18, 2016
1 parent 8800edc commit df98359
Showing 1 changed file with 25 additions and 33 deletions.
58 changes: 25 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Register the service provider by adding it to the `providers` key in `config/app
]
```

Make sure that [Laravel Socialite](https://github.com/laravel/socialite) service provider and facade are also registered in your configuration files.
Make sure that [Laravel Socialite](https://github.com/laravel/socialite) service provider and facade are also registered in your configuration files, if you intend on using Mollie Connect.

## Configuration

Expand Down Expand Up @@ -89,38 +89,30 @@ Route::get('login_callback', function () {
});
```

### Possible problems

- My webhook cannot be reached.

This can be caused because of the CSRF check on the webHook. An example in `app/Http/routes.php`:

```php
Route::group(array('prefix' => 'mollie'), function ()
{
Route::post('webhook', function ($paymentId)
{
/**
* Do what needs to be checked with $paymentId
*/
});
});
```

You need to disable the CSRF check for this route by adding this snippet to `app/Http/Middleware/VerifyCsrfToken.php`:

```php
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array
*/
protected $except = [
'mollie/webhook'
]
```

If this solution does not work, then open a [issue](https://github.com/mollie/laravel-mollie/issues) so we can assist in your problem.
## Possible problems

#### Webhook cannot be reached, because of CSRF protection

The `VerifyCsrfToken` middleware, which is included in the `web` middleware group by default, is the troublemaker if your webhook route is in the same middleware group in the `app/Http/routes.php` file.

```php
Route::post('mollie/webhook', function ($paymentId) { /** Your logic... */ });
```

You can exclude URIs from the CSRF protection in the `app/Http/Middleware/VerifyCsrfToken.php` file:

```php
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array
*/
protected $except = [
'mollie/webhook'
];
```

If this solution does not work, open an [issue](https://github.com/mollie/laravel-mollie/issues) so we can assist you.

## Want to help us make our Laravel module even better?

Expand Down

0 comments on commit df98359

Please sign in to comment.