@usewinter/checkout
Advanced tools
Comparing version 0.1.41 to 0.1.42
@@ -25,2 +25,3 @@ import React = require("react"); | ||
giftingNFT?: boolean; | ||
fa2Address?: string; | ||
onClose?: () => void; | ||
@@ -27,0 +28,0 @@ onSuccess?: (txId: string, email: string) => void; |
@@ -7,7 +7,13 @@ "use strict"; | ||
exports.default = void 0; | ||
require("core-js/modules/web.dom-collections.iterator.js"); | ||
require("core-js/modules/es.json.stringify.js"); | ||
var _react = _interopRequireWildcard(require("react")); | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
const WinterCheckout = _ref => { | ||
@@ -40,2 +46,3 @@ let { | ||
giftingNFT, | ||
fa2Address, | ||
policyId, | ||
@@ -51,2 +58,3 @@ recaptcha | ||
} = e; | ||
if (data === "closeWinterCheckoutModal") { | ||
@@ -67,2 +75,3 @@ onClose === null || onClose === void 0 ? void 0 : onClose(); | ||
}; | ||
window.addEventListener("message", handleWindowEvent); | ||
@@ -74,2 +83,3 @@ return () => window.removeEventListener("message", handleWindowEvent); | ||
let queryString = ""; | ||
if (projectId) { | ||
@@ -85,2 +95,3 @@ queryString += "projectId=" + projectId; | ||
} | ||
if (recaptcha) { | ||
@@ -90,51 +101,73 @@ // Used for jpg primary mints | ||
} | ||
if (walletAddress) { | ||
queryString += "&walletAddress=" + walletAddress; | ||
} | ||
if (email) { | ||
queryString += "&email=" + email; | ||
} | ||
if (mintQuantity) { | ||
queryString += "&mintQuantity=" + mintQuantity; | ||
} | ||
if (fillSource) { | ||
queryString += "&fillSource=" + fillSource; | ||
} | ||
if (orderSource) { | ||
queryString += "&orderSource=" + orderSource; | ||
} | ||
if (erc1155Video) { | ||
queryString += "&erc1155Video=" + erc1155Video; | ||
} | ||
if (title) { | ||
queryString += "&title=" + title; | ||
} | ||
if (language) { | ||
queryString += "&language=" + language; | ||
} | ||
if (brandImage) { | ||
queryString += "&brandImage=".concat(brandImage); | ||
} | ||
if (gentkId) { | ||
queryString += "&gentkId=".concat(gentkId); | ||
} | ||
if (paymentMethod) { | ||
queryString += "&paymentMethod=".concat(paymentMethod); | ||
} | ||
if (giftingAvailable) { | ||
queryString += "&giftingAvailable=".concat(giftingAvailable); | ||
} | ||
if (giftingNFT) { | ||
queryString += "&giftingNFT=".concat(giftingNFT); | ||
} | ||
if (fa2Address) { | ||
queryString += "&fa2Address=".concat(fa2Address); | ||
} | ||
if (extraMintParams) { | ||
queryString += "&extraMintParams=".concat(encodeURIComponent(JSON.stringify(extraMintParams))); | ||
} | ||
if (priceFunctionParams) { | ||
queryString += "&priceFunctionParams=".concat(encodeURIComponent(JSON.stringify(priceFunctionParams))); | ||
} | ||
if (appearance) { | ||
queryString += "&appearance=".concat(encodeURIComponent(JSON.stringify(appearance))); | ||
} | ||
var url; | ||
if (production) { | ||
@@ -149,9 +182,9 @@ url = "https://checkout.usewinter.com/?" + queryString; | ||
} | ||
setProjectUrl(url); | ||
// Open checkout in new window if payment method is SOL | ||
setProjectUrl(url); // Open checkout in new window if payment method is SOL | ||
if (paymentMethod === "SOL" && showModal) { | ||
window.open(url, "checkout", "height=" + window.innerHeight + ",width=800"); | ||
} | ||
}, [onSuccess, onClose, projectId, showModal, walletAddress, email, mintQuantity, erc1155Video, title, brandImage, extraMintParams, priceFunctionParams, production, language, appearance, gentkId, assetId, giftingAvailable, giftingNFT]); | ||
}, [onSuccess, onClose, projectId, showModal, walletAddress, email, mintQuantity, erc1155Video, title, brandImage, extraMintParams, priceFunctionParams, production, language, appearance, gentkId, assetId, giftingAvailable, giftingNFT, fa2Address]); | ||
return showModal && paymentMethod !== "SOL" ? /*#__PURE__*/_react.default.createElement("div", { | ||
@@ -163,3 +196,4 @@ dangerouslySetInnerHTML: { | ||
}; | ||
var _default = WinterCheckout; | ||
exports.default = _default; |
@@ -12,3 +12,5 @@ "use strict"; | ||
}); | ||
var _WinterCheckout = _interopRequireDefault(require("./components/WinterCheckout")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
{ | ||
"name": "@usewinter/checkout", | ||
"version": "0.1.41", | ||
"version": "0.1.42", | ||
"description": "Integrate Winter's NFT checkout with this React component", | ||
@@ -5,0 +5,0 @@ "author": "Evan Fisher", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
10775
201
0