Payments domain model

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.

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

Name

Type

Description

ExternalId

String

Unique identifier for the payment method in the commerce system.

Description

String

A description of the payment method.

Name

String

The name of the payment method.

PaymentOptionId

String

The payment option associated with this payment method.

ShopName

String

The shop name if any associated with this payment method.

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

Name

Type

Description

ExternalId

String

Unique identifier for the payment option in the commerce system.

Description

String

A description of the payment option.

Name

String

Name of the payment option.

ShopName

String

The shop name, if any, associated to the payment option.

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

Name

Type

Description

None

PaymentOptionType

An unassigned payment option.

PayCard

PaymentOptionType

Credit cards, debit cards, and so on.

PayGiftCard

PaymentOptionType

Represents gift cards.

PayLoyaltyCard

PaymentOptionType

Represents loyalty cards.

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

Name

Type

Description

OptionId

String

An unassigned payment option.

MethodId

String

Credit cards, debit cards, and so on.

LineItemIds

List<string>

The line items to check the pricing for.

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.

Name

Type

Description

OptionId

String

An unassigned payment option.

MethodId

String

Credit cards, debit cards, and so on.

LineItemIds

List<string>

The list of line items that the pricing applies to.

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

Name

Type

Description

Visa

CardType

The Visa card type.

MasterCard

CardType

The Master Card card type.

Discover

CardType

The Discover card type.

Debit

CardType

The debit card type.

AllCardTypes

CardType

Represents all supported card types.

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

Name

Type

Description

Level1

PurchaseLevel

Represents level 1 card processing.

Level2

PurchaseLevel

Represents level 2 card processing.

Level3

PurchaseLevel

Represents level 3 card processing.

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

Name

Type

Description

None

TransactionType

No transaction is performed.

Authorize

TransactionType

Authorize a payment.

Reauthorize

TransactionType

Re-authorize a payment.

Capture

TransactionType

Capture a payment.

ImmediateCapture

TransactionType

Perform a capture with no delay.

Void

TransactionType

Void a payment.

Reversal

TransactionType

Reverse a payment.

Refund

TransactionType

Refund a payment.