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

Stripe Gateway: "Must provide source or customer." #183

Open
danieljaouen opened this issue Nov 28, 2019 · 2 comments
Open

Stripe Gateway: "Must provide source or customer." #183

danieljaouen opened this issue Nov 28, 2019 · 2 comments

Comments

@danieljaouen
Copy link

I am trying to use the Stripe gateway. However, I am seeing an error that I cannot resolve:

no case clause matching: %{"error" => %{"code" => "parameter_missing", "doc_url" => "https://stripe.com/docs/error-codes/parameter-missing", "message" => "Must provide source or customer.", "type" => "invalid_request_error"}}

It seems to revolve around this Must provide source or customer. error.

Any help?

@danieljaouen
Copy link
Author

danieljaouen commented Nov 28, 2019

I've gotten a bit further with this issue. Apparently Gringotts.store returns a map containing an id for a customer, but it doesn't save the card it was called with (the cards entry in the returned map has %{"count" => 0}.

The error I see now is:
Cannot charge a customer that has no active card

As far as I can tell, Gringotts.store is storing neither the credit card nor the address I'm feeding into it. Is this a bug?

@danieljaouen
Copy link
Author

danieljaouen commented Nov 28, 2019

Ideally, Gringotts.store would store both the credit card (as the customer's default) and the address in a new customer, and Gringotts.unstore would fetch the customer_id, the credit card, and the address (perhaps in a map?), and then subsequently delete the customer via Stripe's API.

Then Gringotts.authorize and Gringotts.capture would just take an additional [customer: customer_id] in the opts list.

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

1 participant