#[LBG] India-subscription

1 messages · Page 1 of 1 (latest)

jaunty saddle
#

Hi! How are you creating your subscriptions? With Checkout Sessions or directly with a Subscription ?

waxen current
#

Directly with a sub

jaunty saddle
#

Then you can only pass recurring prices when creating the subscription. However you could create an invoice item for the customer first, and then when you create the subscription, that item will be automatically added to the invoice object of the subscription.

waxen current
#

My goal is to create a recurring subscription with a one time initial fee

#

That the customer would confirm on frontend

jaunty saddle
#

If you want the one time initial fee to be included in the first invoice of the subscription, then use the solution I described above. If you want it to be a separate payment, then create a new PaymentIntent for this.

waxen current
#

Ok

#

Do you have more details about the workflow you described please ?

jaunty saddle
#

Sure:

  1. Create an invoice item for the customer, for with the one time fee amount
  2. Then create the subscription like you would normally do
  3. The invoice item you created in step 1 will be automatically added to the first invoice of the subscription you created in step 2
waxen current
#

Isn't this a shortcut ?

#

cus_LdFsYATgpYdkxa

#

Seems to work

jaunty saddle
#

True, you could use that too!

waxen current
#

req_C6KPrYkz7uwYmP

#

Do you confirm that I need to build a PaymentElement (I want it custom) to collecte credit card information and confirm the subscription AND the initial payment intent ?

jaunty saddle
waxen current
#

Checking on it

#

Will the credit card collected be set to be the default payment method of the subscription ?

jaunty saddle
waxen current
#

Ok

#

Does PaymentElement gives access to Googlepay ?

#

Or ApplePay ?

jaunty saddle
#

Yes, both.

#

you can see a live example at the top of the link I shared before.

waxen current
#

The payment methods that are displayed to the customer depends on the ones activated right ?

#

If we activated credit card (default), googlepay and apple only, and if we use PaymentElement (we don't use Card Element), then only those 3 payment methods can appear ?

jaunty saddle
#

Yes, that's correct. Though a customer will never see both Apple Pay and Google Pay at the same time, because they work in different browsers (Google Pay is chrome only, and Apple Pay is Safari only).

waxen current
#

Yes sure

jaunty saddle
#

Also note that if the customer doesn't have a card in their Google/Apple wallet, they won't see the Google/Apple button.

waxen current
#

Yes

#

It's possible that they see "credit card" only

jaunty saddle
#

Exactly.

waxen current
#

Ok

#

Still working on confirming the payment

#

Should we use stripe.confirmPayment and not stripe.confirmCardPayment event though it is a credit card to confirm because we are using PaymentElement and not CardElement ?

jaunty saddle
#

If you are using the Payment Element, then you need to use confirmPayment

waxen current
#

Ok, what is the difference between stripe.confirmPayment and stripe.confirmCardPayment ?

jaunty saddle
#

If you are using the Card Element, you need to use confirmCardPayment. But this would only accept the card payment method, and nothing else (so no Google/Apple pay).

waxen current
#

can we choose the language of the custom payment Element ?

jaunty saddle
waxen current
#

Ok

#

Do you confirm that we can copy paste the code and it should work ?

#

(just changed the return URL)

jaunty saddle
#

Yes, assuming you are using a similar HTML, so that const form = document.getElementById('payment-form'); exists with a submit button on your page.

waxen current
#

Why is the ConfirmPayment displaying all thoses params in the URl ?

#

We only added stripe=ok to test

#

I think i sax on the Stripe doc that the client secret should not appear in the URL

#

Nevermind

jaunty saddle
waxen current
#

Great

#

There is also redirect_status=succeeded

#

In the URL params

#

Does this tells us that de payment intent went OK or it's only for the redirection ?

jaunty saddle
#

if you are redirected to the page, it means the payment succeeded. otherwise if there was an error, you would stay on the Payment Element page.

waxen current
#

Ok so if we are redirected, it means the initial fee was paid, the subscription is created, and the payment method is saved ?

#

Even after a 3DS ?

#

What if the card has insuficient funds after a 3DS ?

jaunty saddle
#

Ok so if we are redirected, it means the initial fee was paid, the subscription is created, and the payment method is saved ?
Yes!
What if the card has insuficient funds after a 3DS ?
You can try that with a test card with one of our test cards, for example 4000000000009995 https://stripe.com/docs/testing#declined-payments

#

In this case you won't be redirected, and you can display an error message to the customer on the page.

waxen current
#

Ok i'll try this

#

Can we add fields to the payment Element ?

#

Like asking the name

jaunty saddle
#

No you can't add fields to the Payment Element itself, but you could add your own inputs on the page to collect extra information if needed.

waxen current
#

I'm asking because when using stripe Checkout :

#

But when using Payment Element :

#

There is no name on the payment method

#

Might be this right ?

dapper phoenix
#

hey @waxen current, I'm taking over from @jaunty saddle just give me a couple of minutes to catch up

waxen current
#

Hello @dapper phoenix

dapper phoenix
waxen current
#

I can't collect a name for the card number ?

dapper phoenix
#

as @jaunty saddle stated above unfortunately you can't with PaymentElement, but you can add your own inputs to collect all sorts of other data you need

waxen current
#

Not having an owner name on the payment method will not affect the payments?

dapper phoenix
#

It depends on the Payment Method Types

waxen current
#

Credit cards

dapper phoenix
#

In credit cards it's not necessary

waxen current
#

is it possible to make a payment intent off_session with a payment method (credit card) that has been authenticated with 3DS fews seconds ago ?

dapper phoenix
#

you could always do that, but we can't guarantee that the issuer bank would not require authentication (3DS) again at any point

waxen current
#

At the end of this step, once redirected, you fetch the pi_ status to check if it has succeeded

dapper phoenix
#

yes

waxen current
#

Why doing so if the customer is redirected ONLY IF it has succeeded ?

dapper phoenix
#

this is in the case you're not using webhooks, which is not what we really recommend

regal tinsel
#

@waxen current what's the question?

waxen current
#

@jaunty saddle confirmed that once redirected it means the payment has succeeded

regal tinsel
#

true! never hurts to check I suppose, since you want to be sure before provisioning access to your product to the customer.

waxen current
#

Ok

waxen current
#

Does stripe.confirmPayment generates a webhook event ?

regal tinsel
#

yep

#

for example, payment_intent.succeeded. (you can test it in test mode and see exactly what happens and look at your Stripe dashboard for logs and events).