Capture Method
Sends a capture transaction to the Global Payments Server.
Syntax
globalcharge.capture(PNRef, [callback])
Callback
The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).
The callback for this method is defined as:
function(err){ }
'err' is the error that occurred. If there was no error, then 'err' is 'null'.
'err' has 2 properties which hold detailed information:
err.code err.message
Remarks
Capture (Post Auth Capture) transactions are typically used when a merchant has previously utilized
the AuthOnly method. A Capture transaction adds the transaction to the current open batch.
To process a capture, call Capture with the PNRef parameter set to the PNRef returned in response from the transaction for which you wish to capture and set the TransactionAmount to the amount you wish to capture. You may issue a partial capture for any value up to the original authorized amount. For example:
Full Capture:
class.TransactionAmount = "15.00"; // Original authorization was for $15.00, so this is a full capture class.Capture("1233513541"); // "1233513541" is the PNRef from the original transactionPartial Capture:
class.TransactionAmount = "10.00"; // Original authorization was for $15.00, so this is a partial capture class.Capture("1233513541"); // PNRef from the original authorization response
Note: Only one Capture can be processed per AuthOnly. To process a second Capture on an AuthOnly you must first use VoidTransaction to Void the first Capture.