-
Notifications
You must be signed in to change notification settings - Fork 682
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
[13.x] Add pay method #1345
[13.x] Add pay method #1345
Conversation
Heya. First of all, there's no |
Hi, automatic_payment_methods is an option that we can pass to the createPaymentIntent method, this is a working example that I am using:
as you see if I don't pass automatic_payment_methods it only shows the card element but when I do this, every other payment element will be activated, I didn't force this option because there was another way to activate elements manually with payment_method_types param that you can specify which elements you need, that is why I didn't add it to PR. |
Yeah I realize that but I think we can wrap that into a separate method. Working on this now.
That's because setup intents is directly related to payment methods. It's only used to setup payment methods for future usage. |
Awesome, I made a complete working example for Payment Elements if you had any questions just let me know. |
So I did some work on this and added a new This method will return a There's also a There's one concern that I have. Although it's not a breaking change to add a new |
There was a problem in the pay method because you are forcing automatic_payment_methods if you add payment_method_types in the options it's not going to work because you can only specify one of these parameters so I just ignored it but we could throw an error instead. |
Why are you adding |
in the docs you can see that you can either add |
Yeah I guess there's something to be said about I just pushed a new $user->payWith(2000, ['card', 'bancontact']); |
Yeah, this is a good one, actually, I already am using this feature in my project so it is not that unnatural. |
I think it would be good to have a
|
@mozex added a |
@driesvints would it make more sense to name these methods |
@taylorotwell bit torn as I really like the clean api of the word |
To use Stripe's new Payment Element we need a Payment Intent, before this PR there was just a createSetupIntent method, but now we can use the createPaymentIntent method that requires an amount parameter and an optional options parameter that according to Stripe's API Docs we need to add this option to our intent request:
'automatic_payment_methods' => [ 'enabled' => true ]
in order to activate new Payment Gateways.