#mamtabajaj_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/1475874833580687383
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi there, can you describe what you mean by OTP? At what point in your flow does this occur? I want to be sure we're on the same page with terminology
with OTP I mean 3DS
I executed two scenarios
In First case, stripe ask for 3DS at upfront payment, and later subscription was scheduled and active successfully
In second case, with same card, 3ds was not requested in upfront payment, but then subscription was marked as Incomplete
With message "3ds verification incomple"
are you using default_incomplete when creating your Subscriptions? https://docs.stripe.com/billing/subscriptions/overview#payment-behavior
const subscription = await stripe.subscriptions.create({
customer: customerId,
items: [{ price: subsPriceId }],
off_session: true,
payment_behavior: 'allow_incomplete',
automatic_tax: {
enabled: true,
},
default_payment_method: paymentMethodId,
payment_settings: {
save_default_payment_method: "on_subscription",
},
metadata: {
source: "checkout",
paymentIntentId,
}
});
yes I do have allow_incomplete
default_incomplete is generally recommended over allow_incomplete to allow you to handle 3DS scenarios for Subscriptions
subscription is created couple of days after the upfront payment
At that time, I don't have hold of customer
Customer makes upfront payment, and system ship the product. when product is delivered monthly subscription is started for customer until he keeps the product
So customer interaction is available during upfront payment only
I see, so is the upfront payment being handled with a Payment Intent with setup_future_usage: off_session?
Yes at the time of create payment intent I am using below api call
const paymentIntent = await stripe.paymentIntents.create({
amount: totalAmount, // already discounted before sending
currency: mainPrice.currency,
customer: customer.id,
automatic_payment_methods: { enabled: true },
setup_future_usage: "off_session",
metadata: {
mainPriceId,
subsPriceId,
baseAmount,
shippingAmount
}
});
here I have setup_future_usage: "off_session", parameters
got it, thanks. so even when using setup_future_usage, it's still possible for the issuing bank to request 3DS on subsequent payments. Stripe doesn't control this, it's up to the bank. when this happens for an off-session payment, like a subscription payment, you'll need to redirect your customer bank to your site so that they can go through the 3DS flow and complete the payment
but how we can redirect customer to 3DS flow
this is automated and behind the scene when customer is not present
do we need to send the invoice over email or something?
you would need to send an email to the customer with a link to bring them to your site
you mean invoice link?
I have to send the invoice link over customer email right ?
there ?
yes, that would work. I would recommend testing this flow using Subscription Test Clocks, just to make sure it works https://docs.stripe.com/billing/testing/test-clocks you can start the Subscription with a test card that doesn't require 3DS, then update the Subscriptoin to use the test card that always requires 3DS, to see how this would work
ok, thanks!
there ?
yes, did you have another question?
yes
Query:-
at the time of update payment intent I am calculating the tax based on address and when confirm the payment intent stripe dashboard have 2 entries under transaction
- with label :- out of bond
- with label payment intent Id
in the stripe dashboard.
does this default stripe behaviour in case of slaes tax calculation?
we're not super familiar with the dashboard or tax calculation in this channel, but I can try to answer. can you paste the ID of the Payment Intent here? it would look like pi_1234abcd
pi_3T47qJD8a3BxMYPJ1GpkMLFB
above image is from test and payment intent ID is from LIVE enviornment
this is live transaction screenshot
ah, so this is for invoice payments, can you share the Invoice ID? in_1234
my suspicion is that these are actually two separate transactions with the same amount. the "Paid out of band" sounds like an Invoice that was paid out of band separately from the Payment Intents you supplied
I created the manually invoice
for the payment upfront payment
under invoices stripe shows one entry but under transaction it has 2 entries
invoice id is
in_1T47wsD8a3BxMYPJa2e6OEGW
I just need to confirm that is this stripe default behaviour
got it, thanks for providing that Invoice ID. let me try to replicate this behavior, one moment
Ok
so yes, this is expected behavior, since you're creating a Payment Intent and then creating an Invoice and paying it out of band, this will create two separate records
Ok
Thanks for the clarification
Please confirm , stripe will charge to customer only one and generate 2 transaction entries because of sales tax right?
Hi there. I'm taking over for denton here, who had to step away
Ok
Please confirm , stripe will charge to customer only one and generate 2 transaction entries because of sales tax right?
give me a moment to catch up on your thread
ok
Okay, so for the smaller amount that says "pending" in the most recent screenshot - are you creating that PaymentIntent manually for a sales tax amount and attaching it to your Invoice?
I'm just trying to understand where that numer is coming from
Actually I create and updated the payment intent using api with the sales tax based on address. i can see the 2 entries under transaction but under invoice i have one entry
after creating the payment intent I amn creating invoice with "paid out of bond"
And your question is about the PaymentIntent that you've created previously, right?
so what's the PaymentIntent that corresponds to in_1T47wsD8a3BxMYPJa2e6OEGW?
yes
so what's the PaymentIntent that corresponds to in_1T47wsD8a3BxMYPJa2e6OEGW?
pi_3T47qJD8a3BxMYPJ1GpkMLFB
okay - this is just a one-off PaymentIntent which has already been paid. It may represent something related to in_1T47wsD8a3BxMYPJa2e6OEGW in your accounting, but it doesn't have a relationship with that Invoice in Stripe
in_1T47wsD8a3BxMYPJa2e6OEGW is marked paid out of band, so there is no charge to the Customer
Sure thing
Can I discuss
By all means
I have created the customer and payment intent and when payment confirm I have updated the payment customer name,email and address information after webhook response. I am using the saved payment method to start the subscription later on after few days. please clarify is the below step required when I call the udate customer api
await stripe.customers.update(customer.id, {
invoice_settings: {
default_payment_method: paymentmethodId,
},
});
so I need to specify the invoice_settings parameter as well at the time of update customer information like email,name and address
invoice_settings parameter is required when I used the saved payment method to start the subscription without user interference
Setting that parameter means that the payment method set as the value will be the default payment method used for all Subscriptions and Invoices where the Payment Method is not explicitly defined on the individual Invoice or Subscription
It isn't strictly speaking necessary, because you could instead choose to manage the Payment Method at the level of the individual Subscription or Invoice. But you have to do one or the other
To sum up, when Stripe chooses what payment method to charge for a Subscription or Invoice, the Payment Method set as default_payment_method on the Subscription or Invoice has precedence, if set, and after that we fall back to customer.invoice_settings.default_payment_method
Ok thank you
Hi there, I took over for my colleague who had to step away...
You're welcome
I have no other queries thank you
Perfect! Have a great rest of your day.
You too