#dbjpanda
1 messages ยท Page 1 of 1 (latest)
Can I create my own hosted invoice page?
Yeah you can create your own payment page and use the PaymentIntent's client secret generated by the Invoice to pay
See: https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements for instance if you are using Subs
Sorry, I couldn't find how to create an invoice hosting on my server.
Are you trying to create a Subscription or a one-off Invoice?
const subscriptionSwitched = await stripe.subscriptions.update(
userData.current_plan.subscription_id,
{
items: [{
id: userData.current_plan.item_id,
price: price_id,
}],
proration_behavior: 'always_invoice',
payment_behavior: 'pending_if_incomplete',
expand: ['latest_invoice.payment_intent'],
billing_cycle_anchor : 'now',
proration_date: userData.current_plan.start_date
},
);
return subscriptionSwitched.latest_invoice.hosted_invoice_url //This is currently giving me stripe hosted invoice. But I want to create a customized invoice on my server.
Okay yeah so this is already going to have the Invoice created via the update. You get that Invoice's PaymentIntent's client secret via subscriptionSwitched.latest_invoice.payment_intent.client_secret. You then pass this to your client and render Payment Element like we show here: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements
If I create a payment form on my own, I can customize the text that I initially wanted to. Right?
Yep you have full control if you create your own form
Thanks. I have another query.
When a customer updates his subscription, it asks for a confirmation by giving a hosted invoice url like below. It particularly helps customer who have enabled 3d secure card.
`const subscriptionSwitched = await stripe.subscriptions.update(
userData.current_plan.subscription_id,
{
items: [{
id: userData.current_plan.item_id,
price: price_id,
}],
proration_behavior: 'always_invoice',
payment_behavior: 'pending_if_incomplete',
expand: ['latest_invoice.payment_intent'],
billing_cycle_anchor : 'now',
proration_date: userData.current_plan.start_date
},
);
return subscriptionSwitched.latest_invoice.hosted_invoice_url
`
How can we prevent this step and directly deduct the money without confirmation?
What type of collection_method are you using?
Are you using charge_automatically or send_invoice?
Basically, I use stripe.checkout.sessions.create with mode:subscription for charging a customer for the first time. So I believe, it is by default charge_automatically
Oh okay then if you have a default PaymentMethod set for the Customer or Subscription there should be an automatic payment attempt
You are saying you aren't seeing that happen?
My concern is when a customer update his subscription manually.
Since I have set payment_behavior: 'pending_if_incomplete' so it does not upgrade the subscription. And payment is incomplete until the customer pays the difference amount.
Right that is how pending_if_incomplete works. It won't actually perform the update until a successful payment occurs
My question is why it doesn't perform the update?
Have you read through https://stripe.com/docs/billing/subscriptions/pending-updates ?
I am looking at the docs.
The update won't be performed until payment is successful
Otherwise the update won't occur
If 3DS is required then confirmation is necessary
Do you have an example Subscription I can look at?
Then we can talk in specifics instead of hypotheticals
I can create an example in 10 mins.
Sure
where can I check If 3DS is required or not? Can I see it in Stripe Dashboard?
I also have an example. Let me know what info do you need to check the issue.
I need the Subscription ID which looks like sub_xxxxxx
sub_1MtefxSBUAj5B2VA55pez6d3
Hi there ๐ jumping in as my teammate needs to step away. Please bear with me a moment while I take a look at that Subscription.
Yes, it looks like a 3DS challenge needs to be completed for that payment to progress. You can see this if you look at the status of the Payment Intent associated with the Invoice, where you'll see a status of requires_action which indicates customer action is required.
I believe that detail is exposed in the response to your request to update the Subscription:
https://dashboard.stripe.com/test/logs/req_uOKopNz7bH4ohl
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
I am looking at the docs
๐ sounds good, let me know if there are any other questions I can help answer.
every time, a subscription is updated, does the user needs to complete the 3D challenge?
We won't have insight into that, as it is up to the issuing bank to determine whether or not they require 3DS to be completed for a payment to be successful.
If the Payment Method was previously set up using either a Setup Intent or a Payment Intent using setup_future_usage: off_session, then we do everything we can to reduce the likelihood of 3DS challenges needing to be completed on renewals but it is ultimately up to the customer's bank whether a challenge needs to be completed.
hopefully I can pass the setup_future_usage: off_session parameter in create checkout session also?
If you're creating Checkout Sessions with mode: subscription then I believe that is done for you automatically.
Yes, I set mode subscription. However, setup_future_usage: off_session does not work for stripe.checkout.sessions.create
That is expected, setup_future_usage is not a valid top-level parameter when creating a Checkout Session, a full list of supported parameters and where they're located in our data structure can be found in our API reference:
https://stripe.com/docs/api/checkout/sessions/create
You don't need to try to include the setup_future_usage when in subscription mode, because in this case we are pretty confident the payment method details being collected will be reused for future off-session payments, so we automatically try to setup the payment method for future off-session usage.
Well. I understand.
However, when I try with 4242424242424242 test card, the payment is still incomplete. I hope it does not require 3D pin
Hm, just noticed this is for India, where I know the RBI regulations make things more complicated but don't recall exactly how offhand.
No, I don't think so, but I don't recall exactly how the process changes for India and am trying to double check that.
If you would like to review as well, this is the relevant document:
https://stripe.com/docs/india-recurring-payments
So, stripe sends a notification every month before deducting the subscription amount?
That is my understanding
Hopefully, I don't need to do anything from my end. Stripe takes care of this. Is it?
Yes