Skip to content

Commit

Permalink
Merge pull request #677 from ebanx/fix/payment-complete
Browse files Browse the repository at this point in the history
Do not override status on CO status notification
  • Loading branch information
miguelxpn authored May 4, 2018
2 parents e1693fd + cb637a8 commit 464e427
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions gateways/class-wc-ebanx-new-gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,6 @@ final public function update_payment( $order, $data ) {
return;
}
$order->payment_complete( $data['payment']['hash'] );
$new_status = 'processing';
break;
case 'CA':
$order->payment_complete();
Expand All @@ -665,7 +664,7 @@ final public function update_payment( $order, $data ) {
break;
}

if ( $new_status !== $old_status ) {
if ( isset( $new_status ) && $new_status !== $old_status ) {
$payment_status = $status[ $data['payment']['status'] ];
$order->add_order_note( sprintf( __( 'EBANX: The payment has been updated to: %s.', 'woocommerce-gateway-ebanx' ), $payment_status ) );
$order->update_status( $new_status );
Expand Down

0 comments on commit 464e427

Please sign in to comment.