@speedlo/payments
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -98,23 +98,20 @@ 'use strict'; | ||
}; | ||
var handlePaymentStatus = function (orderId) { | ||
if (orderId === void 0) { orderId = null; } | ||
return __awaiter(_this, void 0, void 0, function () { | ||
var paymentStatus, hasError; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, queryPaymentStatus(orderId)]; | ||
case 1: | ||
paymentStatus = _a.sent(); | ||
hasError = reportErrors(paymentStatus); | ||
if (!hasError) { | ||
onFinish(); | ||
if (redirectUrl) { | ||
location.replace(redirectUrl); | ||
} | ||
var handlePaymentStatus = function (orderId) { return __awaiter(_this, void 0, void 0, function () { | ||
var paymentStatus, hasError; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, queryPaymentStatus(orderId)]; | ||
case 1: | ||
paymentStatus = _a.sent(); | ||
hasError = reportErrors(paymentStatus); | ||
if (!hasError) { | ||
onFinish(); | ||
if (redirectUrl) { | ||
location.replace(redirectUrl); | ||
} | ||
return [2 /*return*/]; | ||
} | ||
}); | ||
} | ||
return [2 /*return*/]; | ||
} | ||
}); | ||
}; | ||
}); }; | ||
React.useEffect(function () { | ||
@@ -121,0 +118,0 @@ // retrieve orderId from the url |
@@ -10,3 +10,3 @@ interface PaymentStatus { | ||
} | ||
export declare const useGoPay: (queryPaymentStatus: (orderId: string | null) => Promise<PaymentStatus | null>, { onError, onFinish, redirectUrl }?: Partial<IOptions>) => { | ||
export declare const useGoPay: (queryPaymentStatus: (orderId?: string | undefined) => Promise<PaymentStatus | null>, { onError, onFinish, redirectUrl }?: Partial<IOptions>) => { | ||
executeGoPayPayment: (gatewayUrl: string) => Promise<void>; | ||
@@ -13,0 +13,0 @@ paymentLoading: boolean; |
{ | ||
"name": "@speedlo/payments", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"scripts": { | ||
@@ -34,3 +34,3 @@ "prepublish": "node ../../util/builder.js" | ||
}, | ||
"gitHead": "0671127a16740a91ea37c9b97cc16e338a191256" | ||
"gitHead": "764c310587013d16a46738a005132ab02895cebc" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15008
180