1

we use Paypal Express as checkout, using Omnipay php library. Now after the buyer entered his password and agreed to payment on the paypal site, he will be returned to the homepage's success page.

I now wonder, how I can validate that the payment really actually was successful? Calling the success page manually isn't that hard for fake successful payment...

I get a payerid and a token in the back-redirect.

Can I somehow request paypal using omnipay and the token data or payerid to look if the last payment was 100% successful?

I cannot find the documentation for this in Omnipay.

Thanks for help.

ffx
  • 51
  • 3

1 Answers1

0

You can use GetExpressCheckoutDetails https://developer.paypal.com/docs/classic/api/merchant/GetExpressCheckoutDetails_API_Operation_NVP/

The transaction ID will be provided if the payment is created.

Express Checkout would require an API call to complete the payment, if Omnipay is using Classic API that call would be DoExpressCheckoutPayment, so you could add some additional logic around that if you have access to the code.

randstra
  • 365
  • 1
  • 9