Merge pull request #24249 from miguelfspinto/patch-2
Avoid duplicated process for IPN and PDT payment
This commit is contained in:
commit
b63ecca450
|
@ -63,10 +63,12 @@ abstract class WC_Gateway_Paypal_Response {
|
|||
* @param string $note Payment note.
|
||||
*/
|
||||
protected function payment_complete( $order, $txn_id = '', $note = '' ) {
|
||||
if ( ! $order->has_status( array( 'processing', 'completed' ) ) ) {
|
||||
$order->add_order_note( $note );
|
||||
$order->payment_complete( $txn_id );
|
||||
WC()->cart->empty_cart();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Hold order and add note.
|
||||
|
|
Loading…
Reference in New Issue