Products » dgCharge User Guide

Method:  dgCharge::Force()

Force(amount, card_nbr, exp_date, approval_code, customer_ID, customer_name, description)

The Force method processes a credit card forced sale transaction, for which funds have been reserved via a previous preauthorization transaction. See the description of the Preauth method for more information. A current merchant must be set before calling this method (see SetMerchant).

There are four required arguments:

Amount

The amount of the transaction, in cents, expressed as a whole number. For example, $1.00 would be entered as "100".

Card_nbr

The full credit card number, with no spaces and no non-numeric characters.

Exp_date

The four-digit credit card expiration date, with no spaces and no non-numeric characters. For example, an expiration date of 03/02 would be entered as "0302".

Approval_code

The approval code obtained from a prior Preauth transaction for this credit card and amount.
There are three optional arguments:

Customer_ID

Customer identification (maximum length 50 characters). This can be a number or descriptive text that is used to identify the customer.

Customer_name

Customer name as it appears on the credit card (maximum length 50 characters).

Description

A text description (maximum length 256 characters) of the transaction. This can be any information, or descriptive text, that is to be recorded in the dgCharge Professional Edition transaction database for this transaction.

Return Value

If the transaction request cannot be completed for any reason, the method returns a value of False and the ErrorText property contains a description of the error. If the transaction is completed, the method returns a value of True and the ApprovalCode, AuthResponse, ErrorText, RecordNumber, TransDate, and TransTime properties are set. In addition, if the method succeeds, all information concerning the transaction is entered into the dgCharge Professional Edition transaction database.

Note that successful execution of the method does not imply approval of the transaction; the AuthResponse property indicates the status of the transaction.

Code:
<%
    ' create an instance of the object
    Set oChargeObject = Server.CreateObject("dgCharge.Charge")
    ' establish the merchant
    bSetOK = oChargeObject.SetMerchant ("999999999","999999")
    ' process the transaction
    If bSetOK Then
      If Not oChargeObject.Force ("1000","9999999999999999","0304","123456","Mickey Mouse","Force the cheese sale.") Then
       Response.Write (oChargeObject.ErrorText)
      End If
    End If
%>