From 6be4e00a72eacc971cbeeeb6d10124a1eead7f57 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Thu, 28 Feb 2019 09:17:18 +0100 Subject: new payment flow --- .../subscription/SubscriptionFormScreen.js | 39 ++++++++++++---------- 1 file changed, 22 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/containers/subscription/SubscriptionFormScreen.js b/src/containers/subscription/SubscriptionFormScreen.js index 3eb7b6255..cb67ee7f2 100644 --- a/src/containers/subscription/SubscriptionFormScreen.js +++ b/src/containers/subscription/SubscriptionFormScreen.js @@ -43,26 +43,31 @@ export default @inject('stores', 'actions') @observer class SubscriptionFormScre }); const hostedPage = await stores.payment.createHostedPageRequest; - const url = `file://${__dirname}/../../index.html#/payment/${encodeURIComponent(hostedPage.url)}`; if (hostedPage.url) { - const paymentWindow = new BrowserWindow({ - parent: remote.getCurrentWindow(), - modal: true, - title: '🔒 Franz Supporter License', - width: 600, - height: window.innerHeight - 100, - maxWidth: 600, - minWidth: 600, - webPreferences: { - nodeIntegration: true, - }, - }); - paymentWindow.loadURL(url); + if (hostedPage.legacyCheckoutFlow) { + const paymentWindow = new BrowserWindow({ + parent: remote.getCurrentWindow(), + modal: true, + title: '🔒 Franz Supporter License', + width: 600, + height: window.innerHeight - 100, + maxWidth: 600, + minWidth: 600, + webPreferences: { + nodeIntegration: true, + }, + }); + paymentWindow.loadURL(`file://${__dirname}/../../index.html#/payment/${encodeURIComponent(hostedPage.url)}`); - paymentWindow.on('closed', () => { - onCloseWindow(); - }); + paymentWindow.on('closed', () => { + onCloseWindow(); + }); + } else { + actions.app.openExternalUrl({ + url: hostedPage.url, + }); + } } } -- cgit v1.2.3-54-g00ecf From b3f0f2a0f820d97f6ed449e50fb37b0e3c59f317 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Thu, 28 Feb 2019 15:56:33 +0100 Subject: fix module reference --- src/components/ui/Modal/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/components/ui/Modal/index.js b/src/components/ui/Modal/index.js index 8e6ec5a0e..0b7154760 100644 --- a/src/components/ui/Modal/index.js +++ b/src/components/ui/Modal/index.js @@ -3,9 +3,9 @@ import ReactModal from 'react-modal'; import PropTypes from 'prop-types'; import classnames from 'classnames'; import injectCSS from 'react-jss'; +import { Icon } from '@meetfranz/ui'; import styles from './styles'; -import { Icon } from '../../../../packages/ui/lib'; // ReactModal.setAppElement('#root'); -- cgit v1.2.3-54-g00ecf