Paddle.OneOffCharge (paddlex v0.1.0) View Source
OneOffCharge
Link to this section Summary
Functions
Make an immediate one-off charge on top of an existing user subscription This feature is useful for scenarios where buyers need to purchase add-ons on top of a recurring plan.
Link to this section Types
Specs
Link to this section Functions
Specs
create(integer(), number(), String.t()) :: {:ok, t()} | {:error, Paddle.Error.t()}
Make an immediate one-off charge on top of an existing user subscription This feature is useful for scenarios where buyers need to purchase add-ons on top of a recurring plan.
For example, Charges API provides you with the flexibility to charge buyers, with existing subscriptions, right away for one-off top-ups, rather than waiting for the end of their current billing cycle.
Example
Paddle.OneOffCharge.create(2746, 10, "TestCharge")
{:ok, %Paddle.OneOffCharge{
invoice_id: 1,
subscription_id: 1,
amount: "10.00",
currency: "USD",
payment_date: ~D"2018-09-21",
receipt_url: "https://my.paddle.com/receipt/1-1/3-chre8a53a2724c6-42781cb91a"
}}