Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Struggles integrating Credit Card Processing into MS Access
Developer Gateway in Sandbox - 809501
Customer Gateway - Action Hose - 2209197
I am attempting to integrate Credit Card processing into the MS Access application that drives my customer's Hose and Tool Rental business.
I have modified my code since my original request email based on documentation found on your website related to converting AIM code for current API.
I have run into issues with the following procedure:
Public Function ChargeCreditCard()
On Error GoTo Err_ChargeCreditCard
Dim Post_Url
'Post_Url = "https://test.authorize.net/gateway/transact.dll"; ' SANDBOX Environment
Post_Url = GetPostURL(CCEnvironment)
Dim post_string As String
Dim post_response As String
Dim MerchLogin As String
Dim MerchTransKey As String
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim strSQL As String
MerchLogin = CCMerchantLogin(CCEnvironment)
MerchTransKey = CCMerchantKey(CCEnvironment)
post_string = "<createTransactionRequest xmlns='AnetApi/xml/v1/schema/AnetApiSchema.xsd'>" & vbCrLf
post_string = post_string & "<merchantAuthentication>" & vbCrLf
post_string = post_string & "<name>" & MerchLogin & "</name>" & vbCrLf
post_string = post_string & "<transactionKey>" & MerchTransKey & "</transactionKey>" & vbCrLf
post_string = post_string & "</merchantAuthentication>" & vbCrLf
' <refId>123456</refId>
post_string = post_string & "<transactionRequest>" & vbCrLf
post_string = post_string & "<transactionType>authCaptureTransaction</transactionType>" & vbCrLf
post_string = post_string & "<amount>" & Me.PmtAmount & "</amount>" & vbCrLf
post_string = post_string & "<payment>" & vbCrLf
post_string = post_string & "<creditCard>" & vbCrLf
post_string = post_string & "<cardNumber>" & Me.CCAcctNo & "</cardNumber>" & vbCrLf
post_string = post_string & "<expirationDate>" & Me.CCExpMo & "/" & Me.CCExpYr & "</expirationDate>" & vbCrLf
post_string = post_string & "<cardCode>" & Me.CCCode & "</cardCode>" & vbCrLf
post_string = post_string & "</creditCard>" & vbCrLf
post_string = post_string & "</payment>" & vbCrLf
post_string = post_string & "<authorizationIndicatorType>" & vbCrLf
post_string = post_string & "<authorizationIndicator>final</authorizationIndicator>" & vbCrLf
post_string = post_string & "</authorizationIndicatorType>" & vbCrLf
post_string = post_string & "</transactionRequest>" & vbCrLf
post_string = post_string & "</createTransactionRequest>"
'Dim objRequest As New ActiveXObject("Msxml2.DOMDocument.6.0")
Dim objRequest As MSXML2.XMLHTTP
Set objRequest = New MSXML2.XMLHTTP
objRequest.Open "POST", Post_Url, False
objRequest.send post_string
post_response = objRequest.responseText
Exit_ChargeCreditCard:
Set objRequest = Nothing
Exit Function
Err_ChargeCreditCard:
MsgBox Err.Description
Resume Exit_ChargeCreditCard
End Function
The post_string saves as follows:
<createTransactionRequest xmlns='AnetApi/xml/v1/schema/AnetApiSchema.xsd'>
<merchantAuthentication>
<name>2W2a84RTre</name>
<transactionKey>****************</transactionKey>
</merchantAuthentication>
<transactionRequest>
<transactionType>authCaptureTransaction</transactionType>
<amount>15.25</amount>
<payment>
<creditCard>
<cardNumber>************8030</cardNumber>
<expirationDate>4/2025</expirationDate>
<cardCode></cardCode>
</creditCard>
</payment>
<authorizationIndicatorType>
<authorizationIndicator>final</authorizationIndicator>
</authorizationIndicatorType>
</transactionRequest>
</createTransactionRequest>
The Response that I get back:
<HTML><BODY><H3>The following errors have occurred.</H3>(13) The merchant login ID or password is invalid or the account is inactive.<BR></BODY></HTML>
I have verified that my SANDBOX API Login and TransactionKey are valid.
Please help
04-22-2022 10:22 AM
0 REPLIES 0