components.payment_gateway.public.cards ¶
This module defines the public API for the cards subcomponent.
Only business logic is exposed here. Basic entities and enums are exposed in separate modules to avoid loading the entire subcomponent with its models and dependencies when they are not needed.
Classes¶
CardDeliveryLogic ¶
This class is the public interface to the card delivery logic.
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/card_delivery.py
Attributes¶
card_delivery_status_changed_topic
instance-attribute
¶
Functions¶
declare_card_not_received ¶
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/card_delivery.py
declare_card_received ¶
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/card_delivery.py
get_card_order ¶
Get the card order info for a card.
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/card_delivery.py
CardHolderLogic ¶
This class is the public interface to the card holder logic.
Implements the following Nullable patterns: - Nullables: https://www.jamesshore.com/v2/projects/nullables/testing-without-mocks#nullables ⧉ - Parameterless instantiation: https://www.jamesshore.com/v2/projects/nullables/testing-without-mocks#instantiation ⧉
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/card_holders.py
Attributes¶
Functions¶
create
classmethod
¶
Normal factory
create_null
classmethod
¶
Null factory
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/card_holders.py
declare_card_holder ¶
declare_card_holder(
session,
/,
first_name,
last_name,
display_name=None,
short_name=None,
provider=PaymentServiceProvider.adyen,
external_id=None,
)
Declare a card holder.
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/card_holders.py
get_card_holder ¶
Get a card holder entity from its ID.
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/card_holders.py
terminate_card_holder ¶
Terminate a card holder.
Card holders in terminal state cannot be modified or used anymore.
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/card_holders.py
update_card_holder_contact_info ¶
Update the phone number and email of a card holder on the PSP. Phone number is is needed to add cards to digital wallets. Email is optional as a second option for adding cards to digit wallets.
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/card_holders.py
update_card_holder_identity ¶
Update the identity of a card holder.
The current identity of a card holder is used when issuing a card. The identity of a card holder may change over time, but cards are immutable.
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/card_holders.py
CardHolderNotFoundException ¶
Bases: PaymentCardException
Exception raised when trying to use a non-existing Card Holder.
CardHolderTerminatedException ¶
Bases: PaymentCardException
Exception raised when trying to use a terminated Card Holder.
CardIncidentsLogic ¶
This class is the public interface to the card incidents declaration logic.
Incidents should eventually lead to the replacement of the card.
Implements the following Nullable patterns: - Nullables: https://www.jamesshore.com/v2/projects/nullables/testing-without-mocks#nullables ⧉ - Parameterless instantiation: https://www.jamesshore.com/v2/projects/nullables/testing-without-mocks#instantiation ⧉
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/card_incidents.py
Attributes¶
Functions¶
create
classmethod
¶
create_null
classmethod
¶
Null factory
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/card_incidents.py
declare_card_damaged ¶
Declare a card as damaged.
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/card_incidents.py
declare_card_lost ¶
Declare a card as lost.
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/card_incidents.py
declare_card_stolen ¶
Declare a card as stolen.
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/card_incidents.py
declare_card_temporarily_suspended ¶
Declare a card as temporarily suspended.
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/card_incidents.py
CardLifecycleLogic ¶
This class is the public interface to the card lifecycle logic.
Implements the following Nullable patterns: - Nullables: https://www.jamesshore.com/v2/projects/nullables/testing-without-mocks#nullables ⧉ - Parameterless instantiation: https://www.jamesshore.com/v2/projects/nullables/testing-without-mocks#instantiation ⧉
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/card_lifecycle.py
Attributes¶
Functions¶
create
classmethod
¶
create_card ¶
create_card(
session,
/,
card_holder_id,
account_id,
form_factor,
phone_number,
email,
shipment_info=None,
issued_at=None,
issuance_reason=None,
description=None,
reference=None,
configuration=None,
)
Create a card for a card holder.
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/card_lifecycle.py
create_null
classmethod
¶
Null factory
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/card_lifecycle.py
terminate_card ¶
Terminate a card.
Cards in terminal state cannot be modified or used anymore.
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/card_lifecycle.py
CardLogic ¶
This class is the public interface to the card logic.
Implements the following Nullable patterns: - Nullables: https://www.jamesshore.com/v2/projects/nullables/testing-without-mocks#nullables ⧉ - Parameterless instantiation: https://www.jamesshore.com/v2/projects/nullables/testing-without-mocks#instantiation ⧉
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/cards.py
Attributes¶
card_authentication_actions
instance-attribute
¶
Functions¶
create
classmethod
¶
Normal factory
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/cards.py
create_null
classmethod
¶
Null factory
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/cards.py
edit_card_authentication_info ¶
Update the card authentication info. The phone number is mandatory, the email is optional
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/cards.py
get_card ¶
Get a card entity from its ID.
get_card_ids_for_account ¶
Get all the card IDs for an account.
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/cards.py
get_card_ids_for_card_holder ¶
Get all the card IDs for a card holder.
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/cards.py
get_card_pan_reveal_public_key ¶
Get the base-64 public key used for client-side encryption of card PAN reveal requests.
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/cards.py
get_card_pin_reveal_public_key ¶
Get the base-64 public key used for client-side encryption of card PIN reveal requests.
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/cards.py
get_cards_for_account ¶
Get all the cards for an account.
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/cards.py
get_cards_for_card_holder ¶
Get all the cards for a card holder.
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/cards.py
reveal_card_default_password ¶
Reveal the default password of a card.
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/cards.py
reveal_card_pan ¶
Reveal the PAN of a card.
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/cards.py
reveal_card_pin ¶
Reveal the PAN of a card.
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/cards.py
CardNotFoundException ¶
Bases: PaymentCardException
Exception raised when trying to use a non-existing Card.
CardOrderNotFoundException ¶
Bases: PaymentCardException
Exception raised when trying to use a non-existing Card Order.
CardProvisioningLogic ¶
This class is the public interface to the Card provisioning logic.
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/card_provisioning.py
Attributes¶
Functions¶
create_card_provisioning ¶
create_card_provisioning(
session,
/,
card_id,
provider,
external_id,
provisioning_type,
provisioning_date,
wallet_provider,
)
Create a new CardProvisioning
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/card_provisioning.py
get_all_card_provisioning ¶
Get all card provisioning from a given card.
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/card_provisioning.py
CardStatusLogic ¶
This class is the public interface to the card status logic.
Implements the following Nullable patterns: - Nullables: https://www.jamesshore.com/v2/projects/nullables/testing-without-mocks#nullables ⧉ - Parameterless instantiation: https://www.jamesshore.com/v2/projects/nullables/testing-without-mocks#instantiation ⧉
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/card_status.py
Attributes¶
card_suspended_by_provider_topic
instance-attribute
¶
Functions¶
activate_card ¶
Activate a card.
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/card_status.py
close_card ¶
Close a card. This action is non-revertible.
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/card_status.py
create
classmethod
¶
create_null
classmethod
¶
Null factory
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/card_status.py
suspend_card ¶
Suspend a card.
Source code in components/payment_gateway/subcomponents/cards/protected/business_logic/card_status.py
CardTerminatedException ¶
Bases: PaymentCardException
Exception raised when trying to use a terminated Card.
InvalidCardStatusTransitionException ¶
Bases: PaymentCardException, ValueError
Exception raised when attempting an invalid Card status transition.
MissingCardPasswordSaltException ¶
Bases: PaymentCardException
Exception raised when trying to generate a Card password without a password salt.
MissingCardShipmentInfoException ¶
Bases: PaymentCardException, ValueError
Exception raised when trying to create a physical Card without providing shipment info.
PaymentCardException ¶
Bases: PaymentGatewayException
Base class for all Card exceptions.