#Sapna Verma
1 messages · Page 1 of 1 (latest)
👋 happy to help
how are you making the payment?
are you creating a separate Payment Intent?
just using customer api to create a customer and creating a subscription using subscription API
thats all
I am allowing the customer to make a payment before the trial ends
what does that mean?
The card details are entered by the customer before the trial ends.
but the subscription will be started at the end of the trial
shall i use trial_end parameter to take a timestamp
I'm not sure I follow
when the trial ends a new invoice is generated and automatically paid using the Payment Method that was saved upon subscription creation
the trial_end timestamp will be used for the end of trial and payment - right?
just confirming
will the paymentIntent be created automatically on subscription creation?
there won't be a Payment Intent directly
Subscriptions create Invoices
Invoices would have a PaymentIntent if its due amount is more than 0
and they get automatically paid
please read through this https://stripe.com/docs/billing/subscriptions/overview page specifically https://stripe.com/docs/billing/subscriptions/overview#subscription-lifecycle
no, if a subscription is created with a trial or with a first zero-invoice then the subscription's pending_setup_intent field will be populated
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
can we find out the status of paymentIntent when a subscription is created
in subscriptions what's important is the status of the invoices
it is written that stripe.confirmPayment needs to be called to setup payment
that's wrong
will this Js call the API- Confirm a PaymentIntent
yes
confirmPayment confirms a Payment Intent
while confirmSetup confirms a Setup Intent
You chose to use Payment Elements to collect the Payment Methods upon creating the Subscription?
if the subscription has a trial period then yes
on Subscription creation you need to expand on pending_setup_intent and send the client_secret to the front-end to use with the Payment Element to confirm the Setup Intent
can you refer this to a doc where i can go through the details, I am not able to find them on search
there is no page for this
so I should be calling confirmPayment to confirm a Payment Intent
while confirmSetup to confirm a Setup Intent, that is saving the payment details?
i think setupintent is used to save the payment details in a subscription..right
correct
so I should call confirmPayment and confirmSetup both
If your subscription doesn't have trial (1st invoice !=0) you would need to expand on latest_invoice.payment_intent and use the client_secret from the PI to send to the front-end and use the confirmPayment to save the PM and pay the first invoice
If your subscription has trial or 1st invoice = 0 you would expand on pending_setup_intent and sue the client_secret from the SI to send to the front-end and use the confirmSetup to save the PM for future payments on the subscription
I am not able to find latest_invoice.payment_intent
did you create a subscription with trial period?
yes
then it's the second scenario that you need to do
you said - you would need to expand on latest_invoice.payment_intent, what do you mean by expand on?
please read the whole sentence
If your subscription doesn't have trial (1st invoice !=0) then ...
yes...then what is expand on
you would expand on pending_setup_intent...what do you mean by expand on?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
hi, I also read in the docs-- Use stripe.confirmPayment to complete the payment using details from the Payment Element and activate the subscription. This creates a PaymentMethod and confirms the incomplete Subscription’s first PaymentIntent, causing a charge to be made.
Hey, taking over here. Let me know if there's any follow-up Qs I can answer!
What is the exact ask here ?
if i create a subscription, do i need to call both confirmSetup and confirmPayment?...as i am saving as well as taking payment details
I read that in https://stripe.com/docs/payments/accept-a-payment-deferred?type=setup#additional-options
please confirm?
i set the mode to subscription
For subscription you need to follow this guide actually:
https://stripe.com/docs/billing/subscriptions/build-subscriptions
i am confused to use stripe.confirmPaayment and stripe.confirmSetup. Will I use both?
@fringe cypress it depends on whether you're always giving a free trial at the beginning of the subscription or not
okie
If you're not always going to give the free trial then you need to implement both
what coding language are you using?
php
$stripe->subscriptions->create([
'customer' => 'cus_xxx',
'payment_behavior' => 'default_incomplete',
'payment_settings' => [
'save_default_payment_method' => 'on_subscription'
],
.... // here you add trial, items, etc...
'expand' => ['pending_setup_invoice', 'latest_invoice.payment_intent']
]);
after that you check whether pending_setup_invoice or latest_invoice.payment_intent are null or not and based on that you return a hash something like
{
type: 'setup' | 'payment'
client_secret: (either `pending_setup_invoice.client_secret` or `latest_invoice.payment_intent.client_secret`)
}
and based on the type you choose confirmSetup or confirmPayment
is that clear for you @fringe cypress
first time the ConfirmSetup will be written and next time on subscription renewal, when there is no trial I will use confirmPayment....
next time you don't have to do anything
since we automatically charge the Payment Method
you don't have to do anything unless there's an action required
okay..i was confused because in this it is written that you call ConfirmPayment https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements#display-payment-method
as explained here https://stripe.com/docs/billing/subscriptions/webhooks#additional-action
this is in the case that you have the first invoice that needs payment
when there's no trial nor discount
okay, clear
thanks
Also, it is written that the return_url should correspond to a page on your website that provides the status of the payment, by verifying the status of the PaymentIntent when rendering the return page. Inspect the status of the PaymentIntent to decide what to show your customers.
will I be using the status of Setupintent instead of paymentintent?
yes
great, thanks
Also, In case of charging at the end of trial or immediately, I need to pass the relevant timestamp to the trial_end parameter --right?
you can either pass trial_end or trial_period_days to specify how long the trial period is
then you don't specify trial at all
https://stripe.com/docs/api/subscriptions/create#create_subscription-trial_end
https://stripe.com/docs/api/subscriptions/create#create_subscription-trial_period_days
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
these are the parameters you need to use when creating
you need 1 not both
it just that some trial days have passed and payment details are provided and the charge is requested immediately
I don't follow
then can i use now
you don't know how long the trial period is on creation?
no, intially the account is created only on y application and the trial goes on ...some trial days have passed, not all and payment details are provided by the customer and they want the charge immediately and not untill the end of trial.
yes in that case you update the subscription with trial_end = 'now' https://stripe.com/docs/api/subscriptions/update#update_subscription-trial_end
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
thanks
In case of failed payments, we will need to create the paymentIntent ...through confirmPayment..right?
to allow adding a new payment method
you don't create a new Payment Intent you use the existing one on the invoice
yes
what i used on the invoice was setupIntent, shalli use the same to update the default payment method
the payment might fail once you have an invoice with a Payment Intent that fails
you would need to use that same Payment Intent from that invoice
u mean the setupIntent as that i i used while using trials
no
that Setup Intent is used once
and you forget about it
each new cycle there's going to be a new Invoice
and each Invoice will have its own Payment Intent
okay..and a payment.intent is automatically created ? without caling confirmPayment method
the confirmPayment (as its name sounds) confirms the Payment on the frontend when the user enters the payment details
the creation happens automatically
If I am not using Stripe Invoice and will be using my own invoicing solution...would i able to find the paymentIntent somewhere
please answer
Hi there 👋 jumping in as my teammate needs to step away. If you are creating and handling your own Invoices outside of Stripe, then a Payment Intent will likely not be created automatically and you will need to create one for processing the payment.
No, if there is no Invoice in Stripe then none of our Invoice-related features will operate. You will not receive Invoice related events.
okay, so when i create a setupIntent to save the PM details, I must also create a paymentIntent using confirmPayment ?
because the first payment will not create the paymentIntent automatically
the one that is created on first payment...in my case i will have to create a payment intent
@fringe cypress you're allover the place, if you're using the Subscriptions API, Invoices will be generated for you automatically upon each cycle renewal
you don't have to worry about Setup or Payment Intents
if you want to use your own logic to create the invoices and handle the subscription cycles then please disregard everything we've been discussing in the last couple of days and let's start over this whole conversation
it's another approach and a totally different implementation path
you need to decide on which path you want to follow
i will have to go through the another approcah
which one? please be precise
if you want to use your own logic to create the invoices and handle the subscription cycles
or any related subscription events
you would have to build the scheduler logic yourself
any reference in the docs
no there isn't since this is not something related to Stripe directly
i am lost...is there anything like Intents i need to use
I'm not sure why you want to reinvent the wheel here, what is it with Stripe's Subscription that is not compatible with your use case?
I know you are lost
i am sorry
because we ask you to read through docs and you don't
we explain and you don't listen
oh..i will do that from now on..please forgive
no need for the appology
I'm trying to help you out here, but honestly you're doing yourself a disservice by not listening
let's go back to point zero
forget about Intents/Subscriptions/Invoices
okay
You have a customer right?
yes..
you want them to have access to a certain service of yours and in return you want them to pay for a recurring fee right?
yes
on the first subscription only
not on renewing the subscriptions
on the three products i ahve
so always you have a free trial at the start of any of your Subscriptions, right?
yes
you will never have the case where you don't want to offer a free trial upon subscribing
no
ok perfect
you also want to listen to events to know when the subscription is paid for
yes
yes
any reasons why?
no reasons, just that the low code option gives less flexibility
what is the flexibility that you are searching for?
wanted to try intents as a custom code
what do you need that Checkout doesn't give you access to?
I really need to understand so I would be able to guide you through your integration
well i can use checkout,...but that also creates intents
so used the subscriptions instead
@fringe cypress unless I mention intents please forget about them now
ok
Stripe Checkout has 3 modes (something I explained yesterday)
1- payment
2- setup
3- subscription
ok
each mode offers a different functionality
yes
in Setup mode for example you can collect a payment method for a customer without charging them
ok
in Subscription mode, you collect a payment method for a customer and Checkout will create a subscription for you
ok
so now I will ask my question again: what do you need that Checkout doesn't give you access to?
nothing ..i can use checkout
yes...shall I use the setup mode since that saves the payment method
for future use
so use the subscription mode
save the Payment Method for future payments
and create the Invoice and do everything
the only thing you need to worry about is listening to the webhook events
and figure out what to do to fulfill the order
i wont be using invoices from Stripe
but that's a story for the next episode
you can generate your own invoices on the side
but you can't have Subscriptions without Invoices
that's not possible with Stripe
but invoice is an additional add on as it's charged saperately
i dont want to buy that option
you don't pay extra for invoices if you're already using Subscription
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Recurring Invoices are part of the starter pack
for Billing
it's the One-time Invoices that you would have to pay extra to get access to
whats the difference...
let me go back a second
Stripe Invoicing has no fixed fees or setup costs, but Stripe Payments pricing will apply. If you're a business with large invoice amounts, contact sales to discuss pricing options.
if you use Payment Intents you would be subject to this pricing model https://stripe.com/pricing
whereas if you use Billing (creating a subscription) you would be subject to this pricing model https://stripe.com/billing/pricing
View Stripe fees and pricing information. Explore pricing by product, by payment method including credit and debit cards, or design a custom pricing package.
yes the best thing to do is to contact https://support.stripe.com/?contact=true for pricing questions
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
maybe figure out this part to know whether you want to use Billing or not first
and then based on this decision we can proceed with the appropriate approach then
ok, so i should use checkout
are you going to use Billing?
let me go back and think of it...
i will connect with you tomm
it's time to go home for me
thanks for helping this long
no worries take your time, think about this and once you have a decision made please do come back
bbye