Answer the question
In order to leave comments, you need to log in
How to write a payment handler in Bitrix?
I am writing a payment processor for lending. I found links on how to write it.
course
documentation
So I realized that the old version of
d7
handlers
As a result, I wrote such a canoe
<?php
namespace Sale\Handlers\PaySystem;
use Bitrix\Main\Request;
use Bitrix\Sale\PaySystem;
use Bitrix\Sale\Payment;
use Bitrix\Sale;
use Bitrix\Sale\PaySystem\ServiceResult;
class tcreditHandler extends PaySystem\ServiceHandler
{
public function initiatePay(Payment $payment, Request $request = null)
{
AddMessage2Log('TcreditHandler initiatePay()');
$params = array('URL' => $this->getUrl($payment, 'pay'));
$this->setExtraParams($params);
return $this->showTemplate($payment, "template");
}
public static function getIndicativeFields()
{
AddMessage2Log('TcreditHandler getIndicativeFields()');
return array('BX_HANDLER' => 'CREDIT');
}
public function getCurrencyList()
{
AddMessage2Log('TcreditHandler getCurrencyList()');
}
public function processRequest(Payment $payment, Request $request)
{
AddMessage2Log('TcreditHandler processRequest()');
}
public function getPaymentIdFromRequest(Request $request)
{
AddMessage2Log('TcreditHandler getPaymentIdFromRequest()');
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question