Sample files: embedded.php and popin.php
1. embedded.php
This file is used to display the payment form, in embedded mode.
In the HEAD
,,
load our JavaScript library
integrate the public key , mandatory initialization parameter
integrate other initialization parameters , like a URL in case of accepted payment
choose a theme (classic theme)
In the BODY
,,
define the display mode
use , the formToken , created in step 3, in parameter
kr-form-token
<?php include_once 'config.php'; ?> <?php include_once 'formToken.php'; ?> <head> <!-- STEP : 1 : load the JS librairy 2 : required public key 3 : the JS parameters url sucess and langage EN --> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <script type="text/javascript" src="<?php echo DOMAIN_URL; ?>/static/js/krypton-client/V4.0/stable/kr-payment-form.min.js" kr-public-key="<?php echo PUBLIC_KEY; ?>" kr-post-url-success="paid.php"; kr-language="en-EN"> </script> <!-- theme NEON should be loaded in the HEAD section --> <link rel="stylesheet" href= "<?php echo DOMAIN_URL; ?>/static/js/krypton-client/V4.0/ext/neon-reset.css"> <script src= "<?php echo DOMAIN_URL; ?>/static/js/krypton-client/V4.0/ext/neon.js"> </script> </head> <body> <div class="kr-embedded" kr-form-token="<?php echo $formToken; ?>" > </div> </body> </html>
2. popin.php
This file is used to display the payment form, in pop-in mode.
In the HEAD
,,
load our JavaScript library
integrate the public key , mandatory initialization parameter
integrate other initialization parameters , like a URL in case of accepted payment
choose a theme (classic theme)
In the BODY
,,
define , the display mode , (Pop-in mode by adding the attribute
kr-popin
,).use , the formToken , created in step 3, in parameter
kr-form-token
<head> <?php include_once 'config.php'; ?> <?php include_once 'formToken.php'; ?> <!-- STEP : 1 : load the JS librairy 2 : required public key 3 : the JS parameters url sucess and langage EN --> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <script type="text/javascript" src="<?php echo DOMAIN_URL; ?>/static/js/krypton-client/V4.0/stable/kr-payment-form.min.js" kr-public-key="<?php echo PUBLIC_KEY; ?>" kr-post-url-success="paid.php"; kr-language="en-EN"> </script> <!-- theme NEON should be loaded in the HEAD section --> <link rel="stylesheet" href= "<?php echo DOMAIN_URL; ?>/static/js/krypton-client/V4.0/ext/neon-reset.css"> <script src= "<?php echo DOMAIN_URL; ?>/static/js/krypton-client/V4.0/ext/neon.js"> </script> </head> <body> <div class="kr-embedded" kr-popin kr-form-token="<?php echo $formToken; ?>" > </div> </body> </html>