Method: dgCharge::Void()
Void(amount, card_nbr, exp_date, record_number, terminal_ID, customer_ID, customer_name, description)
The
Void method processes a credit card void transaction. A current
merchant must be set before calling this method (see
SetMerchant). The transaction
must be one that has not yet been settled. If the merchant is one that does
manual settlements, the transaction is removed from the open batch.
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".
Record_number
The record number obtained from a prior
transaction for this credit card and amount.
Terminal_ID
The ID of the terminal used to process the original transaction.
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.Void ("1000","9999999999999999","0304",42,1,"123","Mickey Mouse","Undo the cheese sale.") Then
Response.Write (oChargeObject.ErrorText)
End If
End If
%>