payjp v0.1.3 Payjp.Plans

Basic List, Create, Delete API for Plans

  • create a plan
  • get a plan
  • update a plan
  • delete a single plan
  • delete all plan
  • list plans
  • get all plans

https://pay.jp/docs/api/#plan-プラン

Summary

Functions

List all plans. ##Example

{:ok, plans} = Payjp.Plans.all

List all plans w/ given key. ##Example

{:ok, plans} = Payjp.Plans.all key

Changes Plan information. See Payjp docs as to what you can change

Creates a Plan. Note that currency and interval are required parameters, and are defaulted to “JPY” and “month”

Creates a Plan using a given key. Note that currency and interval are required parameters, and are defaulted to “JPY” and “month”

Deletes a Plan with the specified ID

Deletes a Plan with the specified ID using the given key

Deletes all Plans

Example

Payjp.Plans.delete_all

Deletes all Plans w/given key

Example

Payjp.Plans.delete_all key

Retrieves a given Plan with the specified ID. Returns 404 if not found.

Example

Retrieves a given Plan 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 Plans

Returns a list of Plans using the given key

Returns a single Plan using the given Plan ID

Functions

all(accum \\ [], opts \\ [limit: 100])

List all plans. ##Example

{:ok, plans} = Payjp.Plans.all
all(key, accum, opts)

List all plans w/ given key. ##Example

{:ok, plans} = Payjp.Plans.all key
change(id, params)

Changes Plan information. See Payjp docs as to what you can change.

Example

  {:ok, plan} = Payjp.Plans.change("test-plan",[name: "Other Plan"])
change(id, params, key)
create(params)

Creates a Plan. Note that currency and interval are required parameters, and are defaulted to “JPY” and “month”

Example

  {:ok, plan} = Payjp.Plans.create [id: "test-plan", name: "Test Plan", amount: 1000, interval: "month"]
create(params, key)

Creates a Plan using a given key. Note that currency and interval are required parameters, and are defaulted to “JPY” and “month”

Example

{:ok, plan} = Payjp.Plans.create [id: "test-plan", name: "Test Plan", amount: 1000, interval: "month"], key
delete(id)

Deletes a Plan with the specified ID.

Example

  {:ok, res} = Payjp.Plans.delete "test-plan"
delete(id, key)

Deletes a Plan with the specified ID using the given key.

Example

{:ok, res} = Payjp.Plans.delete "test-plan", key
delete_all()

Deletes all Plans

Example

Payjp.Plans.delete_all
delete_all(key)

Deletes all Plans w/given key

Example

Payjp.Plans.delete_all key
get(id)

Retrieves a given Plan with the specified ID. Returns 404 if not found.

Example

  {:ok, cust} = Payjp.Plans.get "plan_id"
get(id, key)

Retrieves a given Plan with the specified ID. Returns 404 if not found. Using a given payjp key to apply against the account associated.

Example

{:ok, cust} = Payjp.Plans.get "plan_id", key
list(limit \\ 10)

Returns a list of Plans.

Example

{:ok, plans} = Payjp.Plans.list
{:ok, plans} = Payjp.Plans.list(20)
list(key, limit)

Returns a list of Plans using the given key.

retrieve(id)
retrieve(id, key)

Returns a single Plan using the given Plan ID.