Skip to content

Commit

Permalink
Alter conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
bor0 committed Jun 5, 2017
1 parent 0a620f1 commit 7db9ace
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/class-wc-gateway-ppec-ipn-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function handle_valid_ipn( $posted_data ) {
$posted_data['payment_status'] = strtolower( $posted_data['payment_status'] );

// Sandbox fix.
if ( isset( $posted_data['test_ipn'], $posted_data['pending_reason'] ) && 'authorization' !== $posted_data['pending_reason'] && 1 == $posted_data['test_ipn'] && 'pending' == $posted_data['payment_status'] ) {
if ( ( empty( $posted_data['pending_reason'] ) || 'authorization' !== $posted_data['pending_reason'] ) && isset( $posted_data['test_ipn'] ) && 1 == $posted_data['test_ipn'] && 'pending' == $posted_data['payment_status'] ) {
$posted_data['payment_status'] = 'completed';
}

Expand Down

0 comments on commit 7db9ace

Please sign in to comment.