Products » dgCharge User Guide

Method:  dgCharge::SetMerchant()

SetMerchant(merchant_id)

The SetMerchant method identifies the merchant for subsequent transactions. This method must be called before use of the Credit, Force, Preauth, Sale, Settle, or Void methods. The specified merchant must have been previously added to the merchant database via the AddMerchant method. The merchant that is established by this method remains the current merchant until the method is called again.

There is one required argument:

Merchant_id

The merchant ID of the merchant account to be set. (Also see AddMerchant)

Return Value

A value of True is returned if successful; otherwise a value of False is returned and the ErrorText property is set.

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

    ' establish the merchant
    bSetOK = oChargeObject.SetMerchant(42)

%>