Subscriptions

class terminusgps.authorizenet.subscriptions.subscriptions.Subscription(id: str | int | None = None, *args, **kwargs)[source]

Public Data Attributes:

merchantAuthentication

Merchant authentication for API calls.

status

Current status of the subscription.

transactions

Transactions for the subscription.

Public Methods:

__init__([id])

create(name, amount, schedule, profile_id, ...)

Creates a subscription in Authorizenet.

cancel()

Cancels the subscription.

Inherited from ControllerExecutionMixin

execute_controller(controller)

Executes an Authorizenet controller and returns its response.

Private Methods:

_authorizenet_get_subscription([...])

Executes a ARBGetSubscriptionRequest using the Authorizenet API.

_authorizenet_get_subscription_status()

Executes a ARBGetSubscriptionStatusRequest using the Authorizenet API.

_authorizenet_update_subscription(subscription)

Executes a ARBUpdateSubscriptionRequest using the Authorizenet API.

_authorizenet_cancel_subscription()

Executes a ARBCancelSubscriptionRequest using the Authorizenet API.


_authorizenet_cancel_subscription() dict | None[source]

Executes a ARBCancelSubscriptionRequest using the Authorizenet API.

ARBCancelSubscriptionRequest

Raises:
Returns:

An Authorizenet API response, if any.

Return type:

dict | None

_authorizenet_get_subscription(include_transactions: bool = False) dict | None[source]

Executes a ARBGetSubscriptionRequest using the Authorizenet API.

ARBGetSubscriptionRequest

Raises:
Returns:

An Authorizenet API response, if any.

Return type:

dict | None

_authorizenet_get_subscription_status() dict | None[source]

Executes a ARBGetSubscriptionStatusRequest using the Authorizenet API.

ARBGetSubscriptionStatusRequest

Raises:
Returns:

An Authorizenet API response, if any.

Return type:

dict | None

_authorizenet_update_subscription(subscription: ARBSubscriptionType) dict | None[source]

Executes a ARBUpdateSubscriptionRequest using the Authorizenet API.

ARBUpdateSubscriptionRequest

Raises:
Returns:

An Authorizenet API response, if any.

Return type:

dict | None

cancel() None[source]

Cancels the subscription.

Raises:
Returns:

Nothing.

Return type:

None

create(name: str, amount: Decimal, schedule: paymentScheduleType, profile_id: int | str, payment_id: int | str, address_id: int | str, trial_amount: Decimal = Decimal('0')) int[source]

Creates a subscription in Authorizenet.

Parameters:
  • name (str) – A name for the subscription.

  • amount (paymentScheduleType) – An amount of money paid per occurrence of the subscription.

  • schedule – A payment schedule for the subscription.

  • profile_id (int | str) – An Authoriznet customer profile id.

  • payment_id (int | str) – An Authoriznet customer payment profile id.

  • address_id (int | str) – An Authoriznet customer address profile id.

  • trial_amount (Decimal) – Trial amount for the subscription. Default is 0.00.

Raises:
Returns:

An Authorizenet subscription id.

Return type:

int

property merchantAuthentication: merchantAuthenticationType

Merchant authentication for API calls.

property status: str | None

Current status of the subscription.

property transactions: list | None

Transactions for the subscription.