sagepay form php - can I get callbacks from sagepay when a transaction completes?

StackOverflow https://stackoverflow.com/questions/7997617

  •  20-02-2021
  •  | 
  •  

I'm putting sagepay into a PHP powered site. So far I've had no trouble integrating the Form into the site, their docs are great compared to paypal (mutter mutter)

However I noticed in the dev guide for form integration, they say you can't rely on sagepay sending the customer back every time as they could close the browser, or navigate somewhere else etc.

At the same time, I don't want to move everything out of the user's cart and into an order before I know it's been confirmed / payed for - otherwise if they cancel or the transaction fails somehow on sagepay's end, their cart will be wiped out when they come back, making retrying the transaction a pain for the user, and I will have a duff order polluting my database.

So what I want to know is if there is a way to get sagepay to send a request to the site when something happens with a payment, similar to paypal's Instant Payment Notifications?

EDIT: Or are they only saying it's patchy because they can't garuantee it, but it works enough of the time to practically rely on it?

有帮助吗?

解决方案

Sagepay (AKA Protx) form integration redirects the user automatically once the transaction has completed.

For small sites, i advise my clients to always check the sagepay transaction logs (on the sagepay site) before sending out any goods.

You should be logging the order before they go to Sagepay. Then changing it's "status" to paid when they get redirected back to your site. This gives you a bit more of a paper trail to pick up any possible issues.

If you want a more robust solution. Try Sagepay direct integration. It has more requirements and is harder to integrate but on bigger projects (where you can't manually check orders) it's usually required. Mainly because users can stay on-site without having to go off to Sagepay to make payments.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top