繁体   English   中英

Wordpress jigoshop端点不会调用processResponse()

[英]Wordpress jigoshop endpoint wont call processResponse()

大家好,我试图用其他付款方式修改蓝色付款插件。 付款后,这种类型需要像processResponse()这样的函数来发布数据,但对我而言什么也没有发生。 端点调用该类,因为如果我在__construct函数中回显某些内容,它就会显示出来。 回声processResponse()可以执行任何操作。 我了解我需要在服务中设置一些细节,但是什么以及如何做? 现在我正在使用此代码

namespace Jigoshop\Extension\BluepayGateway;

use Jigoshop\Integration;
use Jigoshop\Container;
use Jigoshop\Container\Services;
use Jigoshop\Container\Tags;
use Jigoshop\Container\Triggers;
use Jigoshop\Container\Factories;

class Common
{
public function __construct()
{

    Integration::addPsr4Autoload(__NAMESPACE__ . '\\', __DIR__);
    Integration\Helper\Render::addLocation('blue_pay', JIGOSHOP_PAYSERA_GATEWAY_DIR);

    $di = Integration::getService('di');
    $di->services->setDetails('jigoshop.payment.blue_pay', __NAMESPACE__ . '\\Common\\Method', array(
        'jigoshop.options',
        'jigoshop.service.cart',
        'jigoshop.service.order',
        'jigoshop.messages',
    ));

$di = Integration::getService('di');
$di->triggers->add('jigoshop.service.payment', 'addMethod', array('jigoshop.payment.blue_pay'));
}
}
new Common();`

感谢Jigoshop开发人员,我得到了答案。

创建课程:

class Endpoint implements \Jigoshop\Endpoint\Processable
{
    public function processResponse()
    {
         //Your Code here
    }
}

并在Common类构造函数中插入:

$di->services->setDetails('jigoshop.endpoint.blue_pay', __NAMESPACE__ . '\\Common\\Endpoint', []);

要获取端点URL,请使用以下命令:

\Jigoshop\Helper\Endpoint::getUrl('blue_pay');

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM