require.js
Require.js allows to load scripts asynchronously. For more information on the functioning of require.js , go to: https://requirejs.org
Example of integration
To load the embedded form library with requirejs , add the following code in the <head> section of your page:
https://github.com/lyra/rest-php-examples/blob/master/www/js_examples/requirejs/minimalEmbeddedForm.php#L53-L77
require.js will asynchronously load the JavaScript client (krypton path) and the classic theme (kryptonTheme path).
Then, in the body section, add the payment form:
https://github.com/lyra/rest-php-examples/blob/master/www/js_examples/requirejs/minimalEmbeddedForm.php#L85-L102
Note that the configuration directives ( kr-public-key , etc.) are defined in a div within the form ( kr-embedded class), by contrast with classic integration.
Complete example
https://github.com/lyra/rest-php-examples/blob/master/www/js_examples/requirejs/minimalEmbeddedForm.php