【发布时间】:2013-07-10 09:43:53
【问题描述】:
我正在开发一种自定义付款解决方案,但我一直不知道如何通知 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) {
【问题讨论】:
标签: php magento magento-1.7 payment-gateway