小编nir*_*irz的帖子

发布到端点以在购买前获取重定向网址

我正在尝试为名为creditguard的本地网关创建一个自定义的omnipay驱动程序.对于此网关,您需要将数据发布到端点并返回付款表单的重定向URL.

我的问题是你如何在购买前发布并获得回复?

编辑:

Gateway.php

    class Gateway extends AbstractGateway
{
    public function getName()
    {
        return 'Creditguard';
    }

    public function getDefaultParameters()
    {
        return array();

    }

    public function getEndpoint()
    {
        return 'https://verifonetest.creditguard.co.il/xpo/Relay';
    }



    public function purchase(array $parameters = array())
    {
       return $this->createRequest('\Nirz\Creditguard\Message\PurchaseRequest', $parameters);

    }

    public function completePurchase(array $parameters = array())
    {
        return $this->createRequest('\Nirz\Creditguard\Message\CompletePurchaseRequest', $parameters);
    }

}
Run Code Online (Sandbox Code Playgroud)

PurchaseRequest.php

  class PurchaseRequest extends AbstractRequest
{
    protected $liveEndpoint = 'https://verifonetest.creditguard.co.il/xpo/Relay';
    protected $testEndpoint = 'https://verifonetest.creditguard.co.il/xpo/Relay';


    public function getData()
    {
        $this->validate('amount');

        // Either the nodifyUrl or the returnUrl can …
Run Code Online (Sandbox Code Playgroud)

php guzzle omnipay guzzlehttp

9
推荐指数
1
解决办法
324
查看次数

标签 统计

guzzle ×1

guzzlehttp ×1

omnipay ×1

php ×1