Update class-wc-gateway-paypal-response.php

This commit is contained in:
Miguel Pinto 2019-08-27 22:30:33 +01:00 committed by GitHub
parent ae4eba45ec
commit 60ac27ba3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

@ -63,12 +63,10 @@ abstract class WC_Gateway_Paypal_Response {
* @param string $note Payment note.
*/
protected function payment_complete( $order, $txn_id = '', $note = '' ) {
if ( ! $order->get_meta( '_paypal_payment_completed', true ) ) {
if ( ! $order->has_status( array( 'processing', 'completed' ) ) ) {
$order->add_order_note( $note );
$order->payment_complete( $txn_id );
WC()->cart->empty_cart();
$order->update_meta_data( '_paypal_payment_completed', 'yes' );
$order->save();
}
}