Comments (6)
I tested this just now and can confirm there is a bug. Interestingly, I see duplicate meta on the initial subscription order:
That meta is missing from the renewal:
from woocommerce-gateway-stripe.
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](https://private-user-images.githubusercontent.com/8490476/349376767-02ed3ad6-09e4-403d-b510-fcf8cd47a76b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIxODc1MzcsIm5iZiI6MTcyMjE4NzIzNywicGF0aCI6Ii84NDkwNDc2LzM0OTM3Njc2Ny0wMmVkM2FkNi0wOWU0LTQwM2QtYjUxMC1mY2Y4Y2Q0N2E3NmIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcyOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MjhUMTcyMDM3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9OGQ0ODU4ZDM3YjZhNGVmMzA3OTQ1ZjZlYzZlNzhkNTliNWJkNmIyZWQzNzY1MWE2ZWIxMTFmNzdhMGNhOTg5YyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.8UsTRtP60qWIJYP06yOgp1CBLdvl5LmpjumTwBaf7lM)
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.
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.
FWIW this is the relevant change to the API:
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.
8472579-zd
from woocommerce-gateway-stripe.
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](https://private-user-images.githubusercontent.com/8490476/349345936-ad5d1985-8f47-48c5-b6bf-b8bce0ecba26.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIxODc1MzcsIm5iZiI6MTcyMjE4NzIzNywicGF0aCI6Ii84NDkwNDc2LzM0OTM0NTkzNi1hZDVkMTk4NS04ZjQ3LTQ4YzUtYjZiZi1iOGJjZTBlY2JhMjYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcyOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MjhUMTcyMDM3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MTg4ZjE2Yjk5MTg0ZTM2NzMyYmFmZmViZmQyY2MxZDAzNmMzMzg5Y2ZlZTU3YTFkN2JkOGNkNTk0ZmZlYjc1NiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.SApSMS52rKMTBlXB2uzBmjPM3L00Q_c17W046Ns8hUE)
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](https://private-user-images.githubusercontent.com/8490476/349346273-66af0827-a172-4ff4-a0b8-503ffea2a98b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIxODc1MzcsIm5iZiI6MTcyMjE4NzIzNywicGF0aCI6Ii84NDkwNDc2LzM0OTM0NjI3My02NmFmMDgyNy1hMTcyLTRmZjQtYTBiOC01MDNmZmVhMmE5OGIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcyOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MjhUMTcyMDM3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YzVlOWJmNWMxNjllNThlNDg1OTFmZTY1ZDM2MTNkYWY0Nzk2Nzc3ZGVmNTg0MDRmMWM3ZDI4ZGE3NWRiMzQyZCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ._kq6iE9pKo2eg24FU-i5Dz9UwouVuSwgTKXS5q8Pq0k)
![Screenshot 2024-07-17 at 1 07 01 PM](https://private-user-images.githubusercontent.com/8490476/349346557-721aa109-a8f0-47ad-a3be-a6a6ea93b1be.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIxODc1MzcsIm5iZiI6MTcyMjE4NzIzNywicGF0aCI6Ii84NDkwNDc2LzM0OTM0NjU1Ny03MjFhYTEwOS1hOGYwLTQ3YWQtYTNiZS1hNmE2ZWE5M2IxYmUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcyOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MjhUMTcyMDM3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9Y2YyMTE0NDczMmQ5NjBmNTgzZDBhNzRmNGQ3NzA2NjRlMWIxZGI5OGUxNzNjOTRiMDEyYjE2NDFlZmVlNTYwOSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.K0R0LdDruDH6VLVjIV3R6QnuHuGW7JuVgIgaG01cZVI)
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)
- Refunds via Giropay not available after deprecation
- Deprecate Key Sharing - Add re-connect promotional surface
- Minor text updates to webhook settings
- Clear the webhook status when configuring a new one
- Creating a setup intent with a new payment method fails when using the Legacy checkout experience
- Non-existent billing field throwing JS errors on console
- Flag accounts that are connected via the oauth flow and use it to display connected status
- Update the `WC_Stripe_Connect_API` class to support test mode requests
- Webhooks should be configured automatically when connecting via OAuth
- Enable express checkout capability when using Yith Multi-Vendor plugin with shipping enabled
- Missing Payment Method: Paypal HOT 1
- Missing Payment Method: Twint HOT 1
- Duplicate charges when placing order (if "Link By Stripe" was previously connected) HOT 3
- Failing refund e2e test
- Merchant Message Visible on Checkout Page HOT 1
- [HC] - Disabling the CC option makes Stripe APMs show up first, not respecting the order set in the overall WooCommerce Payment settings
- Updating Subscription's payment method to a 3DS card results in an error HOT 1
- Display a notice when the empty state Connect API oauth URL is missing
- Update the empty state connect flow to support connecting test mode
- Why is stylesheet with ID 'wc-stripe-blocks-checkout-style' enqueued everywhere?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from woocommerce-gateway-stripe.