Skip to main content

PayPal Community

  • Dashboard
  • Send and Request
  • Wallet
  • Business
  • Help
Log in
  • Welcome
    • Guidelines
    • News and Events
    • Suggestions for PayPal
    • General Discussions
  • PayPal Help Community
    • Managing Account
    • Transactions
    • Wallet
    • Security and Fraud
    • Products & Services
    • Reporting
  • MTS Community
    • PayPal Upgrade Community
    • PayPal Payments Standard
    • REST APIs
    • NVP/SOAP APIs
    • SDKs
    • Sandbox Environment
    • PayPal Reporting
    • Payflow
    • Ideas for MTS
    • Client-side Integration
    • Server-side Integration
  • The Archives
    • PayPal Help Community Archives
      • Managing Account Archives
      • Transactions Archives
      • Wallet Archives
      • Security and Fraud Archives
      • Products & Services Archives
      • Reporting Archives
    • Help Community
      • PayPal Basics Archives
      • Payments Archives
      • My Money Archives
      • My Account Archives
      • Disputes and Limitations Archives
      • Products and Services Archives
      • PayPal Credit Archives
    • Merchant Community
      • Merchant Products
      • Business Tools Archives
      • Reporting Archives
      • Managing Risk and Fraud Archives
    • Help Archives
      • About Business (Archive)
      • About Payments (Archive)
      • About Settings (Archive)
      • About eBay (Archive)
      • About Protections (Archive)
      • About Products (Archive)
    • Social and Your Voice Archives
      • Off Topic (Archive)
      • My Feedback for PayPal (Archive)
    • About PayPal Archives
      • Watercooler (Archive)
      • Tax Information (Archive)
      • Fees (Archive)
      • eBay and PayPal (Archive)
      • Coupons and promotions (Archive)
    • My Account Archives
      • My account settings (Archive)
      • Account limits and verification (Archive)
      • Account balance (Archive)
      • Bank accounts and credit cards (Archive)
    • Payments Archives
      • Sending money (Archive)
      • Receiving money (Archive)
      • Refunds (Archive)
      • Donations and Fundraising (Archive)
    • Disputes and Security Archives
      • Disputes and claims (Archive)
      • Fraud, phishing and spoof (Archive)
    • My Business Archives
      • Merchant services (Archive)
      • Reporting and tracking (Archive)
      • Shipping (Archive)
    • PayPal Products Archives
      • PayPal Debit Mastercard (Archive)
      • PayPal Extras MasterCard (Archive)
      • PayPal Mobile & Other Services (Archive)
      • Student Accounts (Archive)
      • Bill Me Later (Archive)
    • Getting to know PayPal
      • My PayPal account
      • Security and protection
    • Receiving and sending money
      • Buying with PayPal
      • Selling with PayPal
    • PayPal Here UK
      • PayPal Here News and Events
      • PayPal Here Community
      • Chip and Pin Card Reader
      • PayPal Here App

The Community Forum is not available for new posts or responses; previous posts remain available to review. For comprehensive support options, please visit PayPal.com/HelpCenter
Merchant Technical Support: For technical support and related questions, please visit our Technical Support Help Center or Developer Central

If you want to report illegal content under the EU Digital Services Act, please do so here

since ‎Jun-03-2018
Country: United States
Type: Business
rcnjstudent
rcnjstudent Contributor
Contributor
1
Post
0
Kudos
0
Solutions
Your PayPal Anniversary
The Return
Organized
Active
View all
Latest Contributions by rcnjstudent
  • Topics rcnjstudent has Participated In
  • Latest Contributions by rcnjstudent

Having Extreme Difficulties with PayPal PDT and AS...

