Expand Minimize
This topic has not yet been rated - Rate this topic

ValidateCCNumber

Commerce Server 2002

Use this component to check the expiration date of a credit card and to perform a checksum test on the number. Checksum testing ensures that the format of the number is correct; it does not verify the validity of the account.

Intended use: Order Processing pipeline, Payment stage.

Configuration Values

You can determine when the ValidateCCNumber component checks the credit card by setting component properties. Use the following boxes on the Validate CC tab of the Component Properties dialog box to determine this information.

BoxDescription
Apply whenDetermines when to apply the credit card check. The values are:
Always
Default. Specifies that the format of the credit-card number is always checked.
Equal to method
Specifies that the format of the number should be checked when the value of the payment_method key in the Order dictionary is the same as the string specified for the Method box.
Has any value
Specifies that the format of the number should be checked when the payment_method key of the order has any non-null value.
MethodThe payment method to match against the value of the payment_method key in the Order dictionary. Used when the value in the Apply when is set to Equal to method box.

Values Read

The ValidateCCNumber component reads the following values from the indicated dictionaries.

KeyDictionaryDescription
_cc_numberOrderThe credit card number.
_cc_expmonthOrderThe expiration month as a string.
_cc_expyearOrderThe expiration year as a string.
cc_typeOrderThe type of the credit card as a string. Must be one of the following six types: MasterCard, MC, VISA, Discover, AmericanExpress, AMEX. No other type will be validated.
MessageManagerContextA reference to a MessageManager object, which uses the invalid credit card error constant (pur_badcc) to retrieve an error message.

Values Written

The ValidateCCNumber component writes the following values to the Order dictionary.

KeyDescription
_Purchase_ErrorsError messages are written to this SimpleList object.

Errors

The ValidateCCNumber component returns error level 2 (OPPERRORLEV_WARN) when an error occurs.

The component writes error messages to the _Purchase_Errors collection. The component uses a MessageManager object to retrieve user warning message text.

ConstantCondition
pur_badccThe credit card has expired or has a bad number.

Remarks

The ValidateCCNumber component first determines whether the credit card type specified in the order.cc_type key is one of the types accepted by this component. Accepted types are VISA, MasterCard, AmericanExpress, Discover, and the abbreviations MC and AMEX.

The ValidateCCNumber component checks the values stored in the order._cc_expmonth and order._cc_expyear keys to confirm that the credit card has not expired.

If the card is an accepted type, the component then runs a checksum on the number stored in the order._cc_number key to ensure that the number is properly formed. For example, if the specified credit card type is Discover, a well-formed number must begin with a 3 and must consist of 16 digits.

See Also

MessageManager Object

Copyright © 2005 Microsoft Corporation.
All rights reserved.
Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.