-
Notifications
You must be signed in to change notification settings - Fork 53
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
1 changed file
with
64 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
### Programmatically capture, refund, void, cancel, and ship Mollie orders. | ||
|
||
With the Mollie API, you can programmatically capture, refund, void, cancel, and ship orders. | ||
These actions are logged by the plugin. | ||
Here are some examples of how to use these functions: | ||
|
||
#### Capture an order | ||
```php | ||
use function Mollie\WooCommerce\Inc\Api\mollie_capture_order; | ||
|
||
add_action('init', function () { | ||
$order_id = 123; | ||
$order = wc_get_order($order_id); | ||
mollie_capture_order($order); | ||
}); | ||
``` | ||
|
||
#### Refund an order | ||
```php | ||
use function Mollie\WooCommerce\Inc\Api\mollie_refund_order; | ||
|
||
add_action('init', function () { | ||
$order_id = 123; | ||
$order = wc_get_order($order_id); | ||
mollie_refund_order($order); | ||
}); | ||
``` | ||
|
||
#### Void an order | ||
```php | ||
use function Mollie\WooCommerce\Inc\Api\mollie_void_order; | ||
|
||
add_action('init', function () { | ||
$order_id = 123; | ||
$order = wc_get_order($order_id); | ||
mollie_void_order($order); | ||
}); | ||
``` | ||
|
||
#### Cancel an order | ||
```php | ||
use function Mollie\WooCommerce\Inc\Api\mollie_cancel_order; | ||
|
||
add_action('init', function () { | ||
$order_id = 123; | ||
$order = wc_get_order($order_id); | ||
mollie_cancel_order($order); | ||
}); | ||
``` | ||
|
||
#### Ship an order | ||
```php | ||
use function Mollie\WooCommerce\Inc\Api\mollie_ship_order; | ||
|
||
add_action('init', function () { | ||
$order_id = 123; | ||
$order = wc_get_order($order_id); | ||
mollie_ship_order($order); | ||
}); | ||
``` | ||
|
||
|
||
|
||
|