Commerce Server 3.0 and the Billing API

Microsoft® Site Server version 2.0 included a library (billingapi.lib) that exports the Billing Application Programming Interface (API). The Billing API defines a collection of C-language routines for writing billing events to a file on Site Server.

Site Server 3.0 includes a new version of this library, which has been updated to use the Commerce Server order processing pipeline (OPP). Applications built using the older library need only to re-link to the new one. This library file can be found in \Microsoft Site Server\SiteServer\Commerce\SDK\Commerce\lib\i386.

As currently implemented, the Billing API passes billing events to the OPP. Parameters passed to Billing API routines map to name/value pairs on the OrderForm that is passed to the OPP.

Consequently, in addition to re-linking to the new version of the Billing API library, you need to create the pipeline that processes Billing API events, and to register this pipeline in the Microsoft® Windows NT® system registry by writing the following value to \HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft Site Server 3.0
\Commerce Server 3.0\. The value that you write to this key should be named PCF, and its value should be a string that evaluates to the fully qualified path to the pipeline configuration file that is used to process billing events.

After you have re-linked your applications to this library, and registered a pipeline to process Billing API events, Billing API routines invoke this pipeline and pass it an OrderForm initialized with name/value pairs that map to parameters passed to the Billing API routines.

The following table describes the name/value pairs on the OrderForm, and the Billing API parameters to which they map.

Name Parameter Description
shopper_id hAcctUid Unique identifier for member (hAcct).
_billing_event BeventId Billing Event ID. Always TRANSACTIONEVENT.
vendor_id hVendorID Unique identifier for vendor (hAcct).
Purchase_type DwEkind Vendor Event ID (see the Billing API documentation).
Quantity iNumUnits Number of units.
MeasureID Measure Measure of each unit (see the Billing API documentation).
_oadjust_adjustedprice dwUnitPrice Price of each unit.
currencycode iCurrencyCode Type of currency used for the billing.
date_begin dtbegin End time for member’s actions. Win32® FILETIME data type.
date_end dtend End time for member’s actions. Win32 FILETIME data type.
event_desc lpscDescription Text description of the event.
_billing_result Method result. Return value from the billing system (see the table of return codes for routines defined in the Billing API documentation).
_product_name lpszProductID Text name of the product just purchased.
Token Token Token that was modified to give access to the product.
TransIPaddr The dwIPaddr field of the TRANSACTION_ID structure. IP address of the server that is processing the billing event.
TransTime The ftUnique (FILETIME) member of the TRANSACTION_ID structure. Time that the billing event was generated.
payment_method Billing in the case of a BSMS component.
_billing_action Identifies the Billing API 1.0 name of the routine that caused the pipeline to run. See Billing Action Values for a list of these values.


© 1997-1998 Microsoft Corporation. All rights reserved.