@depay/widgets 7.15.3 → 7.16.0
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/esm/index.bundle.js +3 -3
- package/dist/esm/index.js +97 -82
- package/dist/umd/index.bundle.js +3 -3
- package/dist/umd/index.js +97 -82
- package/package.json +1 -1
package/dist/umd/index.js
CHANGED
|
@@ -19318,30 +19318,34 @@
|
|
|
19318
19318
|
switch (_context.prev = _context.next) {
|
|
19319
19319
|
case 0:
|
|
19320
19320
|
if (!before) {
|
|
19321
|
-
_context.next =
|
|
19321
|
+
_context.next = 6;
|
|
19322
19322
|
break;
|
|
19323
19323
|
}
|
|
19324
19324
|
|
|
19325
|
-
|
|
19325
|
+
_context.next = 3;
|
|
19326
|
+
return before(payment.route.transaction);
|
|
19327
|
+
|
|
19328
|
+
case 3:
|
|
19329
|
+
stop = _context.sent;
|
|
19326
19330
|
|
|
19327
19331
|
if (!(stop === false)) {
|
|
19328
|
-
_context.next =
|
|
19332
|
+
_context.next = 6;
|
|
19329
19333
|
break;
|
|
19330
19334
|
}
|
|
19331
19335
|
|
|
19332
19336
|
return _context.abrupt("return");
|
|
19333
19337
|
|
|
19334
|
-
case
|
|
19338
|
+
case 6:
|
|
19335
19339
|
setClosable(false);
|
|
19336
19340
|
setPaymentState('paying');
|
|
19337
19341
|
setUpdatable(false);
|
|
19338
|
-
_context.next =
|
|
19342
|
+
_context.next = 11;
|
|
19339
19343
|
return web3Client.request({
|
|
19340
19344
|
blockchain: payment.route.transaction.blockchain,
|
|
19341
19345
|
method: 'latestBlockNumber'
|
|
19342
19346
|
});
|
|
19343
19347
|
|
|
19344
|
-
case
|
|
19348
|
+
case 11:
|
|
19345
19349
|
currentBlock = _context.sent;
|
|
19346
19350
|
wallet.sendTransaction(Object.assign({}, payment.route.transaction, {
|
|
19347
19351
|
sent: function sent(transaction) {
|
|
@@ -19367,7 +19371,7 @@
|
|
|
19367
19371
|
}
|
|
19368
19372
|
});
|
|
19369
19373
|
|
|
19370
|
-
case
|
|
19374
|
+
case 13:
|
|
19371
19375
|
case "end":
|
|
19372
19376
|
return _context.stop();
|
|
19373
19377
|
}
|
|
@@ -20615,19 +20619,6 @@
|
|
|
20615
20619
|
});
|
|
20616
20620
|
});
|
|
20617
20621
|
|
|
20618
|
-
var AlertIcon = (function (props) {
|
|
20619
|
-
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
20620
|
-
className: "AlertIcon Icon " + props.className,
|
|
20621
|
-
version: "1.1",
|
|
20622
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
20623
|
-
x: "0px",
|
|
20624
|
-
y: "0px",
|
|
20625
|
-
viewBox: "0 0 20 20"
|
|
20626
|
-
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
20627
|
-
d: "M19.64 16.36L11.53 2.3A1.85 1.85 0 0 0 10 1.21 1.85 1.85 0 0 0 8.48 2.3L.36 16.36C-.48 17.81.21 19 1.88 19h16.24c1.67 0 2.36-1.19 1.52-2.64zM11 16H9v-2h2zm0-4H9V6h2z"
|
|
20628
|
-
}));
|
|
20629
|
-
});
|
|
20630
|
-
|
|
20631
20622
|
var Checkmark = (function (props) {
|
|
20632
20623
|
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
20633
20624
|
className: "Checkmark Icon " + props.className,
|
|
@@ -20702,8 +20693,7 @@
|
|
|
20702
20693
|
var _useContext2 = React.useContext(PaymentTrackingContext),
|
|
20703
20694
|
tracking = _useContext2.tracking,
|
|
20704
20695
|
release = _useContext2.release,
|
|
20705
|
-
forwardTo = _useContext2.forwardTo
|
|
20706
|
-
trackingFailed = _useContext2.trackingFailed;
|
|
20696
|
+
forwardTo = _useContext2.forwardTo;
|
|
20707
20697
|
|
|
20708
20698
|
var _useContext3 = React.useContext(PaymentContext),
|
|
20709
20699
|
payment = _useContext3.payment,
|
|
@@ -20750,37 +20740,21 @@
|
|
|
20750
20740
|
className: "Opacity05"
|
|
20751
20741
|
}, "Payment validated")))));
|
|
20752
20742
|
} else {
|
|
20753
|
-
|
|
20754
|
-
|
|
20755
|
-
|
|
20756
|
-
|
|
20757
|
-
|
|
20758
|
-
|
|
20759
|
-
|
|
20760
|
-
|
|
20761
|
-
|
|
20762
|
-
|
|
20763
|
-
|
|
20764
|
-
|
|
20765
|
-
|
|
20766
|
-
|
|
20767
|
-
}
|
|
20768
|
-
return /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
20769
|
-
className: "Card transparent small disabled"
|
|
20770
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
20771
|
-
className: "CardImage"
|
|
20772
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
20773
|
-
className: "TextCenter"
|
|
20774
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
20775
|
-
className: "Loading Icon"
|
|
20776
|
-
}))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
20777
|
-
className: "CardBody"
|
|
20778
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
20779
|
-
className: "CardBodyWrapper"
|
|
20780
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
20781
|
-
className: "Opacity05"
|
|
20782
|
-
}, "Validating payment")))));
|
|
20783
|
-
}
|
|
20743
|
+
return /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
20744
|
+
className: "Card transparent small disabled"
|
|
20745
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
20746
|
+
className: "CardImage"
|
|
20747
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
20748
|
+
className: "TextCenter"
|
|
20749
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
20750
|
+
className: "Loading Icon"
|
|
20751
|
+
}))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
20752
|
+
className: "CardBody"
|
|
20753
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
20754
|
+
className: "CardBodyWrapper"
|
|
20755
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
20756
|
+
className: "Opacity05"
|
|
20757
|
+
}, "Validating payment")))));
|
|
20784
20758
|
}
|
|
20785
20759
|
};
|
|
20786
20760
|
|
|
@@ -21163,8 +21137,8 @@
|
|
|
21163
21137
|
});
|
|
21164
21138
|
|
|
21165
21139
|
var PaymentTrackingProvider = (function (props) {
|
|
21166
|
-
var _useContext = React.useContext(ErrorContext)
|
|
21167
|
-
|
|
21140
|
+
var _useContext = React.useContext(ErrorContext);
|
|
21141
|
+
_useContext.errorCallback;
|
|
21168
21142
|
|
|
21169
21143
|
var _useContext2 = React.useContext(ConfigurationContext),
|
|
21170
21144
|
track = _useContext2.track,
|
|
@@ -21201,20 +21175,16 @@
|
|
|
21201
21175
|
release = _useState12[0],
|
|
21202
21176
|
setRelease = _useState12[1];
|
|
21203
21177
|
|
|
21204
|
-
var _useState13 = React.useState(
|
|
21178
|
+
var _useState13 = React.useState(),
|
|
21205
21179
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
21206
|
-
|
|
21207
|
-
|
|
21208
|
-
|
|
21209
|
-
var _useState15 = React.useState(),
|
|
21210
|
-
_useState16 = _slicedToArray(_useState15, 2),
|
|
21211
|
-
forwardTo = _useState16[0],
|
|
21212
|
-
setForwardTo = _useState16[1];
|
|
21180
|
+
forwardTo = _useState14[0],
|
|
21181
|
+
setForwardTo = _useState14[1];
|
|
21213
21182
|
|
|
21214
21183
|
var _useContext3 = React.useContext(ClosableContext),
|
|
21215
21184
|
setClosable = _useContext3.setClosable;
|
|
21216
21185
|
|
|
21217
21186
|
var _useContext4 = React.useContext(NavigateContext),
|
|
21187
|
+
navigate = _useContext4.navigate,
|
|
21218
21188
|
set = _useContext4.set;
|
|
21219
21189
|
|
|
21220
21190
|
var openSocket = function openSocket(transaction) {
|
|
@@ -21272,23 +21242,23 @@
|
|
|
21272
21242
|
|
|
21273
21243
|
var retryStartTracking = function retryStartTracking(transaction, afterBlock, paymentRoute, attempt) {
|
|
21274
21244
|
attempt = parseInt(attempt || 1, 10);
|
|
21245
|
+
console.log('attempt', attempt);
|
|
21246
|
+
console.log('track.attempts', track === null || track === void 0 ? void 0 : track.attempts);
|
|
21275
21247
|
|
|
21276
|
-
if (attempt <
|
|
21248
|
+
if (attempt < ((track === null || track === void 0 ? void 0 : track.attempts) || 40)) {
|
|
21277
21249
|
setTimeout(function () {
|
|
21278
21250
|
startTracking(transaction, afterBlock, paymentRoute, attempt + 1);
|
|
21279
21251
|
}, 3000);
|
|
21280
21252
|
} else {
|
|
21281
|
-
console.log('
|
|
21282
|
-
|
|
21283
|
-
|
|
21284
|
-
if (typeof errorCallback == 'function') {
|
|
21285
|
-
errorCallback({
|
|
21286
|
-
code: 'TRACKING_FAILED'
|
|
21287
|
-
});
|
|
21288
|
-
}
|
|
21253
|
+
console.log('navigate TrackingFailed');
|
|
21254
|
+
navigate('TrackingFailed');
|
|
21289
21255
|
}
|
|
21290
21256
|
};
|
|
21291
21257
|
|
|
21258
|
+
var continueTryTracking = function continueTryTracking() {
|
|
21259
|
+
retryStartTracking(transaction, afterBlock, paymentRoute, 1);
|
|
21260
|
+
};
|
|
21261
|
+
|
|
21292
21262
|
var callTracking = function callTracking(payment) {
|
|
21293
21263
|
if (track.endpoint) {
|
|
21294
21264
|
return fetch(track.endpoint, {
|
|
@@ -21395,10 +21365,6 @@
|
|
|
21395
21365
|
}, [polling, transaction, afterBlock, paymentRoute]);
|
|
21396
21366
|
|
|
21397
21367
|
var storePayment = function storePayment(transaction, afterBlock, paymentRoute, attempt) {
|
|
21398
|
-
if (attempt > 3) {
|
|
21399
|
-
return;
|
|
21400
|
-
}
|
|
21401
|
-
|
|
21402
21368
|
fetch('https://public.depay.com/payments', {
|
|
21403
21369
|
headers: {
|
|
21404
21370
|
'Content-Type': 'application/json'
|
|
@@ -21429,18 +21395,18 @@
|
|
|
21429
21395
|
}).then(function (response) {
|
|
21430
21396
|
if (response.status == 200 || response.status == 201) ; else {
|
|
21431
21397
|
setTimeout(function () {
|
|
21432
|
-
storePayment(transaction, afterBlock, paymentRoute
|
|
21398
|
+
storePayment(transaction, afterBlock, paymentRoute);
|
|
21433
21399
|
}, 3000);
|
|
21434
21400
|
}
|
|
21435
21401
|
})["catch"](function (error) {
|
|
21436
21402
|
setTimeout(function () {
|
|
21437
|
-
storePayment(transaction, afterBlock, paymentRoute
|
|
21403
|
+
storePayment(transaction, afterBlock, paymentRoute);
|
|
21438
21404
|
}, 3000);
|
|
21439
21405
|
});
|
|
21440
21406
|
};
|
|
21441
21407
|
|
|
21442
21408
|
var initializeTracking = function initializeTracking(transaction, afterBlock, paymentRoute) {
|
|
21443
|
-
storePayment(transaction, afterBlock, paymentRoute
|
|
21409
|
+
storePayment(transaction, afterBlock, paymentRoute);
|
|
21444
21410
|
|
|
21445
21411
|
if (tracking || track && track.async == true) {
|
|
21446
21412
|
startTracking(transaction, afterBlock, paymentRoute);
|
|
@@ -21460,9 +21426,9 @@
|
|
|
21460
21426
|
value: {
|
|
21461
21427
|
tracking: tracking,
|
|
21462
21428
|
initializeTracking: initializeTracking,
|
|
21429
|
+
continueTryTracking: continueTryTracking,
|
|
21463
21430
|
release: release,
|
|
21464
|
-
forwardTo: forwardTo
|
|
21465
|
-
trackingFailed: trackingFailed
|
|
21431
|
+
forwardTo: forwardTo
|
|
21466
21432
|
}
|
|
21467
21433
|
}, props.children);
|
|
21468
21434
|
});
|
|
@@ -22158,6 +22124,54 @@
|
|
|
22158
22124
|
});
|
|
22159
22125
|
});
|
|
22160
22126
|
|
|
22127
|
+
var TrackingFailedDialog = (function () {
|
|
22128
|
+
var _useContext = React.useContext(PaymentTrackingContext),
|
|
22129
|
+
continueTryTracking = _useContext.continueTryTracking;
|
|
22130
|
+
|
|
22131
|
+
var _useContext2 = React.useContext(PaymentContext),
|
|
22132
|
+
transaction = _useContext2.transaction;
|
|
22133
|
+
|
|
22134
|
+
var _useContext3 = React.useContext(reactDialogStack.NavigateStackContext),
|
|
22135
|
+
navigate = _useContext3.navigate;
|
|
22136
|
+
|
|
22137
|
+
var tryAgain = function tryAgain() {
|
|
22138
|
+
continueTryTracking();
|
|
22139
|
+
navigate('back');
|
|
22140
|
+
};
|
|
22141
|
+
|
|
22142
|
+
return /*#__PURE__*/React__default["default"].createElement(Dialog$1, {
|
|
22143
|
+
stacked: false,
|
|
22144
|
+
header: /*#__PURE__*/React__default["default"].createElement("div", {
|
|
22145
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
22146
|
+
}),
|
|
22147
|
+
body: /*#__PURE__*/React__default["default"].createElement("div", {
|
|
22148
|
+
className: "TextCenter"
|
|
22149
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
22150
|
+
className: "GraphicWrapper"
|
|
22151
|
+
}, /*#__PURE__*/React__default["default"].createElement("img", {
|
|
22152
|
+
className: "Graphic",
|
|
22153
|
+
src: ErrorGraphic
|
|
22154
|
+
})), /*#__PURE__*/React__default["default"].createElement("h1", {
|
|
22155
|
+
className: "LineHeightL Text FontSizeL PaddingTopS FontWeightBold"
|
|
22156
|
+
}, "Tracking payment failed"), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
22157
|
+
className: "Text PaddingTopS PaddingBottomS PaddingLeftS PaddingRightS"
|
|
22158
|
+
}, /*#__PURE__*/React__default["default"].createElement("strong", {
|
|
22159
|
+
className: "FontSizeM"
|
|
22160
|
+
}, "Please ensure you are connected to the internet, then click \"Try again\"."), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
22161
|
+
className: "PaddingTopS"
|
|
22162
|
+
}, /*#__PURE__*/React__default["default"].createElement("span", null, "If this keeps happening, "), /*#__PURE__*/React__default["default"].createElement("a", {
|
|
22163
|
+
className: "Link",
|
|
22164
|
+
href: "mailto:support@depay.com?subject=Payment%20tracking%20failed&body=Tracking%20my%20payment%20failed%0A%0ATransaction:%20".concat(transaction.url)
|
|
22165
|
+
}, "please report it"), "."))),
|
|
22166
|
+
footer: /*#__PURE__*/React__default["default"].createElement("div", {
|
|
22167
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
22168
|
+
}, /*#__PURE__*/React__default["default"].createElement("button", {
|
|
22169
|
+
className: "ButtonPrimary",
|
|
22170
|
+
onClick: tryAgain
|
|
22171
|
+
}, "Try again"))
|
|
22172
|
+
});
|
|
22173
|
+
});
|
|
22174
|
+
|
|
22161
22175
|
var PaymentStack = (function (props) {
|
|
22162
22176
|
var _useContext = React.useContext(ClosableContext),
|
|
22163
22177
|
open = _useContext.open,
|
|
@@ -22178,7 +22192,8 @@
|
|
|
22178
22192
|
ChangeAmount: /*#__PURE__*/React__default["default"].createElement(ChangeAmountDialog, null),
|
|
22179
22193
|
ChangePayment: /*#__PURE__*/React__default["default"].createElement(ChangePaymentDialog, null),
|
|
22180
22194
|
PaymentError: /*#__PURE__*/React__default["default"].createElement(PaymentErrorDialog, null),
|
|
22181
|
-
WrongNetwork: /*#__PURE__*/React__default["default"].createElement(WrongNetworkDialog, null)
|
|
22195
|
+
WrongNetwork: /*#__PURE__*/React__default["default"].createElement(WrongNetworkDialog, null),
|
|
22196
|
+
TrackingFailed: /*#__PURE__*/React__default["default"].createElement(TrackingFailedDialog, null)
|
|
22182
22197
|
}
|
|
22183
22198
|
});
|
|
22184
22199
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depay/widgets",
|
|
3
3
|
"moduleName": "DePayWidgets",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.16.0",
|
|
5
5
|
"description": "Web3 Payments with any token. DePay simplifies and improves Web3 Payments with the power of DeFi. Accept any token with on-the-fly conversion.",
|
|
6
6
|
"main": "./dist/umd/index.js",
|
|
7
7
|
"module": "./dist/esm/index.js",
|