benonymus
So the erro meassage is :
(exit) an exception was raised:
** (FunctionClauseError) no function clause matching in MyApiWeb.FallbackController.call/2
And the code where it is coming from is :
def create(conn, %{
"description" => description,
"email" => email,
"source" => source,
"subscriptionID" => subscriptionID
}) do
with {:ok, %t{} = t} <- Stripe.Customer.create(%{description: description, email: email}) do
conn
|> IO.inspect(t)
end
end
Thanks
Trending in Questions
Hey guys,
I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly
Do you guys have any suggestions what is the best prac...
New
Hello!
Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app.
I creat...
New
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
Anyone here using Honeybadger?
My Honeybadger account is being overwhelmed with noise from some bots. Seeing a lot of
Bandit.HTTPError...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
There are three potential reasons for members of this forum to have a look at https://vutuv.de
You are tired or annoyed of LinkedIn.
Yo...
New
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
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixir-ls
- #ai
- #elixirconf-us
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
NobbZ
I’m not sure what you try to bind to
tin thewithclause. But regardless what gets bound to it, its either an atom or a map/struct, whileIO.inspect/2expects keywords as its seconds argument (wheretis used).I am totally not sure though, if that is the problem though, since your error message complains about
call/2and you have shown only the create action.To actually find your problem you’ll probably need to show more of your controller, as
call/2is the function that should dispatch the request to your actual action, so the problem is much earlier in the stack.benonymus
I am trying to use stripity stripe, and it is form their documentation, so I am not sure myself.
currently I only have this create action in my controller
NobbZ
There has to be more, some
useor other stuff or there wouldn’t even be thecall/2function from the error message.So could you please share the full controller?
benonymus
sure and thanks
NobbZ
A fallback controller will be called when your actual action fails to return a proper conn.
As the
withcan’t match after my understanding (I’ve explained that above), you always returnnil, which isnt a valid conn. So the fallback will be called. Why that doesn’t have a clause matching, we can’t say, because you haven’t shown it.Also can you please share a link to the resources that gave you the example?
benonymus
well I tried to puzzle it out from many, beause I could not find an example that uses striptiy stripe or elixir with stripe really.
also I am assuming that I am using this wrong but I just dont really understand that what the doc is trying to say
https://github.com/code-corps/stripity_stripe
https://medium.com/@njwest/jwt-auth-with-an-elixir-on-phoenix-1-3-guardian-api-and-react-native-mobile-app-1bd00559ea51
I used this as my base, made it work earlier, so I just used it as a general guide, these were the main ones, but had some other ones too
as for my code the router:
defmodule MyApiWeb.Router do
use MyApiWeb, :router
NobbZ
Sorry I have to say, but I can’t find anything in the links that is like the snippet you posted.
So I have to ask again, where did you found the
t = %t{}pattern? What are you trying to achieve by using it?What is it you want to inspect in the
withs body?torconn?Have you understood what
withis used for?Why do you use a fallback controller at all? Do you really need it? Do you understand what it is meant for?
PS: the router is probably unrelated, the error is raised from your fallback controller.
benonymus
the fallback controller was auto generated, this t = %t{} my friend said it and what it tries to achieev is to get the created user.
I want ot inspect the created user so t in this case.
Maybe if you know an open source project that uses elixir with stripe could yo link it?
or just help me understand how to use the package?
Thank you
idi527
t = %t{}seems rather pointless to me since, for examplehere the intermediate value (from
%t{} = %User{}such thatt = User) is lost. If you want to pattern match on a user struct, it’s usually accomplished like thisTo better understand what goes wrong with
we would either need to see the implementation of
MyApiWeb.FallbackControlleror at least what’s intthat causes the “happy path” inwithto fail. Try thisNobbZ
I wasn’t in the need of a payment provider so far.
But please try to match only
{:ok, user}and then doIO.inspect user; conn.