@lookiero/checkout 0.8.1 → 0.8.2

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.
@@ -20,21 +20,23 @@ const useSubmitCheckout = ({ checkoutId, checkoutBookingId, paymentFlowRef, onEr
20
20
  paymentFlowRef.current?.startLegacyBoxCheckout(
21
21
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
22
22
  // @ts-ignore
23
- paymentFlowPayload, async ({ status, toaster }) => {
23
+ paymentFlowPayload, async ({ status, toaster, final }) => {
24
24
  setStartLegacyBoxCheckoutStatus("loading");
25
- if (status === ChargeStatus.EXECUTED) {
26
- setStartLegacyBoxCheckoutStatus("success");
27
- try {
28
- await submitCheckoutCommand();
25
+ if (final) {
26
+ if (status === ChargeStatus.EXECUTED) {
27
+ setStartLegacyBoxCheckoutStatus("success");
28
+ try {
29
+ await submitCheckoutCommand();
30
+ }
31
+ catch (error) { }
32
+ }
33
+ else {
34
+ createNotification({
35
+ level: NotificationLevel.ERROR,
36
+ bodyI18nKey: toaster?.id || I18nMessages.CHECKOUT_TOAST_PAYMENT_ERROR,
37
+ });
38
+ setStartLegacyBoxCheckoutStatus("error");
29
39
  }
30
- catch (error) { }
31
- }
32
- else {
33
- createNotification({
34
- level: NotificationLevel.ERROR,
35
- bodyI18nKey: toaster?.id || I18nMessages.CHECKOUT_TOAST_PAYMENT_ERROR,
36
- });
37
- setStartLegacyBoxCheckoutStatus("error");
38
40
  }
39
41
  });
40
42
  }, [blockCheckoutBooking, createNotification, submitCheckoutCommand, paymentFlowRef]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "0.8.1",
3
+ "version": "0.8.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [