From f0e367cdd3b6ef40bb1f35d299f9463e23d026e6 Mon Sep 17 00:00:00 2001 From: Narek Zakarian Date: Wed, 16 Mar 2022 15:35:50 +0400 Subject: [PATCH] Add filter to allow modifying of request order creation data --- modules/ppcp-api-client/src/Endpoint/OrderEndpoint.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/ppcp-api-client/src/Endpoint/OrderEndpoint.php b/modules/ppcp-api-client/src/Endpoint/OrderEndpoint.php index c01070654..0c16cc407 100644 --- a/modules/ppcp-api-client/src/Endpoint/OrderEndpoint.php +++ b/modules/ppcp-api-client/src/Endpoint/OrderEndpoint.php @@ -235,6 +235,11 @@ class OrderEndpoint { if ( $payment_method ) { $data['payment_method'] = $payment_method->to_array(); } + + /** + * The filter can be used to modify the request data. + */ + $data = apply_filters( 'ppcp_create_order_request_body_data', $data ); $url = trailingslashit( $this->host ) . 'v2/checkout/orders'; $args = array( 'method' => 'POST',