#Manny_Manny_2023
1 messages ยท Page 1 of 1 (latest)
How are you accepting payment from them? Is this through Elements, Checkout, etc?
we are creating subscription through java api using SubscriptionCreateParams
Ok
But how are you collecting payment info from your customers?
Through Elements?
can you tell me what elements is
i do not think we are using elements
What are you using?
That's the backend code
yes we are creating subscription through backend code only
My question is how are you collecting payment method from the customer?
i think we are directing them to a checkout session
So why do you create the subscription separately then? Checkout Sessions can collect payment and start subscriptions all on their own
we also have a requirement where we want to create some subscriptions dynamically and then let users pay at a later day
Ok
Can you share an example payment method id that was collected from one of these checkout sessions? Want to check something
can i give test customer id?
That's fine
cus_OIccPDFOBdzF9D
Ok I see
Ok so back to your original question:
This error is happening because we try to pay the subscription when you create it. You need to set it as default_incomplete if you haven't collected payment yet: https://stripe.com/docs/api/subscriptions/create#create_subscription-payment_behavior
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
which payment behaviour do you suggest when creating a new subscription with no customer payment methods default_incomplete?
if you see my backend code i am using paymentbehaviour allow_incomplete
Yeah use default_incomplete if you haven't collected payment method yet
if we use default_incomplete its saying if subscription is not paid within 23 hours it will expire, what we want to do it create a subscription and allow customer to pay after the first month, so how can we achieve this
Why not wait to create the subscription?
instead of subscription way can we go the subsriptionschedule way and create the schedule for a later day?
Yeah
Recommend only creating a sub once you're ready for the customer to pay
But subscription schedule works too
is there anyway we can set payment method default as card by default?
Hi ๐
I'm stepping in as @gilded minnow has to go.
I'm not sure I understand your question. You can control what payment method types are allowed for any subscription or subscription schedule.
we are using allow_incomplete default behaviour when creating subscription through java backend api and its aasking us to set default_payment_method
how can i set default_payment_method for customer?
Does your customer already have a saved payment method?
no
Okay so that would be an important first step. You cannot set a default_payment_method until the Customer has a saved payment method
can se set default_payment_method as card?
I think you are confusing things here
The default_payment_method requires an actual payment method object
Meaning you have saved a customer's payment method details to Stripe and set it on the Subscription.
I think you are asking if you can set the default payment_method_type
You can specify the types of payment methods you will accept for each subscription in the payment_settings.payment_method_types parameter: https://stripe.com/docs/api/subscriptions/create#create_subscription-payment_settings-payment_method_types
can i get the payment method id from checkout and pass it to susbcription, as we are doing both one time and subscriptiion
Sure, you can configure your Checkout Session to save the payment method data
Do you haven an example Checkout Session ID I can review?
itss working i tried passing the payment method from stripe checkout, thank you so much for all your help, good day