2015-07-03 59 views
1

我建立定制网关Payum库,我必须使用不安全的通知要求完成支付如何为不安全的请求创建NotifyAction?

https://example.com/payment/notify/unsafe/GATEWAY_NAME?amount=100.0&paymentDate=2015-07-03:15:10:57&hashCode=e10b795dd5f52540ca3039ce1af325b4&voucherNumber=6921760593&voucherStatus=PAID&refNumber=asda22sd&currency=USD

Array 
(
    [amount] => 100.0 
    [paymentDate] => 2015-07-03:15:10:57 
    [hashCode] => e10b795dd5f52540ca3039ce1af325b4 
    [voucherNumber] => 6921760593 
    [voucherStatus] => PAID 
    [refNumber] => asda22sd 
    [currency] => USD 
) 

一切工作的发现,只是我不知道该怎么通过使用refNumber获得Payment Token,以便我可以完成购买。

NotifyAction.php:

class NotifyAction extends GatewayAwareAction 
{ 
    /** 
    * {@inheritDoc} 
    */ 
    public function execute($request) 
    { 
     /** @var $request Notify */ 
     RequestNotSupportedException::assertSupports($this, $request); 

     $this->gateway->execute($httpRequest = new GetHttpRequest()); 
     $details = $httpRequest->query; 

     var_dump($details); 
     throw new HttpResponse(null, 200); 
    } 
    /** 
    * {@inheritDoc} 
    */ 
    public function supports($request) 
    { 
     return $request instanceof Notify; 
    } 
} 

回答

0

您存储标记的哈希以refNumber,你呢?如果是这样,有几种方法去:

  1. 您可以创建自己的通知控制器,你可以使用这个refNumber + http请求验证来获得令牌。一旦拥有令牌,您可以像往常一样将令牌传递给网关执行方法。

  2. 你可以注入(如通过构造函数的参数)的http请求验证的通知动作,做验证等