Payjp.Plans (payjp v0.1.6)

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-プラン

Link to this section Summary

Functions

List all plans. ##Example

List all plans w/ given key. ##Example

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

Deletes all Plans w/given key

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

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

Returns a list of Plans.

Returns a list of Plans using the given key.

Returns a single Plan using the given Plan ID.

Link to this section Functions

Link to this function

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

List all plans. ##Example

{:ok, plans} = Payjp.Plans.all
Link to this function

all(key, accum, opts)

List all plans w/ given key. ##Example

{:ok, plans} = Payjp.Plans.all key
Link to this function

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"])
Link to this function

change(id, params, key)

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"]
Link to this function

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

Deletes a Plan with the specified ID.

Example

  {:ok, res} = Payjp.Plans.delete "test-plan"
Link to this function

delete(id, key)

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

Example

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

Deletes all Plans

Example

Payjp.Plans.delete_all
Link to this function

delete_all(key)

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

  {:ok, cust} = Payjp.Plans.get "plan_id"

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
Link to this function

list(limit \\ 10)

Returns a list of Plans.

Example

{:ok, plans} = Payjp.Plans.list
{:ok, plans} = Payjp.Plans.list(20)
Link to this function

list(key, limit)

Returns a list of Plans using the given key.

Link to this function

retrieve(id, key)

Returns a single Plan using the given Plan ID.