I am needing to integrate Sage Pay on our website to accept online payments.

I have downloaded and tested the PHP kit provided by Sage and have run a few successful tests, however, I don't know where to start when it comes to integrating this with Cake PHP.

If anybody has some initial pointers or ideas, or even links (multiple, varied Google searches yielded nothing) that would be great ...

Many thanks,

Dave


Hi there,thanks for the reply, and apologies for the delayed replying myself. I have it all working now, except my final issue as that I need to parse the final response returned from SagePay. The demo has the following code in the final step that gets posted to my site (to an action), The code they have is as follows:

...
$strVPSSignature=$_REQUEST["VPSSignature"];
$strStatusDetail=$_REQUEST["StatusDetail"];
...

Obviously this won't work due to Cake's routing. How do you suggest I parse these value>

Thanks again.

Dave

有帮助吗?

解决方案

Haven't used Sagepay but a few pointers anyway:

  • Third party PHP classes should be loaded as vendors, so that is what I would do with their PHP kit.
  • This guy thinks SagePay's kit is a mess so you might find using his classes is easier to grok.

Although some might say payments belong in the business layer (your model), you might find it easier to initially perform payments from the controller layer. As such, I would start by creating a simple component with the inputs and outputs you need (methods/parameters/return values) and use it as a wrapper for the SagePay vendor of your choice. This will help keep your controller actions skinny. You can refactor later to your taste once you get things working.

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