#madmark00178_unexpected
1 messages ¡ Page 1 of 1 (latest)
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- madmark00178_unexpected, 6 hours ago, 8 messages
- madmark_customer-duplication, 5 days ago, 8 messages
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1215087862752608296
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
@cosmic verge If the Customer has a 100% off Coupon then they won't be charged, there should be no need to remove their payment method
But the coupon is only for three months, and theyve already put in a card for trial and then cancelled (before the trial is up)
One important thing too, our system applies monthly credits to a user's account so i dont want to disrupt that, so i can't use a trial
I want to make sure at the end of three months, they don't get charged unless they decide to re-add their payment method. I've tested this on API somewhat, if i don't apply a payment method to a new subscription that has no trial, it correctly has three months of free use and then if they haven't added a payment method, it goes to 'past due'
Hum okay, let's take a step back then: what have you tried that isn't working?
I was trying to recreate my API thought in dashboard, so what i've tried is cancelling the trial subscription immediately, with the intention of creating a new subscription on the account with the promo code attached, with no payment method. But there was a weird bug happening where the 'add new subscription' window wouldnt pop up, or it would pop up and disappear before populating.
I'm sorry I really don't understand what that could mean.
But let's ignore the Dashboard and talk developer to developer about your code. What isn't working?
I'm just trying to confirm how i can take an existing customer who is in a trial, remove their subscription and start a new subscription with a promo code attached, but without a payment method and without automatically using their payment method if they have one attached to their customer object.
There's really no reason at all to start a new Subscription though.
Ultimately: As a developer, you control what PaymentMethod to use by setting default_payment_method on the Subscription or inside invoice_settings on the Customer
Okay well then i guess the only question i need to know is, how do i know if a subscription is going to use it's default payment method or the custom invoice_settings payment method?
Right so but is that saying that it will try and use any payment method available, whether its on the subscription or if not, if its on the customer invoice setting?
yes and if it's not on the Customer it won't do anything
Okay so then simply put, if i want a customer to have a coupon for 100% off for 3 months, and i don't want them charged at the end automatically, what is the best way to handle that? (Aside from a trial of 3 months)
I'm assuming i would need to remove all payment methods from their account and subscription? Or is there an object on the subscription to not automatically charge?
no sorry you're misunderstanding it all
A Customer can have a PaymentMethod and it won't be magically used. You, as the developer, have to explicitly pick that pm_123 to be used by default for a given Subscription or all of them
As long as you do not set default_payment_method on the Subscription or inside invoice_settings on the Customer then that Subscription will not charge the Customer's card(s)
Got it
You can try it all in Test mode with code to confirm
Yeah will do
And can i view this in the dashboard or do i have to do this in code
Sorry can i modify default_payment_method on a subscription on dashboard*
yeah I think you can
I focus on code-related questions but you should be able to view this in the Dashboard.
Ah okay. Will look more into it. One other quick one, i know i get emails sometimes while in test mode if i use an email from my site's domain. But sometimes they don't come up, and i'm specifically trying to test failed payment notifications. Is there a clear way to make sure those come through in test mode?
The vast majority of emails are never sent in Test mode. Some Subscriptions emails can be but the Customer object has to have the same email address as you use for your own Stripe account