Add filter to allow modifying of request order creation data

This commit is contained in:
Narek Zakarian 2022-03-16 15:35:50 +04:00
parent c5fe98e766
commit f0e367cdd3

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 request data.
*/
$data = apply_filters( 'ppcp_create_order_request_body_data', $data );
$url = trailingslashit( $this->host ) . 'v2/checkout/orders';
$args = array(
'method' => 'POST',