Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add customer ID to default SetupIntent options #745

Closed
hanspagel opened this issue Aug 14, 2019 · 6 comments
Closed

Add customer ID to default SetupIntent options #745

hanspagel opened this issue Aug 14, 2019 · 6 comments

Comments

@hanspagel
Copy link

hanspagel commented Aug 14, 2019

Cashier 10 feels like a big improvement, congrats on the release!

After reading the documentation I stumbled about the customer option for SetupIntents

customer
ID of the Customer this SetupIntent belongs to, if one exists.
If present, payment methods used with this SetupIntent can only be attached to this Customer, and payment methods attached to other Customers cannot be used with this SetupIntent.

Isn't this the behaviour you'd expect when calling $user->createSetupIntent();? I'd expect the SetupIntent to be connected with the user in some way and as Stripe offers the option to make a relation between the Customer and the SetupIntent I think it would be nice to use it.

What do you think?

BTW In case someone wants to pass options, that's already possible with the current method. This would do the above explained thing:

$user->createSetupIntent(['customer' => $user->stripe_id]);
@gbradley
Copy link

This may lead to slightly unpredictable behaviour, since $user may not be a customer yet. I'd personally argue that its best for the method to create SetupIntents consistently rather than having side-effects based on the internal state of the Billable, but then again it would be more convenient...

@hanspagel
Copy link
Author

hanspagel commented Aug 15, 2019

If the user is not a customer, the stripe_id is null, which is the default for customer anyways. 🤷‍♂️

@gbradley
Copy link

Fair enough, I didn't consider that the API will just let you pass null. Good idea :)

@driesvints
Copy link
Member

Actually we had that in place at first but then we ran into this issue: #720

So to me it seems unwanted to use this parameter with setup intents?

@driesvints
Copy link
Member

We removed it again here: #704

@hanspagel
Copy link
Author

Thanks! I'll close it then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants