Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
228 views
in Technique[技术] by (71.8m points)

php - Paypal expres checkout is not sending back the posted data

in my laravel application i am sending the the data to the postman like below :

array:8 [▼
  "items" => array:1 [▼
    0 => array:4 [▼
      "name" => "PWN Netherlands: Building a D&I foundation through mentoring, coaching & sponsorship"
      "price" => 122222
      "qty" => 1
      "event_id" => 1
    ]
  ]
  "return_url" => "http://localhost:8000/paypal/ec-checkout-success"
  "invoice_id" => "_6"
  "item_number" => 22
  "custom" => 33
  "invoice_description" => "PWN Netherlands: Building a D&I foundation through mentoring, coaching & sponsorship"
  "cancel_url" => "http://localhost:8000"
  "total" => 122222
]

so i am sending the item_number and custom field but after payment what i get it just token and playerId like below :

array:2 [▼
  "token" => "EC-4DA935906T0704531"
  "PayerID" => "QQN222QZK25CA"
]
question from:https://stackoverflow.com/questions/66062992/paypal-expres-checkout-is-not-sending-back-the-posted-data

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

After a redirect to PayPal and payer approval, that is all you are going to get back in the return URL's parameters.

If you've integrated the old classic NVP API, the call to then get the details (if you don't have them stored in your server's session) is GetExpressCheckoutDetails.

Also, there will be no payment until you execute it. The call to do so is DoExpressCheckoutPayment.


This is a very old API you seem to be integrating, so the recommendation would be to switch to something current, such as 'Create Order' and 'Capture Order' as documented here. Those should be two routes on your server which return JSON, which you can then pair with the following approval flow: https://developer.paypal.com/demo/checkout/#/pattern/server


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...