Profiles

class terminusgps.authorizenet.profiles.base.AuthorizenetProfileBase(merchant_id: int | str, id: int | str | None = None, *args, **kwargs)[source]
property id: str

An Authorizenet generated id.

property merchantAuthentication: merchantAuthenticationType

Merchant authentication for Authorizenet API calls.

property merchantCustomerId: str

An internally designated customer id.

class terminusgps.authorizenet.profiles.base.AuthorizenetSubProfileBase(customer_profile_id: int | str, default: bool, *args, **kwargs)[source]
property customerProfileId: str

An Authorizenet generated customer profile id.

property default: str

Whether or not the sub profile is set as default in Authorizenet.

property validationMode: str

The validation mode for Authorizenet API calls.

class terminusgps.authorizenet.profiles.addresses.AddressProfile(customer_profile_id: int | str, default: bool, *args, **kwargs)[source]

An Authorizenet customer address profile.

_authorizenet_create_shipping_address(addr: customerAddressType) dict[source]

Executes a createCustomerShippingAddressRequest using the Authorizenet API.

Raises:
  • AssertionError – If id wasn’t set.

  • ControllerExecutionError – If something goes wrong during an Authorizenet API call.

Returns:

An Authorizenet API response.

Return type:

dict

_authorizenet_delete_shipping_address() dict[source]

Executes a deleteCustomerShippingAddressRequest using the Authorizenet API.

Raises:
  • AssertionError – If id wasn’t set.

  • ControllerExecutionError – If something goes wrong during an Authorizenet API call.

Returns:

An Authorizenet API response.

Return type:

dict

_authorizenet_get_shipping_address() dict[source]

Executes a getCustomerShippingAddressRequest using the Authorizenet API.

Raises:
  • AssertionError – If id wasn’t set.

  • ControllerExecutionError – If something goes wrong during an Authorizenet API call.

Returns:

An Authorizenet API response.

Return type:

dict

_authorizenet_update_shipping_address(addr: customerAddressType) dict[source]

Executes a updateCustomerShippingAddressRequest using the Authorizenet API.

Raises:
  • AssertionError – If id wasn’t set.

  • ControllerExecutionError – If something goes wrong during an Authorizenet API call.

Returns:

An Authorizenet API response.

Return type:

dict

create(shipping_addr: customerAddressType) int[source]

Creates an Authorizenet address profile.

Parameters:

shipping_addr (customerAddressType) – An Authorizenet customer address.

Raises:

ControllerExecutionError – If something goes wrong during an Authorizenet API call.

Returns:

A new address profile id.

Return type:

int

delete() dict[source]

Deletes the Authorizenet address profile.

Raises:

ControllerExecutionError – If something goes wrong during an Authorizenet API call.

Returns:

An Authorizenet API response, if any.

Return type:

dict

update(shipping_addr: customerAddressType) dict[source]

Updates the Authorizenet address profile.

Parameters:

shipping_addr (customerAddressType) – A customer shipping address.

Raises:

ControllerExecutionError – If something goes wrong during an Authorizenet API call.

Returns:

An Authorizenet API response.

Return type:

dict

class terminusgps.authorizenet.profiles.customers.CustomerProfile(merchant_id: int | str, id: int | str | None = None, *args, **kwargs)[source]

An Authorizenet customer profile.

_authorizenet_create_customer_profile(email: str, desc: str = '') dict | None[source]

Executes a createCustomerProfileRequest using the Authorizenet API.

createCustomerProfileRequest

Parameters:
  • email (str) – An email address.

  • desc (str) – An optional description.

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:

dict | None

_authorizenet_delete_customer_profile() dict | None[source]

Executes a deleteCustomerProfileRequest using the Authorizenet API.

deleteCustomerProfileRequest

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:

dict | None

_authorizenet_get_customer_profile(issuer_info: bool = True) dict | None[source]

Executes a getCustomerProfileRequest using the Authorizenet API.

getCustomerProfileRequest

Parameters:

issuer_info (bool) – Whether or not to include issuer info in the response.

Raises:
  • AssertionError – If id was not set.

  • ControllerExecutionError – If something goes wrong during an Authorizenet API call.

Returns:

An Authorizenet API response, if any.

Return type:

dict | None

_authorizenet_get_customer_profile_ids() dict | None[source]

Executes a getCustomerProfileIdsRequest using the Authorizenet API.

getCustomerProfileIdsRequest

Raises:

ControllerExecutionError – If something goes wrong during an Authorizenet API call.

Returns:

An Authorizenet API response, if any.

Return type:

dict | None

_authorizenet_update_customer_profile(email: str, desc: str = '') dict | None[source]

Executes an updateCustomerProfileRequest using the Authorizenet API.

