#fatematzuhora
1 messages · Page 1 of 1 (latest)
By "attach to user account" do you mean attached to the customer?
yes
Edited my words, If I repeat:
When I complete the payment, I can see the payment method attached not only user subscription but also customer account. I want to attach the payment method only with the subscription so that the next billing not become fail. But I don't want to attach it to the customer account (because I don't want to succeed to purchase other product using that payment method)
Just a testing but if you remove the save_default_payment_method option when creating Subscription, do you still see it's attached to the Customer?
Do you mean something like that:
const subscription = await stripe.subscriptions.create({
customer: customerId,
items: [{
price: priceId,
}],
payment_behavior: 'default_incomplete',
expand: ['latest_invoice.payment_intent'],
});
Yes!
I tried with this approach
Even with this I can see the payment method also attached with customer account
moreover with this, the payment method is not attaching with the subscription
Yeah it's what I thought. That option means to only control whether attach to Subscription or not. Attaching to Customer, on another hand, is a default behavior
Let me look around a little bit more (while I think you can't control that behavior tho)
sure
Yeah I think it's default behavior and I can reproduce it. The Subscription always needs a Customer, and when a PaymentMethod is used to confirm the Sub's PI it get automatically attached to the Customer
But it's not set as the defaulted one.
So it won't be used automatically if you ever charge your Customer next time
Yes it won't be used automatically.
But is there any way to control the behavior so that customers can make a choice whether they want to attach it to the payment method list or not?
Not that I know of unfortunately
Can you please double check?
I need it one of my project requirements, so wanted to be 100% sure.
Let me check with my colleague
Sorry we think the same. But that's only for the first Invoice of the Subscription
As long as you don't set it as default, it is harmless to let it attached to the customer, I believe
If you want to get rid of it, you can try calling Detach PaymentMethod, but I am afraid that will dispose the PM completely and it won't be used in next Subscription renewal
Yes, you're right.
Once I detach the PaymentMethod, I can see it also detaching from the subscription.
I know there is no harm to let it attached to the customer.
We just wanted to make a choice for our users whether they want to attach it to the payment method list or not.
As you mentioned, it is not possible to make that choice.
Correct?
Yes!
Can you please don't close this thread for a few moments, I wanted to discuss this with my product owner and try to find out if I have any other queries related to this.
I'm just getting back to you.
Sure