-
Notifications
You must be signed in to change notification settings - Fork 460
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
Fix Source creation so that TypeData is passed properly #461
Conversation
The TypeData values are specific to each source type. When the parameters are sent, they have to be passed to the API under the source's type's name so for 3DS you pass `three_d_secure[card]` for example while for Sofort you pass `sofort[country]`.
Wow, that was fast! |
@kostaskoukouvis Mostly for historical reasons I think. Most amounts should be |
@remi-stripe Thanks for the fix! The one problem I see with this one is that if |
Yep :/ all legacy. I see that |
Ha nice catch, https://stripe.com/docs/api#create_source says it's required except for shared Sources. But in that case |
Yeah I'm just thinking that if you left |
@brandur-stripe pushed a fix, is this the right approach? |
Yeah, it's usually preferable not to panic of course, but it's probably helpful in this sort of case where we find an obvious usage error. |
* Fix tooltip wrapping Looks like the metadata table wasn't using the same class definition * Attempting to zero in on test bug * Fix table name * Check for single user
The TypeData values are specific to each source type. When the parameters are sent, they have to be passed to the API under the source's type's name so for 3DS you pass
three_d_secure[card]
for example while for Sofort you passsofort[country]
.This uses a custom
AppendTo
forSourceObjectParams
so that theTypeData
properties are looped over and encoded with the right level based on the current Source's type.r? @brandur-stripe
I've confirmed it works for 3DS now but I was not sure if there was an easier way that looping over
p.TypeData
ourselves.Fixes #460