1. Payments service layer

Payments domain model

Version:

This section describes the domain model that represents the payment information objects where the following three assertions hold true:

  • The domain model primarily serves as DTO objects for transferring information between the external commerce system and Sitecore.
  • The domain model contains the minimum required information as contracts and will typically be extended when integrated with a specific commerce system.
  • The domain model is used when a Sitecore developer needs to synchronize product data with the external commerce system or product data is pushed into Sitecore from the external commerce system.

The following class diagram shows the domain model.

0300001A.png
Note

The domain model consists of abstract classes that make up the contracts with the external system. The contracts are defined as abstract classes instead of interfaces to allow the model to be easily extended later if needed. This follows the best practice guidelines defined in the Framework Design Guidelines. Default implementation of the contracts are delivered as part of Connect. If an actual Connect provider with an external commerce system contains more functionality than that provided by default, the implementation can be replaced. All instantiation of actual classes will be handled through dependency injection.

Class: PaymentMethod

The PaymentMethod class is responsible for representing a type of payment option, for example, Visa is a type of PayCard option.

NameTypeDescription
ExternalIdStringUnique identifier for the payment method in the commerce system.
DescriptionStringA description of the payment method.
NameStringThe name of the payment method.
PaymentOptionIdStringThe payment option associated with this payment method.
ShopNameStringThe shop name if any associated with this payment method.

Class: PaymentOption

The PaymentOption class is responsible for representing different payment option types, for example,Visa.

NameTypeDescription
ExternalIdStringUnique identifier for the payment option in the commerce system.
DescriptionStringA description of the payment option.
NameStringName of the payment option.
ShopNameStringThe shop name, if any, associated to the payment option.

Class: PaymentOptionType

The PaymentOptionType class is a virtual enum class responsible for representing known payment option types, for example, gift card, credit card, and so on.

NameTypeDescription
NonePaymentOptionTypeAn unassigned payment option.
PayCardPaymentOptionTypeCredit cards, debit cards, and so on.
PayGiftCardPaymentOptionTypeRepresents gift cards.
PayLoyaltyCardPaymentOptionTypeRepresents loyalty cards.

Class: PaymentLookup

The PaymentLookup class is used to hold the information required to lookup payment prices for a collection of line items.

NameTypeDescription
OptionIdStringAn unassigned payment option.
MethodIdStringCredit cards, debit cards, and so on.
LineItemIdsListThe line items to check the pricing for.

Class: PaymentPrice

The PaymentPrice class inherits from the Price object and is used to hold the pricing information for a payment option, method, and list of line items.

NameTypeDescription
OptionIdStringAn unassigned payment option.
MethodIdStringCredit cards, debit cards, and so on.
LineItemIdsListThe list of line items that the pricing applies to.

Class: CardType

The CardType class is a virtual enum class responsible for representing the type of payment cards that can be accepted when processing a payment.

NameTypeDescription
VisaCardTypeThe Visa card type.
MasterCardCardTypeThe Master Card card type.
DiscoverCardTypeThe Discover card type.
DebitCardTypeThe debit card type.
AllCardTypesCardTypeRepresents all supported card types.

Class: PurchaseLevel

The PurchaseLevel class is a virtual enum class that represents the level of card processing that will be performed during a payment service transaction.

NameTypeDescription
Level1PurchaseLevelRepresents level 1 card processing.
Level2PurchaseLevelRepresents level 2 card processing.
Level3PurchaseLevelRepresents level 3 card processing.

Class: TransactionType

The TransactionType class is a virtual enum class that represents the type of transaction being performed with a payment service.

NameTypeDescription
NoneTransactionTypeNo transaction is performed.
AuthorizeTransactionTypeAuthorize a payment.
ReauthorizeTransactionTypeRe-authorize a payment.
CaptureTransactionTypeCapture a payment.
ImmediateCaptureTransactionTypePerform a capture with no delay.
VoidTransactionTypeVoid a payment.
ReversalTransactionTypeReverse a payment.
RefundTransactionTypeRefund a payment.
If you have suggestions for improving this article, let us know!