mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Do not call get PayPal order if order id is empty
This commit is contained in:
parent
e5cced2008
commit
fda789228c
1 changed files with 6 additions and 1 deletions
|
@ -162,7 +162,12 @@ class OrderProcessor {
|
|||
*/
|
||||
public function process( \WC_Order $wc_order ): bool {
|
||||
$order_id = $wc_order->get_meta( PayPalGateway::ORDER_ID_META_KEY );
|
||||
$order = $this->session_handler->order() ?? $this->order_endpoint->order( $order_id );
|
||||
if ( ! $order_id ) {
|
||||
$this->last_error = __( 'No PayPal order ID found in the current WooCommerce session.', 'woocommerce-paypal-payments' );
|
||||
return false;
|
||||
}
|
||||
|
||||
$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