[英]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.