I am working on a custom payment solution and am stuck on how to notify magento that the payment was accepted or declined.
I have a PaymentController.php
file and need to enter code to handle this.
The payment gateway provides a HTTP GET
request below.
http://www.websitename.co.uk/mygateway/payment/response?SessionID=&Note=&Tariff=&Status=
SessionID is a unique ID assigned by payment gateway
Note is the orderID which was generated by magento
Tariff is the price of the order in pence i.e. 100p
Status is the status of payment, there are about 10 different types and Status=100 is a successful payment and Status=200 is a failed payment
So it might be http://www.websitename.co.uk/mygateway/payment/response?SessionID=123456&Note=1000051&Tariff=300&Status=100
I am not sure how to create the code to handle this get request and work out the status
I need to place the code between this area of the paymentcontroller
public function responseAction() {
if($this->getRequest()->isPost()) {
/*
/* Your gateway's code to make sure the reponse you
/* just got is from the gatway and not from some weirdo.
/* This generally has some checksum or other checks,
/* and is provided by the gateway.
/* For now, we assume that the gateway's response is valid
*/
$validated = true;
$orderId = '';
if($validated) {