#NotP_Dot - Subscription
1 messages ยท Page 1 of 1 (latest)
Hi ๐
Can you share a request ID for the failed request?
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
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.
yes - req_U3IMBUqmZkJEv7
This is also how I am creating the user:
try:
customer = stripe.Customer.create(
description="Customer Created Via Marketplace API",
email=email
)
print("Created customer", customer)
if(customer and 'id' in customer):
return customer['id']
else:
print("Error, Customer was not created with the email", email)
return ""
except Exception as e:
return str(e)
Please consider adding a default payment method
This is what your code needs to do
You can create a Customer with a default payment method in your create function call using the Test tokens we provide
I am a bit confused, when creating the customer I need to specify their payment method?
You would just specify one of these as the payment_method parameter
If you expect them to be able to pay for anything
for example setting tok_visa when creating the customer for their payment method would be fine, even if they pay with something besides visa?
I am looking at these docs - https://stripe.com/docs/api/customers/create
and it seems like payment_method is optional
Yes it's optional. But then you will get errors when you attempt to automate payments with that customer, unless you specify a payment method when creating the Subscription.
I don't think it's clear what you are trying to achieve with your scripts. Could you explain what the overall goal is?
Overall goal is to create a subscription that also takes a one time payment for the first month.
In order to achieve this I need to use stripe.Subscription.create and add on add_invoice_items
In order to use stripe.Subscription.create I need to first create a customer, which I am doing using stripe.Customer.create.
When the customer is created I then pass the customerID to stripe.Subscription.create but received the error that I brought up earlier regarding payment method
if you believe there is a better way to achieve this please do provide suggestions
I think you just need to pass in a specified payment_behavior when creating the Subscription: https://stripe.com/docs/api/subscriptions/create?event_types-payment_intent.payment_failed#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.
Try adding payment_behavior='default_incomplete' to your Subscription create funtion
NotP_Dot - Subscription
I think that kinda fixed the error. I'll play around more with it thanks for the help
Great to hear. Now when you are ready to accept payment for that subscription you can follow the steps outlined here:
https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements#create-subscription
Thank you for your help
Happy to do it ๐
one quick question
if you're using stripe.checkout.Session.create and passing mode="subscription" can you somehow pass a one time payment along with this session?
No. Right now its either/or