EPTSDK.PaymentSubscription (ept_sdk v14.0.2)

Copy Markdown

A recurring payment agreement for charging a customer on a billing schedule.

First-cycle proration is controlled by :proration_behavior.

When a payment subscription is created or confirmed with proration_behavior: :create_prorations and a future billing_cycle_anchor_at, Edge creates an immediate prorated first charge for the remaining portion of the current billing period while preserving the billing anchor for the first full cycle.

When proration_behavior: :none, Edge skips the immediate prorated charge and delays the first charge until billing_cycle_anchor_at.

Summary

Functions

Confirms an existing %EPTSDK.PaymentSubscription for processing.

Creates an new %EPTSDK.PaymentSubscription{}} with attributes: and relationships:.

Fetches all %EPTSDK.PaymentSubscription{}.

Fetches a %EPTSDK.PaymentSubscription{} by record or by id.

Updates an existing %EPTSDK.PaymentSubscription with attributes: and relationships:.

Functions

confirm(client, record, options \\ [])

Confirms an existing %EPTSDK.PaymentSubscription for processing.

If the subscription is configured with proration_behavior: :create_prorations and a future billing_cycle_anchor_at, confirmation creates an immediate prorated first charge.

The options argument can also have:

  • fields:, a map of filds to return for each resource type i.e. fields: %{payment_subscriptions: ["id"]}
  • include:, a list of relationship chains for the response to return i.e. include: ["payment_subscriptions.merchant"]

create(client, options \\ [])

Creates an new %EPTSDK.PaymentSubscription{}} with attributes: and relationships:.

The options argument can also have:

  • fields:, a map of filds to return for each resource type i.e. fields: %{payment_subscriptions: ["id"]}
  • include:, a list of relationship chains for the response to return i.e. include: ["payment_subscriptions.merchant"]

delete(client, record, options \\ [])

list(client, options \\ [])

Fetches all %EPTSDK.PaymentSubscription{}.

The options argument can be:

  • fields, a map of filds to return for each resource type i.e. fields: %{payment_subscriptions: ["id"]}
  • include, a list of relationship chains for the response to return i.e. include: ["payment_subscriptions.merchant"]
  • sort, ... i.e. sort: ["-name"]
  • filter, ... i.e. fields: %{name: "John"}

new(id, type, record, links, client)

show(client, id, options \\ [])

Fetches a %EPTSDK.PaymentSubscription{} by record or by id.

The options argument can be:

  • fields, a map of filds to return for each resource type i.e. fields: %{payment_subscriptions: ["id"]}
  • include, a list of relationship chains for the response to return i.e. include: ["payment_subscriptions.merchant"]

update(client, record, options \\ [])

Updates an existing %EPTSDK.PaymentSubscription with attributes: and relationships:.

The options argument can also have:

  • fields:, a map of filds to return for each resource type i.e. fields: %{payment_subscriptions: ["id"]}
  • include:, a list of relationship chains for the response to return i.e. include: ["payment_subscriptions.merchant"]