generateHTML static method

String generateHTML(
  1. PayEngineConfig config,
  2. String componentName,
  3. Map<String, String> props, {
  4. String source = 'native ',
})

Implementation

static String generateHTML(
    PayEngineConfig config, String componentName, Map<String, String> props,
    {String source = 'native '}) {
  var scriptURL = "${config.fullScriptURL}?key=${config.publicKey}";
  var component = getHtmlTag(componentName, props);
  return '''
<!DOCTYPE html>
<html>
<head>
  <title>PayEngine Elements</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  ${source == 'web' ? '<script>${injectJavascript(source: source)}</script>' : ''}
  <script src="$scriptURL" async defer type="text/javascript"></script>
</head>
<body>
  $component
</body>
</html>
''';
}