#simp_code
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/1269967204531568652
đ 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.
They're both available on the related Charge object: https://docs.stripe.com/api/charges/object
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
i only used PaymentIntent in my backend and connected stripe pages
There's always an underlying Charge object once the intent succeeds, you can find (and expand) it on the Payment Intent object: https://docs.stripe.com/api/payment_intents/object#payment_intent_object-latest_charge
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
oh ok thanks
No problem, glad I could help!
var options = new PaymentIntentCreateOptions
{
Amount = cents,
Currency = "usd",
AutomaticPaymentMethods = new PaymentIntentAutomaticPaymentMethodsOptions
{
Enabled = false,
},
PaymentMethodTypes = new List<string>
{
"card",
}
};
var serviceToken = new PaymentIntentService();
var intent = await serviceToken.CreateAsync(options);
response.clientSecret = intent.ClientSecret;
response.paymentIntentId = intent.Id;
so in my case how i'll fetch both the "receipt_url" AND "balance_transaction"
Well those wouldn't exist in the intent creation response as they're not sent until the payment succeeds
So you'd either:
- Use a webhook and look up the fields async
- Retreieve the objects post-success
do you have any sample code for this
Which part?
after successful payment fetch receipt_url and balance_transaction
Well you'd retrieve the Payment Intent (https://docs.stripe.com/api/payment_intents/retrieve) and expand (https://docs.stripe.com/api/expanding_objects) the necessary fields: latest_charge.balance_transaction
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ok