FDMSLevel2 Component

Properties   Methods   Events   Config Settings   Errors  

The FDMSLevel2 component is a tool used to create Level2 Corporate Purchasing Card addendum aggregates, which can then be passed to the component and settled.

Syntax

DPayments.DPaymentsSDK.Fdmslevel2

Remarks

The properties required to build a Level 2 addendum depends upon the value of the CardType property. The following tables indicate which properties are valid for what card type:

American Express

Visa

MasterCard

The following example illustrates how to add Level 2 data to a transaction to be settled:

FDMSECommerce.Authorize() FDMSLevel2.CardType = fctVisa FDMSLevel2.CommercialCardType = FDMSECommerce.ResponseCommercialCard FDMSLevel2.OrderDate = "060828" 'September 28th, 2006 FDMSLevel2.FreightTaxAmount = "0" FDMSLevel2.FreightAmount = "600" FDMSLevel2.PurchaseIdentifier = "123456PURCHID" FDMSLevel2.InvoiceNumber = "CUSTCODE" FDMSLevel2.ShippedToZip = "90210" FDMSLevel2.ShippedFromZip = "90210" FDMSLevel2.TaxAmount = "120" FDMSSettle.DetailRecords.Add(New FDMSRecordType(FDMSECommerce.GetDetailAggregate(), FDMSLevel2.GetAddendum()))

Note that while Level 2 addendum data is only applicable to corporate purchasing cards, you may send Level 2 data for all Visa, Master Card, and American Express cards if you wish.

Property List


The following is the full list of the properties of the component with short descriptions. Click on the links for further details.

CardTypeThe card type for which a Level 2 or Level 3 addendum will be created.
CommercialCardTypeIndicates the type of commercial card being settled.
DestinationCountryCountry the goods are to be shipped to.
DestinationStateState or province to which the goods are to be shipped.
DestinationZipThe zip code to which the commodity was shipped.
DiscountAmountAmount of any discount subtracted from the line item totals.
DutyAmountDuty fees (if any) for imported goods.
FreightAmountShipping charges associated with this transaction.
FreightTaxAmountPortion of the FreightAmount that is tax.
FreightTaxRateRate used to calculate the FreightTaxAmount .
InvoiceNumberCustomer Reference Identifier
MerchantReferenceMerchant Reference Number
MerchantTaxIdMerchant's government tax Id number.
MerchantTypeMasterCard merchant classification code.
OrderDateDate of the order in YYMMDD format.
PurchaseIdentifierUsed to identify the purchase.
ShippedFromZipZip code the goods are being shipped from.
TaxAmountSales tax charged in addition to the original TransactionAmount

Method List


The following is the full list of the methods of the component with short descriptions. Click on the links for further details.

ConfigSets or retrieves a configuration setting.
GetAddendumReturns a Level 2 Purchasing card addendum based on the specified CardType
ResetClears all properties to their default values.

Event List


The following is the full list of the events fired by the component with short descriptions. Click on the links for further details.

ErrorFired when information is available about errors during data delivery.

Config Settings


The following is a list of config settings for the component with short descriptions. Click on the links for further details.

BuildInfoInformation about the product's build.
GUIAvailableWhether or not a message loop is available for processing events.
LicenseInfoInformation about the current license.
MaskSensitiveWhether sensitive data is masked in log messages.
UseInternalSecurityAPIWhether or not to use the system security libraries or an internal implementation.

CardType Property (FDMSLevel2 Component)

The card type for which a Level 2 or Level 3 addendum will be created.

Syntax

public Fdmslevel2CardTypes CardType { get; set; }

enum Fdmslevel2CardTypes { fctUnknown, fctVisa, fctMasterCard, fctAmericanExpress }
Public Property CardType As Fdmslevel2CardTypes

Enum Fdmslevel2CardTypes fctUnknown fctVisa fctMasterCard fctAmericanExpress End Enum

Default Value

0

Remarks

The value of this property MUST correspond to the card number that is to be settled in the detail record (to which this addendum is associated). Valid values for this property include:

fctVisa (1)Creates a Group 22 addendum for Visa or MasterCards.
fctMasterCard (2)Creates a Group 22 addendum for Visa or MasterCards.
fctAmericanExpress (3)Creates a Group 21 addendum for American Express cards (NOTE: American Express is not available for Level 3).

