logix-payment-shift4 1.0.1 → 1.0.3
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/dist/index.cjs.js +7 -5
- package/dist/index.esm.js +7 -5
- package/package.json +1 -1
- package/src/PaymentForm.jsx +3 -3
package/dist/index.cjs.js
CHANGED
|
@@ -181,7 +181,9 @@ function _unsupportedIterableToArray(r, a) {
|
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
-
function PaymentForm() {
|
|
184
|
+
function PaymentForm(_ref) {
|
|
185
|
+
var amount = _ref.amount,
|
|
186
|
+
currency = _ref.currency;
|
|
185
187
|
var formRef = React.useRef();
|
|
186
188
|
var initializedRef = React.useRef(false); // yalnız bir dəfə mount üçün
|
|
187
189
|
var shift4Ref = React.useRef(null);
|
|
@@ -220,7 +222,7 @@ function PaymentForm() {
|
|
|
220
222
|
document.body.appendChild(script);
|
|
221
223
|
}, []);
|
|
222
224
|
var handleSubmit = /*#__PURE__*/function () {
|
|
223
|
-
var
|
|
225
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(e) {
|
|
224
226
|
var _result$charge, token, request, threeDSecureToken, apiBase, response, result, _t;
|
|
225
227
|
return _regenerator().w(function (_context) {
|
|
226
228
|
while (1) switch (_context.p = _context.n) {
|
|
@@ -260,8 +262,8 @@ function PaymentForm() {
|
|
|
260
262
|
throw new Error("Card tokenization failed. Please check your details and try again.");
|
|
261
263
|
case 6:
|
|
262
264
|
request = {
|
|
263
|
-
amount:
|
|
264
|
-
currency:
|
|
265
|
+
amount: amount,
|
|
266
|
+
currency: currency,
|
|
265
267
|
card: token.id
|
|
266
268
|
};
|
|
267
269
|
_context.n = 7;
|
|
@@ -316,7 +318,7 @@ function PaymentForm() {
|
|
|
316
318
|
}, _callee, null, [[4, 12, 13, 14]]);
|
|
317
319
|
}));
|
|
318
320
|
return function handleSubmit(_x) {
|
|
319
|
-
return
|
|
321
|
+
return _ref2.apply(this, arguments);
|
|
320
322
|
};
|
|
321
323
|
}();
|
|
322
324
|
return /*#__PURE__*/React.createElement("div", {
|
package/dist/index.esm.js
CHANGED
|
@@ -179,7 +179,9 @@ function _unsupportedIterableToArray(r, a) {
|
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
function PaymentForm() {
|
|
182
|
+
function PaymentForm(_ref) {
|
|
183
|
+
var amount = _ref.amount,
|
|
184
|
+
currency = _ref.currency;
|
|
183
185
|
var formRef = useRef();
|
|
184
186
|
var initializedRef = useRef(false); // yalnız bir dəfə mount üçün
|
|
185
187
|
var shift4Ref = useRef(null);
|
|
@@ -218,7 +220,7 @@ function PaymentForm() {
|
|
|
218
220
|
document.body.appendChild(script);
|
|
219
221
|
}, []);
|
|
220
222
|
var handleSubmit = /*#__PURE__*/function () {
|
|
221
|
-
var
|
|
223
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(e) {
|
|
222
224
|
var _result$charge, token, request, threeDSecureToken, apiBase, response, result, _t;
|
|
223
225
|
return _regenerator().w(function (_context) {
|
|
224
226
|
while (1) switch (_context.p = _context.n) {
|
|
@@ -258,8 +260,8 @@ function PaymentForm() {
|
|
|
258
260
|
throw new Error("Card tokenization failed. Please check your details and try again.");
|
|
259
261
|
case 6:
|
|
260
262
|
request = {
|
|
261
|
-
amount:
|
|
262
|
-
currency:
|
|
263
|
+
amount: amount,
|
|
264
|
+
currency: currency,
|
|
263
265
|
card: token.id
|
|
264
266
|
};
|
|
265
267
|
_context.n = 7;
|
|
@@ -314,7 +316,7 @@ function PaymentForm() {
|
|
|
314
316
|
}, _callee, null, [[4, 12, 13, 14]]);
|
|
315
317
|
}));
|
|
316
318
|
return function handleSubmit(_x) {
|
|
317
|
-
return
|
|
319
|
+
return _ref2.apply(this, arguments);
|
|
318
320
|
};
|
|
319
321
|
}();
|
|
320
322
|
return /*#__PURE__*/React.createElement("div", {
|
package/package.json
CHANGED
package/src/PaymentForm.jsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useRef, useState } from "react";
|
|
2
2
|
|
|
3
|
-
export default function PaymentForm() {
|
|
3
|
+
export default function PaymentForm({amount,currency}) {
|
|
4
4
|
const formRef = useRef();
|
|
5
5
|
const initializedRef = useRef(false); // yalnız bir dəfə mount üçün
|
|
6
6
|
const shift4Ref = useRef(null);
|
|
@@ -53,8 +53,8 @@ export default function PaymentForm() {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
const request = {
|
|
56
|
-
amount:
|
|
57
|
-
currency:
|
|
56
|
+
amount: amount,
|
|
57
|
+
currency: currency,
|
|
58
58
|
card: token.id,
|
|
59
59
|
};
|
|
60
60
|
|