How do I link the Rest response to the IPN response - paypal

I am moving to paypalrest, but have a few questions.
there does not seem to be anything that I can link from my paypal response to the IPN response.
It would seem that I can get by without IPN except for eCheck payments that are pending, I would need to IPN trigger to let me know when they are completed.
How do I link the Rest response to the IPN response, thanks.

Just setup IPN in your PayPal and it will be triggered when new transactions occur. There really isn't any "linking" to the response necessary.

When you get payment details from Rest API, then you can find related transacion ID:
$payment = Payment::get($paymentId, $apiContext);
echo $payment->transactions[0]->related_resources[0]->sale->id;

Related

Paypal API get payment confirmation

I am able to post payment data to the Paypal REST API, and I get a response.
However, I ran some tests and entered incorrect expire dates and invorrect CVV2 numbers, but the response I get from the API is that the credit card has been approved.
From searching around, I understand that I should use the IPN to get a confirmation of the payment. I setup the IPN listener, and when I use the simulator to test, everything seems to be working.
My question is, how to I trigger the IPN callback on the payment? Or what would be the correct method to fully test the credit card details?
Any suggestions would be greatly appreciated! TIA!
Yes, in live env., it will return the same failed response than a wrong card number.

How to refund transaction in paypal? PHP Code

How to refund a transaction at once after pay? I use express checkout and need to refund payments atonce after pay if user paid for some product by mistake.
I found some link:
https://developer.paypal.com/docs/integration/direct/refund-payment/
But it seems to be wrong, because seems I have to send not only transaction id.
If just send curl post with a transaction id, what is non-sandbox link for refund?
I'm doing it via API
Are you sure that paypal is not sending you a transaction id?
Try to do a var dump on $_GET['id'] and see if you get anything... or just check if you get any response in the url. else something is going wrong.

Paypal IPN handler

Does the Paypal provides any api to retry the IPN message using message id? I need to integrate functionality similar to the "resend ipn" button available on IPN history page of paypal.
There is no API to trigger the resend of an IPN, but there are API's to obtain the details that would be included in an IPN for a given transaction, so depending on what you're doing that make work for you.
For example, the combination of TransactionSearch and GetTransactionDetails can be very useful.

SetExpressCheckout callback

Is there any way I can be notified that someone has approved a payment through SetExpressCheckout, if they don't get redirected back to my website?
ie. After they approve the payment I would receive a callback or payment notification.
If so, how would I do it?
Thanks.
Users will always be redirected to your site when using Express Checkout. They have to because the payment isn't final until you call DoExpressCheckoutPayment which can't occur until after they've been redirected back to your site. Maybe I don't understand what you're asking here..??
In any case, take a look at IPN (Instant Payment Notification). It will POST transaction data to a listener script you have on your server so you can automate post-order processing in real-time. Again, though, no IPN would be triggered form SetExpressCheckout alone because no payment has actually been made at that point.

Capturing payment; express checkout

Hi
I have paypal express checkout working on my site, when user buys something the transaction goes through and the merchant is able to capture payment by clicking on the capture button on the sandbox site. Problem is that I need 'capture status' returned to the site as I need to store it in database for future use, is there a way that paypal sends some notification whenever the payment is captured by the merchant.
Thanks
PayPal IPN: https://www.paypal.com/ipn
In short, include NOTIFYURL in your SetExpressCheckout and DoExpresscheckoutPayment call and you'll receive a POST on that URL when the transaction has been captured. Look for 'PAYMENTSTATUS', as that should read 'Complete'.
Don't forget to validate the POST by sending it back to https://www.paypal.com/cgi-bin/webscr?cmd=_notify-validate and checking for a VERIFIED / INVALID response.