다음을 통해 공유


PaymentMethodRouter

Use the PaymentMethodRouter pipeline component to run the correct pipeline to process each Payment in the OrderForm.

Intended use: Order Processing pipeline, Payment stage.

Configuration Values

Use the following boxes on the Execution Mode tab of the Component Properties dialog box to determine this information.

Box

Description

Backward Compatible For CreditCard Processing

Use this option if you are using credit card processing pipeline components from earlier versions of Commerce Server.

Validate Payment Total

Select this option to raise an exception if the sum of all Payments is not equal to the OrderForm's total.

Values Read

The PaymentMethodRouter pipeline component reads the following values from the indicated dictionaries.

Key

Dictionary

Description

Payments

Order

Contains the list of payments for the particular OrderForm.

Type: SimpleList

CacheManager

Context

CacheManager that contains the PaymentMethodCache.

Type: CacheManager

pipelines

Context

Pipeline collection that contains the pipelines that you configure in the Web.config file.

Type: PipelineCollection

Values Written

The PaymentMethodRouter pipeline component writes the following values to the indicated dictionaries.

Key

Dictionary

Description

Payments

Order

The payment that the PaymentProcessor pipeline will process.

Type: Dictionary

Remarks

The PaymentMethodRouter pipeline component routes different types of payments to the pipeline that can process the payment. For each Payment in the OrderForm, the PaymentMethodRouter pipeline component performs the following steps:

  1. Determine the PaymentMethod for the Payment.

  2. Search the PaymentMethodTable to find the name of the pipeline that processes this kind of Payment.

  3. Retrieve the pipeline from the pipelinesPipelineCollection.

  4. Run the pipeline to process the Payment.

Earlier versions of Commerce Server stored information about a credit card payment in the dictionary for the OrderForm object. Commerce Server 2009 stores information about a credit card payment in the payments entry in the dictionary for the OrderForm object. If the pipeline that processes credit card payments in your application expects information about a credit card to be in the OrderForm object, use the Commerce Server Pipeline Editor to select Backward Compatible For Credit Card Processing on the Execution Mode tab of the Component Properties page for the PaymentMethodRouter pipeline component.

You can configure the PaymentMethodRouter pipeline component to validate that the sum of all Payments is equal to the OrderForm's total. If the sum of all Payments is not equal to the OrderForm's total, the PaymentMethodRouter pipeline component raises an exception. To configure the PaymentMethodRouter pipeline component to validate that the sum of all Payments is equal to the OrderForm's total, use the Commerce Server Pipeline Editor to select Validate Payment Total on the Execution Mode tab of the Component Properties page for the PaymentMethodRouter pipeline component.

If the amount of one Payment is zero and the amounts of all other Payments are non-zero, the PaymentMethodRouter pipeline component will calculate a value for the amount of the Payment whose value is zero. The PaymentMethodRouter pipeline component subtracts the sum of all non-zero Payment amounts from the OrderForm's total, and assigns the difference to the Payment whose amount was zero.

See Also

Other Resources

Pipeline Component Reference