Merge pull request #538 from woocommerce/PCP-574-filter-to-modify-sending-data

Add filter to allow modifying of order creation request body data
This commit is contained in:
Emili Castells 2022-04-12 09:16:08 +02:00 committed by GitHub
commit ecf3feab62
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -235,6 +235,11 @@ class OrderEndpoint {
if ( $payment_method ) {
$data['payment_method'] = $payment_method->to_array();
}
/**
* The filter can be used to modify the order creation request body data.
*/
$data = apply_filters( 'ppcp_create_order_request_body_data', $data );
$url = trailingslashit( $this->host ) . 'v2/checkout/orders';
$args = array(
'method' => 'POST',