Products » dgCharge User Guide

Method:  dgCharge::AddMerchant()

AddMerchant(bank_nbr, auto_settlement, description, store_trans_data_locally)

The AddMerchant method adds an merchant account to the database.

There are two required arguments:

Bank_nbr

The bank number for the merchant, as specified by the credit card transaction processor.

Auto_settlement

The desired settlement type for this merchant. There are two possible values for this parameter: True indicates automatic settlement, and False indicates manual settlement. To understand the difference between these two settlement methods, we must consider the steps involved in credit card transaction processing. This processing consists of two steps. The first step is authorization, which takes place when the transaction is initially processed. If the transaction is approved, an authorization code is returned, and the necessary funds are held in reserve from the credit card account. No money changes hands yet, however. The second step in credit card processing is settlement. When authorized credit card transactions are settled, the funds are transferred from the credit card accounts into your merchant account. The authorization step is uniform, but the settlement step can be handled either automatically by the credit card processor, or manually by you, the merchant.

In addition, there are two ways of handling credit sales transactions. The first, and most common, is a straightforward sales transaction that takes place when goods are delivered. In the second situation, goods are ordered, but are not yet available for delivery. In this case, the credit card cannot be charged until the product is delivered, but it is desirable to secure the funds for later payment. This is done by first issuing a credit card preauthorization transaction when the order is received to hold the funds, followed by a credit card force transaction when the merchandise is delivered to finalize the sale. Sales transactions incur lower credit card processing fees for the merchant than preauthorization/force transactions.

By choosing automatic settlement, the merchant is not required to be involved in the settlement process at all. The settlement occurs automatically once per day. If desired, you may query the results of the most recent settlement using the dgCharge Professional Edition CheckLastSettle method. In addition, dgCharge Professional Edition maintains a database of all transactions. This settlement mode is the most convenient, but credit card processing fees for preauthorization/force transactions are slightly higher. It is a good choice for merchants whose products are almost always immediately deliverable: e.g. restaurants, e-tailers whose goods are available at the time of purchase, etc.

Merchants that are set up for manual settlement must settle all transactions manually themselves. All transactions are placed into an open batch, and when you choose to settle, all transactions in the open batch are submitted for settlement. No statements are sent from the credit card transaction processor; however, dgCharge Professional Edition maintains a database of all transactions and settlements. This settlement mode requires more intervention on the part of the merchant, but credit card processing fees for preauthorization/force transactions are reduced. It is, therefore, preferable for merchants whose goods are not always immediately available, and who wish to minimize processing fees.

There are two optional arguments:

Description

A string description of the merchant.

Store_trans_data_locally

A boolean value indicating whether or not transaction data should be stored locally (in a database).

Return Value

A value of 0 (zero) is returned if the method fails, else the merchant ID of the newly added merchant account is returned.

Code:
<%
    ' create an instance of the object
    Set oChargeObject = Server.CreateObject("dgCharge.Charge")

    ' establish the merchant
    lngMerchantID = oChargeObject.AddMerchant("999999999", False, "999999", True)
%>