• Qhub

    (@qhub)


    Trying to understand why so many of orders remain in “Processing” state

    Vipps
    Status AUTHORIZED
    Amount 419.00 NOK
    Captured 0.00 NOK
    Refunded 0.00 NOK
    Vipps initiated 2024-02-10 17:18:30
    Vipps response 2024-02-10 17:21:20

    Order status changed from Pending payment to Processing.

    10.February 2024 at 5:21 pm Delete note

    Payment authorized at Vipps

    10.February 2024 at 5:21 pm Delete note

    Vipps callback received

    10.February 2024 at 5:21 pm Delete note

    Awaiting Vipps payment confirmation

    10.February 2024 at 5:18 pm Delete note

    Vipps payment initiated

    10.February 2024 at 5:18 pm Delete note

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Iver Odin Kvello

    (@iverok)

    Hello,

    The default status of payments when done at Vipps Mobilepay is “Processing”. It is possible to use “On-hold” instead in the settings.

    The only orders that are automatically set to “Complete” are orders that are both “virtual” and “downloadable”, which in WooCommerce means that they dont “require processing”. It is possible to define other types of orders that do not “require processing” with hooks.

    For normal orders then, the order will not by itself change status from “Processing” to “Complete”, it needs to be modified by the store admin when the order is shipped. It is of course possible to automate this where applicable.

    The money will not be captured (transferred to the merchant) by Vipps Mobilepay until the order is marked “Complete”. The money is reserved until this is performed; which is supposed to be when the order is shipped.

    Thread Starter Qhub

    (@qhub)

    Makes sense. All of our products are virtual but not set as virtual or downloadable. But auto-capture of payment is happening for some orders and for some of them it’s not happening automatically. See this example, payment was captured automatically and order was marked as completed automatically. Why is it working for some orders and not others?

    Vipps
    Status AUTHORIZED
    Amount 218.00 NOK
    Captured 218.00 NOK
    Refunded 0.00 NOK
    Vipps initiated 2024-02-13 09:20:08
    Vipps response 2024-02-13 09:20:19
    Vipps capture 2024-02-13 09:20:24
    Vipps refund

    • Order status changed from Processing to Completed.13.February 2024 at 9:20 am Delete note
    • Vipps Payment captured: 218.00 NOK13.February 2024 at 9:20 am Delete note
    • Order status changed from Pending payment to Processing.13.February 2024 at 9:20 am Delete note
    • Payment authorized at Vipps13.February 2024 at 9:20 am Delete note
    • Vipps callback received13.February 2024 at 9:20 am Delete note
    • Awaiting Vipps payment confirmation13.February 2024 at 9:20 am Delete note
    • Vipps payment initiated13.February 2024 at 9:20 am Delete note
    Plugin Author Iver Odin Kvello

    (@iverok)

    Auto-capture should only happen for orders that with no order lines that “need processing” as Woo terms it, and by default that means “virtual” and “downloadable”. Maybe you have some custom code on the filter 'woocommerce_order_item_needs_processing' ?

    Otherwise, you may have some code that applies “Complete” directly.

    Looking at our code, I see that orders that do not need processing should be getting a note in the order log like this:

    Payment automatically captured at Vipps Mobilepay for order not needing processing

    — so if you do not have this, I guess you have some other code that automates order completion.

    Thread Starter Qhub

    (@qhub)

    So if i understand correctly, the default and only behavior of the plugin is that the Orders of any products (which are not Downloadable or Virtual) will remain in “Processing” until someone “Capture” the payment manually or through the code?

    We don’t have any custom code that’s doing this and still the some orders are Captured. The only thing we have is that when user gets on the Thank You page where we are changing order status to “Completed”. But still no Capture.

    Plugin Author Iver Odin Kvello

    (@iverok)

    Yes, that is correct, and not only for this plugin – “Processing” is the default state for “payment complete”, except for virtual/downloadable products.

    The capture logic varies from payment gateway to payment gateway, but the typical flow is that money is reserved at “processing” and captured at “complete”.

    Oh, there is one more exception if you are in Finland and using Bank Transfer as the payment method – for this there is no reserve/capture step; the funds are transferred immediately.

    If you do set the order status to “Complete” at the thank you page, this is the kind of automation I mentioned. The order *will* be captured at this point, and it will look like your example above:

    Status AUTHORIZED
    Amount 218.00 NOK
    Captured 218.00 NOK

    If you have orders that are “completed” without being captured, then you have something weird happening at your store; so I would double check that you aren’t using other kinds of automation or code here. In particular, when setting a Vipps Mobilepay order to “Complete”, the order *will* be captured by the hook that runs when an order changes state. If this fails, the order will in fact be set to “On-hold” instead – so you should never have un-captured orders marked compelte.

    It is possible to defeat this logic, but only by modifying the database directly so that the standard hooks do not run. If you do this, you will need to add a capture step to your logic.

    Now, you should be aware that you can’t assume that all customers will return to the “thankyou” page. It is not at all unheard of to simply close the browser after completing the payment, and if this happens, your action will not occur either. The order should then stay “Processing” until marked “Complete”. If you need to automate order completion, you can simply get these orders and change their state to “completed” using the WC_Order api.

    You should be able to see the state of the order at Vipps Mobilepay in the metabox (“Show complete transaction details”). You can also check the logs found at WooCommerce/Status/Logs, in particular the one named “woo-vipps-<date and hash>”.

    Thread Starter Qhub

    (@qhub)

    Based on the information provided we changed all our products type to “Virtual”. We received an order and still it went into “Processing” instead of Capture and Complete. Any ideas?

    Payment method is Vipps. Is there anything else specific that automatically Captures the payment?

    Transaction details
    
    Order id: Woo282287
    Order status: AUTHORIZED
    Payment method: Vipps
    API: epayment
    All values in ?rer (1/100 NOK)
    Transaction summaryCapured amount:0
    Remaining amount to capture:44900
    Refunded amount:0
    Remaining amount to refund:0
    Cancelled amount:0
    Remaining amount to cancel:44900
    User detailsUser ID:
    First Name: Anonymous customer
    Last Name:
    Mobile Number:
    Email:
    Transaction Log
    Operation: AUTHORIZED
    Amount: 449 NOK
    Success: 1
    Timestamp: 2024-02-15T14:42:55.037Z
    Transaction ID: 10034932134 Operation: CREATED
    Amount: 449 NOK
    Success: 1
    Timestamp: 2024-02-15T14:42:42.7347258Z
    Transaction ID: 93b1074c-64cc-4d1d-956d-2c8bc89cffbb
    • Order status changed from Pending payment to Processing.15.February 2024 at 2:43 pm?Delete note
    • Payment authorized at Vipps15.February 2024 at 2:43 pm?Delete note
    • Awaiting Vipps payment confirmation15.February 2024 at 2:42 pm?Delete note
    • Vipps payment initiated15.February 2024 at 2:42 pm?Delete note
    Thread Starter Qhub

    (@qhub)

    It’s also worth noting that some orders are being Captured and Completed automatically. I see no clear difference to understand what could have caused one order to complete automatically and one to go into Processing. This is confusing. Both products are “Virtual” and payment method is Vipps

    Transaction details

    Order id: Woo282325
    Order status: AUTHORIZED
    Payment method: Vipps
    API: epayment
    All values in ?rer (1/100 NOK)
    Transaction summaryCapured amount:34900
    Remaining amount to capture:0
    Refunded amount:0
    Remaining amount to refund:34900
    Cancelled amount:0
    Remaining amount to cancel:0
    User detailsUser ID:
    First Name: Anonymous customer
    Last Name:
    Mobile Number:
    Email:
    Transaction Log
    Operation: CAPTURED
    Amount: 349 NOK
    Success: 1
    Timestamp: 2024-02-15T22:17:31.505Z
    Transaction ID: 2039400508

    Operation: AUTHORIZED
    Amount: 349 NOK
    Success: 1
    Timestamp: 2024-02-15T22:17:25.382Z
    Transaction ID: 10035411328

    Operation: CREATED
    Amount: 349 NOK
    Success: 1
    Timestamp: 2024-02-15T22:17:18.3488221Z
    Transaction ID: ea2263d9-fe0f-42b5-9fd4-7d4b8b695462

    • This reply was modified 1 year ago by Qhub.
    Plugin Author Iver Odin Kvello

    (@iverok)

    To be treated as “do not need processing” they have to be both “Virtual” and “Downloadable” by default. They don’t actually have to be downloadable”to be marked “Downloadable”, but when they are, they are seen as not “needing processing”.

    The ones that go to “Completed” are probably set so by the “thankyou” hook you are using. There is a race condition here, so it can’t be relied on to defeat the normal flow.

    If you want to modify the “needs processing” logic without using “Downloadable”, the filter to modify is in Woo itself:

    apply_filters( 'woocommerce_order_item_needs_processing', $yesno, $product, $order_item_id );

    $yesno will by default be true only for virtual and downloadable products, but if you have other products that do not need processing you can return “true” for them in this filter.

    Thread Starter Qhub

    (@qhub)

    Ideally this should be a setting in the plugin to not go into Processing even just for Virtual products.

    Plugin Author Iver Odin Kvello

    (@iverok)

    The logic you are talking about here is WooCommerce-logic, not Vipps logic. The standard payment status after “payment complete” is processing, unless the entire order “does not need processing”. The logic is managed by the filter I quoted above, plus this:

    apply_filters( 'woocommerce_payment_complete_order_status', $this->needs_processing() ? 'processing' : 'completed', $this->get_id(), $this );

    This is all standard WooCommerce, so it is not for this payment gateway to change.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Order Status “Processing”’ is closed to new replies.