#dbjpanda

1 messages ยท Page 1 of 1 (latest)

dense cairnBOT
glacial plank
#

Hi there

#

No this Hosted Invoice Page isn't customizable at all

orchid cave
#

Can I create my own hosted invoice page?

glacial plank
#

Yeah you can create your own payment page and use the PaymentIntent's client secret generated by the Invoice to pay

orchid cave
#

Sorry, I couldn't find how to create an invoice hosting on my server.

glacial plank
#

Are you trying to create a Subscription or a one-off Invoice?

orchid cave
#
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.
glacial plank
orchid cave
#

If I create a payment form on my own, I can customize the text that I initially wanted to. Right?

glacial plank
#

Yep you have full control if you create your own form

orchid cave
#

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?

glacial plank
#

What type of collection_method are you using?

#

Are you using charge_automatically or send_invoice?

orchid cave
#

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

glacial plank
#

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?

orchid cave
#

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.

glacial plank
#

Right that is how pending_if_incomplete works. It won't actually perform the update until a successful payment occurs

orchid cave
#

My question is why it doesn't perform the update?

glacial plank
orchid cave
#

I am looking at the docs.

glacial plank
#

The update won't be performed until payment is successful

#

Otherwise the update won't occur

orchid cave
#

And why payment is unsuccessful?

#

until user perform a confirmation action

glacial plank
#

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

orchid cave
#

I can create an example in 10 mins.

glacial plank
#

Sure

orchid cave
#

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.

glacial plank
#

I need the Subscription ID which looks like sub_xxxxxx

orchid cave
#

sub_1MtefxSBUAj5B2VA55pez6d3

azure ivy
#

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

orchid cave
#

I am looking at the docs

azure ivy
#

๐Ÿ‘ sounds good, let me know if there are any other questions I can help answer.

orchid cave
#

every time, a subscription is updated, does the user needs to complete the 3D challenge?

azure ivy
#

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.

orchid cave
#

hopefully I can pass the setup_future_usage: off_session parameter in create checkout session also?

azure ivy
#

If you're creating Checkout Sessions with mode: subscription then I believe that is done for you automatically.

orchid cave
#

Yes, I set mode subscription. However, setup_future_usage: off_session does not work for stripe.checkout.sessions.create

azure ivy
#

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.

orchid cave
#

Well. I understand.

#

However, when I try with 4242424242424242 test card, the payment is still incomplete. I hope it does not require 3D pin

azure ivy
#

Hm, just noticed this is for India, where I know the RBI regulations make things more complicated but don't recall exactly how offhand.

orchid cave
#

You mean for India, every card requires 3D pin?

#

including test card?

azure ivy
#

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.

orchid cave
#

So, stripe sends a notification every month before deducting the subscription amount?

azure ivy
#

That is my understanding

orchid cave
#

Hopefully, I don't need to do anything from my end. Stripe takes care of this. Is it?

azure ivy
#

Yes

dense cairnBOT