mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
Store order info in wc order meta to get if there is no session.
This commit is contained in:
parent
f78dfac648
commit
ab0e90dab0
4 changed files with 26 additions and 7 deletions
|
@ -242,6 +242,13 @@ class CreateOrderEndpoint implements EndpointInterface {
|
|||
}
|
||||
|
||||
$order = $this->create_paypal_order( $wc_order );
|
||||
|
||||
if ( 'pay-now' === $data['context'] && is_a( $wc_order, \WC_Order::class ) ) {
|
||||
$wc_order->update_meta_data( PayPalGateway::ORDER_ID_META_KEY, $order->id() );
|
||||
$wc_order->update_meta_data( PayPalGateway::INTENT_META_KEY, $order->intent() );
|
||||
$wc_order->save_meta_data();
|
||||
}
|
||||
|
||||
wp_send_json_success( $order->to_array() );
|
||||
return true;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue