@seamlessdocs/payment-modals 1.0.62 → 1.0.64
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
|
@@ -167,6 +167,8 @@
|
|
|
167
167
|
}
|
|
168
168
|
},
|
|
169
169
|
transactionUrl: 'https://backend.dev.nonprod.seamlessdocs.com/payments/transactions/govOsPay/transaction.json',
|
|
170
|
+
getTransactionUrl: 'https://backend.dev.nonprod.seamlessdocs.com/payments/transactions/govOsPay/transactions',
|
|
171
|
+
updateTransactionUrl: 'https://backend.dev.nonprod.seamlessdocs.com/payments/transactions/govOsPay/transactions',
|
|
170
172
|
callbacks: {
|
|
171
173
|
onPay: function () {
|
|
172
174
|
setTimeout(function () {
|
|
@@ -215,6 +217,8 @@
|
|
|
215
217
|
}
|
|
216
218
|
},
|
|
217
219
|
transactionUrl: 'https://backend.dev.nonprod.seamlessdocs.com/payments/transactions/govOsPay/transaction.json',
|
|
220
|
+
getTransactionUrl: 'https://backend.dev.nonprod.seamlessdocs.com/payments/transactions/govOsPay/transactions/',
|
|
221
|
+
updateTransactionUrl: 'https://backend.dev.nonprod.seamlessdocs.com/payments/transactions/govOsPay/transactions/',
|
|
218
222
|
callbacks: {
|
|
219
223
|
onPay: function () {
|
|
220
224
|
setTimeout(function () {
|
package/package.json
CHANGED
|
@@ -16,6 +16,8 @@ const GovOSPayACHPaymentModal = ({
|
|
|
16
16
|
paymentCorrelationId,
|
|
17
17
|
paymentConfig,
|
|
18
18
|
transactionUrl,
|
|
19
|
+
getTransactionUrl,
|
|
20
|
+
updateTransactionUrl,
|
|
19
21
|
}) => {
|
|
20
22
|
useEffect(() => {
|
|
21
23
|
// TODO: Remove use of shims when mootools is removed
|
|
@@ -43,6 +45,8 @@ const GovOSPayACHPaymentModal = ({
|
|
|
43
45
|
correlationId={paymentCorrelationId}
|
|
44
46
|
amount={amount}
|
|
45
47
|
onSuccess={onPay}
|
|
48
|
+
getTransactionUrl={getTransactionUrl}
|
|
49
|
+
updateTransactionUrl={updateTransactionUrl}
|
|
46
50
|
/>
|
|
47
51
|
</div>
|
|
48
52
|
</Modal>
|
|
@@ -56,6 +60,8 @@ GovOSPayACHPaymentModal.propTypes = {
|
|
|
56
60
|
paymentCorrelationId: PropTypes.string.isRequired,
|
|
57
61
|
paymentConfig: PropTypes.object.isRequired,
|
|
58
62
|
transactionUrl: PropTypes.string.isRequired,
|
|
63
|
+
getTransactionUrl: PropTypes.string,
|
|
64
|
+
updateTransactionUrl: PropTypes.string,
|
|
59
65
|
};
|
|
60
66
|
|
|
61
67
|
export default GovOSPayACHPaymentModal;
|
|
@@ -17,6 +17,8 @@ const GovOSPayCardPaymentModal = ({
|
|
|
17
17
|
paymentConfig,
|
|
18
18
|
transactionMode,
|
|
19
19
|
transactionUrl,
|
|
20
|
+
getTransactionUrl,
|
|
21
|
+
updateTransactionUrl,
|
|
20
22
|
}) => {
|
|
21
23
|
useEffect(() => {
|
|
22
24
|
// TODO: Remove use of shims when mootools is removed
|
|
@@ -41,6 +43,8 @@ const GovOSPayCardPaymentModal = ({
|
|
|
41
43
|
providerConfig={paymentConfig}
|
|
42
44
|
applicationName={'GovOS Studio'}
|
|
43
45
|
transactionUrl={transactionUrl}
|
|
46
|
+
getTransactionUrl={getTransactionUrl}
|
|
47
|
+
updateTransactionUrl={updateTransactionUrl}
|
|
44
48
|
correlationId={paymentCorrelationId}
|
|
45
49
|
amount={amount}
|
|
46
50
|
onSuccess={onPay}
|
|
@@ -59,6 +63,8 @@ GovOSPayCardPaymentModal.propTypes = {
|
|
|
59
63
|
paymentConfig: PropTypes.object.isRequired,
|
|
60
64
|
transactionMode: PropTypes.oneOf(['preauth' | 'transaction']),
|
|
61
65
|
transactionUrl: PropTypes.string.isRequired,
|
|
66
|
+
getTransactionUrl: PropTypes.string,
|
|
67
|
+
updateTransactionUrl: PropTypes.string,
|
|
62
68
|
};
|
|
63
69
|
|
|
64
70
|
GovOSPayCardPaymentModal.defaultProps = {
|
package/src/index.jsx
CHANGED
|
@@ -12,7 +12,7 @@ import GovOSPayACHPaymentModal from './Components/GovOSPayACHPaymentModal';
|
|
|
12
12
|
import GovOSPayCardPaymentModal from './Components/GovOSPayCardPaymentModal';
|
|
13
13
|
import GovOSPayInvoiceSummaryModal from './Components/GovOSPayInvoiceSummaryModal';
|
|
14
14
|
|
|
15
|
-
import { restoreNativeEventConstructor } from './shims';
|
|
15
|
+
import { restoreNativeEventConstructor, loadJQuery } from './shims';
|
|
16
16
|
|
|
17
17
|
import './OpenViewStyles.css';
|
|
18
18
|
|
|
@@ -101,6 +101,8 @@ handlePaymentModal.govOSPayACHPaymentModal = settings => {
|
|
|
101
101
|
paymentCorrelationId={settings.paymentCorrelationId}
|
|
102
102
|
paymentConfig={settings.paymentConfig}
|
|
103
103
|
transactionUrl={settings.transactionUrl}
|
|
104
|
+
getTransactionUrl={settings.getTransactionUrl}
|
|
105
|
+
updateTransactionUrl={settings.updateTransactionUrl}
|
|
104
106
|
/>,
|
|
105
107
|
document.getElementById('payment-modal')
|
|
106
108
|
);
|
|
@@ -109,18 +111,22 @@ handlePaymentModal.govOSPayACHPaymentModal = settings => {
|
|
|
109
111
|
// TODO: Remove use of shims when mootools is removed
|
|
110
112
|
handlePaymentModal.govOSPayCardPaymentModal = settings => {
|
|
111
113
|
restoreNativeEventConstructor();
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
114
|
+
loadJQuery(() => {
|
|
115
|
+
ReactDOM.render(
|
|
116
|
+
<GovOSPayCardPaymentModal
|
|
117
|
+
onPay={settings.callbacks.onPay}
|
|
118
|
+
onClose={settings.callbacks.onClose}
|
|
119
|
+
amount={settings.amount}
|
|
120
|
+
paymentCorrelationId={settings.paymentCorrelationId}
|
|
121
|
+
paymentConfig={settings.paymentConfig}
|
|
122
|
+
transactionMode={settings.transactionMode}
|
|
123
|
+
transactionUrl={settings.transactionUrl}
|
|
124
|
+
getTransactionUrl={settings.getTransactionUrl}
|
|
125
|
+
updateTransactionUrl={settings.updateTransactionUrl}
|
|
126
|
+
/>,
|
|
127
|
+
document.getElementById('payment-modal')
|
|
128
|
+
);
|
|
129
|
+
});
|
|
124
130
|
}
|
|
125
131
|
|
|
126
132
|
// TODO: Remove use of shims when mootools is removed
|
package/src/shims.js
CHANGED
|
@@ -22,3 +22,26 @@ export function restoreExtendedEventConstructor() {
|
|
|
22
22
|
if (!window.ExtendedEvent) return;
|
|
23
23
|
window.Event = window.ExtendedEvent;
|
|
24
24
|
}
|
|
25
|
+
|
|
26
|
+
export function loadJQuery(callback) {
|
|
27
|
+
// Check if jQuery is already loaded
|
|
28
|
+
if (!window.jQuery) {
|
|
29
|
+
const script = document.createElement('script');
|
|
30
|
+
script.src = "https://code.jquery.com/jquery-3.7.1.min.js"
|
|
31
|
+
script.integrity = "sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo="
|
|
32
|
+
script.crossOrigin = 'anonymous';
|
|
33
|
+
script.onload = () => {
|
|
34
|
+
console.log('jQuery loaded:', window.jQuery.fn.jquery);
|
|
35
|
+
window.jQuery = jQuery.noConflict();
|
|
36
|
+
if (callback) {
|
|
37
|
+
callback();
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
document.body.appendChild(script);
|
|
41
|
+
} else {
|
|
42
|
+
console.log('jQuery already loaded:', window.jQuery.fn.jquery);
|
|
43
|
+
if (callback) {
|
|
44
|
+
callback();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|