@seamlessdocs/payment-modals 1.0.56 → 1.0.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.html CHANGED
@@ -15,6 +15,9 @@
15
15
  <a href="#" id="successModal">Open "Successful Payment" modal</a>
16
16
  <a href="#" id="selectPaymentModal">Open "Select Payment" modal</a>
17
17
  <a href="#" id="achPaymentModal">Open "ACH Payment" modal</a>
18
+ <a href="#" id="govOSPayACHPaymentModal">Open "GovOS Pay ACH Payment" modal</a>
19
+ <a href="#" id="govOSPayCardPaymentModal">Open "GovOS Pay Card Payment" modal</a>
20
+ <a href="#" id="govOSPayInvoiceSummaryModal">Open "GovOS Pay Invoice Summary" modal</a>
18
21
  <a href="#" id="none">Close</a>
19
22
  </div>
20
23
  <div id="payment-modal"></div>
@@ -130,6 +133,134 @@
130
133
  });
131
134
 
132
135
  triggers[7].addEventListener('click', function(event) {
136
+ window.handlePaymentModal.govOSPayACHPaymentModal({
137
+ amount: 2424,
138
+ paymentCorrelationId: String(Math.random()).slice(2),
139
+ paymentConfig: {
140
+ providerAccountCode: "54c574a2-5271-4c93-bd68-57e39930a52a",
141
+ mapping: {
142
+ platformApplicationCode: "FORMS",
143
+ platformTenantCode: "TESTFORCE",
144
+ providerName: "GovOS Pay",
145
+ accountName: "Test studio 3",
146
+ configuration: {
147
+ accessCredentials: {
148
+ gatewayName: "GovOS Pay",
149
+ merchantId: "t1_mer_65e617f34f1e57a4ee46560",
150
+ publicKey: "ae298630ef3e58ddd93079c908d5ff5e"
151
+ },
152
+ scriptUrl: "https://test-api.payrix.com/payFieldsScript"
153
+ }
154
+ },
155
+ merchantInformation: {
156
+ id: "t1_mer_65e617f34f1e57a4ee46560",
157
+ name: "Waxahachie City Test Merchant",
158
+ phone: "5555555555",
159
+ address: {
160
+ address1: "109 South Jackson Street",
161
+ address2: "",
162
+ city: "Waxahachie",
163
+ state: "TX",
164
+ zip: "75165",
165
+ phone: "5555555555"
166
+ }
167
+ }
168
+ },
169
+ transactionUrl: 'https://backend.dev.nonprod.seamlessdocs.com/payments/transactions/govOsPay/transaction.json',
170
+ callbacks: {
171
+ onPay: function () {
172
+ setTimeout(function () {
173
+ console.log('Pay');
174
+ }, 400);
175
+ },
176
+ onClose: function() {
177
+ console.log('close');
178
+ }
179
+ }
180
+ });
181
+ });
182
+
183
+ triggers[8].addEventListener('click', function(event) {
184
+ window.handlePaymentModal.govOSPayCardPaymentModal({
185
+ amount: 2200,
186
+ paymentCorrelationId: String(Math.random()).slice(2),
187
+ paymentConfig: {
188
+ providerAccountCode: "54c574a2-5271-4c93-bd68-57e39930a52a",
189
+ mapping: {
190
+ platformApplicationCode: "FORMS",
191
+ platformTenantCode: "TESTFORCE",
192
+ providerName: "GovOS Pay",
193
+ accountName: "Test studio 3",
194
+ configuration: {
195
+ accessCredentials: {
196
+ gatewayName: "GovOS Pay",
197
+ merchantId: "t1_mer_65e617f34f1e57a4ee46560",
198
+ publicKey: "ae298630ef3e58ddd93079c908d5ff5e"
199
+ },
200
+ scriptUrl: "https://test-api.payrix.com/payFieldsScript"
201
+ }
202
+ },
203
+ merchantInformation: {
204
+ id: "t1_mer_65e617f34f1e57a4ee46560",
205
+ name: "Waxahachie City Test Merchant",
206
+ phone: "5555555555",
207
+ address: {
208
+ address1: "109 South Jackson Street",
209
+ address2: "",
210
+ city: "Waxahachie",
211
+ state: "TX",
212
+ zip: "75165",
213
+ phone: "5555555555"
214
+ }
215
+ }
216
+ },
217
+ transactionUrl: 'https://backend.dev.nonprod.seamlessdocs.com/payments/transactions/govOsPay/transaction.json',
218
+ callbacks: {
219
+ onPay: function () {
220
+ setTimeout(function () {
221
+ console.log('Pay');
222
+ }, 400);
223
+ },
224
+ onClose: function() {
225
+ console.log('close');
226
+ }
227
+ }
228
+ });
229
+ });
230
+
231
+ triggers[9].addEventListener('click', function(event) {
232
+ window.handlePaymentModal.govOSPayInvoiceSummaryModal({
233
+ transactionData: [
234
+ {
235
+ entityName: 'Test entity',
236
+ lineItems: [
237
+ {
238
+ title: 'Test title',
239
+ description: 'Test description',
240
+ quantity: 1,
241
+ unitPrice: 100,
242
+ },
243
+ {
244
+ title: 'Test Fee',
245
+ description: 'Test description 2',
246
+ quantity: 1,
247
+ unitPrice: 200,
248
+ }
249
+ ],
250
+ }
251
+ ],
252
+ callbacks: {
253
+ onClose: function() {
254
+ console.log('close');
255
+ },
256
+ onSubmit: function() {
257
+ console.log('submit');
258
+ }
259
+ }
260
+ });
261
+ });
262
+
263
+ triggers[10].addEventListener('click', function(event) {
133
264
  window.handlePaymentModal.none();
134
265
  });
