- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi everyone,
I have a product with quantities however the quantity isn't being returned in the PDT when the customer is returned to the website.
I'm receiving this in the PDT. 2 items were ordered.
amt=11.00&cc=USD&item_name=THE-PRODUCT&item_number=the-product-code&st=Completed&tx=71xxxxxxxxxxxxxx
The quantity is the only field I actually need. Ideally as POST instead of GET data.
I can't see anything in the button setup outside of allow customer to change quantities checkbox.
Any help would be appreciated.
Thanks
Steve
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I use this code in PHP:
if (isset($_GET['tx'])) { $query_data = [ 'cmd' => '_notify-synch', 'tx' => $_GET['tx'], 'at' => /* my token from paypal settings */ ]; $ch = curl_init(); curl_setopt($ch, CURLOPT_USERAGENT, 'PayPal'); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($query_data)); curl_setopt($ch, CURLOPT_URL, $this->url); $response = curl_exec($ch); $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following steps illustrate the basic flow of a PDT transaction.
- A customer submits a payment.
- PayPal sends the transaction ID of the payment through HTTP as a GET variable (tx). This information is sent to the Return URL you specified in your PayPal account profile.
(You are here. You need to make POST request. Read below.)
- Your return URL web page contains an HTML POST form that retrieves the transaction ID and sends the transaction ID and your unique PDT token to PayPal.
- PayPal replies with a message indicating SUCCESS or FAIL. The SUCCESS message includes transaction details, one per line, in the <Key>=<Value> format. This key-value pair string is URL encoded.
- Your web page parses the message and then displays the information for the customer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks,
this helps with the post/get data.
I'm still not receiving the quantity though.
Cheers
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you send POST request to Paypal with your TX (transaction ID returned to you with GET response)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not yet.
At the moment I'm just looking at the data being returned by Paypal in the GET response.
I'm currently receiving amt, cc, item_name, item_number, st & tx. I thought quantity would be in there too.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No, would not. You are not finished the whole process. I mean at this step you are not sure that transaction is successful.
At your step Paypal returns you only one important parameter - "tx", and Paypal wait you necessarily check transaction through POST.
When you will request (POST) and get response you will get all of parameters about transaction, include quantity.
Read this - https://developer.paypal.com/docs/classic/products/payment-data-transfer/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I use this code in PHP:
if (isset($_GET['tx'])) { $query_data = [ 'cmd' => '_notify-synch', 'tx' => $_GET['tx'], 'at' => /* my token from paypal settings */ ]; $ch = curl_init(); curl_setopt($ch, CURLOPT_USERAGENT, 'PayPal'); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($query_data)); curl_setopt($ch, CURLOPT_URL, $this->url); $response = curl_exec($ch); $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Auto Return feature for digital products without using woocommerce? in PayPal Payments Standard
- Add parameters to custom auto return url? in PayPal Payments Standard
- PERMISSION_DENIED error for checkout/orders/{order_id} endpoint in REST APIs
- Subscription did not get auto renewed in sandbox mode but it was created successfully in Sandbox Environment
- Why does the client when makeing and order return a payment id that does not start with PAYID. in REST APIs