mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +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
|
@ -150,7 +150,8 @@ class OrderProcessor {
|
|||
* @return bool
|
||||
*/
|
||||
public function process( \WC_Order $wc_order ): bool {
|
||||
$order = $this->session_handler->order();
|
||||
$order_id = $wc_order->get_meta( PayPalGateway::ORDER_ID_META_KEY );
|
||||
$order = $this->session_handler->order() ?? $this->order_endpoint->order( $order_id );
|
||||
if ( ! $order ) {
|
||||
$this->last_error = __( 'No PayPal order found in the current WooCommerce session.', 'woocommerce-paypal-payments' );
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue