mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 10:55:00 +08:00
Merge pull request #641 from woocommerce/PCP-580-manual-orders-return-an-error-for-guest-users
Store order info in wc order meta to get if there is no session.
This commit is contained in:
commit
b7c4f23b62
4 changed files with 26 additions and 7 deletions
|
@ -243,6 +243,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