0

I worked with Paypal multiple time. I create a button, redirect to proceed.php?order=order on success, and in proceed.php check if gross amount and payee email match database information.

My code always look like :

    if ($_POST['payer_email'] && $_GET["ordertr"]){
            // get paypal value and product it to fetch correct serial
            $ppemail = trim(mysqli_real_escape_string($con, htmlspecialchars($_POST['payer_email'], ENT_QUOTES, 'UTF-8')));
            $ordertr = trim(mysqli_real_escape_string($con, htmlspecialchars($_GET['ordertr'], ENT_QUOTES, 'UTF-8')));
            $gross = trim(mysqli_real_escape_string($con, htmlspecialchars($_POST['mc_gross'], ENT_QUOTES, 'UTF-8')));
        if ($gross == $actualprice){//price match}
            }

Sadly, it's not getting the POST data back from Paypal as it was before. Is that sadly possible that Paypal stoped sending POST data once user redirected to site? I always used this way instead IPN, and I saw there is PDT but I never used nor never switch on/off before getting POST data like it should.

Any ideas whats wrong?

btc4cash
  • 375
  • 1
  • 4
  • 15
  • I successfully set IPN to use, but I'm still curious why before I was able to get $_POST data directly redirecting user after payment to notify_url ? – btc4cash Aug 12 '17 at 22:29
  • Paypal responds with some `GET` parameters on the success URL. Those usually are `paymentId=` `token=` `PayerID=`, which you can use to retrieve a payment for execution or displaying/using it's parameters. – Christos Lytras Aug 12 '17 at 22:45
  • Really? Because I never user any tokens in paypal. Last time I used maybe 2 months ago, I was able to get payee email from post un my return url. – btc4cash Aug 12 '17 at 23:09
  • I don't think PayPal returns POST data, but maybe you were using a different PP API. The Express Checkout REST API does not return with POST but with GET. Check [`CreatePaymentUsingPayPal.php`](https://github.com/paypal/PayPal-PHP-SDK/blob/master/sample/payments/CreatePaymentUsingPayPal.php) and [`ExecutePayment.php`](https://github.com/paypal/PayPal-PHP-SDK/blob/master/sample/payments/ExecutePayment.php) at [PayPal-PHP-SDK Samples](https://github.com/paypal/PayPal-PHP-SDK/tree/master/sample). – Christos Lytras Aug 12 '17 at 23:15

0 Answers0