@licklist/design 0.44.493 → 0.44.494
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/iframe/order-process/components/BookingSummary/BookingSummary.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/BookingSummary.js +1 -1
- package/dist/iframe/order-process/components/BookingSummary/types/index.d.ts +3 -3
- package/dist/iframe/order-process/components/BookingSummary/types/index.d.ts.map +1 -1
- package/dist/iframe/payment/payment-page/PaymentPage.d.ts.map +1 -1
- package/dist/iframe/payment/payment-page/PaymentPage.js +1 -1
- package/dist/iframe/payment/payment-status-page/PaymentStatusPage.d.ts +4 -2
- package/dist/iframe/payment/payment-status-page/PaymentStatusPage.d.ts.map +1 -1
- package/dist/iframe/payment/payment-status-page/PaymentStatusPage.js +1 -1
- package/package.json +1 -1
- package/src/iframe/order-process/components/BookingSummary/BookingSummary.tsx +4 -1
- package/src/iframe/order-process/components/BookingSummary/types/index.ts +3 -3
- package/src/iframe/payment/payment-page/PaymentPage.tsx +3 -1
- package/src/iframe/payment/payment-status-page/PaymentStatusPage.tsx +23 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BookingSummary.d.ts","sourceRoot":"","sources":["../../../../../src/iframe/order-process/components/BookingSummary/BookingSummary.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAI9C,eAAO,MAAM,cAAc;uJAWxB,KAAK,mBAAmB,EAAE,oBAAoB,CAAC;;;
|
|
1
|
+
{"version":3,"file":"BookingSummary.d.ts","sourceRoot":"","sources":["../../../../../src/iframe/order-process/components/BookingSummary/BookingSummary.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAI9C,eAAO,MAAM,cAAc;uJAWxB,KAAK,mBAAmB,EAAE,oBAAoB,CAAC;;;CA4EjD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),r=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,a=require("@licklist/core/dist/Config"),n=require("../../../../static/loader/LoaderIndicator.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),r=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,a=require("@licklist/core/dist/Config"),n=require("../../../../static/loader/LoaderIndicator.js"),o=require("react-i18next");require("../../../../static/index.js");var m=require("react-intl");require("./components/SummaryTotal/components/SummaryTotalBlock.js");var c=require("./components/ProductsByMenuStep/ProductsByMenuStep.js"),l=require("./components/SummaryTotal/SummaryTotal.js"),s=require("./components/BookingSummaryAccordion/BookingSummaryAccordion.js"),i=function(e){var l=e.date,i=e.menuSteps,u=e.formValues,d=e.isNotShownPeopleAmount,p=e.eventName,y=e.transactionFee,E=void 0===y?0:y,v=e.productsWithErrors,f=e.isLoading,N=e.hasPeopleInput,S=e.peopleAmount,g=o.useTranslation("Design").t,B=m.useIntl().formatNumber,j=t.useMemo((function(){if(u){var e=Object.values(u).filter(Boolean);return null==e?void 0:e.filter((function(e){return 0!==(null==e?void 0:e.quantity)}))}}),[u]);return f?r.createElement("div",{className:"payment-booking-summary"},r.createElement(n.LoaderIndicator,{isLoaded:!1})):r.createElement("div",{className:"payment-booking-summary"},r.createElement(s.BookingSummaryAccordion,{hasPeopleInput:N},r.createElement("div",{className:"event-info"},r.createElement("p",{className:"m-0 title event-name"},p),r.createElement("p",{className:"m-0"},l)),r.createElement("hr",null),(null==j?void 0:j.length)>0?r.createElement("div",null,r.createElement("div",{className:"cart-items"},i.map((function(e){return r.createElement(c.ProductsByMenuStep,{key:e.id,orderProducts:j,step:e,productsWithErrors:v})})),!d&&S>0&&r.createElement(r.Fragment,null,r.createElement("hr",null),r.createElement("div",{className:"d-flex justify-content-between mt-3"},r.createElement("p",{className:"m-0"},g("people"),":"),r.createElement("p",{className:"price"},S))),!!E&&r.createElement(r.Fragment,null,r.createElement("hr",null),r.createElement("div",{className:"d-flex justify-content-between mt-3"},r.createElement("p",{className:"m-0"},g("transactionFee"),":"),r.createElement("p",{className:"price"},B(E,{style:"currency",currency:a.Currency.GBP})))))):r.createElement("div",{className:"cart-items"},r.createElement("p",{className:"empty-cart"},g("emptyBasket")))))};i.SummaryTotal=l.SummaryTotal,i.Accordion=s.BookingSummaryAccordion,exports.BookingSummary=i;
|
|
@@ -4,13 +4,13 @@ export declare const MOBILE_WIDTH = 576;
|
|
|
4
4
|
export declare const ACCORDION_KEY = "booking-summary";
|
|
5
5
|
export declare type BookingSummaryProps = {
|
|
6
6
|
date: string;
|
|
7
|
-
menuSteps
|
|
8
|
-
formValues
|
|
7
|
+
menuSteps?: MenuStep[];
|
|
8
|
+
formValues?: {
|
|
9
9
|
[key: string]: Order;
|
|
10
10
|
};
|
|
11
11
|
totalWithDiscount?: number;
|
|
12
12
|
isNotShownPeopleAmount?: boolean;
|
|
13
|
-
eventName
|
|
13
|
+
eventName?: string;
|
|
14
14
|
hasPeopleInput?: boolean;
|
|
15
15
|
transactionFee?: number;
|
|
16
16
|
isFreePayment?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/BookingSummary/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,8CAA8C,CAAC;AAC5F,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAEvD,eAAO,MAAM,YAAY,MAAM,CAAC;AAChC,eAAO,MAAM,aAAa,oBAAoB,CAAC;AAE/C,oBAAY,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,QAAQ,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/BookingSummary/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,8CAA8C,CAAC;AAC5F,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAEvD,eAAO,MAAM,YAAY,MAAM,CAAC;AAChC,eAAO,MAAM,aAAa,oBAAoB,CAAC;AAE/C,oBAAY,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,UAAU,CAAC,EAAE;QACX,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC;KACtB,CAAC;IACF,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,kBAAkB,CAAC,EAAE,4BAA4B,CAAC,UAAU,CAAC,CAAC;IAC9D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaymentPage.d.ts","sourceRoot":"","sources":["../../../../src/iframe/payment/payment-page/PaymentPage.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AACrF,OAAO,EAAE,mBAAmB,EAAE,MAAM,0DAA0D,CAAC;AAI/F,OAAO,EAEL,oBAAoB,EACrB,MAAM,4BAA4B,CAAC;AAKpC,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,YAAa,SAAQ,oBAAoB;IACjD,oBAAoB,CAAC,EAAE,MAAM,IAAI,CAAC;IAClC,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,EAAE,oBAAoB,CAAC,CAAC;IACrE,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC;AAED,eAAO,MAAM,WAAW,kIAQrB,YAAY,
|
|
1
|
+
{"version":3,"file":"PaymentPage.d.ts","sourceRoot":"","sources":["../../../../src/iframe/payment/payment-page/PaymentPage.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AACrF,OAAO,EAAE,mBAAmB,EAAE,MAAM,0DAA0D,CAAC;AAI/F,OAAO,EAEL,oBAAoB,EACrB,MAAM,4BAA4B,CAAC;AAKpC,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,YAAa,SAAQ,oBAAoB;IACjD,oBAAoB,CAAC,EAAE,MAAM,IAAI,CAAC;IAClC,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,EAAE,oBAAoB,CAAC,CAAC;IACrE,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC;AAED,eAAO,MAAM,WAAW,kIAQrB,YAAY,gBAuHd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("tslib"),o=require("react"),a=(e=o)&&"object"==typeof e&&"default"in e?e.default:e,r=require("react-router-dom"),n=require("../../../static/loader/LoaderIndicator.js"),m=require("react-i18next"),s=require("react-bootstrap");require("../../../static/index.js"),require("../../order-process/components/NavigationFooter/NavigationFooter.js");var i=require("../../page/components/PageHeader/PageHeader.js"),l=require("@licklist/plugins/dist/context/payment/PaymentSessionContext"),c=require("../../order-process/components/BookingSummary/components/SummaryTotal/components/SummaryTotalBlock.js"),u=require("../../ryft/RyftPaymentForm.js"),d=require("../../order-process/components/BookingSummary/BookingSummary.js");require("../../order-process/components/NavigationSteps/NavigationSteps.js"),require("../../order-process/components/StepsForm/StepsForm.js"),require("../../order-process/components/Timer/Timer.js"),require("../../order-process/components/PaymentCard/PaymentCard.js");var p=require("../../order-process/components/BookingSummaryFooter/BookingSummaryFooter.js"),y=require("../../page/components/PageBody/PageBody.js");require("../../order-process/components/CalendarStepsForm/CalendarStepsForm.js");var g=require("./PaymentTimer.js"),f=require("../../page/Page.js");exports.PaymentPage=function(e){var B=e.onCloseIframePayment,P=e.onFailIframePayment,k=e.data,E=e.isLoading,S=e.bookingSummaryProps,q=e.paymentMetadata,j=t.__rest(e,["onCloseIframePayment","onFailIframePayment","data","isLoading","bookingSummaryProps","paymentMetadata"]),v=m.useTranslation("Design").t,x=r.useLocation().search,C=o.useContext(l.PaymentSessionContext).isPaymentSessionExpired,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("tslib"),o=require("react"),a=(e=o)&&"object"==typeof e&&"default"in e?e.default:e,r=require("react-router-dom"),n=require("../../../static/loader/LoaderIndicator.js"),m=require("react-i18next"),s=require("react-bootstrap");require("../../../static/index.js"),require("../../order-process/components/NavigationFooter/NavigationFooter.js");var i=require("../../page/components/PageHeader/PageHeader.js"),l=require("@licklist/plugins/dist/context/payment/PaymentSessionContext"),c=require("../../order-process/components/BookingSummary/components/SummaryTotal/components/SummaryTotalBlock.js"),u=require("../../ryft/RyftPaymentForm.js"),d=require("../../order-process/components/BookingSummary/BookingSummary.js");require("../../order-process/components/NavigationSteps/NavigationSteps.js"),require("../../order-process/components/StepsForm/StepsForm.js"),require("../../order-process/components/Timer/Timer.js"),require("../../order-process/components/PaymentCard/PaymentCard.js");var p=require("../../order-process/components/BookingSummaryFooter/BookingSummaryFooter.js"),y=require("../../page/components/PageBody/PageBody.js");require("../../order-process/components/CalendarStepsForm/CalendarStepsForm.js");var g=require("./PaymentTimer.js"),f=require("../../page/Page.js");exports.PaymentPage=function(e){var B=e.onCloseIframePayment,P=e.onFailIframePayment,k=e.data,E=e.isLoading,S=e.bookingSummaryProps,q=e.paymentMetadata,j=t.__rest(e,["onCloseIframePayment","onFailIframePayment","data","isLoading","bookingSummaryProps","paymentMetadata"]),v=m.useTranslation("Design").t,x=r.useLocation().search,C=o.useContext(l.PaymentSessionContext).isPaymentSessionExpired,F=Boolean(new URLSearchParams(x).get("isIframePayment")),b=function(){window.close()};return o.useEffect((function(){F&&B&&window.addEventListener("beforeunload",(function(){B()}))}),[]),o.useEffect((function(){C&&F&&P&&P()}),[C]),E?a.createElement(n.LoaderIndicator,{isLoaded:!1}):null===k?a.createElement(f.Page,null,a.createElement(y.PageBody,{leftBlock:a.createElement(y.PageBody.LeftBlock,null,a.createElement("div",{className:"d-flex h-100 w-100 justify-content-center align-items-center flex-column"},a.createElement("h6",null,v("linkNotActiveOrExpired")),a.createElement(s.Col,{xs:12,md:3},a.createElement(s.Button,{className:"mt-5 w-20",onClick:function(){window.location.href="https://booked.it/"}},v("backToSite")))))})):a.createElement(f.Page,{className:"payment_link",headerBlock:a.createElement(i.PageHeader,{showBackButton:F,onBackButtonClick:F?b:void 0,showCloseButton:F,onCloseButtonClick:F?b:void 0},a.createElement(g.PaymentTimer,null),a.createElement("div",{className:"d-flex align-items-center justify-content-center w-100"},v("paymentDetails")))},a.createElement(y.PageBody,{leftBlock:a.createElement(y.PageBody.LeftBlock,null,a.createElement(u.RyftPaymentForm,t.__assign({},j))),rightBlock:a.createElement(y.PageBody.RightBlock,{bottomBlock:a.createElement(p.BookingSummaryFooter,{showButton:!1},a.createElement("div",{className:"d-flex flex-column justify-content-between"},q&&a.createElement(a.Fragment,null,a.createElement(c.SummaryTotalBlock,{label:v("total"),amount:q.total||0}),a.createElement(c.SummaryTotalBlock,{label:v("paidSum"),amount:q.paid||0})),a.createElement(c.SummaryTotalBlock,{label:v(q?"remaining":"total"),amount:(null==k?void 0:k.amount)+((null==S?void 0:S.transactionFee)||0)})))},a.createElement("h6",null,v("paymentDetails")),a.createElement(d.BookingSummary,t.__assign({},S)))}))};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import { BookingSummaryProps } from "../../order-process/components/BookingSummary/types";
|
|
3
|
+
import { PaymentMetadata } from "../payment-page/PaymentPage";
|
|
3
4
|
export declare const ORDER_STATUS_FAILED = "failed";
|
|
4
5
|
export declare const ORDER_STATUS_SUCCESS = "success";
|
|
5
6
|
export declare const ORDER_STATUS_PENDING = "pending";
|
|
@@ -8,7 +9,6 @@ interface PaymentStatusComponentProps {
|
|
|
8
9
|
onCloseWindow: () => void;
|
|
9
10
|
onBack?: () => void;
|
|
10
11
|
onTryAgain?: () => void;
|
|
11
|
-
totalAmount?: number;
|
|
12
12
|
isLoading?: boolean;
|
|
13
13
|
status: OrderStatusPrefix;
|
|
14
14
|
isAppUsingInIframe?: boolean;
|
|
@@ -16,7 +16,9 @@ interface PaymentStatusComponentProps {
|
|
|
16
16
|
EventCardComponent?: ReactNode;
|
|
17
17
|
showCloseButton?: boolean;
|
|
18
18
|
email?: string;
|
|
19
|
+
totalAmount?: number;
|
|
20
|
+
paymentMetadata?: PaymentMetadata;
|
|
19
21
|
}
|
|
20
|
-
export declare const PaymentStatusPage: ({ onCloseWindow, onBack, onTryAgain,
|
|
22
|
+
export declare const PaymentStatusPage: ({ onCloseWindow, onBack, onTryAgain, isLoading, status, isAppUsingInIframe, bookingSummaryProps, EventCardComponent, showCloseButton, email, totalAmount, paymentMetadata, }: PaymentStatusComponentProps) => JSX.Element;
|
|
21
23
|
export {};
|
|
22
24
|
//# sourceMappingURL=PaymentStatusPage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaymentStatusPage.d.ts","sourceRoot":"","sources":["../../../../src/iframe/payment/payment-status-page/PaymentStatusPage.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AASzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,qDAAqD,CAAC;
|
|
1
|
+
{"version":3,"file":"PaymentStatusPage.d.ts","sourceRoot":"","sources":["../../../../src/iframe/payment/payment-status-page/PaymentStatusPage.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AASzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,qDAAqD,CAAC;AAC1F,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,eAAO,MAAM,mBAAmB,WAAW,CAAC;AAC5C,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAC9C,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAE9C,oBAAY,iBAAiB,GACzB,OAAO,oBAAoB,GAC3B,OAAO,mBAAmB,GAC1B,OAAO,oBAAoB,CAAC;AAEhC,UAAU,2BAA2B;IACnC,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,kBAAkB,CAAC,EAAE,SAAS,CAAC;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC;AAGD,eAAO,MAAM,iBAAiB,iLAa3B,2BAA2B,gBAqF7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("tslib"),o=require("react"),r=(e=o)&&"object"==typeof e&&"default"in e?e.default:e,a=require("../../../static/loader/LoaderIndicator.js"),n=require("react-i18next");require("../../order-process/components/NavigationFooter/NavigationFooter.js"),require("../../page/components/PageHeader/PageHeader.js");var s=require("../payment-status-header/PaymentStatusHeader.js"),m=require("../../order-process/components/BookingSummary/components/SummaryTotal/components/SummaryTotalBlock.js");require("../../order-process/components/BookingSummary/components/SummaryTotal/SummaryTotal.js");var i=require("../../order-process/components/BookingSummary/BookingSummary.js");require("../../order-process/components/NavigationSteps/NavigationSteps.js"),require("../../order-process/components/StepsForm/StepsForm.js"),require("../../order-process/components/Timer/Timer.js"),require("../../order-process/components/PaymentCard/PaymentCard.js");var c=require("../../order-process/components/BookingSummaryFooter/BookingSummaryFooter.js"),l=require("../../page/components/PageBody/PageBody.js");require("../../order-process/components/CalendarStepsForm/CalendarStepsForm.js");var u=require("../../page/Page.js"),p=require("./component/PaymentStatusBody.js"),d="failed",g="success",y="pending";exports.ORDER_STATUS_FAILED=d,exports.ORDER_STATUS_PENDING=y,exports.ORDER_STATUS_SUCCESS=g,exports.PaymentStatusPage=function(e){var o=e.onCloseWindow,S=e.onBack,B=e.onTryAgain,E=e.isLoading,k=e.status,P=e.isAppUsingInIframe,j=e.bookingSummaryProps,q=e.EventCardComponent,v=e.showCloseButton,T=void 0!==v&&v,f=e.email,C=e.totalAmount,F=void 0===C?0:C,h=e.paymentMetadata,_=n.useTranslation("Design").t,b=function(){switch(k){case g:return _("purchaseSuccessful");case y:return _("pendingPayment");default:return _("purchaseFailed")}}();return E?r.createElement(a.LoaderIndicator,{isLoaded:!1}):r.createElement(u.Page,{className:"payment-status-page",headerBlock:r.createElement(s.PaymentStatusHeader,{success:k!==d,showCloseButton:T,onCloseButtonClick:o,title:k===y?_("pendingPayment"):void 0}),isAppUsingInIframe:P},r.createElement(l.PageBody,{leftBlock:r.createElement(l.PageBody.LeftBlock,{title:b},r.createElement("div",null,q,r.createElement(p.PaymentStatusBody,{status:k,onBack:S||o,onTryAgain:B,email:f}))),rightBlock:r.createElement(l.PageBody.RightBlock,{bottomBlock:r.createElement(c.BookingSummaryFooter,{showButton:!1},r.createElement("div",{className:"d-flex flex-column justify-content-between"},h&&r.createElement(r.Fragment,null,r.createElement(m.SummaryTotalBlock,{label:_("total"),amount:h.total||0}),r.createElement(m.SummaryTotalBlock,{label:_("paidSum"),amount:h.paid||0})),r.createElement(m.SummaryTotalBlock,{label:_(h?"remaining":"total"),amount:F+((null==j?void 0:j.transactionFee)||0)})))},j?r.createElement(i.BookingSummary,t.__assign({},j)):r.createElement("h6",null,b))}))};
|
package/package.json
CHANGED
|
@@ -25,6 +25,9 @@ export const BookingSummary = ({
|
|
|
25
25
|
const { formatNumber } = useIntl();
|
|
26
26
|
|
|
27
27
|
const orderProducts = useMemo(() => {
|
|
28
|
+
if (!formValues) {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
28
31
|
const products = Object.values(formValues).filter(Boolean) as Order[];
|
|
29
32
|
|
|
30
33
|
return products?.filter((prod) => prod?.quantity !== 0);
|
|
@@ -47,7 +50,7 @@ export const BookingSummary = ({
|
|
|
47
50
|
</div>
|
|
48
51
|
<hr />
|
|
49
52
|
|
|
50
|
-
{orderProducts
|
|
53
|
+
{orderProducts?.length > 0 ? (
|
|
51
54
|
<div>
|
|
52
55
|
<div className="cart-items">
|
|
53
56
|
{menuSteps.map((menuStep: MenuStep) => {
|
|
@@ -6,13 +6,13 @@ export const ACCORDION_KEY = "booking-summary";
|
|
|
6
6
|
|
|
7
7
|
export type BookingSummaryProps = {
|
|
8
8
|
date: string;
|
|
9
|
-
menuSteps
|
|
10
|
-
formValues
|
|
9
|
+
menuSteps?: MenuStep[];
|
|
10
|
+
formValues?: {
|
|
11
11
|
[key: string]: Order;
|
|
12
12
|
};
|
|
13
13
|
totalWithDiscount?: number;
|
|
14
14
|
isNotShownPeopleAmount?: boolean;
|
|
15
|
-
eventName
|
|
15
|
+
eventName?: string;
|
|
16
16
|
hasPeopleInput?: boolean;
|
|
17
17
|
transactionFee?: number;
|
|
18
18
|
isFreePayment?: boolean;
|
|
@@ -142,7 +142,9 @@ export const PaymentPage = ({
|
|
|
142
142
|
)}
|
|
143
143
|
<SummaryTotalBlock
|
|
144
144
|
label={t(paymentMetadata ? "remaining" : "total")}
|
|
145
|
-
amount={
|
|
145
|
+
amount={
|
|
146
|
+
data?.amount + (bookingSummaryProps?.transactionFee || 0)
|
|
147
|
+
}
|
|
146
148
|
/>
|
|
147
149
|
</div>
|
|
148
150
|
</BookingSummaryFooter>
|
|
@@ -9,6 +9,7 @@ import { BookingSummary, BookingSummaryFooter } from "../../order-process";
|
|
|
9
9
|
import { PaymentStatusHeader } from "../payment-status-header/PaymentStatusHeader";
|
|
10
10
|
import { SummaryTotalBlock } from "../../order-process/components/BookingSummary/components/SummaryTotal";
|
|
11
11
|
import { BookingSummaryProps } from "../../order-process/components/BookingSummary/types";
|
|
12
|
+
import { PaymentMetadata } from "../payment-page/PaymentPage";
|
|
12
13
|
|
|
13
14
|
export const ORDER_STATUS_FAILED = "failed";
|
|
14
15
|
export const ORDER_STATUS_SUCCESS = "success";
|
|
@@ -23,7 +24,6 @@ interface PaymentStatusComponentProps {
|
|
|
23
24
|
onCloseWindow: () => void;
|
|
24
25
|
onBack?: () => void;
|
|
25
26
|
onTryAgain?: () => void;
|
|
26
|
-
totalAmount?: number;
|
|
27
27
|
isLoading?: boolean;
|
|
28
28
|
status: OrderStatusPrefix;
|
|
29
29
|
isAppUsingInIframe?: boolean;
|
|
@@ -31,6 +31,8 @@ interface PaymentStatusComponentProps {
|
|
|
31
31
|
EventCardComponent?: ReactNode;
|
|
32
32
|
showCloseButton?: boolean;
|
|
33
33
|
email?: string;
|
|
34
|
+
totalAmount?: number;
|
|
35
|
+
paymentMetadata?: PaymentMetadata;
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
// @TODO In future think, how to reuse this component in Iframe Pending, Success and Failed Pages
|
|
@@ -38,7 +40,6 @@ export const PaymentStatusPage = ({
|
|
|
38
40
|
onCloseWindow,
|
|
39
41
|
onBack,
|
|
40
42
|
onTryAgain,
|
|
41
|
-
totalAmount,
|
|
42
43
|
isLoading,
|
|
43
44
|
status,
|
|
44
45
|
isAppUsingInIframe,
|
|
@@ -46,6 +47,8 @@ export const PaymentStatusPage = ({
|
|
|
46
47
|
EventCardComponent,
|
|
47
48
|
showCloseButton = false,
|
|
48
49
|
email,
|
|
50
|
+
totalAmount = 0,
|
|
51
|
+
paymentMetadata,
|
|
49
52
|
}: PaymentStatusComponentProps) => {
|
|
50
53
|
const { t } = useTranslation("Design");
|
|
51
54
|
|
|
@@ -98,16 +101,26 @@ export const PaymentStatusPage = ({
|
|
|
98
101
|
<PageBody.RightBlock
|
|
99
102
|
bottomBlock={
|
|
100
103
|
<BookingSummaryFooter showButton={false}>
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
<div className="d-flex flex-column justify-content-between">
|
|
105
|
+
{paymentMetadata && (
|
|
106
|
+
<>
|
|
107
|
+
<SummaryTotalBlock
|
|
108
|
+
label={t("total")}
|
|
109
|
+
amount={paymentMetadata.total || 0}
|
|
110
|
+
/>
|
|
111
|
+
<SummaryTotalBlock
|
|
112
|
+
label={t("paidSum")}
|
|
113
|
+
amount={paymentMetadata.paid || 0}
|
|
114
|
+
/>
|
|
115
|
+
</>
|
|
116
|
+
)}
|
|
106
117
|
<SummaryTotalBlock
|
|
107
|
-
label={t("total")}
|
|
108
|
-
amount={
|
|
118
|
+
label={t(paymentMetadata ? "remaining" : "total")}
|
|
119
|
+
amount={
|
|
120
|
+
totalAmount + (bookingSummaryProps?.transactionFee || 0)
|
|
121
|
+
}
|
|
109
122
|
/>
|
|
110
|
-
|
|
123
|
+
</div>
|
|
111
124
|
</BookingSummaryFooter>
|
|
112
125
|
}
|
|
113
126
|
>
|