Answered by:
Problem with Paypal Website Payments Pro

Question
-
User565442435 posted
I'm trying to just get a payment to post to an account and I'm getting an error back that doesn't help very much. I know the credit card is good because it is added to a test account in my sandbox account. Can anyone tell me what I'm doing wrong? Here's the error I'm getting L_SHORTMESSAGE0: Internal Error
L_LONGMESSAGE0: Timeout processing request
L_ERRORCODE0: 10001 ACK: Failure
TIMESTAMP: 2011-11-30T16:52:54Z
CORRELATIONID: eaaf6ce29a5ee
And here's the code I'm usingProtected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load doTransaction("4600399972002150", "Visa", "01/30", "123", ".01", "Test", "User", "123 Main St.", _ "San Jose", "CA", "95131") End Sub Protected Sub doTransaction(ByVal ccNumber As String, ByVal ccType As String, ByVal expireDate As String, ByVal cvvNum As String, _ ByVal amount As String, ByVal firstName As String, ByVal lastName As String, ByVal street As String, _ ByVal city As String, ByVal state As String, ByVal zip As String) 'API Credentials (3-token) Dim strUsername As String = System.Configuration.ConfigurationManager.AppSettings("apiUserName") Dim strPassword As String = System.Configuration.ConfigurationManager.AppSettings("apiPassword") Dim strSignature As String = System.Configuration.ConfigurationManager.AppSettings("apiSignature") Dim strCredentials As String = "USER=" & strUsername & "&PWD=" & strPassword & "&SIGNATURE=" & strSignature Dim strNVPSandboxServer As String = System.Configuration.ConfigurationManager.AppSettings("paypalUrl") Dim strAPIVersion As String = "2.3" 'credit card types 'Visa 'MasterCard 'Discover 'Amex Dim strNVP = strCredentials & "&METHOD=DoDirectPayment" & _ "&CREDITCARDTYPE=" & ccType & _ "&ACCT=" & ccNumber & _ "&EXPDATE=" & expireDate & _ "&CVV2=" & cvvNum & _ "&AMT=" & amount & _ "&FIRSTNAME=" & firstName & _ "&LASTNAME=" & lastName & _ "&IPADDRESS=216.58.228.226" & _ "&STREET=" & street & _ "&CITY=" & city & _ "&STATE=" & state & _ "&COUNTRY=YS" & _ "&ZIP=" & zip & _ "&COUNTRYCODE=US" & _ "&PAYMENTACTION=Sale" & _ "&VERSION=" & strAPIVersion Try 'Create web request and web response objects, make sure you using the correct server (sandbox/live) Dim wrWebRequest As HttpWebRequest = DirectCast(WebRequest.Create(strNVPSandboxServer), HttpWebRequest) wrWebRequest.Method = "POST" Dim requestWriter As New StreamWriter(wrWebRequest.GetRequestStream()) requestWriter.Write(strNVP) requestWriter.Close() ' Get the response. Dim hwrWebResponse As HttpWebResponse = DirectCast(wrWebRequest.GetResponse(), HttpWebResponse) Dim responseReader As New StreamReader(wrWebRequest.GetResponse().GetResponseStream()) 'and read the response Dim dataReturned As String = responseReader.ReadToEnd() responseReader.Close() Dim result As String = Server.UrlDecode(dataReturned) Dim arrResult As String() = result.Split("&"c) Dim htResponse As New Hashtable() Dim arrayReturned As String() For Each item As String In arrResult arrayReturned = item.Split("="c) htResponse.Add(arrayReturned(0), arrayReturned(1)) Next Dim strAck As String = htResponse("ACK").ToString() If strAck = "Success" OrElse strAck = "SuccessWithWarning" Then Dim strAmt As String = htResponse("AMT").ToString() Dim strCcy As String = htResponse("CURRENCYCODE").ToString() Dim strTransactionID As String = htResponse("TRANSACTIONID").ToString() 'ordersDataSource.InsertParameters("TransactionID").DefaultValue = strTransactionID For Each i In htResponse Response.Write(i.Key & ": " & i.Value & "<br />") Next 'Dim strSuccess As String = "Thank you, your order for: $" & strAmt & " " & strCcy & " has been processed." 'successLabel.Text = strSuccess Else 'Dim strErr As String = "Error: " & htResponse("L_LONGMESSAGE0").ToString() 'Dim strErrcode As String = "Error code: " & htResponse("L_ERRORCODE0").ToString() 'Response.Write(strErr & "<br />" & strErrcode) For Each i In htResponse Response.Write(i.Key & ": " & i.Value & "<br />") Next End If Catch ex As Exception ' do something to catch the error, like write to a log file. Response.Write(ex.ToString) End Try End Sub
Wednesday, November 30, 2011 1:18 PM
Answers
-
User565442435 posted
Figured out my problem, needed to change the date to 012010
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, November 30, 2011 5:08 PM