#Nick - Add Credit Card (Not Default)
1 messages · Page 1 of 1 (latest)
Alright, just to double check, you are using the PaymentMethod, Subscription, and Invoice APIs correct?
The credit cards are added via a SetupIntent
But yes, Subscription and Invoice API's
Basically, we have 2 products. One you can host yourself, and one that we host for you in the cloud. What's happening is, some customers will sign up for the self-hosted version, pay with their card, but then that card is automatically the default payment. Later, they sign up for a trial of our cloud product (no credit card acquired), but the subscription points at the default payment method, which I don't really want
Okay so when you assign a payment method to a subscription it doesn't automatically make that the default payment method.
but it seems that if there is no payment method, and you add one via a setupintent, Stripe automatically marks it as the customer invoice settings default source
Unless I'm misunderstanding you? You have to do the setupintent to get the payment method ID, and then you can assign that payment method to the subscription you create, but at that point it's already been made the default AFAICT
Not as far as I am aware. Each subscription can have a payment method specified.
This is detailed here: https://stripe.com/docs/billing/subscriptions/payment-methods-setting
I'll read through the doc and play around with it a bit more. Maybe come back with some more questions later
Thanks for your help!
So this doc looks to be more about payment methods where I'm talking about payment sources
Our only payment method is credit card
I'm still trying to figure out how the this becoming a default, because that is not the default behavior
Are you using the Source API?
Rather than the PaymentMethod API?
https://stripe.com/docs/api/setup_intents/create this is the API we're using
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
It sets the card up for future payments (renewals, expansions, etc)
The card itself is captured by your iframe component. Maybe I'm not understanding the question because that's abstracting?
Okay but for the Setup Intent you are attaching a payment method. Are you using the Card or Source or PaymentMethod API to generate that value?
I'm going to say PaymentMethod, because I have this code
const result = await confirmCardSetup(
paymentSetupIntent.client_secret,
{
payment_method: {
card: billingDetails.card,
billing_details: {
name: billingDetails.name,
address: {
line1: billingDetails.billingAddress.address,
line2: billingDetails.billingAddress.address2,
city: billingDetails.billingAddress.city,
state: billingDetails.billingAddress.state,
country: getCode(billingDetails.billingAddress.country),
postal_code: billingDetails.billingAddress.postalCode,
}
}
}
}
);
For confirming the card setup
confirmCardSetup is the stripe Javascript library function
Sorry if I'm difficult lol
No worries.
I'm just trying to understand what objets you are working with. Because with the PaymentMethod object and SetupIntent, we do not make that payment method the default.
Defaults can be set on a customer's Invoice settings but it sounds like you don't want any default behaviors
Yeah exactly, don't want any default behaviours
That's the test customer I'm working with, if the event and logs help you out. I'll run through a quick scenario to get the data bootstrapped, one sec
Okay! I think we found something.
In this request in your Go code: https://dashboard.stripe.com/test/logs/req_ERbpe8zOTjVa0U
You are explicitly setting the default payment method. So figure out where this is happening and stop that request. That should avoid the default behavior you are seeing.