render('@Payment/PayZen/form.html.twig'); } public function tunnel(ContainerInterface $container, Request $request): Response { $args = array( 'shopID' => '67578262', // shopID 'certTest' => 'WUHU792v8Ov4wfeP', // certificate, TEST-version 'certProd' => 'WUHU792v8Ov4wfeP', // certificate, PRODUCTION-version 'ctxMode' => 'TEST', // PRODUCTION || TEST 'platform' => 'https://secure.payzen.eu/vads-payment/', // Platform URL 'debug' => true, 'type_signature' => 'hmac' //ou 'sha1' ); $toolbox = new PayZenToolBox($args); $post_parameters = $toolbox->getFormData($request->request->all()); return $this->render('@Payment/PayZen/tunnel.html.twig',['post_parameters'=>$post_parameters]); } /** * @param ContainerInterface $container * @return Response */ public function default(ContainerInterface $container): Response { return $this->render('@Payment/PayZen/default.html.twig'); } public function ipn(ContainerInterface $container): Response { return $this->render('@Payment/PayZen/ipn.html.twig'); } public function retour(ContainerInterface $container, Request $request): Response { $args = array( 'shopID' => '67578262', // shopID 'certTest' => 'WUHU792v8Ov4wfeP', // certificate, TEST-version 'certProd' => 'WUHU792v8Ov4wfeP', // certificate, PRODUCTION-version 'ctxMode' => 'TEST', // PRODUCTION || TEST 'platform' => 'https://secure.payzen.eu/vads-payment/', // Platform URL 'debug' => true, 'type_signature' => 'hmac' //ou 'sha1' ); $toolbox = new PayZenToolBox($args); $post_parameters = $request->request->all(); $control = $toolbox->checkSignature($post_parameters); if($control && $toolbox->debug == true){ $response = $toolbox->getIpn(); $status = (isset($response['vads_trans_status']) && is_array($response)) ? $response['vads_trans_status'] : 'undefined'; $vads_warranty_result = (isset($response['vads_warranty_result'])) ? $response['vads_warranty_result'] : 'undefined'; $vads_threeds_status = (isset($response['vads_threeds_status'])) ? $response['vads_threeds_status'] : 'undefined'; $vads_auth_result = (isset($response['vads_auth_result'])) ? $response['vads_auth_result'] : 'undefined'; $vads_capture_delay = (isset($response['vads_capture_delay'])) ? $response['vads_capture_delay'] : 'undefined'; $vads_validation_mode = (isset($response['vads_validation_mode'])) ? $response['vads_validation_mode'] : 'undefined'; //echo '

'.$i18n['paymentstatus'].' : '.$status.'

'; echo '

vads_warranty_result : '.$vads_warranty_result.'

'; echo '

vads_threeds_status (3DS) : '.$vads_warranty_result.'

'; echo '

vads_auth_result : '.$vads_auth_result.'

'; echo '

vads_capture_delay: '.$vads_capture_delay.'

'; echo '

vads_validation_mode: '.$vads_validation_mode.'

'; //echo "

".$i18n['datawithdoclinks'].'

'; echo ''; $form = ''; foreach ($response as $name => $value) { $doc_name = (strpos($name, 'vads_') !== false) ? str_replace('_','-',$name): false; $doclink = ($doc_name) ? 'https://payzen.io/en-EN/form-payment/standard-payment/'.$doc_name.'.html': '#'; $form .= ''; $form .= ''; $form .= ''; $form .= ''; } echo $form; echo '
'; //echo "

".$i18n['rawdata'].'

'; echo '
';
            dump($response);
            echo '
'; } elseif($control && $toolbox->debug === false){ $response = $toolbox->getIpn(); $status = (isset($response['vads_trans_status']) && is_array($response)) ? $response['vads_trans_status'] : 'undefined'; //echo '

'.$i18n['paymentstatus'].' : '.$status.'

'; }else { //echo $i18n['invalidsign']; } return $this->render('@Payment/PayZen/retour.html.twig'); } }