UNPKG

react-stripe-checkout

Version:

Easily inject checkout.js as a react component. Will load the script on demand and supports all the options from stripe docs.

24 lines (18 loc) 566 B
const noop = () => {} const empty = () => ({}) require.extensions['.css'] = empty require.extensions['.ico'] = noop require.extensions['.png'] = noop var jsdom = require('jsdom').jsdom var exposedProperties = ['window', 'navigator', 'document'] global.document = jsdom('') global.window = document.defaultView Object.keys(document.defaultView).forEach((property) => { if (typeof global[property] === 'undefined') { exposedProperties.push(property) global[property] = document.defaultView[property] } }) global.navigator = { userAgent: 'node.js' }