StripePost v0.4.2 StripePost.Client View Source
Access service functionality through Elixir functions, wrapping the underlying HTTP API calls.
This is where you will want to write your custom code to access your API.
Link to this section Summary
Functions
Charge an account with the following body configurations
Create a customer with the following body configurations
Retrieve a customer by his/her stripe ID
List all customer, if you don’t provide a limit we will fetch them all
Link to this section Functions
Charge an account with the following body configurations
StripePost.charge(
%{amount: 10000,
currency: "cad",
description: "3 wozzle",
source: "pk_abc_123"}
)
Where the source
is the payment token received from Stripe most likely
in your client javascriopt.
You also now also authorize (without charging) an account by setting the
capture
field to false
. For more details auth and capture
StripePost.charge(
%{amount: 10000,
currency: "cad",
description: "3 wozzle",
source: "pk_abc_123"
capture: false}
)
The configurations are optional, and can be (preferrably) configured as elixir configs, like:
config :stripe_post,
secret_key: "sk_test_abc123",
public_key: "pk_test_def456",
content_type: "application/x-www-form-urlencoded"
But, if you must, then you can specify it directly like
configs = %{
secret_key: "sk_test_abc123",
content_type: "application/x-www-form-urlencoded"
}
Create a customer with the following body configurations
body = %{description: "customer xxx", source: "pk_abc_123"}
Retrieve a customer by his/her stripe ID
List all customer, if you don’t provide a limit we will fetch them all
query_params = %{limit: 100, starting_after: "obj_pk_1234"}