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

Updating client using source prop is not working #177

Open
fernandoiwamoto opened this issue Feb 12, 2021 · 1 comment
Open

Updating client using source prop is not working #177

fernandoiwamoto opened this issue Feb 12, 2021 · 1 comment

Comments

@fernandoiwamoto
Copy link

fernandoiwamoto commented Feb 12, 2021

I have my integration with rails and when I create customer as Stripe::Customer.create({ source: source }), I can see the sources object there. But then when I try to update my Customer, it gives me Bad Request as Stripe::Customer.update(stripe_customer_id, { source: card_token }). Using any other props, it works fine.

Copying this code
https://github.com/adrienverge/localstripe/blob/master/localstripe/resources.py#L715
To
https://github.com/adrienverge/localstripe/blob/master/localstripe/resources.py#L721
Works fine.

@H--o-l
Copy link
Collaborator

H--o-l commented Feb 15, 2021

Hi @fernandoiwamoto thanks for sharing!

It's totally possible that one property available in the real Stripe API is missing inside localstripe.
localstripe only implement what's contributors have contributes.
So don't hesitate to open a PR to propose code changes or new code!

In your PR, please include links to relevant Stripe API documentation, so we can easily check.
Also, don't forget to say that you have tested with the real Stripe API (you must test it with it).
Last things: you will be asked to add a small unit-test inside this file https://github.com/adrienverge/localstripe/blob/2709044ab35698ab7cd80fb9dab05933aedbb551/test.sh, so prepare a small example using CURL ;-)

PS: ourself in our APP, to update a customer payment method, we use customer update API invoice_settings.default_payment_method parameter and it works with localstripe. Maybe you could use it too? (I'm not saying is better, I don't know, I'm just saying that it works out-of-the-box with localstripe).

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

No branches or pull requests

2 participants