by rcnjstudent Contributor in PayPal Reporting
‎Jun-03-2018 11:04 AM
‎Jun-03-2018 11:04 AM
So I'm trying to add PayPal to my test site and the payment part works just fine with the hosted button.  The problem I'm encountering is with the return back to my site to verify payment was successful.  I've tried so many different scripts online and from YouTube and I just can't get this to work.  I've never felt so stupid before in my entire life.  I'm trying with PDT verification first since it seemed the simplest.  I keep getting a message stating FAIL for some reason.  I'm using my facilitator account from Sandbox to have the PayPal Merchant ID button and am using the buyer account to place the payment.  I've been working on this for over a week and just can't get this to work :(.  Can anyone advise what I'm doing wrong here?  Is there any way I can get a more detailed error output to see what's going on?   Here's the sample return value from the website (has been anonymized a bit but you still can see what I'm getting back):   http://samplesitename.com/Verify_PayPal_Transaction.aspx?amt=10.00&cc=USD&item_name=Sample%20Buy%20Now%20Button&st=Completed&tx=90S9306NA3174205 Returning Error:  FAIL Imports System.Collections.Generic Imports System.Net Imports System.IO  ' ASP.NET VB Partial Class Verify_PayPal_Transaction Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 'Am = Amount 'St = Status 'CUSTOMIZE THIS: This Is the seller's Payment Data Transfer authorization token. ' Replace this with the PDT token in "Website Payment Preferences" under your account. 'Post back to either sandbox or live Dim strSandbox As String = "https://www.sandbox.paypal.com/cgi-bin/webscr" Dim strLive As String = "https://www.paypal.com/cgi-bin/webscr" Dim req As HttpWebRequest = CType(WebRequest.Create(strSandbox), HttpWebRequest) Dim authToken As String = "M9KpLUf_kdFkfTp96FTGV6Faedjq6n5hWxw6_JZaZ6Psg19e11AyLvJQx1O" Dim txToken As String = Request.QueryString("tx") Dim strRequest As String = "cmd=_notify-synch&tx=" & txToken & "&at=" & authToken 'Set values for the request back req.Method = "POST" req.ContentType = "application/x-www-form-urlencoded" req.ContentLength = strRequest.Length 'for proxy 'Dim proxy As New WebProxy(New System.Uri("http://url:port#")) 'req.Proxy = proxy 'Send the request to PayPal and get the response Dim streamOut As StreamWriter = New StreamWriter(req.GetRequestStream(), Encoding.ASCII) streamOut.Write(strRequest) streamOut.Close() Dim streamIn As StreamReader = New StreamReader(req.GetResponse().GetResponseStream()) Dim strResponse As String = streamIn.ReadToEnd() streamIn.Close() If Not String.IsNullOrEmpty(strResponse) Then Dim results As New Dictionary(Of String, String) Dim reader As New StringReader(strResponse) Dim line As String = reader.ReadLine() If line = "SUCCESS" Then While True Dim aLine As String aLine = reader.ReadLine If aLine IsNot Nothing Then Dim strArr() As String strArr = aLine.Split("=") results.Add(strArr(0), strArr(1)) Else Exit While End If End While '<p><h3>Your order has been received.</h3></p>") '<b>Details</b><br>") '<li>Name: " + results("first_name") & " " & results("last_name") & "</li>") '<li>Item: " & results("item_name") & "</li>") '<li>Amount: " & results("payment_gross") & "</li>") '<hr>") ElseIf line = "FAIL" Then 'log for manual investigation Response.Write(strResponse) 'Unable to retreive transaction detail") End If Else 'Unknown Error") End If End Class ... View more
Paypal Logo
  • Help
  • Contact Us
  • Security
  • Fees
  • © 1999-2025 PayPal, Inc. All rights reserved.
  • Privacy
  • Legal
  • Cookies
  • Policy Updates

The money in your balance is eligible for pass-through FDIC insurance.

The PayPal Cash Mastercard is issued by The Bancorp Bank pursuant to a license by Mastercard International Incorporated. The Bancorp Bank; Member FDIC.

Powered by Khoros
Welcome to the PayPal Community!