Authorize Method
Authorizes an FSA card for a Healthcare transaction.
Syntax
fdmshealthcare.authorize([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
This method sends an authorization request through Datawire to the FDMS transaction processor. The credit card is specified through the CardNumber, CardExpMonth, and CardExpYear or CardMagneticStripe properties. Whether the card is manually entered, track1 swiped, or track 2 swiped is specified by the CardEntryDataSource property.
An authorization blocks funds on the customer's credit card, but does not actually transfer funds. In order for funds to be transferred and the transaction completed, you must settle the transaction. To do this, you must pass an XML aggregate containing the results of the transaction to the Settlement class. For example:
FDMSHealthCare1.URL = "https://staging1.datawire.net/sd/" FDMSHealthCare1.IndustryType = itRetail FDMSHealthCare1.DatawireId = "YOURDATAWIREID" FDMSHealthCare1.MerchantNumber = "000000925990" FDMSHealthCare1.MerchantTerminalNumber = "573138" FDMSHealthCare1.TPPID = "VNT001" FDMSHealthCare1.VisaIdentifier = "0B34567890123456789" FDMSHealthCare1.ClinicAmount = "" FDMSHealthCare1.DentalAmount = "" FDMSHealthCare1.VisionAmount = "" FDMSHealthCare1.PrescriptionAmount = "6000" FDMSHealthCare1.TotalMedicalAmount = "8000" FDMSHealthCare1.TransactionAmount = "20200" FDMSHealthCare1.CardMagneticStripe = "B4662060000000005^FDCS TEST CARD^120410123456789" FDMSHealthCare1.CardEntryDataSource = edsTrack1 FDMSHealthCare1.TransactionNumber = 1 FDMSHealthCare1.Authorize() If (FDMSHealthCare1.ResponseCaptureFlag) Then FDMSSettle1.DetailRecordCount = FDMSSettle1.DetailRecordCount + 1 FDMSSettle1.DetailRecordAggregate[FDMSSettle1.DetailRecordCount-1] = FDMSHealthCare1.GetDetailAggregate() End If
Note that FSA cards may be only partially approved. If the card is authorized for less than the full amount, the ResponseApprovalCode property will begin with "AL" instead of "AP", and the ResponseAuthorizedAmount will contain the amount that was actually removed from the card. The customer must then pay the remainder via another means. If the customer cannot pay the remainder or wishes to cancel the transaction, use the ReversePartialAuth method to reverse the authorization.
Important Note: You must ping your list of service provider URLs and update the URL property to the service provider with the shortest response time every 100 transactions, as well as when your application initially starts. This is not a normal ICMP ping - to determine the fastest transaction URL you must use the special Ping method inside the FDMSRegister class. (You may update your list of service provider URLs with the FDMSRegister class's ServiceDiscovery method).