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 Stripe.Token.create #200
Add Stripe.Token.create #200
Conversation
We can perhaps handle this with some upcoming testing work we're planning on doing. I'm not sure it's a good idea to implement a public API for doing something that only helps with testing. |
I was also wondering if this is something to actually do or not. Here's my thoughts : |
@joshsmith @begedin, any thoughts about this one ? |
I think if we do it, it should be done as a |
5e85cb8
to
4f4b48f
Compare
Right @joshsmith, I just updated the PR accordingly. |
lib/stripe/token.ex
Outdated
|
||
You MUST pass in your Publishable Key in `opts` : | ||
|
||
Stripe.Token.create(%{card: card_map}, api_key: "STRIPE_PUBLISHABLE_KEY") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to pass in your publishable key for this to work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was a false assumption of mine, since it has to be with the publishable key on the client side, I supposed we needed it too on direct API requests for creating a token (it works with both, though). In the API Docs they are giving an example with a secret key as a parameter.
https://stripe.com/docs/api#create_card_token
I will remove the requirement for the publishable key as an argument in the doc section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joshsmith just updated the doc section.
Mirroring Stripe Public Token API This function is meant to be only used in Unit Tests to simulate a token provided by the client.
4f4b48f
to
950ddda
Compare
This is fine enough for me 👍 |
Fixed a compile error introduced by merging beam-community#197 and beam-community#200 in parallel.
Thanks ! |
This function is meant to be only used in Unit Tests to simulate a token provided by the client.