Skip to content

Commit

Permalink
Update webhook.md (#107)
Browse files Browse the repository at this point in the history
* Update webhook.md

* Update README.md

* Update recurring_and_direct_charge.md

* Update webhook.md
  • Loading branch information
JBtje authored and sandervanhooft committed Sep 16, 2019
1 parent 85ef2f3 commit 84df194
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Laravel-Mollie's service providers will be automatically registered using Larave

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->withFacades(true, ['Mollie\Laravel\Facades\Mollie' => 'Mollie']);

$app->register(Mollie\Laravel\MollieServiceProvider::class);
```
Expand Down Expand Up @@ -99,7 +99,7 @@ public function preparePayment()
*/
if ($payment->isPaid())
{
echo "Payment received.";
echo 'Payment received.';
// Do your thing ...
}
```
Expand Down
18 changes: 9 additions & 9 deletions docs/recurring_and_direct_charge.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ First of all you need to [create a new customer](https://docs.mollie.com/payment

```php
$customer = Mollie::api()->customers()->create([
"name" => "John Doe",
"email" => "[email protected]",
'name' => 'John Doe',
'email' => '[email protected]',
]);
```

Expand All @@ -23,12 +23,12 @@ After creating the user, you can [start a payment](https://docs.mollie.com/payme
$payment = Mollie::api()->payments()->create([
'amount' => [
'currency' => 'EUR',
'value' => '25.00', // You must send the correct number of decimals, thus we enforce the use of strings
'value' => '25.00', // You must send the correct number of decimals, thus we enforce the use of strings
],
'customerId' => $customer->id,
'customerId' => $customer->id,
'sequenceType' => 'first',
'description' => 'My Initial Payment',
'redirectUrl' => 'https://domain.com/return',
'description' => 'My Initial Payment',
'redirectUrl' => 'https://domain.com/return',
'webhookUrl' => route('webhooks.mollie'),
]);

Expand All @@ -51,11 +51,11 @@ If any of the mandates is valid, charging the user is a piece of cake. Make sure
$payment = Mollie::api()->payments()->create([
'amount' => [
'currency' => 'EUR',
'value' => '25.00', // You must send the correct number of decimals, thus we enforce the use of strings
'value' => '25.00', // You must send the correct number of decimals, thus we enforce the use of strings
],
'customerId' => $customer->id,
'customerId' => $customer->id,
'sequenceType' => 'recurring',
'description' => 'Direct Charge',
'description' => 'Direct Charge',
'webhookUrl' => route('webhooks.mollie'),
]);
```
Expand Down
6 changes: 3 additions & 3 deletions docs/webhook.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ $payment = Mollie::api()->payments()->create([
'currency' => 'EUR',
'value' => '10.00', // You must send the correct number of decimals, thus we enforce the use of strings
],
"description" => "My first API payment",
"redirectUrl" => "https://webshop.example.org/order/12345/",
'description' => 'My first API payment',
'redirectUrl' => 'https://webshop.example.org/order/12345/',
'webhookUrl' => route('webhooks.mollie'),
]);
```
Expand All @@ -36,7 +36,7 @@ class MollieWebhookController extends Controller {

$payment = Mollie::api()->payments()->get($request->id);

if($payment->isPaid()) {
if ($payment->isPaid()) {
// do your thing...
}
}
Expand Down

0 comments on commit 84df194

Please sign in to comment.