#Manny_Manny_2023

1 messages ยท Page 1 of 1 (latest)

reef otterBOT
gilded minnow
#

How are you accepting payment from them? Is this through Elements, Checkout, etc?

flat edge
#

we are creating subscription through java api using SubscriptionCreateParams

gilded minnow
#

Ok

#

But how are you collecting payment info from your customers?

#

Through Elements?

flat edge
#

can you tell me what elements is

gilded minnow
#

How are you collecting payment info from your customers?

flat edge
#

i do not think we are using elements

gilded minnow
#

What are you using?

flat edge
gilded minnow
#

That's the backend code

flat edge
#

yes we are creating subscription through backend code only

gilded minnow
#

My question is how are you collecting payment method from the customer?

flat edge
#

i think we are directing them to a checkout session

gilded minnow
#

So why do you create the subscription separately then? Checkout Sessions can collect payment and start subscriptions all on their own

flat edge
#

we also have a requirement where we want to create some subscriptions dynamically and then let users pay at a later day

gilded minnow
#

Ok

#

Can you share an example payment method id that was collected from one of these checkout sessions? Want to check something

flat edge
#

can i give test customer id?

gilded minnow
#

That's fine

flat edge
#

cus_OIccPDFOBdzF9D

gilded minnow
#

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

flat edge
#

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

gilded minnow
#

Yeah use default_incomplete if you haven't collected payment method yet

flat edge
#

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

reef otterBOT
gilded minnow
#

Why not wait to create the subscription?

flat edge
#

instead of subscription way can we go the subsriptionschedule way and create the schedule for a later day?

gilded minnow
#

Yeah

#

Recommend only creating a sub once you're ready for the customer to pay

#

But subscription schedule works too

flat edge
#

is there anyway we can set payment method default as card by default?

next river
#

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.

flat edge
#

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?

next river
#

Does your customer already have a saved payment method?

flat edge
#

no

next river
#

Okay so that would be an important first step. You cannot set a default_payment_method until the Customer has a saved payment method

flat edge
#

can se set default_payment_method as card?

next river
#

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

flat edge
#

can i get the payment method id from checkout and pass it to susbcription, as we are doing both one time and subscriptiion

next river
#

Sure, you can configure your Checkout Session to save the payment method data

#

Do you haven an example Checkout Session ID I can review?

flat edge
#

itss working i tried passing the payment method from stripe checkout, thank you so much for all your help, good day