#simp_code

1 messages ¡ Page 1 of 1 (latest)

lofty merlinBOT
#

👋 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.

whole swallowBOT
#

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.

teal flame
outer ocean
#

i only used PaymentIntent in my backend and connected stripe pages

teal flame
outer ocean
#

oh ok thanks

teal flame
#

No problem, glad I could help!

outer ocean
#

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"

teal flame
#

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
outer ocean
#

do you have any sample code for this

teal flame
#

Which part?

outer ocean
#

after successful payment fetch receipt_url and balance_transaction

teal flame
#

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

outer ocean
#

ok

lofty merlinBOT