Coder Social home page Coder Social logo

kmindi / wc-stripe-asynchronous-payments-pending-to-payment-complete Goto Github PK

View Code? Open in Web Editor NEW
9.0 3.0 0.0 8 KB

Wordpress Plugin that executes "payment complete" if SEPA direct debit is used and the payment is still pending, but you want to regard it as complete.

PHP 100.00%
woocommerce-payment wordpress-plugin stripe stripe-payment sepa

wc-stripe-asynchronous-payments-pending-to-payment-complete's Introduction

Pending Payments to Payment Complete for WooCommerce Stripe Payment Gateway

Wordpress Plugin that executes "payment complete" if SEPA direct debit is used and the payment is still pending, but you want to regard it as complete. Use this extension if you trust that the customer has provided correct payment information and that the payment usually succeeds. If it does not you should handle it manually and maybe charge the customer additional fees.

Installation

The most convenient way is to use GitHub Updater:

  1. Install GitHub Updater
  2. Go to Settings->GitHub Updater->Install Plugin and point it to kmindi/wc-stripe-asynchronous-payments-pending-to-payment-complete

Problem description

The Stripe payment system handles various different payment methods. These methods can either be synchronous (like credit card payments) or asynchronous (like SEPA direct debit). If an asynchronous payment method is used for a WooCommerce order, a charge is created and the order is set to "on-hold" until the charge succeeds. For SEPA direct debit this can take 5-14 days!

Now imagine you sell virtual products like memberships that require purchasing a subscription product which will renew automatically. Not only the first order but all orders, will be "on-hold" until the charge succeeds. This means a subscription will also be inactive during that time, even though the customer provided the payment information and does not expect a break in his subscription.

How this extension solves the problem

  1. They key part is that we hook into the action wc_gateway_stripe_process_response from the Stripe plugin.
  2. In this action hook we execute $order->payment_complete if the response is using "sepa_debit" and the order is in "pending" state.

wc-stripe-asynchronous-payments-pending-to-payment-complete's People

Contributors

kmindi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

wc-stripe-asynchronous-payments-pending-to-payment-complete's Issues

Fees are not set

  • The successful charge is not added to the order and that results in not updated fees

  • is it possible to call update_fees from a pending transaction? (or is the balance history not updated at that time. => if not. Then the stripe plugin has to change the webhook for succesful payment to run through even if the order is not on-hold OR it should make a hook available if the webhook is executed, so we can (here with th is plugin) do that ourselfs.

What happens with disputes?

Hello,

First of all, a big thank you for your work, I was running through a similar problem:

  1. A renewal order is created, by default in "pending payment" status.
  2. The linked subscription passes from "Active" to "On hold"
  3. Stripe takes up to 14 days to process payment
  4. The subscription gets back to active
  5. The big problem is that the next renewal date is 30 days after it got back to Active, so we gave away 15 days for free to the customer!!

Your snippet (I read all the thread here), seems to fix this issue, but I am wondering what would happen if after a payment is complete, there is a dispute.

By default the renewal order passes back to "On hold", and the same for the subscription... I think in this case the order is okay to go back to on-hold, or maybe even to "Pending payment", but the subscription should remain always active, except if it is manually put on hold by the admin or by the customer in his "My account" area.

Please if you have a moment let me know your thoughts.

Sorry to ask here, maybe it's not the proper channel, but the thread mentioned above is now closed!

Thanks again,
Best regards

Order still in process

Thank you for your plugin. It works really well for subscriptions status, but the order status will be still in process and not makred as completed.

What if payment failed

Hello

Thank you for your plugin, i have one question.

What if the payment is contested by the customer ?

Natively the order pass "on hold" then payment is clear by stripe 14days after order and we can processing the order. The order status change from "on hold" to "processing" then "completed".

But it can happen that a customer contest the payment after that time, so the order status passed from "completed" to "on hold" again automatically

Will your plugin interfere with this native behaviour?

Thank you !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.