简体   繁体   English

Wordpress jigoshop端点不会调用processResponse()

[英]Wordpress jigoshop endpoint wont call processResponse()

ello, im trying to modify blue pay plugin, with other payment type. 大家好,我试图用其他付款方式修改蓝色付款插件。 This type after payment needs function like processResponse() to post data, but for me nothings happens. 付款后,这种类型需要像processResponse()这样的函数来发布数据,但对我而言什么也没有发生。 Endpoint calls the class, because if i echo something in __construct function its shows. 端点调用该类,因为如果我在__construct函数中回显某些内容,它就会显示出来。 Echo processResponse() dosent do anything. 回声processResponse()可以执行任何操作。 I understand that i need to set up some details in services, but what and how? 我了解我需要在服务中设置一些细节,但是什么以及如何做? Now im using this code ` 现在我正在使用此代码

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();`

Thanks to Jigoshop developers i got an answer. 感谢Jigoshop开发人员,我得到了答案。

Create class: 创建课程:

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

and in Common class constuctor insert: 并在Common类构造函数中插入:

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

And to get endpoint url use this: 要获取端点URL,请使用以下命令:

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

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

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