#cooper4952_api
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1273277813218082826
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- cooper4952_api, 5 days ago, 4 messages
Why did server close for 5 hours
Hello, we often close it for internal events/meetings and such..
Hmm, I do see a balance transaction associated with the charge..
can you share the exact response you're getting from the API?
[2024-08-14 02:57:15] local.INFO: Stripe\Charge JSON: {
"id": "ch_3Pndx3Qe6SjYWk0Q0R6ZNThf",
"object": "charge",
"amount": 2200,
"amount_captured": 2200,
"amount_refunded": 0,
"application": "ca_LmXJ3DYRiviw6e2OMDZZ774w8m00SxX1",
"application_fee": null,
"application_fee_amount": null,
"authorization_code": "123456",
"balance_transaction": null,
"billing_details": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"email": null,
"name": null,
"phone": null
},
"calculated_statement_descriptor": "WELLGROOMEDPETS.COM",
"captured": true,
"created": 1723629432,
"currency": "usd",
"customer": null,
"description": "Grooming for Cooper",
"destination": null,
"dispute": null,
"disputed": false,
"failure_balance_transaction": null,
"failure_code": null,
"failure_message": null,
"fraud_details": [],
"invoice": null,
"livemode": false,
"metadata": [],
"on_behalf_of": null,
"order": null,
as you see, this is latest_charge. The sdk version is "stripe/stripe-php": "15.6.0"
I think that's expected with capture_method = automatic_async
See: https://docs.stripe.com/payments/payment-intents/asynchronous-capture#opt-in-async-capture
@visual vault if you retrieve the PaymentIntent right now, do you see the balance transaction?
It worked! Thank you
You'd want to wait for charge.updated event before making the API request to retrieve the balance transaction
What do you think regarding asynchronous capture? I mostly use instant capture. webhooks is used for only confirm.
To update user side, I need to us socket?
Think about it in what way? It is fine to use, it is actually the default behavior now because it makes confirm calls faster. If that speed doesn't matter to your integration and having the balance transaction would make it easier for your integration specifying automatic for capture method should be fine for your use case
But yes, a webhook endpoint would be useful for being able to react to the balance transaction being created on your side without polling the charge until it updates
Thank you so much!!! Have a great day