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
RajaMohanRajaMohan 

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.

 

 

Thanks

Raja

Surendra nuneSurendra nune
Hi RajaMohan,

Have you tried using this approach to prepare base64 request?

https://help.salesforce.com/apex/HTViewSolution?urlname=How-do-you-convert-a-Blob-to-string-1327108626373&language=en_US (https://help.salesforce.com/apex/HTViewSolution?urlname=How-do-you-convert-a-Blob-to-string-1327108626373&language=en_US)
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.
 
 
Regards
Ankit
 
janakijanaki
Hi Ankit,

Earlier I also faced the same error - 5006 : Unable to redirect to Vendors web site.The Vendor failed to provide a RedirectionURL.
http://www.sagepay.co.uk/support/error-codes/5006-unable-redirect-vendors-web-site-vendor-failed-provide-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.

https://www.sagepay.co.uk/support/12/38/server-integration-the-notification-post

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

Thanks,
Janaki Anandakumar