express-payment-request
Advanced tools
Comparing version 0.1.0-alpha.2 to 0.1.0-alpha.3
@@ -17,6 +17,2 @@ "use strict"; | ||
if (!window.Buffer) { | ||
window.Buffer = require("buffer"); | ||
} | ||
var postMessageStream = new _postMessageStream["default"]({ | ||
@@ -23,0 +19,0 @@ name: "express-payment-request@provider", |
@@ -50,2 +50,5 @@ "use strict"; | ||
// https://stackoverflow.com/a/50377270/1701465 | ||
global.Buffer = global.Buffer || require('buffer').Buffer; | ||
var validate = function validate(_ref) { | ||
@@ -84,3 +87,3 @@ var merchantInfo = _ref.merchantInfo, | ||
var host = "https://".concat(req.get("host")); | ||
var html = "\n<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <title>Payment</title>\n <style>\n body { margin:0; }\n </style>\n <script type=\"text/javascript\">\n window.__REACT_APP_CONFIG__ = {\n path: \"".concat(path, "\",\n host: \"").concat(host, "\",\n deepLinkUri: ").concat(!!deepLinkUri ? "\"".concat((0, _base.decode)(deepLinkUri), "\"") : null, ",\n methodData: ").concat(JSON.stringify(methodData), ",\n details: ").concat((0, _base.decode)(details), ", \n options: ").concat(JSON.stringify(options), ",\n forceApplePayJS: ").concat(forceApplePayJS, ",\n };\n </script>\n </head>\n <body>\n <div id=\"container\"></div>\n <div id=\"root\"></div>\n <script src=\"").concat(path, "/root/app.js\" charset=\"utf-8\"></script>\n <script src=\"").concat(path, "/root/vendor.js\" charset=\"utf-8\"></script>\n <script src=\"").concat(path, "/app.js\" charset=\"utf-8\"></script>\n <script src=\"").concat(path, "/vendor.js\" charset=\"utf-8\"></script>\n </body>\n</html>\n ").trim(); | ||
var html = "\n<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <title>Payment</title>\n <style>\n body { margin:0; }\n </style>\n <script>\n var global = global || window;\n </script>\n <script type=\"text/javascript\">\n window.__REACT_APP_CONFIG__ = {\n path: \"".concat(path, "\",\n host: \"").concat(host, "\",\n deepLinkUri: ").concat(!!deepLinkUri ? "\"".concat((0, _base.decode)(deepLinkUri), "\"") : null, ",\n methodData: ").concat(JSON.stringify(methodData), ",\n details: ").concat((0, _base.decode)(details), ", \n options: ").concat(JSON.stringify(options), ",\n forceApplePayJS: ").concat(forceApplePayJS, ",\n };\n </script>\n </head>\n <body>\n <div id=\"container\"></div>\n <div id=\"root\"></div>\n <script src=\"").concat(path, "/root/app.js\" charset=\"utf-8\"></script>\n <script src=\"").concat(path, "/root/vendor.js\" charset=\"utf-8\"></script>\n <script src=\"").concat(path, "/app.js\" charset=\"utf-8\"></script>\n <script src=\"").concat(path, "/vendor.js\" charset=\"utf-8\"></script>\n </body>\n</html>\n ").trim(); | ||
return res.status(_httpStatusCodes.OK).send((0, _handlebars.compile)(html)({})); | ||
@@ -87,0 +90,0 @@ })["catch"](next); |
{ | ||
"name": "express-payment-request", | ||
"version": "0.1.0-alpha.2", | ||
"version": "0.1.0-alpha.3", | ||
"description": "💸 A middleware for Express which can be used to serve the Payment Request API.", | ||
@@ -5,0 +5,0 @@ "main": "dist", |
@@ -1,5 +0,1 @@ | ||
if (!window.Buffer) { | ||
window.Buffer = require("buffer"); | ||
} | ||
import "@babel/polyfill"; | ||
@@ -6,0 +2,0 @@ |
@@ -0,1 +1,4 @@ | ||
// https://stackoverflow.com/a/50377270/1701465 | ||
global.Buffer = global.Buffer || require('buffer').Buffer; | ||
import "@babel/polyfill"; | ||
@@ -52,2 +55,5 @@ | ||
</style> | ||
<script> | ||
var global = global || window; | ||
</script> | ||
<script type="text/javascript"> | ||
@@ -54,0 +60,0 @@ window.__REACT_APP_CONFIG__ = { |
Sorry, the diff of this file is too big to display
7841
5381044