-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
70 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ Here you can see an example of how easy it is to use [Mollie recurring](https:// | |
First of all you need to [create a new customer](https://docs.mollie.com/payments/recurring#payments-recurring-first-payment) (step 1), this is pretty straight forward | ||
|
||
```php | ||
$customer = Mollie::api()->customers()->create([ | ||
$customer = Mollie::customers()->create([ | ||
'name' => 'John Doe', | ||
'email' => '[email protected]', | ||
]); | ||
|
@@ -20,7 +20,7 @@ $customer = Mollie::api()->customers()->create([ | |
After creating the user, you can [start a payment](https://docs.mollie.com/payments/recurring#payments-recurring-first-payment) (step 3), it's important to set `sequenceType` to `first`, this will generate a mandate on Mollie's end that can be used to do direct charges. Without setting the `method` the payment screen of Mollie will display your methods that support recurring payments. | ||
|
||
```php | ||
$payment = Mollie::api()->payments()->create([ | ||
$payment = Mollie::payments()->create([ | ||
'amount' => [ | ||
'currency' => 'EUR', | ||
'value' => '25.00', // You must send the correct number of decimals, thus we enforce the use of strings | ||
|
@@ -41,14 +41,14 @@ return redirect($payment->getCheckoutUrl(), 303); | |
After doing the initial payment, you may [charge the users card/account directly](https://docs.mollie.com/payments/recurring#payments-recurring-charging-on-demand). Make sure there's a valid mandate connected to the customer. In case there are multiple mandates at least one should have `status` set to `valid`. Checking mandates is easy: | ||
|
||
```php | ||
$mandates = Mollie::api()->mandates()->listFor($customer); | ||
$mandates = Mollie::mandates()->listFor($customer); | ||
``` | ||
|
||
If any of the mandates is valid, charging the user is a piece of cake. Make sure `sequenceType` is set to `recurring`. | ||
|
||
|
||
```php | ||
$payment = Mollie::api()->payments()->create([ | ||
$payment = Mollie::payments()->create([ | ||
'amount' => [ | ||
'currency' => 'EUR', | ||
'value' => '25.00', // You must send the correct number of decimals, thus we enforce the use of strings | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters