• Resolved jo8nie

    (@jo8nie)


    Sandbox mode and live mode is giving this issue. I am pasting the latest log below:

    06-15-2020 @ 11:02:47 –
    ———-
    PayFast ITN call received
    ———-
    06-15-2020 @ 11:02:47 – Get posted data
    06-15-2020 @ 11:02:47 – PayFast Data: Array
    (
    [m_payment_id] => 2514
    [pf_payment_id] => 1069734
    [payment_status] => COMPLETE
    [item_name] => Janine Lazarus – 2514
    [item_description] => New order from Janine Lazarus
    [amount_gross] => 5.00
    [amount_fee] => -2.30
    [amount_net] => 2.70
    [custom_str1] => wc_order_UXxEefsfmtQyB
    [custom_str2] => WooCommerce/4.1.0; https://www.janinemedia.co.za
    [custom_str3] => 2514
    [custom_str4] =>
    [custom_str5] =>
    [custom_int1] =>
    [custom_int2] =>
    [custom_int3] =>
    [custom_int4] =>
    [custom_int5] =>
    [name_first] => xxxx
    [name_last] => xxxx
    [email_address] => [email protected]
    [merchant_id] => 10004002
    [signature] => a756d4f02fbd6afe0e9d7c48050bcc27
    )

    06-15-2020 @ 11:02:47 – Verify security signature
    06-15-2020 @ 11:02:47 – Signature = valid
    06-15-2020 @ 11:02:47 – Verify data received
    06-15-2020 @ 11:02:47 – Host = https://sandbox.payfast.co.za/eng/query/validate
    06-15-2020 @ 11:02:47 – Params = Array
    (
    [m_payment_id] => 2514
    [pf_payment_id] => 1069734
    [payment_status] => COMPLETE
    [item_name] => Janine Lazarus – 2514
    [item_description] => New order from Janine Lazarus
    [amount_gross] => 5.00
    [amount_fee] => -2.30
    [amount_net] => 2.70
    [custom_str1] => wc_order_UXxEefsfmtQyB
    [custom_str2] => WooCommerce/4.1.0; https://www.janinemedia.co.za
    [custom_str3] => 2514
    [custom_str4] =>
    [custom_str5] =>
    [custom_int1] =>
    [custom_int2] =>
    [custom_int3] =>
    [custom_int4] =>
    [custom_int5] =>
    [name_first] => xxxxx
    [name_last] => xxxxx
    [email_address] => [email protected]
    [merchant_id] => 10004002
    )

    06-15-2020 @ 11:02:47 – Response:
    Array
    (
    [VALID] =>
    )

    06-15-2020 @ 11:02:47 – Check data against internal order
    06-15-2020 @ 11:02:47 – Order Details:
    customer id:11
    order id: 2514
    parent id: 0
    status: pending
    total: 5.00
    currency: ZAR
    key: wc_order_UXxEefsfmtQyB
    06-15-2020 @ 11:02:47 – Check status and update order
    06-15-2020 @ 11:02:47 – – Complete
    06-15-2020 @ 11:02:47 –
    ———-
    End ITN call
    ———-

    What steps can I take to troubleshoot? Payfast has a backlog and I can’t get through to them. I’ve logged this issue about a week ago and have heard nothing back.

    I don’t want to update WooCommerce as Payfast is not even tested with the version I have installed.

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter jo8nie

    (@jo8nie)

    I found this code:

    add_action( 'woocommerce_thankyou', 'custom_woocommerce_auto_complete_order' );
    function custom_woocommerce_auto_complete_order( $order_id ) { 
        if ( ! $order_id ) {
            return;
        }
    
        $order = wc_get_order( $order_id );
        $order->update_status( 'completed' );
    }

    Is this okay to use?

    Plugin Support Aashik P – a11n

    (@aashik)

    Hi there!

    Just to reconfirm that I’m understanding correctly, you’re reporting that successful payments made via Payfast are set to Processing instead of Completed?

    If yes, that is by design. You can read more about that at Order Statuses – Documentation.

    Unless all the products in the order are both Virtual AND Downloadable, the order status is set to Processing.

    The snippet in your last response comes from Automatically Complete Orders – Documentation, and it is safe to use. However, please make sure that you have a complete backup of your store (your web host should be able to help you with that) before adding any snippets.

    Thread Starter jo8nie

    (@jo8nie)

    Hi Aashik, thanks for your response!

    Yes, you understood correctly. My product is virtual but not downloadable as it is an online course. So that is why I need the order to immediately set to completed.

    The snippet worked and all is good. Thanks again!

    Plugin Support Aashik P – a11n

    (@aashik)

    The snippet worked and all is good. Thanks again!

    Glad to be of help!

    I’ll mark this topic as solved for now. Please feel free to open a new topic if you have any other questions.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Woocommerce order ‘processing’ after successful payment’ is closed to new replies.