wolfiton
How to use the braintree package is there any example?
Hi everyone,
Is there any tutorial or example, of how to use the Braintree library?
alias Braintree.Customer
alias Braintree.ErrorResponse, as: Error
case Customer.create(%{company: "Whale Corp"}) do
{:ok, %Customer{} = customer} -> do_stuff_with_customer(customer)
{:error, %Error{} = error} -> do_stuff_with_error(error)
end
What can I do here?
do_stuff_with_customer(customer)
I need the customer the amount and the country
PS: I can’t use stripe because it is unavailable in my country.
UPDATE: For anybody else that wants to use this, some examples can be found in the repo inside files so for payments you can find them in transactions.ex, here is the link braintree-elixir/lib/transaction.ex at master · sorentwo/braintree-elixir · GitHub
Thanks in advance for any tips or help on this.
Most Liked
NobbZ
Anything missing in the documentation?
sorentwo
I’m the author and maintainer of the Braintree library, though I haven’t been a user of it for many years now. It didn’t get much doc love because it aimed to mirror the official Ruby client.
For use cases beyond initial setup I suggest referencing the Ruby docs. In fact, the individual module docs point to the official Ruby docs in many places.
Popular in Discussions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