updateCustomerProfileRequest

Parameters:
  • email (str) – An email address.

  • desc (str) – An optional description.

Raises:
  • ControllerExecutionError – If something goes wrong during an Authorizenet API call.

  • AssertionError – If id wasn’t set.

Returns:

An Authorizenet API response, if any.

Return type:

dict | None

create(email: str, desc: str | None = None) int[source]

Creates a customer profile using the Authorizenet API and returns its id.

Parameters:
  • email (str) – An email address.

  • desc (str | None) – An optional description.

Raises:

ControllerExecutionError – If something goes wrong during an Authorizenet API call.

Returns:

The new customer profile id.

Return type:

int

delete() None[source]

Deletes the customer profile.

Raises:

ControllerExecutionError – If something goes wrong during an Authorizenet API call.

Returns:

Nothing.

Return type:

None

property exists: bool

Whether or not the customer profile exists in Authorizenet.

get_addresses() list[dict] | None[source]

Returns a list of the customer’s address profiles.

Raises:

ControllerExecutionError – If something goes wrong during an Authorizenet API call.

Returns:

A list of customer shipping addresses, if they exist.

Return type:

list | None

get_payment_profiles() list[dict] | None[source]

Returns a list of the customer’s payment profiles.

Raises:

ControllerExecutionError – If something goes wrong during an Authorizenet API call.

Returns:

A list of customer payment profiles, if they exist.

Return type:

list | None

update(email: str, desc: str = '') None[source]

Updates the customer profile.

Parameters:
  • email (str) – An email address.

  • desc (str) – An optional description. Default is ""

Raises:

ControllerExecutionError – If something goes wrong during an Authorizenet API call.

Returns:

Nothing.

Return type:

None

class terminusgps.authorizenet.profiles.payments.PaymentProfile(customer_profile_id: int | str, default: bool, *args, **kwargs)[source]

An Authorizenet customer payment profile.

_authorizenet_create_payment_profile(billing_addr: customerAddressType, payment: paymentType) dict[source]

Executes a createCustomerPaymentProfileRequest using the Authorizenet API.

Parameters:
  • billing_addr (customerAddressType) – A customer address.

  • payment (paymentType) – A payment method.

Raises:

AssertionError – If id wasn’t set.

:raises : If id wasn’t set. :returns: An Authorizenet API response. :rtype: dict

_authorizenet_delete_payment_profile() dict[source]

Executes a deleteCustomerPaymentProfileRequest using the Authorizenet API.

Raises:

AssertionError – If id wasn’t set.

Returns:

An Authorizenet API response.

Return type:

dict

_authorizenet_get_payment_profile(issuer_info: bool = False) dict[source]

Executes a getCustomerPaymentProfileRequest using the Authorizenet API.

Parameters:

issuer_info (bool) – Whether or not to include issuer information in the response.

Raises:

AssertionError – If id wasn’t set.

Returns:

An Authorizenet API response.

Return type:

dict

_authorizenet_get_transaction_list_for_customer(limit: int = 100, ordering: str = 'submitTimeUTC', offset: int = 1, descending: bool = False) dict[source]

Executes a getTransactionListForCustomerRequest using the Authorizenet API.

Parameters:
  • limit (int) – Total number of transactions to retrieve. Default is 100.

  • ordering (str) – A field to order the transactions by. Default is "submitTimeUTC".

  • offset (customerAddressType) – Page of the response to retrieve.

  • descending (bool) – Sort the results in descending order.

Raises:
Returns:

An Authorizenet API response.

Return type:

dict

_authorizenet_update_payment_profile(billing_addr: customerAddressType, payment: paymentType) dict[source]

Executes a validateCustomerPaymentProfileRequest using the Authorizenet API.

Parameters:
  • billing_addr (customerAddressType) – A customer address.

  • payment (paymentType) – A payment method.

Raises:

AssertionError – If id wasn’t set.

Returns:

An Authorizenet API response.

Return type:

dict

_authorizenet_validate_payment_profile() dict[source]

Executes a validateCustomerPaymentProfileRequest using the Authorizenet API.

Raises:

AssertionError – If id wasn’t set.

Returns:

An Authorizenet API response.

Return type:

dict

create(billing_addr: customerAddressType, payment: paymentType) int[source]

Creates an Authorizenet payment profile and returns its id.

Parameters:
  • billing_addr (customerAddressType) – A billing address.

  • payment (paymentType) – A payment object.

Returns:

The new payment profile’s id.

Return type:

int

delete() dict[source]

Deletes the Authorizenet payment profile.

update(billing_addr: customerAddressType, payment: paymentType) dict[source]

Updates the Authorizenet payment profile.