CommercialCardType Property (FDMSLevel2 Component)

Indicates the type of commercial card being settled.

Syntax

public Fdmslevel2CommercialCardTypes CommercialCardType { get; set; }

enum Fdmslevel2CommercialCardTypes { fccNotCommercial, fccPurchaseCard, fccCorporateCard, fccBusinessCard, fccUnknown }
Public Property CommercialCardType As Fdmslevel2CommercialCardTypes

Enum Fdmslevel2CommercialCardTypes fccNotCommercial fccPurchaseCard fccCorporateCard fccBusinessCard fccUnknown End Enum

Default Value

0

Remarks

Business, corporate, and purchasing cards are subsets of commercial cards. Therefore, the user should send Level 2 (and possibly Level 3) data in the settlement when this property indicates a commercial card was used. The following table indicates the type of commercial card:

fccNotCommercial (0)Card presented for authorization is not a commercial card
fccPurchaseCard (1)Card presented for authorization is a Purchasing Card.
fccCorporateCard (2)Card presented for authorization is a Corporate Card.
fccBusinessCard (3)Card presented for authorization is a Business Card.
fccUnknown (4)Unable to obtain information from processor.

Note: Commercial card transactions settled with Level 2 or Level 3 data must include tax amounts to receive the best interchange rate.

This property is used for both Visa and MasterCard Corporate Purchasing Cards.

DestinationCountry Property (FDMSLevel2 Component)

Country the goods are to be shipped to.

Syntax

public string DestinationCountry { get; set; }
Public Property DestinationCountry As String

Default Value

""

Remarks

For Visa and MasterCard transactions, this property contains the three-digit numeric code of the country where the goods are being shipped. These codes are specified by ISO-3166. For the United States, use "840".

The maximum length of this property is 3 characters.

This property is used for both Visa and MasterCard Corporate Purchasing Cards.

DestinationState Property (FDMSLevel2 Component)

State or province to which the goods are to be shipped.

Syntax

public string DestinationState { get; set; }
Public Property DestinationState As String

Default Value

""

Remarks

This property contains the State or Province where purchased goods will be delivered. The maximum length of this property is 3 characters. This property is only used for MasterCard Corporate Purchasing Cards.

DestinationZip Property (FDMSLevel2 Component)

The zip code to which the commodity was shipped.

Syntax

public string DestinationZip { get; set; }
Public Property DestinationZip As String

Default Value

""

Remarks

If the ship-to zip code is not available, or the customer purchased the item in person (Card-present transaction), this property should be defaulted to the zip code of the merchant where the purchase took place. In this case, both DestinationZip and ShippedFromZip should be identical.

The maximum length for this property is 10 characters.

This property is used for Visa, MasterCard, and American Express Corporate Purchasing Cards.

DiscountAmount Property (FDMSLevel2 Component)

Amount of any discount subtracted from the line item totals.

Syntax

public string DiscountAmount { get; set; }
Public Property DiscountAmount As String

Default Value

""

Remarks

This property contains the amount of any discount applied to the transaction by the merchant. This field should be empty if no line item discount applies, or if Level 3 data is attached to the transaction, and contains discount amounts for individual items on an item-by-item basis.

This amount is to be presented with an implied decimal point. For example, US $10.00 must be represented as 1000, and $0.10 is likewise simply 10. The allowable number of significant digits as well as the positioning of any implied decimal point is dictated by the designated CurrencyCode configuration setting. In the United States (default), the number of allowable significant digits is seven. Thus the maximum TransactionAmount is "9999999", yielding a US dollar amount of $99,999.99. This field may not contain a negative number.

This property is only used for Visa Corporate Purchasing Cards.

DutyAmount Property (FDMSLevel2 Component)

Duty fees (if any) for imported goods.

Syntax

public string DutyAmount { get; set; }
Public Property DutyAmount As String

Default Value

""

Remarks

This property contains the fee amount associated with the import of the purchased goods.

This amount is to be presented with an implied decimal point. For example, US $10.00 must be represented as 1000, and $0.10 is likewise simply 10. The allowable number of significant digits as well as the positioning of any implied decimal point is dictated by the designated CurrencyCode configuration setting. In the United States (default), the number of allowable significant digits is seven. Thus the maximum TransactionAmount is "9999999", yielding a US dollar amount of $99,999.99. This field may not contain a negative number.

This property is used for both Visa and MasterCard Corporate Purchasing Cards.

FreightAmount Property (FDMSLevel2 Component)

Shipping charges associated with this transaction.

Syntax

public string FreightAmount { get; set; }
Public Property FreightAmount As String

Default Value

""

Remarks

This property contains the freight or shipping portion of the total transaction amount.

This amount is to be presented with an implied decimal point. For example, US $10.00 must be represented as 1000, and $0.10 is likewise simply 10. The allowable number of significant digits as well as the positioning of any implied decimal point is dictated by the designated CurrencyCode configuration setting. In the United States (default), the number of allowable significant digits is seven. Thus the maximum TransactionAmount is "9999999", yielding a US dollar amount of $99,999.99. This field may not contain a negative number.

This property is used for both Visa and MasterCard Corporate Purchasing Cards.

FreightTaxAmount Property (FDMSLevel2 Component)

Portion of the FreightAmount that is tax.

Syntax

public string FreightTaxAmount { get; set; }
Public Property FreightTaxAmount As String

Default Value

""

Remarks

This property contains the amount of any Value Added Taxes (VAT) which can be associated with the freight or shipping charges of the overall purchase.

This amount is to be presented with an implied decimal point. For example, US $10.00 must be represented as 1000, and $0.10 is likewise simply 10. The allowable number of significant digits as well as the positioning of any implied decimal point is dictated by the designated CurrencyCode configuration setting. In the United States (default), the number of allowable significant digits is seven. Thus the maximum TransactionAmount is "9999999", yielding a US dollar amount of $99,999.99. This field may not contain a negative number.

This property is only used for Visa Corporate Purchasing Cards.

FreightTaxRate Property (FDMSLevel2 Component)

Rate used to calculate the FreightTaxAmount .

Syntax

public string FreightTaxRate { get; set; }
Public Property FreightTaxRate As String

Default Value

""

Remarks

This property contains the tax rate used to calculate the FreightTaxAmount. This field has a two-digit implied decimal position, and the maximum length is 4 digits.

This property is only used for Visa Corporate Purchasing Cards.

InvoiceNumber Property (FDMSLevel2 Component)

Customer Reference Identifier

Syntax

public string InvoiceNumber { get; set; }
Public Property InvoiceNumber As String

Default Value

""

Remarks

This property contains the Customer Reference Indicator, used by the customer to identify the purchase (e.g., the invoice number). The maximum length of this property is 17 characters.

This property is only used for Visa Corporate Purchasing Cards.

MerchantReference Property (FDMSLevel2 Component)

Merchant Reference Number

Syntax

public string MerchantReference { get; set; }
Public Property MerchantReference As String

Default Value

""

Remarks

For Master Card, this property contains the code that facilitates merchant/corporation communication and record keeping. For Visa, this property contains the invoice number associated with the VAT invoice (not applicable in the US).

The maximum length of this property is 15 characters for Visa and 17 characters for MasterCard.

This property is used for both Visa and MasterCard Corporate Purchasing Cards.

MerchantTaxId Property (FDMSLevel2 Component)

Merchant's government tax Id number.

Syntax

public string MerchantTaxId { get; set; }
Public Property MerchantTaxId As String

Default Value

""

Remarks

This property contains the government-assigned tax identification number of the merchant from whom the goods or services were purchased.

The maximum length of this property is 15 characters. This property is only used for MasterCard Corporate Purchasing Cards.

MerchantType Property (FDMSLevel2 Component)

MasterCard merchant classification code.

Syntax

public string MerchantType { get; set; }
Public Property MerchantType As String

Default Value

"0000"

Remarks

Merchant Type is a four-position field defined by MasterCard that describes various merchant classifications. Each position in the field has a separate, special meaning for categorizing the merchant. If the data for a particular position is not available, that position must contain a blank. If it is available, it must contain one of the following business codes:

Position 1 - Business Classification

0 Unknown
1 Corporation
2 Other Business Structure (e.g., Partnership, Sole Proprietorship, Joint Venture, etc.)

Position 2 - Type of Business Owner Classification

0 Unknown
1 No Applicable Classification (not female or handicapped)
2 Female Business Owner
3 Physically Handicapped Female Business Owner
4 Physically Handicapped Business Owner

Position 3 - Minority, Small Business, Disadvantaged Certification

0 Unknown
1 Certification Not Applicable
2 SBA Certification as Small Business
3 SBA Certification as Small Disadvantaged Business
4 Other Government or Agency Recognized Certification (e.g., Minority Supplier Development Council)
5 Self-certified Small Business
6 Definition 2 and Definition 4
7 Definition 3 and Definition 4
8 Definition 4 and Definition 5

Position 4 - Racial or Ethnic Type (Unconditional Majority Owner)

0 Unknown
1 African American
2 Asian Pacific American
3 Subcontinent Asian American
4 Hispanic American
5 Native American Indian
6 Native Hawaiian
7 Native Alaskan
8 Caucasian
9 Other

The maximum length of this property is 4 characters. This property is only used for MasterCard Corporate Purchasing Cards.

OrderDate Property (FDMSLevel2 Component)

Date of the order in YYMMDD format.

Syntax

public string OrderDate { get; set; }
Public Property OrderDate As String

Default Value

""

Remarks

This property contains the purchase order date, and must be supplied in the YYMMDD format.

The maximum length of this field is 6 digits.

This property is only used for Visa Corporate Purchasing Cards.

PurchaseIdentifier Property (FDMSLevel2 Component)

Used to identify the purchase.

Syntax

public string PurchaseIdentifier { get; set; }
Public Property PurchaseIdentifier As String

Default Value

""

Remarks

This field is required for Visa, MasterCard and Amex Level2 transactions.For Visa this field should contain a merchant assigned value to identify the purchase such as the SKU number. For MasterCard this field should contain the code that was supplied to the merchant by the cardholder. For Amex this field should contain the customer reference number. The maximum length of this property is 25 characters.

ShippedFromZip Property (FDMSLevel2 Component)

Zip code the goods are being shipped from.

Syntax

public string ShippedFromZip { get; set; }
Public Property ShippedFromZip As String

Default Value

""

Remarks

This property contains the Postal/Zip code of the address from where the purchased goods are being shipped.

The maximum length of this property is 10 characters.

This property is used for both Visa and MasterCard Corporate Purchasing Cards.

TaxAmount Property (FDMSLevel2 Component)

Sales tax charged in addition to the original TransactionAmount

Syntax

public string TaxAmount { get; set; }
Public Property TaxAmount As String

Default Value

""

Remarks

This property contains the amount of state or provincial (or VAT) tax included in the transaction amount. Any non-zero sales tax must have a minimum value of 0.1% and a maximum value of 22% of the sale amount.

This amount is to be presented with an implied decimal point. For example, US $10.00 must be represented as 1000, and $0.10 is likewise simply 10. The allowable number of significant digits as well as the positioning of any implied decimal point is dictated by the designated CurrencyCode configuration setting. In the United States (default), the number of allowable significant digits is seven. Thus the maximum TransactionAmount is "9999999", yielding a US dollar amount of $99,999.99. This field may not contain a negative number.

This property is used for Visa, MasterCard, and American Express Corporate Purchasing Cards.

Config Method (FDMSLevel2 Component)

Sets or retrieves a configuration setting.

Syntax

public string Config(string configurationString);
Public Function Config(ByVal ConfigurationString As String) As String

Remarks

Config is a generic method available in every component. It is used to set and retrieve configuration settings for the component.

These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the component, access to these internal properties is provided through the Config method.

To set a configuration setting named PROPERTY, you must call Config("PROPERTY=VALUE"), where VALUE is the value of the setting expressed as a string. For boolean values, use the strings "True", "False", "0", "1", "Yes", or "No" (case does not matter).

To read (query) the value of a configuration setting, you must call Config("PROPERTY"). The value will be returned as a string.

GetAddendum Method (FDMSLevel2 Component)

Returns a Level 2 Purchasing card addendum based on the specified CardType

Syntax

public string GetAddendum();
Public Function GetAddendum() As String

Remarks

The properties required to build a Level 2 addendum depends upon the value of the CardType property. The following tables indicate which properties are valid for what card type:

American Express

Visa

MasterCard

The following example illustrates how to add Level 2 data to a transaction to be settled:

