#reyanchougle
1 messages · Page 1 of 1 (latest)
Hi, what are your queries?
Hey..
Basically I want know that suppose if a user is from india then I need to pass inr as currency. If I pass usd then it has some Non NRI prerequisites and unble to process it further. So what is the recommended way? Shall we pass the currency specific to the user's country who is making the payment like for india it would be inr. For USA it would be usd
?
Normally you should decide the currency first, and then your customer will need to pay in that currency.
But I agree it's a reasonable request to display different currencies to customers, will record your feedback
But now what currency should I pass to session? When I pass usd it do not work for indian cards. When I pass inr then it works
Sir. Please respond fast I have few more questions to ask
My suggestion would be create 2 Sessions for customers using usd and inr
You can write in Support to see if they have any Beta program for multiple currencies in Checkout
(They probably have, but depends on your Stripe account)
Sure please write all your questions down and I will try to address one by one
oh ok.. So it depends on the country the stripe account belongs to
Question - When I pass UnitAmountDecimal as 1985.52, it becomes 19.85 and when I pass 1985.52 * 100.00, it becomes the correct amount 1985.52. Is this the way we need to send the amount? Total_Amount * 100.00
Question - Can a customer belong to multiple recurring subscriptions at on time?
Question - Will I always get subscriptionId in webhook?
Question - is there any parameter in webhook to identify if the payment is done for first time or is it automatic recurring?
Is this the way we need to send the amount? Total_Amount * 100.00
Yes because most currency expectamountin smallest unit. $1 = 100 cents and we take the amount by cents. More info: https://stripe.com/docs/currencies#zero-decimal
Question - Can a customer belong to multiple recurring subscriptions at on time?
Yes
Question - Will I always get subscriptionId in webhook?
Yes you should
In case of failure as well?
Question - is there any parameter in webhook to identify if the payment is done for first time or is it automatic recurring?
Depends on which webhook event you are looking at
I am monitoring checkout.session.completed, invoice.paid and invoice.payment_failed
is that a concrete way to identify it the webhook is for recurring and not for first payment?
Okie, checkout.session.completed is only for the first Payment
checkout.session.completed is only for success right? When there is a failure it will return invoice.payment_failed even in first payment right?
invoice.paid and invoice.payment_failed could be both first Payment or recurring payment, but you can look at its billing_reason https://stripe.com/docs/api/invoices/object#invoice_object-billing_reason to see if it's subscription_create or subscription_update
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Yes, correct
I would suggest testing in Test mode
you have Test Clock to manipulate Test Subscriptions
ok
The billing_reason can be used to identify if it is first payment or automatic recurring right?
Yep
Support we need to cancel the subscription when it expires so I am using below code in .net
var sessionSubscriptionService = new Stripe.SubscriptionService();
await sessionSubscriptionService.UpdateAsync(id, new Stripe.SubscriptionUpdateOptions
{
CancelAtPeriodEnd = true
});
Is this fine?
Look fine to me but you can test it freely in Test mode
Yeah sure
The session object and the subscription object will be one for all first and recurring payments right?
Yes of course
Is subscription created in case of invoice.payment_failed or when we get failure url callback?
No it won't I believe