payjp v0.1.0 Payjp.Subscriptions
Main API for working with Subscriptions at Payjp. Through this API you can:
- create
- change
- retrieve
- cancel
- cancel_all
- list all
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/#subscription-定期課金)
Summary
Functions
List all subscriptions
List all subscriptions using given api key
Cancels a subscription
Cancels a subscription with given api key
Cancel all subscriptions for account
Cancel all subscriptions for account using given api key
Changes a customer’s subscription (plan, description, etc - see Payjp API for acceptable options). Subscription ID is required for this
Changes a customer’s subscription using given api key(plan, description, etc - see Payjp API for acceptable options). Customer ID, Subscription ID, opts and api key are required for this
Starts a subscription for the specified customer
Starts a subscription for the specified customer using given api key
Deletes a subscription
Deletes a subscription with given api key
Returns a subscription; subscription_id is required
Returns a subscription using given api key; subscription_id is required
Returns a list of Subscriptions with a default limit of 10 which you can override with list/1
Returns a list of Subscriptions with a default limit of 10 which you can override with list/1
Using a given payjp key to apply against the account associated
Pauses a subscription
Pauses a subscription with given api key
Resumes a subscription
Resumes a subscription with given api key
Functions
List all subscriptions.
##Example
{:ok, subscriptions} = Payjp.Subscriptions.all
List all subscriptions using given api key.
##Example
{:ok, subscriptions} = Payjp.Subscriptions.all [], key, []
Cancels a subscription with given api key.
Example
Payjp.Subscriptions.cancel "subscription_id", key, []
Cancel all subscriptions for account.
#Example
Payjp.Subscriptions.cancel_all customer_id
Cancel all subscriptions for account using given api key.
#Example
Payjp.Subscriptions.cancel_all customer_id, key
Changes a customer’s subscription (plan, description, etc - see Payjp API for acceptable options). Subscription ID is required for this.
Example
Payjp.Subscriptions.change "subscription_id", "plan_id"
Changes a customer’s subscription using given api key(plan, description, etc - see Payjp API for acceptable options). Customer ID, Subscription ID, opts and api key are required for this.
Example
Payjp.Subscriptions.change "subscription_id", [plan: "plan_id"], key
Starts a subscription for the specified customer.
Example
new_sub = [
plan: plan_id,
metadata: [
...
]
]
{:ok, sub} = Payjp.Subscriptions.create customer_id, new_sub
Starts a subscription for the specified customer using given api key.
Example
new_sub = [
plan: plan_id,
metadata: [
...
]
]
{:ok, sub} = Payjp.Subscriptions.create customer_id, opts, key
Deletes a subscription with given api key.
Example
Payjp.Subscriptions.delete "subscription_id", key, []
Returns a subscription; subscription_id is required.
Example
{:ok, customer} = Payjp.Subscriptions.get "subscription_id"
Returns a subscription using given api key; subscription_id is required.
Example
{:ok, sub} = Payjp.Subscriptions.get "subscription_id", key
Returns a list of Subscriptions with a default limit of 10 which you can override with list/1
Example
{:ok, subscriptions} = Payjp.Subscriptions.list(limit: 20)
Returns a list of Subscriptions 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, subscriptions} = Payjp.Subscriptions.list(key, limit: 20)
Pauses a subscription with given api key.
Example
Payjp.Subscriptions.pause "subscription_id", key, []