mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Merge branch 'trunk' into pcp-475-free-trial
This commit is contained in:
commit
1b5052a858
5 changed files with 48 additions and 9 deletions
|
@ -226,7 +226,7 @@ class OrderEndpoint {
|
|||
'application_context' => $this->application_context_repository
|
||||
->current_context( $shipping_preference )->to_array(),
|
||||
);
|
||||
if ( $payer ) {
|
||||
if ( $payer && ! empty( $payer->email_address() ) && ! empty( $payer->name() ) ) {
|
||||
$data['payer'] = $payer->to_array();
|
||||
}
|
||||
if ( $payment_token ) {
|
||||
|
@ -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',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue