Paddle.SubscriptionPayment (paddlex v0.1.0) View Source

SubscriptionPayment

Link to this section Summary

Functions

List all paid and upcoming (unpaid) payments

Change the due date of the upcoming subscription payment

Link to this section Types

Specs

list_args() :: [
  plan: integer(),
  is_paid: boolean(),
  from: String.t(),
  to: String.t(),
  is_one_off_charge: boolean()
]

Specs

t() :: %Paddle.SubscriptionPayment{
  amount: integer(),
  currency: String.t(),
  id: integer(),
  is_one_off_charge: boolean(),
  is_paid: boolean(),
  payout_date: String.t(),
  receipt_url: String.t(),
  subscription_id: integer()
}

Link to this section Functions

Specs

list(list_args()) :: {:ok, [t()]} | {:error, Paddle.Error.t()}

List all paid and upcoming (unpaid) payments

Examples

Paddle.SubscriptionPayment.list() 
{:ok, [%Paddle.SubscriptionPayment{
  id: 8936,
  subscription_id: 2746,
  amount: 1,
  currency: "USD",
  payout_date: "2015-10-15",
  is_paid: 0,
  is_one_off_charge: 0,
  receipt_url: "https://www.paddle.com/receipt/469214-8936/1940881-chrea0eb34164b5-f0d6553bdf"
}]}
Link to this function

reschedule(payment_id, date)

View Source

Specs

reschedule(integer(), Date.t()) :: {:ok, nil} | {:error, Paddle.Error.t()}

Change the due date of the upcoming subscription payment

Note: You may need to first call Paddle.SubscriptionPayment.list/1 to obtain an upcoming (unpaid) payment ID value to make this call.

Examples

Paddle.SubscriptionPayment.reschedule(10, ~D[2015-10-15])
{:ok, nil}