135
266
  </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seamlessdocs/payment-modals",
3
- "version": "1.0.56",
3
+ "version": "1.0.57",
4
4
  "description": "Payment modals for SeamlessDocs",
5
5
  "main": "build/payment-modals.js",
6
6
  "repository": {
@@ -44,6 +44,7 @@
44
44
  "webpack-dev-server": "^3.2.1"
45
45
  },
46
46
  "dependencies": {
47
+ "@kofile/platform-react-payrix": "1.6.15",
47
48
  "babel-plugin-import": "^1.11.0",
48
49
  "base64-image-loader": "^1.2.1",
49
50
  "classnames": "^2.2.6",
@@ -0,0 +1,40 @@
1
+ .modalContainer {
2
+ overflow-y: auto;
3
+
4
+ box-sizing: border-box;
5
+ max-width: 600px;
6
+ height: 100%;
7
+ max-height: calc(100vh - 150px);
8
+
9
+ border-radius: none;
10
+ background: none;
11
+ }
12
+
13
+ .modal {
14
+ display: flex;
15
+ flex-direction: column;
16
+ align-items: center;
17
+ justify-content: center;
18
+ padding: 2rem;
19
+
20
+ border-radius: 6px;
21
+ background: #fff;
22
+ }
23
+
24
+ .backIcon {
25
+ margin-right: 8px;
26
+ }
27
+
28
+ .backTextContainer {
29
+ display: flex;
30
+ align-items: center;
31
+
32
+ margin-bottom: 10px;
33
+
34
+ cursor: pointer;
35
+
36
+ color: white;
37
+
38
+ font-size: 13px;
39
+ line-height: 16px;
40
+ }
@@ -0,0 +1,55 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { ACHPayment } from '@kofile/platform-react-payrix';
4
+
5
+ import Modal from '../Modal';
6
+
7
+ import backIcon from '../../assets/img/back.svg';
8
+
9
+ import styles from './GovOSPayACHPaymentModal.module.css';
10
+
11
+ const GovOSPayACHPaymentModal = ({
12
+ amount,
13
+ onPay,
14
+ onClose,
15
+ paymentCorrelationId,
16
+ paymentConfig,
17
+ transactionUrl,
18
+ }) => {
19
+ return (
20
+ <Modal className={styles.modalContainer}>
21
+ <div
22
+ className={styles.backTextContainer}
23
+ onClick={onClose}
24
+ onKeyDown={onClose}
25
+ role="button"
26
+ tabIndex="0"
27
+ >
28
+ <img className={styles.backIcon} src={backIcon} alt="back" />
29
+ Back to form
30
+ </div>
31
+ <div className={styles.modal}>
32
+ <ACHPayment
33
+ lineItems={[]}
34
+ providerConfig={paymentConfig}
35
+ applicationName={'GovOS Studio'}
36
+ transactionUrl={transactionUrl}
37
+ correlationId={paymentCorrelationId}
38
+ amount={amount}
39
+ onSuccess={onPay}
40
+ />
41
+ </div>
42
+ </Modal>
43
+ );
44
+ };
45
+
46
+ GovOSPayACHPaymentModal.propTypes = {
47
+ onPay: PropTypes.func.isRequired,
48
+ onClose: PropTypes.func.isRequired,
49
+ amount: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
50
+ paymentCorrelationId: PropTypes.string.isRequired,
51
+ paymentConfig: PropTypes.object.isRequired,
52
+ transactionUrl: PropTypes.string.isRequired,
53
+ };
54
+
55
+ export default GovOSPayACHPaymentModal;
@@ -0,0 +1,40 @@
1
+ .modalContainer {
2
+ overflow-y: auto;
3
+
4
+ box-sizing: border-box;
5
+ max-width: 600px;
6
+ height: 100%;
7
+ max-height: calc(100vh - 150px);
8
+
9
+ border-radius: none;
10
+ background: none;
11
+ }
12
+
13
+ .modal {
14
+ display: flex;
15
+ flex-direction: column;
16
+ align-items: center;
17
+ justify-content: center;
18
+ padding: 2rem;
19
+
20
+ border-radius: 6px;
21
+ background: #fff;
22
+ }
23
+
24
+ .backIcon {
25
+ margin-right: 8px;
26
+ }
27
+
28
+ .backTextContainer {
29
+ display: flex;
30
+ align-items: center;
31
+
32
+ margin-bottom: 10px;
33
+
34
+ cursor: pointer;
35
+
36
+ color: white;
37
+
38
+ font-size: 13px;
39
+ line-height: 16px;
40
+ }
@@ -0,0 +1,55 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { CardPayment } from '@kofile/platform-react-payrix';
4
+
5
+ import Modal from '../Modal';
6
+
7
+ import backIcon from '../../assets/img/back.svg';
8
+
9
+ import styles from './GovOSPayCardPaymentModal.module.css';
10
+
11
+ const GovOSPayCardPaymentModal = ({
12
+ amount,
13
+ onPay,
14
+ onClose,
15
+ paymentCorrelationId,
16
+ paymentConfig,
17
+ transactionUrl,
18
+ }) => {
19
+ return (
20
+ <Modal className={styles.modalContainer}>
21
+ <div
22
+ className={styles.backTextContainer}
23
+ onClick={onClose}
24
+ onKeyDown={onClose}
25
+ role="button"
26
+ tabIndex="0"
27
+ >
28
+ <img className={styles.backIcon} src={backIcon} alt="back" />
29
+ Back to form
30
+ </div>
31
+ <div className={styles.modal}>
32
+ <CardPayment
33
+ lineItems={[]}
34
+ providerConfig={paymentConfig}
35
+ applicationName={'GovOS Studio'}
36
+ transactionUrl={transactionUrl}
37
+ correlationId={paymentCorrelationId}
38
+ amount={amount}
39
+ onSuccess={onPay}
40
+ />
41
+ </div>
42
+ </Modal>
43
+ );
44
+ };
45
+
46
+ GovOSPayCardPaymentModal.propTypes = {
47
+ onPay: PropTypes.func.isRequired,
48
+ onClose: PropTypes.func.isRequired,
49
+ amount: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
50
+ paymentCorrelationId: PropTypes.string.isRequired,
51
+ paymentConfig: PropTypes.object.isRequired,
52
+ transactionUrl: PropTypes.string.isRequired,
53
+ };
54
+
55
+ export default GovOSPayCardPaymentModal;
@@ -0,0 +1,40 @@
1
+ .modalContainer {
2
+ overflow-y: auto;
3
+
4
+ box-sizing: border-box;
5
+ max-width: 600px;
6
+ height: 100%;
7
+ max-height: calc(100vh - 150px);
8
+
9
+ border-radius: none;
10
+ background: none;
11
+ }
12
+
13
+ .modal {
14
+ display: flex;
15
+ flex-direction: column;
16
+ align-items: center;
17
+ justify-content: center;
18
+ padding: 2rem;
19
+
20
+ border-radius: 6px;
21
+ background: #fff;
22
+ }
23
+
24
+ .backIcon {
25
+ margin-right: 8px;
26
+ }
27
+
28
+ .backTextContainer {
29
+ display: flex;
30
+ align-items: center;
31
+
32
+ margin-bottom: 10px;
33
+
34
+ cursor: pointer;
35
+
36
+ color: white;
37
+
38
+ font-size: 13px;
39
+ line-height: 16px;
40
+ }
@@ -0,0 +1,52 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { InvoiceSummary } from '@kofile/platform-react-payrix';
4
+
5
+ import Modal from '../Modal';
6
+
7
+ import backIcon from '../../assets/img/back.svg';
8
+
9
+ import styles from './GovOSPayInvoiceSummaryModal.module.css';
10
+
11
+ const GovOSPayInvoiceSummaryModal = ({
12
+ onSubmit,
13
+ onClose,
14
+ transactionData,
15
+ }) => {
16
+ return (
17
+ <Modal className={styles.modalContainer}>
18
+ <div
19
+ className={styles.backTextContainer}
20
+ onClick={onClose}
21
+ onKeyDown={onClose}
22
+ role="button"
23
+ tabIndex="0"
24
+ >
25
+ <img className={styles.backIcon} src={backIcon} alt="back" />
26
+ Back to form
27
+ </div>
28
+ <div className={styles.modal}>
29
+ <InvoiceSummary
30
+ onSubmit={onSubmit}
31
+ transactionData={transactionData}
32
+ />
33
+ </div>
34
+ </Modal>
35
+ );
36
+ };
37
+
38
+ GovOSPayInvoiceSummaryModal.propTypes = {
39
+ onSubmit: PropTypes.func.isRequired,
40
+ onClose: PropTypes.func.isRequired,
41
+ transactionData: PropTypes.arrayOf(PropTypes.shape({
42
+ entityName: PropTypes.string,
43
+ lineItems: PropTypes.arrayOf(PropTypes.shape({
44
+ title: PropTypes.string,
45
+ description: PropTypes.string,
46
+ quantity: PropTypes.number,
47
+ unitPrice: PropTypes.number,
48
+ })),
49
+ })).isRequired,
50
+ };
51
+
52
+ export default GovOSPayInvoiceSummaryModal;
package/src/index.jsx CHANGED
@@ -8,6 +8,9 @@ import SuccessModal from './Components/SuccessModal';
8
8
  import EmptyModal from './Components/EmptyModal';
9
9
  import SelectPaymentModal from './Components/SelectPaymentModal';
10
10
  import ACHPaymentModal from './Components/ACHPaymentModal';
11
+ import GovOSPayACHPaymentModal from './Components/GovOSPayACHPaymentModal';
12
+ import GovOSPayCardPaymentModal from './Components/GovOSPayCardPaymentModal';
13
+ import GovOSPayInvoiceSummaryModal from './Components/GovOSPayInvoiceSummaryModal';
11
14
 
12
15
  import './OpenViewStyles.css';
13
16
 
@@ -85,6 +88,45 @@ handlePaymentModal.achPaymentModal = settings => {
85
88
  );
86
89
  };
