Profiles
Base
- class terminusgps.authorizenet.profiles.base.AuthorizenetProfileBase(id: int | str | None = None, *args, **kwargs)[source]
Base class for Authorizenet profiles.
Public Data Attributes:
An Authorizenet generated id.
A merchant authentication object to authenticate Authorizenet API calls.
The current Authorizenet API validation mode.
Public Methods:
__init__([id])Sets
idif provided.__str__()Returns a string representation of the profile, if
idwas set.Inherited from
AuthorizenetControllerExecutorexecute_controller(controller)Executes an Authorizenet API controller and returns its response.
- class terminusgps.authorizenet.profiles.base.AuthorizenetSubProfileBase(customer_profile_id: int | str, id: int | str | None = None, default: bool = False)[source]
Base class for Authorizenet ‘sub-profiles’, profiles that have an associated customer profile.
Public Data Attributes:
A customer profile id.
Whether or not the sub-profile is set as default.
Inherited from
AuthorizenetProfileBaseAn Authorizenet generated id.
A merchant authentication object to authenticate Authorizenet API calls.
The current Authorizenet API validation mode.
Public Methods:
__init__(customer_profile_id[, id, default])Sets
customerProfileIdfor the sub-profile.Inherited from
AuthorizenetProfileBase__init__([id])Sets
idif provided.__str__()Returns a string representation of the profile, if
idwas set.Inherited from
AuthorizenetControllerExecutorexecute_controller(controller)Executes an Authorizenet API controller and returns its response.
Customer
- class terminusgps.authorizenet.profiles.customers.CustomerProfile(id: int | str | None = None, merchant_id: str | None = None, email: str | None = None, desc: str | None = None)[source]
An Authorizenet customer profile.
Public Data Attributes:
A merchant designated id.
A customer email address.
A customer profile description.
The current Authorizenet validation mode.
Inherited from
AuthorizenetProfileBaseAn Authorizenet generated id.
A merchant authentication object to authenticate Authorizenet API calls.
The current Authorizenet API validation mode.
Public Methods:
__init__([id, merchant_id, email, desc])Sets
merchant_id,emailanddesc.create()Creates the customer profile in Authorizenet.
update()Updates the customer profile in Authorizenet if
idis set.delete()Deletes the customer profile in Authorizenet and sets
idtoNoneifidis set.Returns a list of payment profile ids assigned to the customer profile.
Returns a list of address profile ids assigned to the customer profile.
Inherited from
AuthorizenetProfileBase__init__([id])Sets
idif provided.__str__()Returns a string representation of the profile, if
idwas set.Inherited from
AuthorizenetControllerExecutorexecute_controller(controller)Executes an Authorizenet API controller and returns its response.
Private Methods:
Generates and returns a
customerProfileExType.Generates and returns a
customerProfileType._authorizenet_get_customer_profile([issuer_info])Executes a
getCustomerProfileRequestusing the Authorizenet API._authorizenet_create_customer_profile([validate])Executes a
createCustomerProfileRequestusing the Authorizenet API._authorizenet_update_customer_profile([validate])Executes an
updateCustomerProfileRequestusing the Authorizenet API.Executes a
deleteCustomerProfileRequestusing the Authorizenet API.
- _authorizenet_create_customer_profile(validate: bool = False) dict | None[source]
Executes a
createCustomerProfileRequestusing the Authorizenet API.- Parameters:
validate (
bool) – Whether or not to validate the customer profile in Authorizenet.- Raises:
AssertionError – If neither
merchantCustomerIdnoremailwere set.AuthorizenetControllerExecutionError – If something goes wrong during an Authorizenet API call.
- Returns:
An Authorizenet API response, if any.
- Return type:
- _authorizenet_delete_customer_profile() dict | None[source]
Executes a
deleteCustomerProfileRequestusing the Authorizenet API.- Raises:
AssertionError – If
idwasn’t set.AuthorizenetControllerExecutionError – If something goes wrong during an Authorizenet API call.
- Returns:
An Authorizenet API response, if any.
- Return type:
- _authorizenet_get_customer_profile(issuer_info: bool = True) dict | None[source]
Executes a
getCustomerProfileRequestusing the Authorizenet API.- Parameters:
issuer_info (
bool) – Whether or not to include issuer info in the response. Default isTrue.- Raises:
AuthorizenetControllerExecutionError – If something goes wrong during an Authorizenet API call.
- Returns:
An Authorizenet API response, if any.
- Return type:
- _authorizenet_update_customer_profile(validate: bool = False) dict | None[source]
Executes an
updateCustomerProfileRequestusing the Authorizenet API.- Parameters:
validate (
bool) – Whether or not to validate the customer profile in Authorizenet.- Raises:
AssertionError – If
idwasn’t set.AuthorizenetControllerExecutionError – If something goes wrong during an Authorizenet API call.
- Returns:
An Authorizenet API response, if any.
- Return type:
- _generate_customer_profile_ex_type() customerProfileExType[source]
Generates and returns a
customerProfileExType.- Returns:
A customer profile object.
- Return type:
customerProfileExType
- _generate_customer_profile_type() customerProfileType[source]
Generates and returns a
customerProfileType.- Returns:
A customer profile object.
- Return type:
customerProfileType
- create() int[source]
Creates the customer profile in Authorizenet.
- Raises:
AssertionError – If neither
merchant_idnoremailwere set.AuthorizenetControllerExecutionError – If something goes wrong during an Authorizenet API call.
- Returns:
An id for the new customer profile.
- Return type:
- delete() None[source]
Deletes the customer profile in Authorizenet and sets
idtoNoneifidis set.- Returns:
Nothing.
- Return type:
- get_address_profile_ids() list[int][source]
Returns a list of address profile ids assigned to the customer profile.
- Returns:
A list of address profile ids.
- Return type:
- get_payment_profile_ids() list[int][source]
Returns a list of payment profile ids assigned to the customer profile.
- Returns:
A list of payment profile ids.
- Return type:
- class terminusgps.authorizenet.profiles.addresses.AddressProfile(customer_profile_id: int | str, id: int | str | None = None, default: bool = False)[source]
An Authorizenet customer address profile.
Public Data Attributes:
Inherited from
AuthorizenetSubProfileBaseA customer profile id.
Whether or not the sub-profile is set as default.
Inherited from
AuthorizenetProfileBaseAn Authorizenet generated id.
A merchant authentication object to authenticate Authorizenet API calls.
The current Authorizenet API validation mode.
Public Methods:
create(address)Creates the customer shipping address profile in Authorizenet.
update(address)Updates the customer shipping address to the new address in Authorizenet.
delete()Deletes the customer address profile in Authorizenet and sets
idtoNoneifidis set.Inherited from
AuthorizenetSubProfileBase__init__(customer_profile_id[, id, default])Sets
customerProfileIdfor the sub-profile.Inherited from
AuthorizenetProfileBase__init__([id])Sets
idif provided.__str__()Returns a string representation of the profile, if
idwas set.Inherited from
AuthorizenetControllerExecutorexecute_controller(controller)Executes an Authorizenet API controller and returns its response.
Private Methods:
Executes a
getCustomerShippingAddressRequestusing the Authorizenet API.Executes a
createCustomerShippingAddressRequestusing the Authorizenet API.Executes a
updateCustomerShippingAddressRequestusing the Authorizenet API.Executes a
deleteCustomerShippingAddressRequestusing the Authorizenet API.
- _authorizenet_create_shipping_address(address: customerAddressType) dict | None[source]
Executes a
createCustomerShippingAddressRequestusing the Authorizenet API.
- _authorizenet_delete_shipping_address() dict | None[source]
Executes a
deleteCustomerShippingAddressRequestusing the Authorizenet API.deleteCustomerShippingAddressRequest
- Raises:
AssertionError – If
idwasn’t set.AssertionError – If
customerProfileIdwasn’t set.ControllerExecutionError – If something goes wrong during an Authorizenet API call.
- Returns:
An Authorizenet API response, if any.
- Return type:
- _authorizenet_get_shipping_address() dict | None[source]
Executes a
getCustomerShippingAddressRequestusing the Authorizenet API.getCustomerShippingAddressRequest
- Raises:
AssertionError – If
idwasn’t set.AssertionError – If
customerProfileIdwasn’t set.ControllerExecutionError – If something goes wrong during an Authorizenet API call.
- Returns:
An Authorizenet API response, if any.
- Return type:
- _authorizenet_update_shipping_address(address: customerAddressType) dict | None[source]
Executes a
updateCustomerShippingAddressRequestusing the Authorizenet API.updateCustomerShippingAddressRequest
- Raises:
AssertionError – If
idwasn’t set.AssertionError – If
customerProfileIdwasn’t set.ControllerExecutionError – If something goes wrong during an Authorizenet API call.
- Returns:
An Authorizenet API response, if any.
- Return type:
- create(address: customerAddressType) int[source]
Creates the customer shipping address profile in Authorizenet.
- Parameters:
address (
customerAddressType) – A customer address.- Returns:
An address profile id.
- Return type:
- class terminusgps.authorizenet.profiles.payments.PaymentProfile(customer_profile_id: int | str, id: int | str | None = None, default: bool = False)[source]
An Authorizenet customer payment profile.
Public Data Attributes:
Last 4 digits of the payment profile credit card.
Inherited from
AuthorizenetSubProfileBaseA customer profile id.
Whether or not the sub-profile is set as default.
Inherited from
AuthorizenetProfileBaseAn Authorizenet generated id.
A merchant authentication object to authenticate Authorizenet API calls.
The current Authorizenet API validation mode.
Public Methods:
create(address, payment)Creates the customer payment profile in Authorizenet.
update(address, payment)Updates the customer payment profile in Authorizenet if
idis set.delete()Deletes the customer payment profile in Authorizenet and sets
idtoNoneifidis set.Inherited from
AuthorizenetSubProfileBase__init__(customer_profile_id[, id, default])Sets
customerProfileIdfor the sub-profile.Inherited from
AuthorizenetProfileBase__init__([id])Sets
idif provided.__str__()Returns a string representation of the profile, if
idwas set.Inherited from
AuthorizenetControllerExecutorexecute_controller(controller)Executes an Authorizenet API controller and returns its response.
Private Methods:
Executes a
getTransactionListForCustomerRequestusing the Authorizenet API.Executes a
createCustomerPaymentProfileRequestusing the Authorizenet API._authorizenet_get_payment_profile([issuer_info])Executes a
getCustomerPaymentProfileRequestusing the Authorizenet API.Executes a
updateCustomerPaymentProfileRequestusing the Authorizenet API.Executes a
validateCustomerPaymentProfileRequestusing the Authorizenet API.Executes a
deleteCustomerPaymentProfileRequestusing the Authorizenet API.
- _authorizenet_create_payment_profile(address: customerAddressType, payment: paymentType) dict | None[source]
Executes a
createCustomerPaymentProfileRequestusing the Authorizenet API.
- _authorizenet_delete_payment_profile() dict | None[source]
Executes a
deleteCustomerPaymentProfileRequestusing the Authorizenet API.deleteCustomerPaymentProfileRequest
- Raises:
AssertionError – If
idwasn’t set.ControllerExecutionError – If something goes wrong during an Authorizenet API call.
- Returns:
An Authorizenet API response, if any.
- Return type:
- _authorizenet_get_payment_profile(issuer_info: bool = True) dict | None[source]
Executes a
getCustomerPaymentProfileRequestusing the Authorizenet API.getCustomerPaymentProfileRequest
- Parameters:
issuer_info (
bool) – Whether or not to include issuer information in the response. Default isTrue.- Raises:
AssertionError – If
idwasn’t set.ControllerExecutionError – If something goes wrong during an Authorizenet API call.
- Returns:
An Authorizenet API response, if any.
- Return type:
- _authorizenet_get_transaction_list_for_customer(limit: int = 100, ordering: str = 'submitTimeUTC', offset: int = 1, descending: bool = False) dict | None[source]
Executes a
getTransactionListForCustomerRequestusing the Authorizenet API.getTransactionListForCustomerRequest
- Parameters:
- Raises:
ValueError – If
orderingis invalid.AssertionError – If
idwasn’t set.ControllerExecutionError – If something goes wrong during an Authorizenet API call.
- Returns:
An Authorizenet API response, if any.
- Return type:
- _authorizenet_update_payment_profile(address: customerAddressType, payment: paymentType) dict | None[source]
Executes a
updateCustomerPaymentProfileRequestusing the Authorizenet API.updateCustomerPaymentProfileRequest
- Parameters:
address (
customerAddressType) – A customer address.payment (
paymentType) – A payment method.
- Raises:
AssertionError – If
idwasn’t set.ControllerExecutionError – If something goes wrong during an Authorizenet API call.
- Returns:
An Authorizenet API response, if any.
- Return type:
- _authorizenet_validate_payment_profile() dict | None[source]
Executes a
validateCustomerPaymentProfileRequestusing the Authorizenet API.validateCustomerPaymentProfileRequest
- Raises:
AssertionError – If
idwasn’t set.ControllerExecutionError – If something goes wrong during an Authorizenet API call.
- Returns:
An Authorizenet API response, if any.
- Return type:
- create(address: customerAddressType, payment: paymentType) int[source]
Creates the customer payment profile in Authorizenet.
- Parameters:
address (
customerAddressType) – A customer address.payment (
paymentType) – A payment.
- Returns:
A customer payment profile id.
- Return type:
- class terminusgps.authorizenet.profiles.subscriptions.SubscriptionProfile(customer_profile_id: int | str, id: int | str | None = None, default: bool = False)[source]
An Authorizenet subscription profile.
Public Data Attributes:
The subscription amount.
Current subscription status.
Subscription transactions.
Inherited from
AuthorizenetSubProfileBaseA customer profile id.
Whether or not the sub-profile is set as default.
Inherited from
AuthorizenetProfileBaseAn Authorizenet generated id.
A merchant authentication object to authenticate Authorizenet API calls.
The current Authorizenet API validation mode.
Public Methods:
create(subscription)Creates a subscription in Authorizenet.
update(subscription)Updates a subscription in Authorizenet if
idis set.delete()Deletes (cancels) a subscription in Authorizenet if
idis set.Inherited from
AuthorizenetSubProfileBase__init__(customer_profile_id[, id, default])Sets
customerProfileIdfor the sub-profile.Inherited from
AuthorizenetProfileBase__init__([id])Sets
idif provided.__str__()Returns a string representation of the profile, if
idwas set.Inherited from
AuthorizenetControllerExecutorexecute_controller(controller)Executes an Authorizenet API controller and returns its response.
Private Methods:
_authorizenet_create_subscription(subscription)Executes a
ARBCreateSubscriptionRequestusing the Authorizenet API.Executes a
ARBGetSubscriptionRequestusing the Authorizenet API.Executes a
ARBGetSubscriptionStatusRequestusing the Authorizenet API._authorizenet_update_subscription(subscription)Executes a
ARBUpdateSubscriptionRequestusing the Authorizenet API.Executes a
ARBCancelSubscriptionRequestusing the Authorizenet API.
- _authorizenet_cancel_subscription() dict | None[source]
Executes a
ARBCancelSubscriptionRequestusing the Authorizenet API.- Raises:
AssertionError – If
idwasn’t set.AuthorizenetControllerExecutionError – If something goes wrong during an Authorizenet API call.
- Returns:
An Authorizenet API response, if any.
- Return type:
- _authorizenet_create_subscription(subscription: ARBSubscriptionType) dict | None[source]
Executes a
ARBCreateSubscriptionRequestusing the Authorizenet API.- Raises:
AssertionError – If
idwasn’t set.AuthorizenetControllerExecutionError – If something goes wrong during an Authorizenet API call.
- Returns:
An Authorizenet API response, if any.
- Return type:
- _authorizenet_get_subscription(include_transactions: bool = False) dict | None[source]
Executes a
ARBGetSubscriptionRequestusing the Authorizenet API.- Parameters:
include_transactions – Whether or not to include subscription transactions in the Authorizenet API response. Default is
False.- Raises:
AssertionError – If
idwasn’t set.AuthorizenetControllerExecutionError – If something goes wrong during an Authorizenet API call.
- Returns:
An Authorizenet API response, if any.
- Return type:
- _authorizenet_get_subscription_status() dict | None[source]
Executes a
ARBGetSubscriptionStatusRequestusing the Authorizenet API.ARBGetSubscriptionStatusRequest
- Raises:
AssertionError – If
idwasn’t set.AuthorizenetControllerExecutionError – If something goes wrong during an Authorizenet API call.
- Returns:
An Authorizenet API response, if any.
- Return type:
- _authorizenet_update_subscription(subscription: ARBSubscriptionType) dict | None[source]
Executes a
ARBUpdateSubscriptionRequestusing the Authorizenet API.- Raises:
AssertionError – If
idwasn’t set.AuthorizenetControllerExecutionError – If something goes wrong during an Authorizenet API call.
- Returns:
An Authorizenet API response, if any.
- Return type:
- create(subscription: ARBSubscriptionType) int[source]
Creates a subscription in Authorizenet.
- Parameters:
subscription (
ARBSubscriptionType) – A subscription.- Raises:
AuthorizenetControllerExecutionError – If something goes wrong during an Authorizenet API call.
- Returns:
A subscription id.
- Return type:
- delete() None[source]
Deletes (cancels) a subscription in Authorizenet if
idis set.- Raises:
AuthorizenetControllerExecutionError – If something goes wrong during an Authorizenet API call.
- Returns:
Nothing.
- Return type:
- property status: AuthorizenetSubscriptionStatus | None
Current subscription status.
- Type:
- update(subscription: ARBSubscriptionType) None[source]
Updates a subscription in Authorizenet if
idis set.- Parameters:
subscription (
ARBSubscriptionType) – A subscription.- Raises:
AuthorizenetControllerExecutionError – If something goes wrong during an Authorizenet API call.
- Returns:
Nothing.
- Return type: