TSYSLevel2 Class
Properties Methods Events Configuration Settings Errors
The TSYSLevel2 component is a tool used to create Level2 Corporate Purchasing Card addendum aggregates, which can then be passed to the TSYSSETTLE component and settled.
Class Name
InPayDirect_TSYSLevel2
Procedural Interface
inpaydirect_tsyslevel2_open(); inpaydirect_tsyslevel2_close($res); inpaydirect_tsyslevel2_register_callback($res, $id, $function); inpaydirect_tsyslevel2_get_last_error($res); inpaydirect_tsyslevel2_get_last_error_code($res); inpaydirect_tsyslevel2_set($res, $id, $index, $value); inpaydirect_tsyslevel2_get($res, $id, $index); inpaydirect_tsyslevel2_do_config($res, $configurationstring); inpaydirect_tsyslevel2_do_getaddendum($res); inpaydirect_tsyslevel2_do_reset($res);
Remarks
The type of addendum created by this class depends upon the value of the CardType property. If the CardType is ctVisa or ctMasterCard a Group 22 addendum will be created by the GetAddendum method. Properties valid for these CardTypes are: IsTaxExempt, LocalSalesTax, and PurchaseOrderNumber. The following example illustrates how to add a Visa/MasterCard Level2 addendum to a detail record in the settlement:
TSYSECommerce.Authorize() TSYSSettle.DetailRecordCount = 1 TSYSSettle.DetailAggregate[0] = TSYSECommerce.GetDetailAggregate() TSYSLevel2.CardType = ctVisa TSYSLevel2.IsTaxExempt = False TSYSLevel2.LocalSalesTax = "423" '$4.23 TSYSLevel2.PurchaseOrderNumber = "12345678901234567" TSYSSettle.DetailAddendum[0] = TSYSLevel2.GetAddendum()
If the CardType is ctAmericanExpress, the addendum created will be Group 21 instead of Group 22. Only the properties prefixed with "Amex" are applicable in this case. These include: AmexCardholderReference, AmexChargeDescriptor, AmexSalesTax, AmexShippedToZip, and AmexSupplierNumber. The following example shows how to add an American Express Level2 addendum to a detail record in the settlement:
TSYSECommerce.Authorize() TSYSSettle.DetailRecordCount = 2 TSYSSettle.DetailAggregate[1] = TSYSECommerce.GetDetailAggregate() TSYSLevel2.CardType = ctAmericanExpress TSYSLevel2.AmexCardholderReference = "INV12345678" TSYSLevel2.AmexChargeDescriptor = "Test transaction" TSYSLevel2.AmexSalesTax = "373" TSYSLevel2.AmexShippedToZip = "90210" TSYSLevel2.AmexSupplierNumber = "SUP244568" TSYSSettle.DetailAddendum[1] = TSYSLevel2.GetAddendum()
Note that while Level2 addendum data is only applicable to corporate purchasing cards, you may send Level2 data for all Visa, Master Card, and American Express cards if you wish.
Note: If you are attempting to settle American Express transactions which include Level2 commercial card data, and you receive an error indicating that the "Record Type is missing or invalid" for the Detail Record containing that transaction, the problem is that your merchant account is not set up to settle American Express commercial cards.
Property List
The following is the full list of the properties of the class with short descriptions. Click on the links for further details.
AmexCardholderReference | Reference number supplied by the card holder. |
AmexChargeDescriptor | Description of this transaction. |
AmexSalesTax | Portion of the transaction amount which is sales tax. |
AmexShippedToZip | The zip code to which the commodity was shipped. |
AmexSupplierNumber | Supplier Reference Number contained in the American Express Level 2 addendum. |
CardType | The card type for which a Level2 or Level3 addendum will be created. |
IsTaxExempt | Indicates whether this purchasing card qualifies for tax-exempt status. |
LocalSalesTax | Sales tax charged in addition to the original TransactionAmount . |
PurchaseOrderNumber | Optional customer-specified purchase order number. |
Method List
The following is the full list of the methods of the class with short descriptions. Click on the links for further details.
Config | Sets or retrieves a configuration setting . |
GetAddendum | Returns a Level2 Purchasing card addendum based on the specified CardType . |
Reset | Clears all properties to their default values. |
Event List
The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.
Error | Information about errors during data delivery. |
Configuration Settings
The following is a list of configuration settings for the class with short descriptions. Click on the links for further details.
CodePage | The system code page used for Unicode to Multibyte translations. |