payjp v0.1.1 Payjp.Customers
Main API for working with Customers at Payjp. Through this API you can:
- create customers
- get a customer
- update customer
- delete single customer
- delete all customer
- get customers list
- get all customers
- list subscriptions for the customer
- get a subscription for the customer
Supports Connect workflow by allowing to pass in any API key explicitely (vs using the one from env/config).
(API ref: https://pay.jp/docs/api/#customer-顧客
Summary
Functions
List all customers
List all customers. Using a given payjp key to apply against the account associated
Creates a Customer with the given parameters - all of which are optional
Creates a Customer with the given parameters - all of which are optional. Using a given payjp key to apply against the account associated
Deletes a Customer with the specified ID
Deletes a Customer with the specified ID Using a given payjp key to apply against the account associated
Deletes all Customers
Deletes all Customers Using a given payjp key to apply against the account associated
Retrieves a given Customer with the specified ID. Returns 404 if not found.
Example
Retrieves a given Customer with the specified ID. Returns 404 if not found. Using a given payjp key to apply against the account associated.
Example
Returns a list of Customers with a default limit of 10 which you can override with list/1
Returns a list of Customers with a default limit of 10 which you can override with list/1
Using a given payjp key to apply against the account associated
Returns a subscription; customer_id and subscription_id are required
Returns a subscription using given api key; customer_id and subscription_id are required
Returns subscription list for the specified customer; customer_id is required
Returns subscription list for the specified customer with given api key; customer_id is required
Updates a Customer with the given parameters - all of which are optional
Updates a Customer with the given parameters - all of which are optional. Using a given payjp key to apply against the account associated
Functions
List all customers.
##Example
{:ok, customers} = Payjp.Customers.all
List all customers. Using a given payjp key to apply against the account associated.
##Example
{:ok, customers} = Payjp.Customers.all key, accum, since
Creates a Customer with the given parameters - all of which are optional.
Example
new_customer = [
email: "test@test.com",
description: "An Test Account",
metadata:[
app_order_id: "ABC123"
app_state_x: "xyz"
],
card: [
number: "4111111111111111",
exp_month: 01,
exp_year: 2018,
cvc: 123,
name: "Joe Test User"
]
]
{:ok, res} = Payjp.Customers.create new_customer
Creates a Customer with the given parameters - all of which are optional. Using a given payjp key to apply against the account associated.
Example
{:ok, res} = Payjp.Customers.create new_customer, key
Deletes a Customer with the specified ID Using a given payjp key to apply against the account associated.
Example
{:ok, resp} = Payjp.Customers.delete "customer_id", key
Deletes all Customers Using a given payjp key to apply against the account associated.
Example
Payjp.Customers.delete_all key
Retrieves a given Customer with the specified ID. Returns 404 if not found.
Example
{:ok, cust} = Payjp.Customers.get "customer_id"
Retrieves a given Customer with the specified ID. Returns 404 if not found. Using a given payjp key to apply against the account associated.
Example
{:ok, cust} = Payjp.Customers.get "customer_id", key
Returns a list of Customers with a default limit of 10 which you can override with list/1
Example
{:ok, customers} = Payjp.Customers.list
{:ok, customers} = Payjp.Customers.list(since: 1487473464, limit: 20)
Returns a list of Customers with a default limit of 10 which you can override with list/1
Using a given payjp key to apply against the account associated.
Example
{:ok, customers} = Payjp.Customers.list(key, since: 1487473464, limit: 20)
Returns a subscription; customer_id and subscription_id are required.
Example
{:ok, sub} = Payjp.Subscriptions.subscription "customer_id", "subscription_id"
Returns a subscription using given api key; customer_id and subscription_id are required.
Example
{:ok, sub} = Payjp.Subscriptions.subscription "customer_id", "subscription_id", key
Returns subscription list for the specified customer; customer_id is required.
Example
{:ok, sub} = Payjp.Subscriptions.subscriptions "customer_id"
Returns subscription list for the specified customer with given api key; customer_id is required.
Example
{:ok, sub} = Payjp.Subscriptions.subscriptions "customer_id" key, []