Conversation
…iRequestAction.php Fix the interface and add a second method to generate transaction Id Change calculation for the amount send to Payzen, Payzen need a non-decimal value for amount Fork from ekyna/payum-payzen branch 1.6
| * @return PayzenGatewayFactory | ||
| */ | ||
| public static function build(array $defaultConfig, GatewayFactoryInterface $coreGatewayFactory = null): PayzenGatewayFactory | ||
| public static function build(array $defaultConfig, GatewayFactoryInterface $coreGatewayFactory = null, TransactionIdInterface $transactionId = null): PayzenGatewayFactory |
There was a problem hiding this comment.
This is not compatible with Payum/Core:
PayumBuilder::buildAddedGatewayFactories() won't give a value to $transationId argument.
I think default translation id generator should be defined in the default config.
| 'payum.action.notify' => new Action\NotifyAction(), | ||
| 'payum.action.api.request' => new Action\Api\ApiRequestAction(), | ||
| 'payum.action.api.request' => new Action\Api\ApiRequestAction($this->transactionId), | ||
| 'payum.action.api.response' => new Action\Api\ApiResponseAction(), |
There was a problem hiding this comment.
It might be possible to configure transaction id generator here. Something like:
'payum.action.api.directory' => sys_get_temp_dir(),
'payum.action.api.id_generator' => function(array $config) {
return new IdGeneratedByFile($config['payum.action.api.directory'])
},then, when configuring api (around line 92), maybe you can do something like this:
$config['payum.api'] = function (ArrayObject $config) {
$api = new Api\Api();
$api->setConfig($payzenConfig);
$api->setIdGenerator($config['payum.action.api.id_generator']);
return $api;
};There was a problem hiding this comment.
I agree too, when you are using Payum, it's better to inject what you need on the Action or on the Api services. Here it's better to just inject it into payum.action.api.request as @ekyna said.
| 'payum.action.status' => new Action\StatusAction(), | ||
| 'payum.action.notify' => new Action\NotifyAction(), | ||
| 'payum.action.api.request' => new Action\Api\ApiRequestAction(), | ||
| 'payum.action.api.request' => new Action\Api\ApiRequestAction($this->transactionId), |
There was a problem hiding this comment.
Inject transaction id generator into Api instance (see next comment) instead of ApiRequestAction .
ApiRequestAction is aware of Api (just give access to generator).
|
Hi ! |
Convert the transaction id's methods to be an interface who returns an array with vads_trans_id and vads_trans_date. A new method by date is added to generate your transaction id.
Convert the order amount to include the decimals from the currency in a new non-decimal number.