• Resolved huku12345

    (@huku12345)


    I created an online lecture site using learnpress and woocommerce. However, point payment proceeds normally, but when using card payment, the payment page freezes for a long time and then a message appears saying that there is a problem with the cart. The payment is made normally through the credit card company, but the WooCommerce order shows as pending.

    • This topic was modified 8 months, 2 weeks ago by huku12345.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support ckadenge (woo-hc)

    (@ckadenge)

    Hi @huku12345,

    Thanks for reaching out.

    I’m sorry to hear that you’re experiencing issues with card payments on your online lecture site. This might be due to a number of reasons, such as a conflict with a plugin or theme, an issue with your payment gateway, or a problem with your site’s configuration.

    I’d like to understand your site properly. Please share with us the necessary information below for us to investigate the issue further:

    1. System Status Report which you can find via WooCommerce > Status > Get system report > Copy for support, then paste it via https://gist.github.com/ and send the link here.
    2. Fatal error logs (if any) under WooCommerce > Status > Logs.
      You could copy and paste your reply here or paste it via https://gist.github.com/ and send the link here.

    Once we have more information, we’ll be able to assist you further.

    Thread Starter huku12345

    (@huku12345)

    Plugin Support ckadenge (woo-hc)

    (@ckadenge)

    Hi again @huku12345,

    Thanks for sharing more details on this.

    First and foremost I was able to check your system status report and could notice you are using an outdated database version, to avoid any issues, I’d recommend updating your database to the latest version by heading over to WooCommerce > Status > Tools > Update Database.

    ????? ?? ???? – ???? ?? ????: CodeMShop – 3.3.10

    Also, from your system status report, I was able to notice you are using the above plugin for payment collection, is that correct?

    This is a third-party plugin and our scope of support is only limited to WooCommerce, I’d recommend reaching out directly to their support team for further troubleshooting, as they stand a better chance to troubleshoot the issue.

    I hope this helps. Cheers!

    Thread Starter huku12345

    (@huku12345)

    thank you I did as you said and made the payment again and made the same credit card payment, but I got this message: “There are some issues with the items in your cart. Please go back to the cart page and resolve these issues before checking out.” I also contacted the plugin production company.
    Any help possible would be greatly appreciated.

    Thread Starter huku12345

    (@huku12345)

    This is the answer from learnpress woocommerce plugin.

    “Sorry, I see that the payment steps are almost correct, just the payment part is wrong. but woocommerce’s payment methods, so please contact woocommerce to check again.”

    Plugin Support ckadenge (woo-hc)

    (@ckadenge)

    Hi @huku12345,

    ?“There are some issues with the items in your cart. Please go back to the cart page and resolve these issues before checking out.”

    Are you able to share screenshot of how you can view the checkout page from your end? You can use a screenshot sharing software like https://snipboard.io/ and paste the link here.

    Sorry, I see that the payment steps are almost correct, just the payment part is wrong. but woocommerce’s payment methods, so please contact woocommerce to check again.”

    I had suggested reaching out to the plugin support team for the plugin you use to collect payments with from your site and not LearnPress. Please reach out to this (????? ?? ???? – ???? ?? ????: CodeMShop – 3.3.10) as it is the plugin used to collect payments from your site.

    Upon checking your site, I was unable to add any payment details. I’ve attached a screenshot here: https://snipboard.io/M92JdA.jpg

    Looking forward to assisting you further.

    Thread Starter huku12345

    (@huku12345)

    I've had a hard time with this, so I'm uploading it because I want to help people who are having trouble with this. Thank you for your kind reply.
    
    
    
    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
    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
    • This reply was modified 8 months, 2 weeks ago by huku12345.

    Hey there @huku12345,

    Thank you so much for adding your input! Some of our customers might indeed find this guide helpful!

    We appreciate you being an active part of the community ??

    Have a wonderful day!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘PAYMENT ISSUE’ is closed to new replies.