87
90
 
91
+ handlePaymentModal.govOSPayACHPaymentModal = settings => {
92
+ ReactDOM.render(
93
+ <GovOSPayACHPaymentModal
94
+ onPay={settings.callbacks.onPay}
95
+ onClose={settings.callbacks.onClose}
96
+ amount={settings.amount}
97
+ paymentCorrelationId={settings.paymentCorrelationId}
98
+ paymentConfig={settings.paymentConfig}
99
+ transactionUrl={settings.transactionUrl}
100
+ />,
101
+ document.getElementById('payment-modal')
102
+ );
103
+ }
104
+
105
+ handlePaymentModal.govOSPayCardPaymentModal = settings => {
106
+ ReactDOM.render(
107
+ <GovOSPayCardPaymentModal
108
+ onPay={settings.callbacks.onPay}
109
+ onClose={settings.callbacks.onClose}
110
+ amount={settings.amount}
111
+ paymentCorrelationId={settings.paymentCorrelationId}
112
+ paymentConfig={settings.paymentConfig}
113
+ transactionUrl={settings.transactionUrl}
114
+ />,
115
+ document.getElementById('payment-modal')
116
+ );
117
+ }
118
+
119
+ handlePaymentModal.govOSPayInvoiceSummaryModal = settings => {
120
+ ReactDOM.render(
121
+ <GovOSPayInvoiceSummaryModal
122
+ onSubmit={settings.callbacks.onSubmit}
123
+ onClose={settings.callbacks.onClose}
124
+ transactionData={settings.transactionData}
125
+ />,
126
+ document.getElementById('payment-modal')
127
+ );
128
+ }
129
+
88
130
  handlePaymentModal.none = () => {
89
131
  ReactDOM.render(<EmptyModal />, document.getElementById('payment-modal'));
90
132
  };