You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 15, 2024. It is now read-only.
I found a small issue when I tried to generate several forms for one page (one form per payment type), the field PBX_HMAC is not regenerated for each form.
It seems that once the service has been called and a form generated, this parameter is set for the execution lifetime, due to this if condition in Lexik\Bundle\PayboxBundle\Paybox\System\Base\Request (line 129-133) :
/** * Returns all parameters set for a payment. * * @return array */publicfunctiongetParameters()
{
// This condition prevent the generation of a new PBX_HMACif (null === $this->getParameter('PBX_HMAC')) {
$this->setParameter('PBX_TIME', date('c'));
$this->setParameter('PBX_HMAC', strtoupper($this->computeHmac()));
}
$resolver = newParameterResolver($this->globals['currencies']);
return$resolver->resolve($this->parameters);
}
To overcome this, I extended this class in my app by adding this parameter
/** * Returns all parameters set for a payment. * * @return array */publicfunctiongetParameters()
{
//if (null === $this->getParameter('PBX_HMAC')) {$this->setParameter('PBX_TIME', date('c'));
$this->setParameter('PBX_HMAC', strtoupper($this->computeHmac()));
//}$resolver = newParameterResolver($this->globals['currencies']);
return$resolver->resolve($this->parameters);
}
It works well :)
Btw, I also had to extend \Lexik\Bundle\PayboxBundle\Paybox\System\Base\ParameterResolver for another reason, the value "ANCV" was not allowed in the PBX_TYPECARTE options, since the ParameterResolver is manually instanciated in Request::getParameters().
Yondz
The text was updated successfully, but these errors were encountered:
I know it is not the way this bundle was designed for, but I need to instanciate several pre-configured payment buttons on the same page (VISA, Mastercard, CB, ..), and thus set PBX_TYPECARTE var to the proper value -> generate the PBX_HMAC for each button.
This way the user goes directly to the pre-configured payment method.
Hi,
I found a small issue when I tried to generate several forms for one page (one form per payment type), the field PBX_HMAC is not regenerated for each form.
It seems that once the service has been called and a form generated, this parameter is set for the execution lifetime, due to this if condition in Lexik\Bundle\PayboxBundle\Paybox\System\Base\Request (line 129-133) :
To overcome this, I extended this class in my app by adding this parameter
And commented the condition like this :
It works well :)
Btw, I also had to extend \Lexik\Bundle\PayboxBundle\Paybox\System\Base\ParameterResolver for another reason, the value "ANCV" was not allowed in the PBX_TYPECARTE options, since the ParameterResolver is manually instanciated in Request::getParameters().
Yondz
The text was updated successfully, but these errors were encountered: