Getting an order id by order key if invoice prefix has changed. #1440

This commit is contained in:
Brent Shepherd 2012-08-27 14:07:06 +10:00
parent 1e8ffbf9ec
commit 45be86cf31
1 changed files with 5 additions and 0 deletions

View File

@ -575,6 +575,11 @@ class WC_Paypal extends WC_Payment_Gateway {
$order = new WC_Order( $order_id );
if ( ! isset( $order->id ) ) { // We have an invalid $order_id, probably because invoice_prefix has changed
$order_id = woocommerce_get_order_id_by_order_key( $order_key );
$order = new WC_Order( $order_id );
}
if ( $order->order_key !== $order_key ) :
if ($this->debug=='yes') $this->log->add( 'paypal', 'Error: Order Key does not match invoice.' );
exit;