Skip to content

Commit 2d339cb

Browse files
committed
Restore compatibility with WC <3.0
1 parent 2138780 commit 2d339cb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

plugin/classes/api/Aplazame_Api_ConfirmController.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,12 @@ public function confirm( $payload ) {
5656
case 'pending':
5757
switch ( $payload['status_reason'] ) {
5858
case 'confirmation_required':
59-
if ( ! $order->payment_complete() ) {
60-
return self::ko();
59+
if ( method_exists( $order, 'payment_complete' ) ) {
60+
if ( ! $order->payment_complete() ) {
61+
return self::ko();
62+
}
63+
} else {
64+
$order->update_status( 'processing', sprintf( __( 'Confirmed', 'aplazame' ) ) );
6165
}
6266
break;
6367
}

0 commit comments

Comments
 (0)