From 307f3296973da6be4bb9a7725f1924d6779b7eca Mon Sep 17 00:00:00 2001 From: Sander van Hooft Date: Mon, 9 Jul 2018 12:44:23 +0200 Subject: [PATCH] Added named webhook route to examples. Fixes #52 --- README.md | 2 +- docs/recurring_and_direct_charge.md | 2 ++ docs/webhook.md | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1fdc7c8..772864f 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ $payment = Mollie::api()->payments()->create([ '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/", + 'webhookUrl' => route('webhooks.mollie'), ]); $payment = Mollie::api()->payments()->get($payment->id); diff --git a/docs/recurring_and_direct_charge.md b/docs/recurring_and_direct_charge.md index bbdbc7e..070f047 100644 --- a/docs/recurring_and_direct_charge.md +++ b/docs/recurring_and_direct_charge.md @@ -29,6 +29,7 @@ $payment = Mollie::api()->payments()->create([ 'sequenceType' => 'first', 'description' => 'My Initial Payment', 'redirectUrl' => 'https://domain.com/return', + 'webhookUrl' => route('webhooks.mollie'), ]); ``` @@ -52,6 +53,7 @@ If any of the mandates is valid, charging the user is a piece of cake. Make sure 'customerId' => $customer->id, 'sequenceType' => 'recurring', 'description' => 'Direct Charge', + 'webhookUrl' => route('webhooks.mollie'), ]); ``` diff --git a/docs/webhook.md b/docs/webhook.md index 0df5a8c..11db45b 100644 --- a/docs/webhook.md +++ b/docs/webhook.md @@ -13,7 +13,7 @@ $payment = Mollie::api()->payments()->create([ ], "description" => "My first API payment", "redirectUrl" => "https://webshop.example.org/order/12345/", - 'webhookUrl' => 'https://domain.com/webhooks/mollie', + 'webhookUrl' => route('webhooks.mollie'), ]); ```