• Resolved Ambyomoron

    (@josiah-s-carberry)


    As I understand it, when a customer pays using SEPA Direct Debit, Stripe sends a message back to whatever webhook has been defined. I would like to know if the plugin already does any automatic handling of that message. In addition, I would like to write a function to automatically change the status of the order to ‘complete’ when receiving the message that payment succeeded. Is that possible? Can someone direct me to the documentation needed to do that?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support Saravanan S, a11n

    (@simplysaru)

    Hi @josiah-s-carberry,

    To confirm, on payment confirmation you want the order to be completed instead of processing. Did we understand you correctly? There are order status control plugins that may be able to do this for you.

    Is that what you are looking for? Could you explain with an example?

    Thread Starter Ambyomoron

    (@josiah-s-carberry)

    Yes, that is correct. But I do not intend to add yet another plugin to do something that must be simple enough, if only the relevant filters or actions were documented somewhere.

    Plugin Support Saravanan S, a11n

    (@simplysaru)

    Hi @josiah-s-carberry,

    Thanks for the confirmation. The stripe plugin doesn’t directly manipulate the order status, but WooCommerce does. Here is the documentation of action and hook references in WooCommerce.

    If you need to cross-reference anything from the stripe plugin, the Github repository is here.

    Hope that helps. Let us know if that helps.

    Thread Starter Ambyomoron

    (@josiah-s-carberry)

    Thank you for that, but my question is which action or filter should be used to handle the message from stripe that payment was received.

    Hi,

    I understand you would like to know for a filter or action.

    Are your products physical or digital?

    If they are physical products, you can use the WooCommerce Order Status Control plugin. It allows you to automatically mark paid orders as “complete” instead of “processing”.

    If they are digital then the order will be auto-completed.

    Let us know.

    Thread Starter Ambyomoron

    (@josiah-s-carberry)

    Thank you, Igor, for your message. Unfortunately, it is not pertinent to my issue, which is NOT a question of physical vs. digital (it is neither). It is a question of different payment methods.

    Mirko P.

    (@rainfallnixfig)

    Hi @josiah-s-carberry,

    Searching around I found a snippet that will set Stripe orders to Completed status when the payment is completed:

    https://www.ads-software.com/support/topic/custom-order-status-after-payment-success/#post-12720604

    If you do require more help with the actual coding, we’d recommend consulting a developer or one of the customization experts listed at https://woocommerce.com/customizations/.

    Hope this points you in the right direction.

    Cheers.

    Thread Starter Ambyomoron

    (@josiah-s-carberry)

    Thank you, Mirko, for this contribution. In fact, I already use exactly that snippet.

    The problem, though, is to understand which action is triggered when Stripe sends back the message the the SEPA payment has been made, which normally occurs some time well after the order is placed. Is it indeed woocommerce_payment_complete ???

    When you use Stripe’s test environment, the whole transaction happens immediately, so it is impossible to distinguish between placing the order and confirming the payment. I suppose a network sniffer could yield that information, but I am not equipped with that. And I do not want to test this in a production environment.

    Luminus Alabi

    (@luminus)

    Automattic Happiness Engineer

    Hi @josiah-s-carberry,

    At this point, you’re going to want to speak to your developer and have them look into this for you. Or if you’re the developer in charge, you’ll want to look through the code yourself since you’re intent on providing a code related solution and you don’t want to use a plugin, nor are you interested in any of the solutions already suggested.

    The GitHub repository for the Stripe plugin is public and you can look through the code here

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Function for handling payment received message’ is closed to new replies.