I have the following code and I am able to create new users. The email is not stored.
Code:
defmodule StripeTestWeb.PaymentController do
use StripeTestWeb, :controller
use Stripe.API
def index(conn, _params) do
{:ok, customer_data} = Stripe.Customer.create(%{email: conn.body_params['stripeEmail']})
render(conn, "index.html")
end
end
How do I capture and store their email ?

There are two glitches with this code I can spot on:
Look:
'abc'is essentially the same as (in pseudocode)This should be probably considered a legacy that came back from XX century. Whenever you need a binary (the string,) always use double quotes.
Stripe.Customer.create. This is unlikely what you actually want to do; to pass it to the underlying controller, usePlug.Conn.assign/3(or at least validate the outcome of a call tocreatefunction and somehow deal with errors.The summing up, the solution that would be likely robust looks like: