Skip to content

Commit

Permalink
= 4.2.0 =
Browse files Browse the repository at this point in the history
~ Modified: set_status.
  • Loading branch information
tungnxt89 committed Dec 12, 2022
1 parent 32511c9 commit 2f6d418
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 1 addition & 3 deletions inc/class-lp-page-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -1024,10 +1024,8 @@ public function check_webhook_paypal_ipn() {

if ( json_last_error() === JSON_ERROR_NONE ) {
$order_id = $data_order->order_id;

$lp_order = learn_press_get_order( $order_id );
$lp_order->set_status( 'completed' );
$lp_order->save();
$lp_order->update_status( LP_ORDER_COMPLETED );
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion inc/order/class-lp-order.php
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,8 @@ public static function get_icons_status(): array {
* @version 1.0.1
*/
public function set_status( string $new_status = '', string $note = '' ) {
$new_status = 'lp-' === substr( $new_status, 0, 3 ) ? substr( $new_status, 3 ) : $new_status;
// Ensure status not has prefix 'lp-'.
$new_status = str_replace( 'lp-', '', $new_status );
$valid_statuses = array_values( LP_Order::get_order_statuses() );
if ( ! in_array( $new_status, $valid_statuses ) && 'trash' !== $new_status ) {
$new_status = LP_ORDER_PENDING;
Expand Down
2 changes: 1 addition & 1 deletion learnpress.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin URI: http://thimpress.com/learnpress
* Description: LearnPress is a WordPress complete solution for creating a Learning Management System (LMS). It can help you to create courses, lessons and quizzes.
* Author: ThimPress
* Version: 4.2.0-beta-6
* Version: 4.2.0-beta-7
* Author URI: http://thimpress.com
* Requires at least: 5.8
* Tested up to: 6.1.1
Expand Down

0 comments on commit 2f6d418

Please sign in to comment.