我正在研究一个自定义支付解决方案,并且一直坚持如何通知 magento 付款被接受或拒绝。
我有一个PaymentController.php
文件,需要输入代码来处理这个。
支付网关在下面提供HTTP GET
请求。
http://www.websitename.co.uk/mygateway/payment/response?SessionID=&Note=&Tariff=&Status=
SessionID 是支付网关分配的唯一 ID
注意是magento生成的orderID
关税是以便士为单位的订单价格,即 100 便士
Status是支付的状态,大概有10种不同的类型,Status=100是支付成功,Status=200是支付失败
所以可能是http://www.websitename.co.uk/mygateway/payment/response?SessionID=123456&Note=1000051&Tariff=300&Status=100
我不确定如何创建代码来处理这个获取请求并计算出状态
我需要将代码放在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) {