When paying with points and credit card, the order appears as pending.
-
AuthorPosts
-
-
March 12, 2024 at 4:06 PM #965235bodymentParticipant
When making a combined payment with points and a credit card on LearnPress, the order status shows as ‘Pending.’ However, in WooCommerce, it appears as ‘Payment Pending. When I tested it again, it came out as pending just by card payment. The payment has been made
When you pay, the credit card company notifies you that the payment has been made, and the payment is actually made. However, the screen stops for a long time on the payment page. The page is not turning over, and a few minutes later, a message comes out saying there is a problem with the shopping cart.
https://bodyment.co.kr/wp-content/uploads/2024/03/스크린샷-2024-03-12-오후-6.35.45.png
https://thimpress.com/forums/topic/purchased-a-course-but-cannot-confirm-it-on-profile-page/
After paying points, I only checked that the lecture was included on the profile page, but this is the situation when I paid with my card today. -
March 12, 2024 at 4:48 PM #965243bodymentParticipantThis reply has been marked as private.
-
March 13, 2024 at 8:25 AM #965313JuliaKeymasterThis reply has been marked as private.
-
March 13, 2024 at 8:45 AM #965323bodymentParticipantThis reply has been marked as private.
-
March 13, 2024 at 9:45 AM #965334bodymentParticipantThis reply has been marked as private.
-
March 13, 2024 at 3:53 PM #965391JuliaKeymasterThis reply has been marked as private.
-
March 13, 2024 at 5:44 PM #965424bodymentParticipantThis reply has been marked as private.
-
March 14, 2024 at 10:59 AM #965512bodymentParticipantThis reply has been marked as private.
-
March 14, 2024 at 1:55 PM #965536JuliaKeymasterThis reply has been marked as private.
-
March 15, 2024 at 8:54 AM #965688bodymentParticipant
The payment error occurred due to a bug in the “LearnPress – WooCommerce Payment Methods Integration” plugin.
[1] Register the hook below in the class-lp-wc-hooks.php file.
add_action( ‘woocommerce_after_order_object_save’, array( $this, ‘create_lp_order’ ), 10 );
[2] When order information is saved after payment, the function below is executed.
public function create_lp_order( WC_Order $wc_order ) {
$wc_order_id = $wc_order->get_id();
$lp_woo_order = new LP_Woo_Order( 0, $wc_order_id );
$lp_woo_order->create_lp_order();
}[3] create_lp_order() of LP_Woo_Order class; If you check the function, you will find the code below.
$wc_order_id = $wc_order->get_id();
$user_id = get_current_user_id();
//if is guest checkout, check isset wp user by checkout email
if ( $user_id === 0 ) {
$email = $wc_order->get_billing_email();
$user = get_user_by( ’email’, $email );
if ( $user ) {
$user_id = $user->ID;
$wc_order->set_customer_id( $user_id );
$wc_order->save();
}
}[4] There is no problem when the payment is completed within the site, such as through a bank transfer. However, a problem occurs when returning to the site after the payment is completed through an external PG company.
[4-1] Because get_current_user_id() is 0
[4-2] Search for a customer using email information for the order, then set the customer ID for the order.
[4-3] Save order information. At this time, the Hook registered in [1] is called again and falls into an infinite loop, resulting in a memory error or execution time exceeded error.As a temporary measure, we have changed function [2] as follows.
public function create_lp_order( WC_Order $wc_order ) {
remove_action( ‘woocommerce_after_order_object_save’, array( $this, ‘create_lp_order’ ), 10 );
$wc_order_id = $wc_order->get_id();
$lp_woo_order = new LP_Woo_Order( 0, $wc_order_id );
$lp_woo_order->create_lp_order();
add_action( ‘woocommerce_after_order_object_save’, array( $this, ‘create_lp_order’ ), 10 );
}
For this error, you must request official distribution after correction from the plugin developer, and do not update the plugin until the patch version is distributed.thank you
-
-
March 15, 2024 at 3:07 PM #965745JuliaKeymasterThis reply has been marked as private.
-
April 23, 2024 at 11:55 AM #971729JuliaKeymasterThis reply has been marked as private.
-
-
AuthorPosts
You must be logged in to reply to this topic. You can click here