#szef0
1 messages ยท Page 1 of 1 (latest)
๐ Hi there, Happy to help!
Could you please share more details about integration ?
You should follow this guide:
https://stripe.com/docs/billing/subscriptions/build-subscriptions
Hello, we followed this guide, but our case is that we create checkout session with mode "payment" and later create a subscription schedule with correct price - because users sometimes buy something for the last 10 days so the price is a fraction and later the want to pay full price for a full month so we create a subscription schedule
maybe this is our mistake that Payment method is not set?
The price for the subscription and scheduled dates are all ok - but customers are not charged automatically - so maybe we should you something else rather that subscription schedule?
this is our dashboards
Yes you need to se a PaymentMethod to be used for the subscription:
https://stripe.com/docs/api/subscriptions/create#create_subscription-default_payment_method
Or you define a default paymentMethod for the customer:
https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method
so for example is it enough to set default_payment_method in subscription schedule and it should be the payment_method id starting with pm_xxxx
yes?
Yes with a small precision, it must be set for the subscription related to the subscription_schedule in fact:
https://stripe.com/docs/api/subscription_schedules/object#subscription_schedule_object-subscription
when we make a subscription schedule a subscription object is null isnt it?
No, after subscription_schedule creation, a subscription will be created also behind,
ok, will try and let you know. Thank you for now! ๐
The API returns The customer does not have a payment method with the ID pm_xxx. The payment method must be attached to the customer. when we try to update the customer. We take the pm_xxx from the initial payment of this customer
now we have this error - Message: This PaymentMethod was previously used without being attached to a Customer or was detached from a Customer, and may not be used again. what is the correct way to be able to attach payment method to a customer?
You need to do that attachment prior to payment, or if completing an initial payment you need to mark it for future usage
How are you using the PM the first time?
Im just making Checkout Session with mode payment. We want to use the payment method if he chooses to use card. We are not able to use this payment method before the payment because we dont know it before he finishes checkout session - which part are we doing wrong
We cant use "mode" subscription or setup, because our prices are fixed only when paying for a full month
If you're taking initial payment via checkout thats fine, one moment
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
you can set this in the Checkout session creation to indicate the card for future use, and it will be attached to the customer (either the one you supply, or a new one)
Okay thank you, I used the off_session parameter and I guess the customer will have the payment_method automatically connected to them so the subscription_schedule will work as it should
thank you
Great, np!