GithubHelp home page GithubHelp logo

Comments (6)

aheckler avatar aheckler commented on July 29, 2024 2

I tested this just now and can confirm there is a bug. Interestingly, I see duplicate meta on the initial subscription order:

Screenshot taken on 2024-07-15 at 11 41 39 UTC@2x

That meta is missing from the renewal:

Screenshot taken on 2024-07-15 at 11 43 08 UTC@2x

from woocommerce-gateway-stripe.

james-allan avatar james-allan commented on July 29, 2024 1

Just following up, I've confirmed it's definitely related to the api version change. I switched out the API version used when create_and_confirm_intent_for_off_session() is called and that resolved it.

I'd still like to look at what could be causing the difference between checkout payments and subscription payments. All I have been able to tell so far, is that Stripe updates the charge with the balance transaction after it has succeeded so there's a short delay (3ms).

Screenshot 2024-07-17 at 3 52 36 PM

The only potential fix that comes to mind is listening to that charge.updated webhook or scheduling an async job to go update the order fee from the balance information shortly after the transaction has been processed.

from woocommerce-gateway-stripe.

james-allan avatar james-allan commented on July 29, 2024 1

I'd still like to look at what could be causing the difference between checkout payments and subscription payments.

I think I found what the difference is and what will fix it. Subscription payments don't have the capture_method set to automatic. I'll submit a PR later tonight.

from woocommerce-gateway-stripe.

james-allan avatar james-allan commented on July 29, 2024 1

FWIW this is the relevant change to the API:

Screenshot 2024-07-17 at 6 17 18 PM
Ref: https://docs.stripe.com/upgrades#2024-04-10

In the 2024-04-10 version they changed the default payment intent capture_method to async so we don't get charge information immediately. As I mentioned above changing it to automatic will cause the payment to be captured as soon as it is raised and we will receive charge information.

from woocommerce-gateway-stripe.

OmarFPG avatar OmarFPG commented on July 29, 2024

8472579-zd

from woocommerce-gateway-stripe.

james-allan avatar james-allan commented on July 29, 2024

It looks like this could be related to the Stripe API version bump included in 8.5.0.

After making a subscription charge, we use to receive from Stripe a response that included a balance_transaction. That balance transaction is what we used to process the fee data.

Stripe API version 2019-09-09 response includes the charge object with a balance transaction ID directly:

Screenshot 2024-07-17 at 1 03 15 PM

That's no longer the case though. In the 2024-06-20 version, the charges arg doesn't exist, we have a latest_charge but when you fetch the charge, the balance transaction is empty.

Screenshot 2024-07-17 at 1 05 14 PM Screenshot 2024-07-17 at 1 07 01 PM

What I haven't yet worked out is why the balance transaction is missing when processing subscription payments, but aren't missing when you process payments on the front end. 🤔

from woocommerce-gateway-stripe.

Related Issues (20)

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.