FDMSECommerce.Authorize() FDMSLevel2.CardType = fctVisa FDMSLevel2.CommercialCardType = FDMSECommerce.ResponseCommercialCard FDMSLevel2.OrderDate = "060828" 'September 28th, 2006 FDMSLevel2.FreightTaxAmount = "0" FDMSLevel2.FreightAmount = "600" FDMSLevel2.PurchaseIdentifier = "123456PURCHID" FDMSLevel2.InvoiceNumber = "CUSTCODE" FDMSLevel2.ShippedToZip = "90210" FDMSLevel2.ShippedFromZip = "90210" FDMSLevel2.TaxAmount = "120" FDMSSettle.DetailRecords.Add(New FDMSRecordType(FDMSECommerce.GetDetailAggregate(), FDMSLevel2.GetAddendum()))

Reset Method (FDMSLevel2 Component)

Clears all properties to their default values.

Syntax

public void Reset();
Public Sub Reset()

Remarks

This method clears all properties to their default values.

Error Event (FDMSLevel2 Component)

Fired when information is available about errors during data delivery.

Syntax

public event OnErrorHandler OnError;

public delegate void OnErrorHandler(object sender, Fdmslevel2ErrorEventArgs e);

public class Fdmslevel2ErrorEventArgs : EventArgs {
  public int ErrorCode { get; }
  public string Description { get; }
}
Public Event OnError As OnErrorHandler

Public Delegate Sub OnErrorHandler(sender As Object, e As Fdmslevel2ErrorEventArgs)

Public Class Fdmslevel2ErrorEventArgs Inherits EventArgs
  Public ReadOnly Property ErrorCode As Integer
  Public ReadOnly Property Description As String
End Class

Remarks

The Error event is fired in case of exceptional conditions during message processing. Normally the component throws an exception.

The ErrorCode parameter contains an error code, and the Description parameter contains a textual description of the error. For a list of valid error codes and their descriptions, please refer to the Error Codes section.

Config Settings (FDMSLevel2 Component)

The component accepts one or more of the following configuration settings. Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the component, access to these internal properties is provided through the Config method.

Base Config Settings

BuildInfo:   Information about the product's build.

When queried, this setting will return a string containing information about the product's build.

GUIAvailable:   Whether or not a message loop is available for processing events.

In a GUI-based application, long-running blocking operations may cause the application to stop responding to input until the operation returns. The component will attempt to discover whether or not the application has a message loop and, if one is discovered, it will process events in that message loop during any such blocking operation.

In some non-GUI applications, an invalid message loop may be discovered that will result in errant behavior. In these cases, setting GUIAvailable to false will ensure that the component does not attempt to process external events.

LicenseInfo:   Information about the current license.

When queried, this setting will return a string containing information about the license this instance of a component is using. It will return the following information:

  • Product: The product the license is for.
  • Product Key: The key the license was generated from.
  • License Source: Where the license was found (e.g., RuntimeLicense, License File).
  • License Type: The type of license installed (e.g., Royalty Free, Single Server).
  • Last Valid Build: The last valid build number for which the license will work.
MaskSensitive:   Whether sensitive data is masked in log messages.

In certain circumstances it may be beneficial to mask sensitive data, like passwords, in log messages. Set this to true to mask sensitive data. The default is true.

This setting only works on these components: AS3Receiver, AS3Sender, Atom, Client(3DS), FTP, FTPServer, IMAP, OFTPClient, SSHClient, SCP, Server(3DS), Sexec, SFTP, SFTPServer, SSHServer, TCPClient, TCPServer.

UseInternalSecurityAPI:   Whether or not to use the system security libraries or an internal implementation.

When set to false, the component will use the system security libraries by default to perform cryptographic functions where applicable. In this case, calls to unmanaged code will be made. In certain environments, this is not desirable. To use a completely managed security implementation, set this setting to true.

Setting this configuration setting to true tells the component to use the internal implementation instead of using the system security libraries.

On Windows, this setting is set to false by default. On Linux/macOS, this setting is set to true by default.

If using the .NET Standard Library, this setting will be true on all platforms. The .NET Standard library does not support using the system security libraries.

Note: This setting is static. The value set is applicable to all components used in the application.

When this value is set, the product's system dynamic link library (DLL) is no longer required as a reference, as all unmanaged code is stored in that file.

Trappable Errors (FDMSLevel2 Component)

FDMSLevel2 Errors

501   Data field invalid length.
502   Data field invalid format.
503   Data field out of range.
605   Invalid CardType.