I am trying to switch to using CIM and Api call to authoriza and later capture transactions. Everything is successful up to capturing the authorized amount. I am sending the API call and getting back no response (and nothing happening on the server). This is the code I am using, which is basically the same code I used to do the authorization which worked just fine with the fields switched to send what I think are the proper fields. Have tried using profileTransPriorAuthCapture and profileTransCaptureOnly both and neither returns anything. Can anyone help? Site is programmed in classic ASP.
strReq = "<?xml version=""1.0"" encoding=""utf-8""?>" _
& "<createCustomerProfileTransactionRequest xmlns=""AnetApi/xml/v1/schema/AnetApiSchema.xsd"">" _
& MerchantAuthentication() _
& "<transaction>" _
& " <profileTransPriorAuthCapture>" _
& " <amount>" & Cdbl(GRAND_TOTAL) & "</amount>" _
& " <customerProfileId>" & ANETID & "</customerProfileId>" _
& " <customerPaymentProfileId>" & PROFID & "</customerPaymentProfileId>" _
& " <order>" _
& " <invoiceNumber>" & ORDER_ID & "</invoiceNumber>" _
& " <description>From Nature With Love Order #" & ORDER_ID & "</description>" _
& " </order>" _
& " <transId>" & AuthTransID & "</transId>" _
& " <approvalCode>" & AuthApprovalCode & "</approvalCode>" _
& " </profileTransPriorAuthCapture>" _
& "</transaction>" _
& "</createCustomerProfileTransactionRequest>"
Set objResponse = SendApiRequest(strReq)
03-03-2015 02:03 PM - edited 03-03-2015 02:03 PM
profileTransPriorAuthCapture don't use approvedCode. but that shouldn't stop it from sending
Can you look at the strreq before you do the SendApiRequest
on the auth_only did you use the # in the description?
03-03-2015 04:25 PM - edited 03-03-2015 04:26 PM
I did not use the # in the description for the authorization so tried taking it out and it didn't make any difference, here is the authorization:
strReq = "<?xml version=""1.0"" encoding=""utf-8""?>" _
& "<createCustomerProfileTransactionRequest xmlns=""AnetApi/xml/v1/schema/AnetApiSchema.xsd"">" _
& MerchantAuthentication() _
& "<transaction>" _
& " <profileTransAuthOnly>" _
& " <amount>" & Cdbl(grand_total) & "</amount>" _
& " <customerProfileId>" & ANETID & "</customerProfileId>" _
& " <customerPaymentProfileId>" & PROFID & "</customerPaymentProfileId>" _
& " <order>" _
& " <invoiceNumber>" & ORDER_NO & "</invoiceNumber>" _
& " <description>From Nature With Love Order No " & order_id & "</description>" _
& " </order>" _
& " <cardCode>" & CVVS & "</cardCode>" _
& " </profileTransAuthOnly>" _
& "</transaction>" _
& "</createCustomerProfileTransactionRequest>"
then I tried cutting it down as much as I thought I could: to this, but still nothing is returned
strReq = "<?xml version=""1.0"" encoding=""utf-8""?>" _
& "<createTransactionRequest xmlns=""AnetApi/xml/v1/schema/AnetApiSchema.xsd"">" _
& MerchantAuthentication() _
& "<transactionRequest>" _
& " <transactionType>priorAuthCaptureTransaction</transactionType>" _
& " <amount>" & Cdbl(GRAND_TOTAL) & "</amount>" _
& " <transId>" & AuthTransID & "</transId>" _
& "</transactionRequest>" _
& "</createTransactionRequest>"
I can view the string, it looks like this if I response.write it: (replaced the real codes, of course)
6xxxxxxxS 6xxxxxxxxxxx3 priorAuthCaptureTransaction 0.01 699999993
03-03-2015 04:58 PM
The raw response in SendApiRequest() is blank too? Are you using createCustomerProfileTransactionRequest or createTransactionRequest
03-03-2015 06:00 PM - edited 03-03-2015 06:01 PM
I have tried both createCustomerProfileTransactionRequest and createTransactionRequest.
There seems to be no raw response or its blank, I do :
Set objResponse = SendApiRequest(strReq)
Set objDirectResponse = objResponse.selectSingleNode("/*/api:directResponse")
If Not (objDirectResponse Is Nothing) Then
do some other stuff
else
Response.Write("No response received<hr>")
end if
and all I get back is "No Response Received"
03-03-2015 06:08 PM
You assuming the there is a directResponse? how about the raw objResponse?
03-04-2015 04:08 AM
If I response write the raw objResponse then I get nothing.
03-19-2015 04:18 PM
Look into the function SendApiRequest and see what is failing.
03-19-2015 05:03 PM