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
id
if provided.__str__
()Returns a string representation of the profile, if
id
was set.Inherited from
AuthorizenetControllerExecutor
execute_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
AuthorizenetProfileBase
An 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
customerProfileId
for the sub-profile.Inherited from
AuthorizenetProfileBase
__init__
([id])Sets
id
if provided.__str__
()Returns a string representation of the profile, if
id
was set.Inherited from
AuthorizenetControllerExecutor
execute_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: int | str | None = None, email: str | None = None, desc: str | None = None)[source]
An Authorizenet customer profile.
Public Data Attributes:
The current Authorizenet validation mode.
A merchant designated customer id.
A customer email address.
A customer description.
Inherited from
AuthorizenetProfileBase
An 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])create
()Creates the customer profile in Authorizenet.
update
()Updates the customer profile in Authorizenet if
id
is set.delete
()Deletes the customer profile in Authorizenet and sets
id
toNone
ifid
is 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
id
if provided.__str__
()Returns a string representation of the profile, if
id
was set.Inherited from
AuthorizenetControllerExecutor
execute_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
getCustomerProfileRequest
using the Authorizenet API._authorizenet_create_customer_profile
([validate])Executes a
createCustomerProfileRequest
using the Authorizenet API._authorizenet_update_customer_profile
([validate])Executes an
updateCustomerProfileRequest
using the Authorizenet API.Executes a
deleteCustomerProfileRequest
using the Authorizenet API.
- _authorizenet_create_customer_profile(validate: bool = False) dict | None [source]
Executes a
createCustomerProfileRequest
using the Authorizenet API.- Parameters:
validate (
bool
) – Whether or not to validate the customer profile in Authorizenet.- Raises:
AssertionError – If neither
merchantCustomerId
noremail
were 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
deleteCustomerProfileRequest
using the Authorizenet API.- Raises:
AssertionError – If
id
wasn’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
getCustomerProfileRequest
using 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
updateCustomerProfileRequest
using the Authorizenet API.- Parameters:
validate (
bool
) – Whether or not to validate the customer profile in Authorizenet.- Raises:
AssertionError – If
id
wasn’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
merchantCustomerId
noremail
were 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
id
toNone
ifid
is 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
AuthorizenetSubProfileBase
A customer profile id.
Whether or not the sub-profile is set as default.
Inherited from
AuthorizenetProfileBase
An 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
id
toNone
ifid
is set.Inherited from
AuthorizenetSubProfileBase
__init__
(customer_profile_id[, id, default])Sets
customerProfileId
for the sub-profile.Inherited from
AuthorizenetProfileBase
__init__
([id])Sets
id
if provided.__str__
()Returns a string representation of the profile, if
id
was set.Inherited from
AuthorizenetControllerExecutor
execute_controller
(controller)Executes an Authorizenet API controller and returns its response.
Private Methods:
Executes a
getCustomerShippingAddressRequest
using the Authorizenet API.Executes a
createCustomerShippingAddressRequest
using the Authorizenet API.Executes a
updateCustomerShippingAddressRequest
using the Authorizenet API.Executes a
deleteCustomerShippingAddressRequest
using the Authorizenet API.
- _authorizenet_create_shipping_address(address: customerAddressType) dict | None [source]
Executes a
createCustomerShippingAddressRequest
using the Authorizenet API.
- _authorizenet_delete_shipping_address() dict | None [source]
Executes a
deleteCustomerShippingAddressRequest
using the Authorizenet API.deleteCustomerShippingAddressRequest
- Raises:
AssertionError – If
id
wasn’t set.AssertionError – If
customerProfileId
wasn’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
getCustomerShippingAddressRequest
using the Authorizenet API.getCustomerShippingAddressRequest
- Raises:
AssertionError – If
id
wasn’t set.AssertionError – If
customerProfileId
wasn’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
updateCustomerShippingAddressRequest
using the Authorizenet API.updateCustomerShippingAddressRequest
- Raises:
AssertionError – If
id
wasn’t set.AssertionError – If
customerProfileId
wasn’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
AuthorizenetSubProfileBase
A customer profile id.
Whether or not the sub-profile is set as default.
Inherited from
AuthorizenetProfileBase
An 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
id
is set.delete
()Deletes the customer payment profile in Authorizenet and sets
id
toNone
ifid
is set.Inherited from
AuthorizenetSubProfileBase
__init__
(customer_profile_id[, id, default])Sets
customerProfileId
for the sub-profile.Inherited from
AuthorizenetProfileBase
__init__
([id])Sets
id
if provided.__str__
()Returns a string representation of the profile, if
id
was set.Inherited from
AuthorizenetControllerExecutor
execute_controller
(controller)Executes an Authorizenet API controller and returns its response.
Private Methods:
Executes a
getTransactionListForCustomerRequest
using the Authorizenet API.Executes a
createCustomerPaymentProfileRequest
using the Authorizenet API._authorizenet_get_payment_profile
([issuer_info])Executes a
getCustomerPaymentProfileRequest
using the Authorizenet API.Executes a
updateCustomerPaymentProfileRequest
using the Authorizenet API.Executes a
validateCustomerPaymentProfileRequest
using the Authorizenet API.Executes a
deleteCustomerPaymentProfileRequest
using the Authorizenet API.
- _authorizenet_create_payment_profile(address: customerAddressType, payment: paymentType) dict | None [source]
Executes a
createCustomerPaymentProfileRequest
using the Authorizenet API.
- _authorizenet_delete_payment_profile() dict | None [source]
Executes a
deleteCustomerPaymentProfileRequest
using the Authorizenet API.deleteCustomerPaymentProfileRequest
- Raises:
AssertionError – If
id
wasn’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
getCustomerPaymentProfileRequest
using the Authorizenet API.getCustomerPaymentProfileRequest
- Parameters:
issuer_info (
bool
) – Whether or not to include issuer information in the response. Default isTrue
.- Raises:
AssertionError – If
id
wasn’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
getTransactionListForCustomerRequest
using the Authorizenet API.getTransactionListForCustomerRequest
- Parameters:
- Raises:
ValueError – If
ordering
is invalid.AssertionError – If
id
wasn’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
updateCustomerPaymentProfileRequest
using the Authorizenet API.updateCustomerPaymentProfileRequest
- Parameters:
address (
customerAddressType
) – A customer address.payment (
paymentType
) – A payment method.
- Raises:
AssertionError – If
id
wasn’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
validateCustomerPaymentProfileRequest
using the Authorizenet API.validateCustomerPaymentProfileRequest
- Raises:
AssertionError – If
id
wasn’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:
Current subscription status.
Subscription transactions.
Inherited from
AuthorizenetSubProfileBase
A customer profile id.
Whether or not the sub-profile is set as default.
Inherited from
AuthorizenetProfileBase
An 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
id
is set.delete
()Deletes (cancels) a subscription in Authorizenet if
id
is set.Inherited from
AuthorizenetSubProfileBase
__init__
(customer_profile_id[, id, default])Sets
customerProfileId
for the sub-profile.Inherited from
AuthorizenetProfileBase
__init__
([id])Sets
id
if provided.__str__
()Returns a string representation of the profile, if
id
was set.Inherited from
AuthorizenetControllerExecutor
execute_controller
(controller)Executes an Authorizenet API controller and returns its response.
Private Methods:
_authorizenet_create_subscription
(subscription)Executes a
ARBCreateSubscriptionRequest
using the Authorizenet API.Executes a
ARBGetSubscriptionRequest
using the Authorizenet API.Executes a
ARBGetSubscriptionStatusRequest
using the Authorizenet API._authorizenet_update_subscription
(subscription)Executes a
ARBUpdateSubscriptionRequest
using the Authorizenet API.Executes a
ARBCancelSubscriptionRequest
using the Authorizenet API.
- _authorizenet_cancel_subscription() dict | None [source]
Executes a
ARBCancelSubscriptionRequest
using the Authorizenet API.- Raises:
AssertionError – If
id
wasn’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
ARBCreateSubscriptionRequest
using the Authorizenet API.- Raises:
AssertionError – If
id
wasn’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
ARBGetSubscriptionRequest
using the Authorizenet API.- Parameters:
include_transactions – Whether or not to include subscription transactions in the Authorizenet API response. Default is
False
.- Raises:
AssertionError – If
id
wasn’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
ARBGetSubscriptionStatusRequest
using the Authorizenet API.ARBGetSubscriptionStatusRequest
- Raises:
AssertionError – If
id
wasn’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
ARBUpdateSubscriptionRequest
using the Authorizenet API.- Raises:
AssertionError – If
id
wasn’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
id
is 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
id
is set.- Parameters:
subscription (
ARBSubscriptionType
) – A subscription.- Raises:
AuthorizenetControllerExecutionError – If something goes wrong during an Authorizenet API call.
- Returns:
Nothing.
- Return type: