function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

how to do Sagepay Integration using apex?

Hi All,


Did anyone do SagePay Integration using apex? I want to implement it for my client. I got the document from SagePay. The request format is only given in the document. The way to do the encryption and sending the request are not provided over there.


Please help me out to complete this.





Surendra nuneSurendra nune
Hi RajaMohan,

Have you tried using this approach to prepare base64 request? (
Ankit Gupta@ DeveloperAnkit Gupta@ Developer
Hi Raja,

Your client will have to do basic configuration from Sagepay. Earlier I faced same issue. I have done Sagepay Integration by following their documentation. Sometime it was working and some time it was throwing  an error 5006error. For this problem I reached to sagepay but did not get any solution.
Hi Ankit,

Earlier I also faced the same error - 5006 : Unable to redirect to Vendors web site.The Vendor failed to provide a RedirectionURL.

For the same error, even I also contacted Sagepay support, but we didn't get any proper solution for this. After few days of struggle, I relaised that the error comming becuse of I failed to make response with RedirectionURL for Sagepay Notification POST after transaction.

So please make sure that you are making response for Sagepay Notification POST with proper Status and RedirectURL.

Janaki Anandakumar