rebill-web-components-sdk 1.8.32 → 1.8.34-beta.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/cjs/apm-checkout_19.cjs.entry.js +12 -12
- package/dist/cjs/card-identification_5.cjs.entry.js +8 -8
- package/dist/cjs/collapsible-card.cjs.entry.js +1 -1
- package/dist/cjs/discount-coupon.rebill-divider.entry.cjs.js.map +1 -0
- package/dist/cjs/discount-coupon_2.cjs.entry.js +157 -0
- package/dist/cjs/index-C-VTnc0I.js.map +1 -1
- package/dist/cjs/input-otp.cjs.entry.js +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/organization-logo.rebill-card-icon.rebill-checkout-single-column.rebill-footer.entry.cjs.js.map +1 -1
- package/dist/cjs/organization-logo_4.cjs.entry.js +3 -3
- package/dist/cjs/otp-component_7.cjs.entry.js +8 -8
- package/dist/cjs/rebill-alert.cjs.entry.js +2 -2
- package/dist/cjs/rebill-card-carousel.cjs.entry.js +1 -1
- package/dist/cjs/rebill-card.cjs.entry.js +1 -1
- package/dist/cjs/rebill-container_2.cjs.entry.js +2 -2
- package/dist/cjs/rebill-flex-container.cjs.entry.js +1 -1
- package/dist/cjs/rebill-form.cjs.entry.js +1 -1
- package/dist/cjs/rebill-grid-container.cjs.entry.js +1 -1
- package/dist/cjs/rebill-input-select.cjs.entry.js +2 -2
- package/dist/cjs/rebill-input-text.cjs.entry.js +2 -2
- package/dist/cjs/rebill-renewal.cjs.entry.js +32 -12
- package/dist/cjs/rebill-renewal.entry.cjs.js.map +1 -1
- package/dist/cjs/rebill-timeline-debit-day.rebill-timeline-free-trial.entry.cjs.js.map +1 -0
- package/dist/cjs/{discount-coupon_3.cjs.entry.js → rebill-timeline-debit-day_2.cjs.entry.js} +3 -117
- package/dist/cjs/rebill-vertical-divider.cjs.entry.js +1 -1
- package/dist/cjs/rebill-web-components-sdk.cjs.js +1 -1
- package/dist/cjs/renewal-success-page.renewal-summary.entry.cjs.js.map +1 -1
- package/dist/cjs/renewal-success-page_2.cjs.entry.js +41 -13
- package/dist/cjs/{renewal.store-C9AesGY1.js → renewal.store-BaH9Id4E.js} +5 -2
- package/dist/cjs/renewal.store-BaH9Id4E.js.map +1 -0
- package/dist/cjs/root-component.cjs.entry.js +1 -1
- package/dist/collection/components/checkout/discount-coupon/discount-coupon.css +4 -0
- package/dist/collection/components/checkout/discount-coupon/discount-coupon.js +104 -4
- package/dist/collection/components/checkout/discount-coupon/discount-coupon.js.map +1 -1
- package/dist/collection/components/checkout/otp/otp.js +4 -4
- package/dist/collection/components/checkout/payment-method-selector/card-fields/card-fields-wrapper.js +2 -2
- package/dist/collection/components/checkout/payment-method-selector/card-fields/identification/identification.js +1 -1
- package/dist/collection/components/checkout/payment-method-selector/card-fields/iframe/CardIframe.js +2 -2
- package/dist/collection/components/checkout/payment-method-selector/card-fields/iframe/skeleton/CardSkeleton.js +1 -1
- package/dist/collection/components/checkout/payment-method-selector/card-fields/installments/installments.js +2 -2
- package/dist/collection/components/checkout/rebill-footer/rebill-footer.css +1 -1
- package/dist/collection/components/checkout/rebill-footer/rebill-footer.js +1 -1
- package/dist/collection/components/checkout/user-information/user-information-phone.js +1 -1
- package/dist/collection/components/checkout/user-information/user-information.js +3 -3
- package/dist/collection/components/renewal/rebill-renewal.js +31 -11
- package/dist/collection/components/renewal/rebill-renewal.js.map +1 -1
- package/dist/collection/components/renewal/renewal-success-page/renewal-success-page.js +2 -2
- package/dist/collection/components/renewal/renewal-summary/renewal-summary.js +101 -16
- package/dist/collection/components/renewal/renewal-summary/renewal-summary.js.map +1 -1
- package/dist/collection/components/root-component/root-component.js +1 -1
- package/dist/collection/components/shared/alert/alert.js +2 -2
- package/dist/collection/components/shared/card/card.js +1 -1
- package/dist/collection/components/shared/card-carousel/card-carousel.js +1 -1
- package/dist/collection/components/shared/collapsible-card/collapsible-card.js +1 -1
- package/dist/collection/components/shared/divider/divider.js +1 -1
- package/dist/collection/components/shared/divider/vertical-divider.js +1 -1
- package/dist/collection/components/shared/form/form.js +1 -1
- package/dist/collection/components/shared/inputs/input-checkbox/input-checkbox.js +1 -1
- package/dist/collection/components/shared/inputs/input-combo/input-combo.js +1 -1
- package/dist/collection/components/shared/inputs/input-otp/input-otp.js +2 -2
- package/dist/collection/components/shared/inputs/input-phone/input-phone.js +2 -2
- package/dist/collection/components/shared/inputs/input-select/input-select.js +2 -2
- package/dist/collection/components/shared/inputs/input-text/input-text.js +2 -2
- package/dist/collection/components/shared/layouts/custom/single-column/checkout-single-column.js +1 -1
- package/dist/collection/components/shared/layouts/generics/container.js +1 -1
- package/dist/collection/components/shared/layouts/generics/flex.js +1 -1
- package/dist/collection/components/shared/layouts/generics/grid.js +1 -1
- package/dist/collection/components/shared/mode-sandbox/mode-sandbox-mobile.js +1 -1
- package/dist/collection/components/shared/selectable-card/selectable-card.js +2 -2
- package/dist/collection/components/shared/singlePaymentMethod/singlePaymentMethod.js +4 -4
- package/dist/collection/components/shared/timeline/timeline-debit-day.js +1 -1
- package/dist/collection/components/shared/timeline/timeline-free-trial.js +1 -1
- package/dist/collection/models/renewal.model.js.map +1 -1
- package/dist/collection/store/renewal.store.js +3 -0
- package/dist/collection/store/renewal.store.js.map +1 -1
- package/dist/components/apm-checkout.js +1 -1
- package/dist/components/bank-transfer.js +1 -1
- package/dist/components/card-fields-wrapper.js +1 -1
- package/dist/components/card-identification.js +1 -1
- package/dist/components/card-iframe.js +1 -1
- package/dist/components/card-skeleton.js +1 -1
- package/dist/components/collapsible-card.js +1 -1
- package/dist/components/discount-coupon.js +1 -1
- package/dist/components/input-otp.js +1 -1
- package/dist/components/otp-component.js +1 -1
- package/dist/components/{p-BbLfqjb0.js → p-3K2fnS0h.js} +5 -5
- package/dist/components/{p-BbLfqjb0.js.map → p-3K2fnS0h.js.map} +1 -1
- package/dist/components/p-8BpuJ_V5.js.map +1 -1
- package/dist/components/{p-Dm2xJSTe.js → p-B0QvmxUI.js} +3 -3
- package/dist/components/{p-Dm2xJSTe.js.map → p-B0QvmxUI.js.map} +1 -1
- package/dist/components/{p-CYhj6VLQ.js → p-B544NesK.js} +4 -4
- package/dist/components/{p-CYhj6VLQ.js.map → p-B544NesK.js.map} +1 -1
- package/dist/components/{p-mA3Sj5fj.js → p-B7uE6iBd.js} +11 -11
- package/dist/components/{p-mA3Sj5fj.js.map → p-B7uE6iBd.js.map} +1 -1
- package/dist/components/{p-1ZvL9CLG.js → p-BLbS7nF7.js} +3 -3
- package/dist/components/{p-1ZvL9CLG.js.map → p-BLbS7nF7.js.map} +1 -1
- package/dist/components/{p-qI3t-gYu.js → p-BZYd-So1.js} +4 -4
- package/dist/components/{p-qI3t-gYu.js.map → p-BZYd-So1.js.map} +1 -1
- package/dist/components/{p-tTqPr5zM.js → p-BeVdyYff.js} +6 -6
- package/dist/components/{p-tTqPr5zM.js.map → p-BeVdyYff.js.map} +1 -1
- package/dist/components/{p-1I-sUD5D.js → p-BuNsfNGm.js} +6 -6
- package/dist/components/{p-1I-sUD5D.js.map → p-BuNsfNGm.js.map} +1 -1
- package/dist/components/{p-BV_MHtDc.js → p-C0LGxeng.js} +3 -3
- package/dist/components/{p-BV_MHtDc.js.map → p-C0LGxeng.js.map} +1 -1
- package/dist/components/{p-DvXuQN4U.js → p-CD0TNzOh.js} +12 -12
- package/dist/components/{p-DvXuQN4U.js.map → p-CD0TNzOh.js.map} +1 -1
- package/dist/components/{p-wjfhDzgd.js → p-CKYowY5T.js} +4 -4
- package/dist/components/{p-wjfhDzgd.js.map → p-CKYowY5T.js.map} +1 -1
- package/dist/components/{p-ChnuJbVe.js → p-C_S6-o9t.js} +10 -10
- package/dist/components/{p-ChnuJbVe.js.map → p-C_S6-o9t.js.map} +1 -1
- package/dist/components/{p-CKiwr2yo.js → p-CajUouzQ.js} +3 -3
- package/dist/components/{p-CKiwr2yo.js.map → p-CajUouzQ.js.map} +1 -1
- package/dist/components/{p-fEiok6NF.js → p-CfUbJq8-.js} +3 -3
- package/dist/components/{p-fEiok6NF.js.map → p-CfUbJq8-.js.map} +1 -1
- package/dist/components/{p-BWkW7_Hh.js → p-CisP549A.js} +36 -9
- package/dist/components/p-CisP549A.js.map +1 -0
- package/dist/components/{p-DiNW75Kd.js → p-CmYsenWG.js} +3 -3
- package/dist/components/{p-DiNW75Kd.js.map → p-CmYsenWG.js.map} +1 -1
- package/dist/components/{p-QzWBUSLD.js → p-CneaXzeq.js} +4 -4
- package/dist/components/{p-QzWBUSLD.js.map → p-CneaXzeq.js.map} +1 -1
- package/dist/components/{p-Di8WeTd9.js → p-CuX2faVH.js} +4 -4
- package/dist/components/{p-Di8WeTd9.js.map → p-CuX2faVH.js.map} +1 -1
- package/dist/components/{p-h8TZeiqt.js → p-D0AmEJnp.js} +6 -6
- package/dist/components/{p-h8TZeiqt.js.map → p-D0AmEJnp.js.map} +1 -1
- package/dist/components/{p-B1BCKuQ0.js → p-D1lAYXxG.js} +8 -8
- package/dist/components/{p-B1BCKuQ0.js.map → p-D1lAYXxG.js.map} +1 -1
- package/dist/components/{p-BnBTbmTe.js → p-DA0QxWuE.js} +4 -4
- package/dist/components/{p-BnBTbmTe.js.map → p-DA0QxWuE.js.map} +1 -1
- package/dist/components/{p-CpXk4UfE.js → p-DBi6K19S.js} +5 -5
- package/dist/components/{p-CpXk4UfE.js.map → p-DBi6K19S.js.map} +1 -1
- package/dist/components/{p-gj5jUg6C.js → p-DDp9qjAz.js} +3 -3
- package/dist/components/{p-gj5jUg6C.js.map → p-DDp9qjAz.js.map} +1 -1
- package/dist/components/{p-DlrQ_kVv.js → p-DIILFLsN.js} +5 -5
- package/dist/components/{p-DlrQ_kVv.js.map → p-DIILFLsN.js.map} +1 -1
- package/dist/components/{p-CNBrNMEa.js → p-DKn8wDv6.js} +3 -3
- package/dist/components/{p-CNBrNMEa.js.map → p-DKn8wDv6.js.map} +1 -1
- package/dist/components/{p-D6yu2OYw.js → p-DPUz_1Ev.js} +5 -5
- package/dist/components/{p-D6yu2OYw.js.map → p-DPUz_1Ev.js.map} +1 -1
- package/dist/components/{p-BL08tUBX.js → p-DRTzT9ks.js} +3 -3
- package/dist/components/{p-BL08tUBX.js.map → p-DRTzT9ks.js.map} +1 -1
- package/dist/components/{p-DSFlA7FF.js → p-DaS8xGPM.js} +5 -5
- package/dist/components/{p-DSFlA7FF.js.map → p-DaS8xGPM.js.map} +1 -1
- package/dist/components/{p-DZWQyp55.js → p-DgRM4z7g.js} +3 -3
- package/dist/components/{p-DZWQyp55.js.map → p-DgRM4z7g.js.map} +1 -1
- package/dist/components/{p-DU4kUISl.js → p-Dm8Dxmer.js} +5 -5
- package/dist/components/{p-DU4kUISl.js.map → p-Dm8Dxmer.js.map} +1 -1
- package/dist/components/{p-DrAiGSzG.js → p-Dp8EoajW.js} +3 -3
- package/dist/components/{p-DrAiGSzG.js.map → p-Dp8EoajW.js.map} +1 -1
- package/dist/components/{p-BX1_zmbg.js → p-DvV5MmYi.js} +5 -5
- package/dist/components/{p-BX1_zmbg.js.map → p-DvV5MmYi.js.map} +1 -1
- package/dist/components/{p-4hVDutj0.js → p-DzdUnkvh.js} +3 -3
- package/dist/components/{p-4hVDutj0.js.map → p-DzdUnkvh.js.map} +1 -1
- package/dist/components/{p-D3QILlvg.js → p-HzmATjhQ.js} +5 -5
- package/dist/components/p-HzmATjhQ.js.map +1 -0
- package/dist/components/{p-CVtNCEPd.js → p-PBF27XTU.js} +3 -3
- package/dist/components/{p-CVtNCEPd.js.map → p-PBF27XTU.js.map} +1 -1
- package/dist/components/{p-BmjU_TBT.js → p-QTa3HvQl.js} +3 -3
- package/dist/components/{p-BmjU_TBT.js.map → p-QTa3HvQl.js.map} +1 -1
- package/dist/components/{p-WQJ1HwUp.js → p-dgrAtFYi.js} +6 -6
- package/dist/components/{p-WQJ1HwUp.js.map → p-dgrAtFYi.js.map} +1 -1
- package/dist/components/{p-RGadlsa-.js → p-hpg1lOUJ.js} +5 -2
- package/dist/components/p-hpg1lOUJ.js.map +1 -0
- package/dist/components/{p-D4oYYfeG.js → p-nkv8Z87a.js} +8 -8
- package/dist/components/{p-D4oYYfeG.js.map → p-nkv8Z87a.js.map} +1 -1
- package/dist/components/{p-dtookouT.js → p-nvpvagPB.js} +7 -7
- package/dist/components/{p-dtookouT.js.map → p-nvpvagPB.js.map} +1 -1
- package/dist/components/{p-B-Wxp2_p.js → p-oE_0ElW3.js} +69 -20
- package/dist/components/p-oE_0ElW3.js.map +1 -0
- package/dist/components/{p-CKZvdOpK.js → p-qDaQOriJ.js} +4 -4
- package/dist/components/{p-CKZvdOpK.js.map → p-qDaQOriJ.js.map} +1 -1
- package/dist/components/{p-lfUd06gm.js → p-rnhSIhil.js} +3 -3
- package/dist/components/{p-lfUd06gm.js.map → p-rnhSIhil.js.map} +1 -1
- package/dist/components/{p-Dr1acigj.js → p-xNgCL9nV.js} +4 -4
- package/dist/components/{p-Dr1acigj.js.map → p-xNgCL9nV.js.map} +1 -1
- package/dist/components/payment-method-selector.js +1 -1
- package/dist/components/qr-code.js +1 -1
- package/dist/components/rebill-address-form.js +1 -1
- package/dist/components/rebill-address-search.js +1 -1
- package/dist/components/rebill-address.js +1 -1
- package/dist/components/rebill-alert.js +1 -1
- package/dist/components/rebill-bank-selector.js +1 -1
- package/dist/components/rebill-card-carousel.js +1 -1
- package/dist/components/rebill-card.js +1 -1
- package/dist/components/rebill-checkout-form.js +1 -1
- package/dist/components/rebill-checkout-single-column.js +1 -1
- package/dist/components/rebill-checkout.js +39 -39
- package/dist/components/rebill-container.js +1 -1
- package/dist/components/rebill-divider.js +1 -1
- package/dist/components/rebill-flex-container.js +1 -1
- package/dist/components/rebill-footer.js +1 -1
- package/dist/components/rebill-form.js +1 -1
- package/dist/components/rebill-grid-container.js +1 -1
- package/dist/components/rebill-input-checkbox.js +1 -1
- package/dist/components/rebill-input-combo.js +1 -1
- package/dist/components/rebill-input-phone.js +1 -1
- package/dist/components/rebill-input-select.js +1 -1
- package/dist/components/rebill-input-text.js +1 -1
- package/dist/components/rebill-installments.js +1 -1
- package/dist/components/rebill-mode-sandbox-mobile.js +1 -1
- package/dist/components/rebill-processing-payment.js +1 -1
- package/dist/components/rebill-renewal.js +77 -51
- package/dist/components/rebill-renewal.js.map +1 -1
- package/dist/components/rebill-summary.js +1 -1
- package/dist/components/rebill-timeline-debit-day.js +1 -1
- package/dist/components/rebill-timeline-free-trial.js +1 -1
- package/dist/components/rebill-vertical-divider.js +1 -1
- package/dist/components/renewal-success-page.js +1 -1
- package/dist/components/renewal-summary.js +1 -1
- package/dist/components/root-component.js +6 -6
- package/dist/components/selectable-card.js +1 -1
- package/dist/components/single-payment-method.js +1 -1
- package/dist/components/success-page.js +1 -1
- package/dist/components/user-information-phone.js +1 -1
- package/dist/components/user-information.js +1 -1
- package/dist/esm/apm-checkout_19.entry.js +12 -12
- package/dist/esm/card-identification_5.entry.js +8 -8
- package/dist/esm/collapsible-card.entry.js +1 -1
- package/dist/esm/discount-coupon.rebill-divider.entry.js.map +1 -0
- package/dist/esm/discount-coupon_2.entry.js +154 -0
- package/dist/esm/index-D8cwEAmw.js.map +1 -1
- package/dist/esm/input-otp.entry.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/organization-logo.rebill-card-icon.rebill-checkout-single-column.rebill-footer.entry.js.map +1 -1
- package/dist/esm/organization-logo_4.entry.js +3 -3
- package/dist/esm/otp-component_7.entry.js +8 -8
- package/dist/esm/rebill-alert.entry.js +2 -2
- package/dist/esm/rebill-card-carousel.entry.js +1 -1
- package/dist/esm/rebill-card.entry.js +1 -1
- package/dist/esm/rebill-container_2.entry.js +2 -2
- package/dist/esm/rebill-flex-container.entry.js +1 -1
- package/dist/esm/rebill-form.entry.js +1 -1
- package/dist/esm/rebill-grid-container.entry.js +1 -1
- package/dist/esm/rebill-input-select.entry.js +2 -2
- package/dist/esm/rebill-input-text.entry.js +2 -2
- package/dist/esm/rebill-renewal.entry.js +32 -12
- package/dist/esm/rebill-renewal.entry.js.map +1 -1
- package/dist/esm/rebill-timeline-debit-day.rebill-timeline-free-trial.entry.js.map +1 -0
- package/dist/esm/{discount-coupon_3.entry.js → rebill-timeline-debit-day_2.entry.js} +6 -119
- package/dist/esm/rebill-vertical-divider.entry.js +1 -1
- package/dist/esm/rebill-web-components-sdk.js +1 -1
- package/dist/esm/renewal-success-page.renewal-summary.entry.js.map +1 -1
- package/dist/esm/renewal-success-page_2.entry.js +41 -13
- package/dist/esm/{renewal.store-C6hSvhsF.js → renewal.store-vAxzxA8H.js} +5 -2
- package/dist/esm/renewal.store-vAxzxA8H.js.map +1 -0
- package/dist/esm/root-component.entry.js +1 -1
- package/dist/rebill-web-components-sdk/discount-coupon.rebill-divider.entry.esm.js.map +1 -0
- package/dist/rebill-web-components-sdk/organization-logo.rebill-card-icon.rebill-checkout-single-column.rebill-footer.entry.esm.js.map +1 -1
- package/dist/rebill-web-components-sdk/p-012e3770.entry.js +2 -0
- package/dist/rebill-web-components-sdk/p-012e3770.entry.js.map +1 -0
- package/dist/rebill-web-components-sdk/{p-1c3e7171.entry.js → p-0239917e.entry.js} +2 -2
- package/dist/rebill-web-components-sdk/{p-edb69e28.entry.js → p-1ac036d7.entry.js} +2 -2
- package/dist/rebill-web-components-sdk/{p-36a897c4.entry.js → p-1d7e392c.entry.js} +2 -2
- package/dist/rebill-web-components-sdk/{p-e5b0f2b9.entry.js → p-2ebb1d54.entry.js} +2 -2
- package/dist/rebill-web-components-sdk/{p-e8eadef6.entry.js → p-3a5bdb02.entry.js} +2 -2
- package/dist/rebill-web-components-sdk/{p-5df71605.entry.js → p-43924d1d.entry.js} +2 -2
- package/dist/rebill-web-components-sdk/p-43924d1d.entry.js.map +1 -0
- package/dist/rebill-web-components-sdk/{p-9084f3ef.entry.js → p-47ee3edc.entry.js} +2 -2
- package/dist/rebill-web-components-sdk/{p-92de0c03.entry.js → p-508cc019.entry.js} +2 -2
- package/dist/rebill-web-components-sdk/{p-924e7ec2.entry.js → p-515e9e16.entry.js} +2 -2
- package/dist/rebill-web-components-sdk/p-5ac0522d.entry.js +2 -0
- package/dist/rebill-web-components-sdk/{p-821e1fed.entry.js → p-6089b208.entry.js} +2 -2
- package/dist/rebill-web-components-sdk/p-63baba00.entry.js +2 -0
- package/dist/rebill-web-components-sdk/p-63baba00.entry.js.map +1 -0
- package/dist/rebill-web-components-sdk/{p-a0d6b0c0.entry.js → p-6ea98ccf.entry.js} +2 -2
- package/dist/rebill-web-components-sdk/{p-bc6f455d.entry.js → p-7287e0f0.entry.js} +2 -2
- package/dist/rebill-web-components-sdk/{p-26f12a67.entry.js → p-8c7f75c0.entry.js} +2 -2
- package/dist/rebill-web-components-sdk/{p-26f12a67.entry.js.map → p-8c7f75c0.entry.js.map} +1 -1
- package/dist/rebill-web-components-sdk/p-D8cwEAmw.js.map +1 -1
- package/dist/rebill-web-components-sdk/{p-c8a5a137.entry.js → p-aa96087c.entry.js} +2 -2
- package/dist/rebill-web-components-sdk/{p-63020e78.entry.js → p-ad9a6685.entry.js} +2 -2
- package/dist/rebill-web-components-sdk/{p-7e94aec8.entry.js → p-e0a3f3a8.entry.js} +2 -2
- package/dist/rebill-web-components-sdk/p-e242be38.entry.js +2 -0
- package/dist/rebill-web-components-sdk/p-e242be38.entry.js.map +1 -0
- package/dist/rebill-web-components-sdk/p-f672574a.entry.js +2 -0
- package/dist/rebill-web-components-sdk/p-nVuaISVM.js +2 -0
- package/dist/rebill-web-components-sdk/p-nVuaISVM.js.map +1 -0
- package/dist/rebill-web-components-sdk/rebill-renewal.entry.esm.js.map +1 -1
- package/dist/rebill-web-components-sdk/rebill-timeline-debit-day.rebill-timeline-free-trial.entry.esm.js.map +1 -0
- package/dist/rebill-web-components-sdk/rebill-web-components-sdk.esm.js +1 -1
- package/dist/rebill-web-components-sdk/renewal-success-page.renewal-summary.entry.esm.js.map +1 -1
- package/dist/types/components/checkout/discount-coupon/discount-coupon.d.ts +5 -0
- package/dist/types/components/renewal/renewal-summary/renewal-summary.d.ts +12 -5
- package/dist/types/components.d.ts +24 -4
- package/dist/types/models/renewal.model.d.ts +3 -0
- package/package.json +1 -1
- package/dist/cjs/discount-coupon.rebill-timeline-debit-day.rebill-timeline-free-trial.entry.cjs.js.map +0 -1
- package/dist/cjs/rebill-divider.cjs.entry.js +0 -18
- package/dist/cjs/rebill-divider.entry.cjs.js.map +0 -1
- package/dist/cjs/renewal.store-C9AesGY1.js.map +0 -1
- package/dist/components/p-B-Wxp2_p.js.map +0 -1
- package/dist/components/p-BWkW7_Hh.js.map +0 -1
- package/dist/components/p-D3QILlvg.js.map +0 -1
- package/dist/components/p-RGadlsa-.js.map +0 -1
- package/dist/esm/discount-coupon.rebill-timeline-debit-day.rebill-timeline-free-trial.entry.js.map +0 -1
- package/dist/esm/rebill-divider.entry.js +0 -16
- package/dist/esm/rebill-divider.entry.js.map +0 -1
- package/dist/esm/renewal.store-C6hSvhsF.js.map +0 -1
- package/dist/rebill-web-components-sdk/discount-coupon.rebill-timeline-debit-day.rebill-timeline-free-trial.entry.esm.js.map +0 -1
- package/dist/rebill-web-components-sdk/p-43675422.entry.js +0 -2
- package/dist/rebill-web-components-sdk/p-43675422.entry.js.map +0 -1
- package/dist/rebill-web-components-sdk/p-51571e15.entry.js +0 -2
- package/dist/rebill-web-components-sdk/p-5df71605.entry.js.map +0 -1
- package/dist/rebill-web-components-sdk/p-7ea96b11.entry.js +0 -2
- package/dist/rebill-web-components-sdk/p-CdYpsLqg.js +0 -2
- package/dist/rebill-web-components-sdk/p-CdYpsLqg.js.map +0 -1
- package/dist/rebill-web-components-sdk/p-b519d8a2.entry.js +0 -2
- package/dist/rebill-web-components-sdk/p-b519d8a2.entry.js.map +0 -1
- package/dist/rebill-web-components-sdk/p-eb6a2c0d.entry.js +0 -2
- package/dist/rebill-web-components-sdk/p-eb6a2c0d.entry.js.map +0 -1
- package/dist/rebill-web-components-sdk/rebill-divider.entry.esm.js.map +0 -1
- /package/dist/rebill-web-components-sdk/{p-1c3e7171.entry.js.map → p-0239917e.entry.js.map} +0 -0
- /package/dist/rebill-web-components-sdk/{p-edb69e28.entry.js.map → p-1ac036d7.entry.js.map} +0 -0
- /package/dist/rebill-web-components-sdk/{p-36a897c4.entry.js.map → p-1d7e392c.entry.js.map} +0 -0
- /package/dist/rebill-web-components-sdk/{p-e5b0f2b9.entry.js.map → p-2ebb1d54.entry.js.map} +0 -0
- /package/dist/rebill-web-components-sdk/{p-e8eadef6.entry.js.map → p-3a5bdb02.entry.js.map} +0 -0
- /package/dist/rebill-web-components-sdk/{p-9084f3ef.entry.js.map → p-47ee3edc.entry.js.map} +0 -0
- /package/dist/rebill-web-components-sdk/{p-92de0c03.entry.js.map → p-508cc019.entry.js.map} +0 -0
- /package/dist/rebill-web-components-sdk/{p-924e7ec2.entry.js.map → p-515e9e16.entry.js.map} +0 -0
- /package/dist/rebill-web-components-sdk/{p-51571e15.entry.js.map → p-5ac0522d.entry.js.map} +0 -0
- /package/dist/rebill-web-components-sdk/{p-821e1fed.entry.js.map → p-6089b208.entry.js.map} +0 -0
- /package/dist/rebill-web-components-sdk/{p-a0d6b0c0.entry.js.map → p-6ea98ccf.entry.js.map} +0 -0
- /package/dist/rebill-web-components-sdk/{p-bc6f455d.entry.js.map → p-7287e0f0.entry.js.map} +0 -0
- /package/dist/rebill-web-components-sdk/{p-c8a5a137.entry.js.map → p-aa96087c.entry.js.map} +0 -0
- /package/dist/rebill-web-components-sdk/{p-63020e78.entry.js.map → p-ad9a6685.entry.js.map} +0 -0
- /package/dist/rebill-web-components-sdk/{p-7e94aec8.entry.js.map → p-e0a3f3a8.entry.js.map} +0 -0
- /package/dist/rebill-web-components-sdk/{p-7ea96b11.entry.js.map → p-f672574a.entry.js.map} +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var index = require('./index-C-VTnc0I.js');
|
|
4
4
|
var i18n_service = require('./i18n.service-DjVTlGfF.js');
|
|
5
|
-
var renewal_store = require('./renewal.store-
|
|
5
|
+
var renewal_store = require('./renewal.store-BaH9Id4E.js');
|
|
6
6
|
var breakpoint = require('./breakpoint-CWd4pcNv.js');
|
|
7
7
|
var colorClassMapper = require('./color-class-mapper-CtKnrxwI.js');
|
|
8
8
|
var html2canvas = require('./pdf-generator-DV2OJH6J.js');
|
|
@@ -203,9 +203,9 @@ const RenewalSuccessPage = class {
|
|
|
203
203
|
return cardBrand && cardLastFour ? `${formattedBrand} - ${cardLastFour}` : formattedBrand;
|
|
204
204
|
};
|
|
205
205
|
render() {
|
|
206
|
-
return (index.h("rebill-checkout-single-column", { key: '
|
|
206
|
+
return (index.h("rebill-checkout-single-column", { key: 'e2146edfbd50d59dc29b1b1f9bf65a0a4fa62d99' }, index.h("div", { key: 'a66cd3a74d7f1101ff6b80c0cb5ebf8ece74f0fa', class: "renewal-success-page__success-content" }, index.h("rebill-typography", { key: '006d639c3bbf87f00cd5a54a471f34ca441ef567', variant: "h3", color: colorClassMapper.COLORS_ENUM.PRIMARY_DARK_TEXT }, i18n_service.I18nService.translate('processing.successTitle')), index.h("div", { key: '018ca7c5c6c8738b869d1b74924ec65e51088b10', class: "renewal-success-page__success-icon" }, index.h("svg", { key: '6ea6d85826586426c59e98564c798b6056b05b2d', width: breakpoint.isBreakpointBelow(this.breakpoint, breakpoint.BREAKPOINT_ENUM.DESKTOP) ? '64' : '96', height: breakpoint.isBreakpointBelow(this.breakpoint, breakpoint.BREAKPOINT_ENUM.DESKTOP) ? '64' : '96', viewBox: "0 0 96 96", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { key: '86f2b5114a0628dc3db093f2e7cbe4f7a59b12c4', "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M7.99219 47.998C7.99219 25.9067 25.9008 7.99805 47.9922 7.99805C70.0836 7.99805 87.9922 25.9067 87.9922 47.998C87.9922 70.0894 70.0836 87.998 47.9922 87.998C25.9008 87.998 7.99219 70.0894 7.99219 47.998ZM61.5401 39.2645C62.2396 38.4096 62.1136 37.1496 61.2587 36.4501C60.4038 35.7507 59.1437 35.8767 58.4443 36.7316L41.8437 57.0211L35.4064 50.5838C34.6254 49.8028 33.359 49.8028 32.578 50.5838C31.7969 51.3649 31.7969 52.6312 32.578 53.4123L40.578 61.4123C40.9775 61.8118 41.5275 62.0237 42.0918 61.9956C42.6562 61.9674 43.1823 61.7019 43.5401 61.2645L61.5401 39.2645Z", fill: "#35B093" }))), index.h("div", { key: 'c9575e3a1d2627caf0aa80ea29240b0730b20dd2', class: "renewal-success-page__info-card" }, index.h("div", { key: 'afe371111cf2f4cda615ecb32eec06f652a9154b', class: "renewal-success-page__card-row" }, index.h("rebill-typography", { key: '38dc7a45fbeb51b4916a617e60be972f7e03c5ac', variant: "body2", color: colorClassMapper.COLORS_ENUM.SECONDARY }, i18n_service.I18nService.translate('processing.paymentMethod')), index.h("div", { key: 'f6f93a8dac29163f7901b8adbd5816754715c109', class: "renewal-success-page__card-value" }, index.h("div", { key: 'f2e8e8ee445ba3078dce3a76f6a82290424449cd', class: "renewal-success-page__payment-method-display" }, this.typePaymentMethod === i18n_service.PAYMENT_METHOD_ENUM.CARD && (index.h(index.h.Fragment, null, index.h("rebill-card-icon", { key: 'c8176486ea186d7a87314cdefe373152bd1d1736', "card-brand": renewal_store.renewalState.data?.cardInformation?.brand || '' }), index.h("rebill-typography", { key: '8275ffadcdae6f22dc1693b2d0f14a2f13973dec', variant: "body2", color: colorClassMapper.COLORS_ENUM.PRIMARY_DARK_TEXT }, this.textPaymentMethodCard()))), this.typePaymentMethod === i18n_service.PAYMENT_METHOD_ENUM.BANK_TRANSFER && (index.h("div", { key: 'd841b51309ff60d7562ea4dfd9229b3737b86b25', style: { display: 'flex', alignItems: 'center', gap: '8px' } }, index.h("div", { key: '6f8f18b839c59222030b5ba8767e785f530deb18', style: { display: 'flex', alignItems: 'center', gap: '8px' } }, this.getPaymentMethodConfig(i18n_service.PAYMENT_METHOD_ENUM.BANK_TRANSFER).icons.map(iconName => {
|
|
207
207
|
return index.h("rebill-icon", { name: iconName, size: "24px" });
|
|
208
|
-
})), index.h("rebill-typography", { key: '
|
|
208
|
+
})), index.h("rebill-typography", { key: 'cdc1f6e8824cec829d63b86951b787a42e51590a', variant: "body2", color: colorClassMapper.COLORS_ENUM.PRIMARY_DARK_TEXT }, i18n_service.I18nService.translate('paymentMethods.bank_transfer'))))))), index.h("div", { key: 'ae4594811c441f28816ab96b1541d52bf6ccb581', class: "renewal-success-page__card-row" }, index.h("rebill-typography", { key: 'f182608a30ca95723f525c2f412dba6b913fd31a', variant: "body2", color: colorClassMapper.COLORS_ENUM.SECONDARY }, i18n_service.I18nService.translate('processing.paymentDate')), index.h("rebill-typography", { key: '8274d6f30d424022d7572f09542abd4d3cc26102', variant: "body2", color: colorClassMapper.COLORS_ENUM.PRIMARY_DARK_TEXT }, dateFormatter.formatDateTime(this.paymentDate || this.getPaymentDate()) || '')), index.h("div", { key: 'cc8a1e805cdbe2a059e0d3d55ac00ad9a5a6c54b', class: "renewal-success-page__card-row" }, index.h("rebill-typography", { key: '2c27cda2c104b58dc9cd3cdb0d5e34d4d2de776d', variant: "body2", color: colorClassMapper.COLORS_ENUM.SECONDARY }, i18n_service.I18nService.translate('processing.paymentEmail')), index.h("rebill-typography", { key: '0848731cf49df91c67630dc074d2cd5b1a23d2c0', variant: "body2", color: colorClassMapper.COLORS_ENUM.PRIMARY_DARK_TEXT }, renewal_store.renewalState.data.subscription.customerEmail)), index.h("div", { key: 'c2ca80947dae7e8650a14466501601252e389ede', class: "renewal-success-page__card-row" }, index.h("rebill-typography", { key: 'aad476e68218021d5b329c67f5e4a3d2d0cf8408', variant: "body2", color: colorClassMapper.COLORS_ENUM.SECONDARY }, i18n_service.I18nService.translate('processing.paymentReference')), index.h("rebill-typography", { key: '5805602cd60f1a597dab5f3b08936aab1f413413', variant: "body2", color: colorClassMapper.COLORS_ENUM.PRIMARY_DARK_TEXT, class: "renewal-success-page__reference-number" }, this.referenceNumber || ''))), index.h("div", { key: '08ddc28d25d2a44fe7f5967310c1d85691411344', class: "renewal-success-page__info-card" }, index.h("rebill-typography", { key: '4169af6ef1a19ca4f803a2f40698038eba00fab5', variant: "subtitle-bold", color: colorClassMapper.COLORS_ENUM.PRIMARY_DARK_TEXT }, i18n_service.I18nService.translate('processing.purchaseDetails')), index.h("div", { key: '53bb4e1ec2bfaf7978cc130c4b695b821b1a047f', class: "renewal-success-page__card-row" }, index.h("rebill-typography", { key: '06b15d3b19eb904ca807533c2d1c09d35987e876', variant: "body2", color: colorClassMapper.COLORS_ENUM.SECONDARY }, i18n_service.I18nService.translate('processing.purchaseDetail')), index.h("rebill-typography", { key: '75b11c207c212ecfb8b8e534055fed63284e04f4', variant: "body2", color: colorClassMapper.COLORS_ENUM.PRIMARY_DARK_TEXT }, renewal_store.renewalState.data.subscription.name[0]?.text || 'Subscription')), index.h("div", { key: 'd708351cd149371409dc1463ea4cc50c89483afd', class: "renewal-success-page__card-row" }, index.h("rebill-typography", { key: '466df181658f791dcdab0f90f2b3b4273b4d52d5', variant: "body2", color: colorClassMapper.COLORS_ENUM.SECONDARY }, i18n_service.I18nService.translate('processing.purchaseSubtotal')), index.h("rebill-typography", { key: '2075bf46e03956f38d10a1be0e81a4b376f8890a', variant: "body2", color: colorClassMapper.COLORS_ENUM.PRIMARY_DARK_TEXT }, this.getFormattedSubtotal())), index.h("div", { key: '8f303e0df89e32e81701d35893eaf52e9b1fb292', class: "renewal-success-page__card-row" }, index.h("rebill-typography", { key: '5692c09557b35fb139e1bd7e4fe058ae6a3710f6', variant: "body2", color: colorClassMapper.COLORS_ENUM.SECONDARY }, i18n_service.I18nService.translate('processing.purchaseMontoTotal')), index.h("div", { key: 'c53f7ff474c7fbb496c57ed682bcfd72952efe19', class: "renewal-success-page__total-amount-container" }, index.h("rebill-typography", { key: 'c80499907d5b09f9672295cd0a455c86ad4769f6', variant: "body2", color: colorClassMapper.COLORS_ENUM.PRIMARY_DARK_TEXT }, this.getFormattedTotal()))), index.h("div", { key: '634c3dd9943445daa4e22f25e967d9d87626cec3', class: "renewal-success-page__card-divider" }), index.h("div", { key: '85242693ccd3b20d4185969db706e189522d57e2', class: "renewal-success-page__download-container" }, index.h("svg", { key: 'ce9a62f0dbef94f68bb6123c41a03b8d7dd1882e', class: "download-icon", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { key: '08d9eb758104099b0659f18ce923e113e1bd6545', d: "M13.498 9.83333V12.1667C13.498 12.903 12.9011 13.5 12.1647 13.5H3.83138C3.095 13.5 2.49805 12.903 2.49805 12.1667V9.83333M7.99804 10V2.5M7.99804 10L5.66471 7.66667M7.99804 10L10.3314 7.66667", stroke: "currentColor", "stroke-linecap": "round", "stroke-linejoin": "round" })), index.h("rebill-button", { key: '87939ff2ac53d1846765a75950bb2f83fef0a297', type: "button", variant: "download", size: "small", onClick: this.handleDownloadReceipt }, index.h("rebill-typography", { key: '71f24c5a35d00b90f7c7276fffd99799bf458f49', variant: "overline", color: colorClassMapper.COLORS_ENUM.PRIMARY_DARK_TEXT }, i18n_service.I18nService.translate('processing.download')))), index.h("div", { key: 'f6298572d821d8c71e432c5218ef505dfcab0b13', class: "renewal-success-page__contact-info" }, index.h("rebill-typography", { key: '783e48675a837e12359795342de5220344c4a534', variant: "information-text", color: colorClassMapper.COLORS_ENUM.SECONDARY }, i18n_service.I18nService.translate('processing.downloadDescription')))))));
|
|
209
209
|
}
|
|
210
210
|
};
|
|
211
211
|
RenewalSuccessPage.style = renewalSuccessPageCss;
|
|
@@ -222,6 +222,15 @@ const RenewalSummary = class {
|
|
|
222
222
|
'details',
|
|
223
223
|
'summary',
|
|
224
224
|
];
|
|
225
|
+
totalAmount;
|
|
226
|
+
subscriptionTitle;
|
|
227
|
+
subscriptionAmount;
|
|
228
|
+
nextChargeDate;
|
|
229
|
+
frequency;
|
|
230
|
+
currency;
|
|
231
|
+
couponCode;
|
|
232
|
+
discountAmount;
|
|
233
|
+
discountPercentage;
|
|
225
234
|
componentWillLoad() {
|
|
226
235
|
i18n_service.instance.on('languageChanged', this.handleLanguageChange);
|
|
227
236
|
}
|
|
@@ -231,12 +240,6 @@ const RenewalSummary = class {
|
|
|
231
240
|
handleLanguageChange = () => {
|
|
232
241
|
this.forceUpdate = this.forceUpdate + 1;
|
|
233
242
|
};
|
|
234
|
-
totalAmount;
|
|
235
|
-
subscriptionTitle;
|
|
236
|
-
subscriptionAmount;
|
|
237
|
-
nextChargeDate;
|
|
238
|
-
frequency;
|
|
239
|
-
currency;
|
|
240
243
|
getFrequencyText() {
|
|
241
244
|
if (!this.frequency || !this.frequency.period)
|
|
242
245
|
return '';
|
|
@@ -245,8 +248,28 @@ const RenewalSummary = class {
|
|
|
245
248
|
const translationKey = `summary.${period}`;
|
|
246
249
|
return i18n_service.I18nService.translate(translationKey, { count });
|
|
247
250
|
}
|
|
251
|
+
getDiscountAmount() {
|
|
252
|
+
const amountDiscount = Math.max(0, this.discountAmount);
|
|
253
|
+
if (amountDiscount > 0) {
|
|
254
|
+
return amountDiscount;
|
|
255
|
+
}
|
|
256
|
+
const percentage = this.discountPercentage;
|
|
257
|
+
if (percentage && percentage > 0) {
|
|
258
|
+
const base = this.totalAmount;
|
|
259
|
+
const percentageDiscount = (base * percentage) / 100;
|
|
260
|
+
return Math.max(0, percentageDiscount);
|
|
261
|
+
}
|
|
262
|
+
return 0;
|
|
263
|
+
}
|
|
264
|
+
getFinalAmount() {
|
|
265
|
+
const final = this.totalAmount - this.getDiscountAmount();
|
|
266
|
+
return Math.max(0, final);
|
|
267
|
+
}
|
|
268
|
+
hasDiscount() {
|
|
269
|
+
return this.getDiscountAmount() > 0;
|
|
270
|
+
}
|
|
248
271
|
renderHeader = () => {
|
|
249
|
-
return (index.h("div", { class: "header" }, index.h("p", { class: "title" }, i18n_service.I18nService.translate('renewal.title')), index.h("p", { class: "amount" }, i18n_service.formatAmount(this.
|
|
272
|
+
return (index.h("div", { class: "header" }, index.h("p", { class: "title" }, i18n_service.I18nService.translate('renewal.title')), index.h("p", { class: "amount" }, index.h("span", { class: "total-amount" }, i18n_service.formatAmount(this.getFinalAmount(), this.currency)), ' ', index.h("span", { class: "per" }, "/ ", this.getFrequencyText().toLowerCase()))));
|
|
250
273
|
};
|
|
251
274
|
renderInfoRow = (label, value) => {
|
|
252
275
|
return (index.h("div", { class: "row" }, index.h("div", { class: "left" }, label), index.h("div", { class: "right" }, value)));
|
|
@@ -260,11 +283,16 @@ const RenewalSummary = class {
|
|
|
260
283
|
renderSubtotal = () => {
|
|
261
284
|
return this.renderInfoRow(i18n_service.I18nService.translate('renewal.subtotal'), i18n_service.formatAmount(this.totalAmount, this.currency));
|
|
262
285
|
};
|
|
286
|
+
renderDiscount = () => {
|
|
287
|
+
if (!this.hasDiscount())
|
|
288
|
+
return null;
|
|
289
|
+
return (index.h("div", { class: "row" }, index.h("div", { class: "left" }, i18n_service.I18nService.translate('summary.discount')), index.h("div", { class: "right discount-chip-wrapper" }, index.h("discount-coupon", { displayMode: "readonly", readonlyCouponCode: this.couponCode || undefined, readonlyDiscountAmount: this.getDiscountAmount(), readonlyCurrency: this.currency }))));
|
|
290
|
+
};
|
|
263
291
|
renderTotal = () => {
|
|
264
|
-
return (index.h("div", { class: "total-row" }, index.h("div", { class: "left" }, i18n_service.I18nService.translate('renewal.totalToRenew')), index.h("div", { class: "right" }, i18n_service.formatAmount(this.
|
|
292
|
+
return (index.h("div", { class: "total-row" }, index.h("div", { class: "left" }, i18n_service.I18nService.translate('renewal.totalToRenew')), index.h("div", { class: "right" }, i18n_service.formatAmount(this.getFinalAmount(), this.currency))));
|
|
265
293
|
};
|
|
266
294
|
renderDesktop = () => {
|
|
267
|
-
return (index.h("div", { class: "wrapper" }, this.renderHeader(), index.h("div", { class: "info" }, index.h("div", { class: "row" }, index.h("div", { class: "" }, i18n_service.I18nService.translate('renewal.subscriptionDetails'))), this.renderProduct(), this.renderNextRenewal(), this.renderSubtotal()), this.renderTotal()));
|
|
295
|
+
return (index.h("div", { class: "wrapper" }, this.renderHeader(), index.h("div", { class: "info" }, index.h("div", { class: "row" }, index.h("div", { class: "" }, i18n_service.I18nService.translate('renewal.subscriptionDetails'))), this.renderProduct(), this.renderNextRenewal(), this.renderSubtotal(), this.renderDiscount()), this.renderTotal()));
|
|
268
296
|
};
|
|
269
297
|
render() {
|
|
270
298
|
if (this.displayedComponents.includes('header') &&
|
|
@@ -279,7 +307,7 @@ const RenewalSummary = class {
|
|
|
279
307
|
return (index.h("collapsible-card", { header: i18n_service.I18nService.translate('summary.details') }, this.renderProduct(), this.renderNextRenewal()));
|
|
280
308
|
}
|
|
281
309
|
if (this.displayedComponents.includes('summary')) {
|
|
282
|
-
return (index.h("collapsible-card", { header: i18n_service.I18nService.translate('summary.summary') }, this.renderInfoRow(this.subscriptionTitle, '1 x ' + i18n_service.formatAmount(this.subscriptionAmount, this.currency)), this.renderSubtotal(), index.h("rebill-divider", null), this.renderInfoRow(i18n_service.I18nService.translate('renewal.totalToRenew'), i18n_service.formatAmount(this.
|
|
310
|
+
return (index.h("collapsible-card", { header: i18n_service.I18nService.translate('summary.summary') }, this.renderInfoRow(this.subscriptionTitle, '1 x ' + i18n_service.formatAmount(this.subscriptionAmount, this.currency)), this.renderSubtotal(), this.renderDiscount(), index.h("rebill-divider", null), this.renderInfoRow(i18n_service.I18nService.translate('renewal.totalToRenew'), i18n_service.formatAmount(this.getFinalAmount(), this.currency))));
|
|
283
311
|
}
|
|
284
312
|
}
|
|
285
313
|
};
|
|
@@ -63,6 +63,9 @@ const initialRenewalState = {
|
|
|
63
63
|
currency: '',
|
|
64
64
|
country: '',
|
|
65
65
|
paymentMethods: [],
|
|
66
|
+
couponCode: null,
|
|
67
|
+
discountPercentage: 0,
|
|
68
|
+
discountedAmount: 0,
|
|
66
69
|
},
|
|
67
70
|
paymentMethods: [],
|
|
68
71
|
country: '',
|
|
@@ -197,6 +200,6 @@ class RenewalStore {
|
|
|
197
200
|
exports.RenewalStore = RenewalStore;
|
|
198
201
|
exports.onChange = onChange;
|
|
199
202
|
exports.renewalState = renewalState;
|
|
200
|
-
//# sourceMappingURL=renewal.store-
|
|
203
|
+
//# sourceMappingURL=renewal.store-BaH9Id4E.js.map
|
|
201
204
|
|
|
202
|
-
//# sourceMappingURL=renewal.store-
|
|
205
|
+
//# sourceMappingURL=renewal.store-BaH9Id4E.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renewal.store-BaH9Id4E.js","sources":["src/store/renewal.store.ts"],"sourcesContent":["import { createStore } from '@stencil/store';\nimport { SavedCard } from '../api/entities/cards/types';\nimport {\n CreateAPMCheckoutResponse,\n CreateCardCheckoutResponse,\n} from '../api/entities/checkout/types';\nimport { ENUM_INSTALLMENT_MODEL } from '../models/enums/installment.enum';\nimport { PAYMENT_METHOD_ENUM } from '../models/enums/payment-methods.enum';\nimport { RebillRenewalProps, RenewalSession } from '../models/renewal.model';\n\nexport interface RenewalSessionState {\n token: string;\n data: RenewalSession;\n form: {\n isLoading: boolean;\n selectedPaymentMethod?: PAYMENT_METHOD_ENUM;\n selectedCard?: SavedCard;\n cvv?: string;\n savedCards: SavedCard[];\n checkoutResponse?: CreateCardCheckoutResponse | CreateAPMCheckoutResponse | null;\n userIdentification?: {\n documentType?: string;\n documentNumber?: string;\n };\n selectedBankId?: string;\n };\n isInitialized: boolean;\n fetchingInstallments: boolean;\n cardMode?: 'input' | 'select' | null;\n deviceId?: string;\n providerKey?: string;\n}\n\nconst initialRenewalState: RenewalSessionState = {\n token: '',\n data: {\n id: '',\n cardId: '',\n cardTokenId: '',\n cardInformation: {\n brand: '',\n type: '',\n isoCountry: '',\n bank: '',\n lastFour: '',\n installments: {\n isAvailableInstallments: false,\n installments: [],\n selectedInstallment: undefined,\n },\n },\n subscription: {\n id: '',\n organizationId: '',\n status: '',\n name: [],\n description: [],\n planId: null,\n amount: 0,\n currency: '',\n isPriceFixed: false,\n targetCurrency: null,\n isProcessing: false,\n frequency: {\n count: 0,\n period: null,\n },\n repetitions: 0,\n currentRepetitions: 0,\n debitDay: null,\n type: '',\n lastChargeDate: '',\n nextChargeDate: '',\n remainingIterations: 0,\n customerId: '',\n customerName: '',\n customerEmail: '',\n paymentMethod: '',\n cardId: null,\n cardLastFour: null,\n trialPeriodDays: null,\n metadata: null,\n createdAt: '',\n },\n organization: {\n id: '',\n name: '',\n logoUrl: null,\n },\n price: {\n amount: 0,\n currency: '',\n country: '',\n paymentMethods: [],\n couponCode: null,\n discountPercentage: 0,\n discountedAmount: 0,\n },\n paymentMethods: [],\n country: '',\n createdAt: '',\n updatedAt: '',\n },\n form: {\n isLoading: false,\n savedCards: [],\n },\n isInitialized: false,\n fetchingInstallments: false,\n cardMode: 'select',\n};\n\nexport const { state: renewalState, onChange } =\n createStore<RenewalSessionState>(initialRenewalState);\n\nexport class RenewalStore {\n static initializeRenewal(renewalProps: RebillRenewalProps) {\n const { token, ...allProps } = renewalProps;\n renewalState.token = token;\n renewalState.data = allProps;\n renewalState.data.country = allProps.country;\n\n if (allProps.subscription?.cardId) {\n renewalState.data.cardId = allProps.subscription.cardId;\n }\n\n renewalState.isInitialized = true;\n }\n\n static setLoading(isLoading: boolean) {\n renewalState.form = {\n ...renewalState.form,\n isLoading,\n };\n }\n\n static setSelectedPaymentMethod(paymentMethod: PAYMENT_METHOD_ENUM) {\n renewalState.form = {\n ...renewalState.form,\n selectedPaymentMethod: paymentMethod,\n };\n }\n\n static setSelectedCard(card: SavedCard) {\n renewalState.form = {\n ...renewalState.form,\n selectedCard: card,\n };\n }\n\n static setCvv(cvv: string) {\n renewalState.form = {\n ...renewalState.form,\n cvv,\n };\n }\n\n static setSavedCards(cards: SavedCard[]) {\n renewalState.form = {\n ...renewalState.form,\n savedCards: cards,\n };\n }\n\n static setCheckoutResponse(response: CreateCardCheckoutResponse | CreateAPMCheckoutResponse) {\n renewalState.form = {\n ...renewalState.form,\n checkoutResponse: response,\n };\n }\n\n static setUserIdentification(identification: { documentType?: string; documentNumber?: string }) {\n renewalState.form = {\n ...renewalState.form,\n userIdentification: {\n ...renewalState.form.userIdentification,\n ...identification,\n },\n };\n }\n\n static clearRenewal() {\n renewalState.data = initialRenewalState.data;\n renewalState.form = initialRenewalState.form;\n renewalState.isInitialized = false;\n }\n\n static getRenewalState(): RenewalSessionState {\n return renewalState;\n }\n\n static setCardId(cardId: string) {\n renewalState.data.cardId = cardId;\n }\n\n static setCardTokenId(cardTokenId: string) {\n renewalState.data.cardTokenId = cardTokenId;\n }\n\n static setFetchingInstallments(fetchingInstallments: boolean) {\n renewalState.fetchingInstallments = fetchingInstallments;\n }\n\n static setCardInformation(cardInformation: {\n brand: string;\n type: string;\n isoCountry: string;\n bank: string;\n lastFour?: string;\n installments: {\n installments: {\n model: ENUM_INSTALLMENT_MODEL;\n cft: number;\n installment: number;\n totalAmount: number;\n installmentAmount: number;\n cftAmount: number;\n }[];\n };\n }) {\n if (cardInformation) {\n renewalState.data.cardInformation = {\n ...cardInformation,\n installments: {\n ...renewalState.data.cardInformation?.installments,\n installments: cardInformation.installments.installments,\n isAvailableInstallments: !!cardInformation.installments.installments.length,\n },\n };\n } else {\n renewalState.data.cardInformation = {\n brand: '',\n type: '',\n isoCountry: '',\n bank: '',\n lastFour: '',\n installments: {\n isAvailableInstallments: false,\n installments: [],\n selectedInstallment: undefined,\n },\n };\n }\n }\n\n static setSelectedBankId(bankId: string) {\n renewalState.form = {\n ...renewalState.form,\n selectedBankId: bankId,\n };\n }\n\n static setCardMode(cardMode: 'input' | 'select' | null) {\n renewalState.cardMode = cardMode;\n }\n\n static setDeviceId(deviceId: string) {\n renewalState.deviceId = deviceId;\n }\n\n static setProviderKey(providerKey: string) {\n renewalState.providerKey = providerKey;\n }\n}\n"],"names":["createStore"],"mappings":";;;;AAiCA,MAAM,mBAAmB,GAAwB;AAC/C,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,IAAI,EAAE;AACJ,QAAA,EAAE,EAAE,EAAE;AACN,QAAA,MAAM,EAAE,EAAE;AACV,QAAA,WAAW,EAAE,EAAE;AACf,QAAA,eAAe,EAAE;AACf,YAAA,KAAK,EAAE,EAAE;AACT,YAAA,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;AACjC,QAAA,YAAY,CAAC,QAAQ,GAAG,QAAQ;;IAGlC,OAAO,cAAc,CAAC,WAAmB,EAAA;AACvC,QAAA,YAAY,CAAC,WAAW,GAAG,WAAW;;AAEzC;;;;;;"}
|
|
@@ -54,7 +54,7 @@ const RootComponent = class {
|
|
|
54
54
|
i18n_service.SessionStore.setDiscount(null);
|
|
55
55
|
}
|
|
56
56
|
render() {
|
|
57
|
-
return (index.h("div", { key: '
|
|
57
|
+
return (index.h("div", { key: '564e1491e1df14c02c46df6840d4f615d83e1d31' }, index.h("div", { key: '2600d34a558565c7c45310e5349926958e025ef0', style: { display: 'flex', justifyContent: 'flex-end', padding: '1rem' } }, index.h("rebill-button", { key: '5fad0458517fceafcfab3fa2704206b61e528220', onClick: () => this.handleLanguageChange(this.currentLang === locales_enum.LOCALES_ENUM.EN ? locales_enum.LOCALES_ENUM.ES : locales_enum.LOCALES_ENUM.EN) }, this.currentLang === locales_enum.LOCALES_ENUM.EN ? 'Cambiar a Español' : 'Switch to English')), index.h("rebill-form", { key: '7cf4b4d03bdaf7169915336b34acb8dc42fd752b', validationSchema: this.validationSchema, initialData: this.formData, onSubmit: e => this.handleSubmit(e), onChange: e => this.handleChange(e), renderForm: ({ submit, formData: _formData, errors }) => (index.h("rebill-container", { maxWidth: "800px" }, index.h("h3", null, i18n_service.I18nService.translate('common.welcome')), index.h("rebill-input-text", { id: "nombre", label: "Nombre", placeholder: "Ingrese su nombre", error: errors.nombre }), index.h("rebill-input-text", { id: "apellido", label: "Apellido", placeholder: "Ingrese su apellido", error: errors.apellido }), index.h("rebill-input-select", { disabled: true, id: "pais", label: "Pa\u00EDs", error: errors.pais, options: [
|
|
58
58
|
{ label: 'Argentina', value: 'AR' },
|
|
59
59
|
{ label: 'Brasil', value: 'BR' },
|
|
60
60
|
{ label: 'Chile', value: 'CL' },
|
|
@@ -13,6 +13,10 @@ var ACTION_STATUS;
|
|
|
13
13
|
export class DiscountCoupon {
|
|
14
14
|
el;
|
|
15
15
|
hideLabel = false;
|
|
16
|
+
displayMode = 'editable';
|
|
17
|
+
readonlyCouponCode;
|
|
18
|
+
readonlyDiscountAmount;
|
|
19
|
+
readonlyCurrency;
|
|
16
20
|
couponCode = '';
|
|
17
21
|
actionStatus = ACTION_STATUS.NOT_APPLIED;
|
|
18
22
|
isLoading = false;
|
|
@@ -25,6 +29,9 @@ export class DiscountCoupon {
|
|
|
25
29
|
this.unsubscribeCurrentLocaleStore = SessionStore.onChange('currentLocale', () => {
|
|
26
30
|
this.currentLocale = sessionState.currentLocale;
|
|
27
31
|
});
|
|
32
|
+
if (this.readonlyCouponCode) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
28
35
|
if (sessionState.data.pricing.discountCouponCode &&
|
|
29
36
|
sessionState.data.pricing.discountAmount > 0) {
|
|
30
37
|
this.actionStatus = ACTION_STATUS.APPLIED;
|
|
@@ -37,6 +44,9 @@ export class DiscountCoupon {
|
|
|
37
44
|
}
|
|
38
45
|
}
|
|
39
46
|
componentDidUpdate() {
|
|
47
|
+
if (this.readonlyCouponCode) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
40
50
|
if (this.actionStatus === ACTION_STATUS.EDITING && this.inputRef) {
|
|
41
51
|
setTimeout(async () => {
|
|
42
52
|
const inputElement = await this.inputRef.getInputElement();
|
|
@@ -47,6 +57,8 @@ export class DiscountCoupon {
|
|
|
47
57
|
}
|
|
48
58
|
}
|
|
49
59
|
async onApplyCoupon() {
|
|
60
|
+
if (this.readonlyCouponCode)
|
|
61
|
+
return;
|
|
50
62
|
const sessionId = sessionState.data.sessionId;
|
|
51
63
|
if (!sessionId) {
|
|
52
64
|
return;
|
|
@@ -81,15 +93,26 @@ export class DiscountCoupon {
|
|
|
81
93
|
}
|
|
82
94
|
}
|
|
83
95
|
onCancelCoupon() {
|
|
96
|
+
if (this.readonlyCouponCode)
|
|
97
|
+
return;
|
|
84
98
|
this.actionStatus = ACTION_STATUS.NOT_APPLIED;
|
|
85
99
|
this.couponCode = '';
|
|
86
100
|
this.isError = false;
|
|
87
101
|
}
|
|
102
|
+
renderReadonlyView() {
|
|
103
|
+
if (!this.readonlyCouponCode && this.readonlyDiscountAmount) {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
return (h("div", { class: "coupon-chip coupon-chip--readonly" }, h("rebill-icon", { name: "tag-sale", size: "16px" }), h("div", { class: "coupon-content" }, h("rebill-typography", { variant: "overline", color: COLORS_ENUM.PRIMARY_DARK_TEXT }, this.readonlyCouponCode), this.readonlyDiscountAmount && (h("rebill-typography", { variant: "overline", color: COLORS_ENUM.GREEN }, "-$", formatAmountWithoutCurrency(this.readonlyDiscountAmount, this.readonlyCurrency))))));
|
|
107
|
+
}
|
|
88
108
|
render() {
|
|
89
|
-
|
|
109
|
+
if (this.readonlyCouponCode) {
|
|
110
|
+
return this.renderReadonlyView();
|
|
111
|
+
}
|
|
112
|
+
return (h("div", null, h("div", { class: "summary-row", style: {
|
|
90
113
|
alignItems: this.actionStatus === ACTION_STATUS.EDITING ? 'flex-start' : 'center',
|
|
91
114
|
display: 'flex',
|
|
92
|
-
} }, !this.hideLabel && (h("rebill-typography", {
|
|
115
|
+
} }, !this.hideLabel && (h("rebill-typography", { variant: "body2", style: { marginTop: this.actionStatus === ACTION_STATUS.EDITING ? '7px' : '0px' } }, I18nService.translate('discountCoupons.discount'))), this.actionStatus === ACTION_STATUS.NOT_APPLIED && (h("rebill-button", { variant: "filled", size: "small", theme: "primary-dark", onClick: () => (this.actionStatus = ACTION_STATUS.EDITING) }, I18nService.translate('discountCoupons.addDiscount'))), this.actionStatus === ACTION_STATUS.EDITING && (h("div", { class: "summary-row", style: { alignItems: 'flex-start', display: 'flex' } }, h("rebill-input-text", { ref: el => (this.inputRef = el), id: "discountCoupon", value: this.couponCode, placeholder: I18nService.translate('discountCoupons.addDiscount'), disabled: this.isLoading, error: this.isError ? I18nService.translate('discountCoupons.error') : '', clearable: true, uppercase: true, onInput: e => {
|
|
93
116
|
e.stopPropagation();
|
|
94
117
|
if (e.detail && e.detail.value !== undefined) {
|
|
95
118
|
this.couponCode = e.detail.value;
|
|
@@ -98,12 +121,12 @@ export class DiscountCoupon {
|
|
|
98
121
|
if (!this.couponCode.trim()) {
|
|
99
122
|
this.onCancelCoupon();
|
|
100
123
|
}
|
|
101
|
-
} }), h("rebill-button", {
|
|
124
|
+
} }), h("rebill-button", { variant: "filled", theme: "primary-dark", size: "small", loading: this.isLoading, disabled: this.isLoading || !this.couponCode.trim(), onClick: () => this.onApplyCoupon(), style: { marginTop: this.actionStatus === ACTION_STATUS.EDITING ? '3px' : '0px' } }, I18nService.translate('discountCoupons.apply')))), this.actionStatus === ACTION_STATUS.APPLIED && (h("div", { class: "coupon-chip" }, h("rebill-icon", { name: "tag-sale", size: "16px" }), h("div", { class: "coupon-content", onClick: () => (this.actionStatus = ACTION_STATUS.EDITING) }, h("rebill-typography", { variant: "overline", color: COLORS_ENUM.PRIMARY_DARK_TEXT }, sessionState.data.pricing.discountCouponCode), h("rebill-typography", { variant: "overline", color: COLORS_ENUM.GREEN }, "-$", formatAmountWithoutCurrency(sessionState.data.pricing.discountAmount, sessionState.data.pricing.currency))), h("div", { class: "coupon-close", onClick: () => {
|
|
102
125
|
this.actionStatus = ACTION_STATUS.NOT_APPLIED;
|
|
103
126
|
this.couponCode = '';
|
|
104
127
|
SessionStore.setDiscount(null);
|
|
105
128
|
this.discountApplied.emit(false);
|
|
106
|
-
} }, h("rebill-icon", {
|
|
129
|
+
} }, h("rebill-icon", { name: "x", size: "20px", color: COLORS_ENUM.PRIMARY_DARK_TEXT })))))));
|
|
107
130
|
}
|
|
108
131
|
static get is() { return "discount-coupon"; }
|
|
109
132
|
static get originalStyleUrls() {
|
|
@@ -137,6 +160,83 @@ export class DiscountCoupon {
|
|
|
137
160
|
"reflect": false,
|
|
138
161
|
"attribute": "hide-label",
|
|
139
162
|
"defaultValue": "false"
|
|
163
|
+
},
|
|
164
|
+
"displayMode": {
|
|
165
|
+
"type": "string",
|
|
166
|
+
"mutable": false,
|
|
167
|
+
"complexType": {
|
|
168
|
+
"original": "'editable' | 'readonly'",
|
|
169
|
+
"resolved": "\"editable\" | \"readonly\"",
|
|
170
|
+
"references": {}
|
|
171
|
+
},
|
|
172
|
+
"required": false,
|
|
173
|
+
"optional": false,
|
|
174
|
+
"docs": {
|
|
175
|
+
"tags": [],
|
|
176
|
+
"text": ""
|
|
177
|
+
},
|
|
178
|
+
"getter": false,
|
|
179
|
+
"setter": false,
|
|
180
|
+
"reflect": false,
|
|
181
|
+
"attribute": "display-mode",
|
|
182
|
+
"defaultValue": "'editable'"
|
|
183
|
+
},
|
|
184
|
+
"readonlyCouponCode": {
|
|
185
|
+
"type": "string",
|
|
186
|
+
"mutable": false,
|
|
187
|
+
"complexType": {
|
|
188
|
+
"original": "string",
|
|
189
|
+
"resolved": "string",
|
|
190
|
+
"references": {}
|
|
191
|
+
},
|
|
192
|
+
"required": false,
|
|
193
|
+
"optional": true,
|
|
194
|
+
"docs": {
|
|
195
|
+
"tags": [],
|
|
196
|
+
"text": ""
|
|
197
|
+
},
|
|
198
|
+
"getter": false,
|
|
199
|
+
"setter": false,
|
|
200
|
+
"reflect": false,
|
|
201
|
+
"attribute": "readonly-coupon-code"
|
|
202
|
+
},
|
|
203
|
+
"readonlyDiscountAmount": {
|
|
204
|
+
"type": "number",
|
|
205
|
+
"mutable": false,
|
|
206
|
+
"complexType": {
|
|
207
|
+
"original": "number",
|
|
208
|
+
"resolved": "number",
|
|
209
|
+
"references": {}
|
|
210
|
+
},
|
|
211
|
+
"required": false,
|
|
212
|
+
"optional": true,
|
|
213
|
+
"docs": {
|
|
214
|
+
"tags": [],
|
|
215
|
+
"text": ""
|
|
216
|
+
},
|
|
217
|
+
"getter": false,
|
|
218
|
+
"setter": false,
|
|
219
|
+
"reflect": false,
|
|
220
|
+
"attribute": "readonly-discount-amount"
|
|
221
|
+
},
|
|
222
|
+
"readonlyCurrency": {
|
|
223
|
+
"type": "string",
|
|
224
|
+
"mutable": false,
|
|
225
|
+
"complexType": {
|
|
226
|
+
"original": "string",
|
|
227
|
+
"resolved": "string",
|
|
228
|
+
"references": {}
|
|
229
|
+
},
|
|
230
|
+
"required": false,
|
|
231
|
+
"optional": true,
|
|
232
|
+
"docs": {
|
|
233
|
+
"tags": [],
|
|
234
|
+
"text": ""
|
|
235
|
+
},
|
|
236
|
+
"getter": false,
|
|
237
|
+
"setter": false,
|
|
238
|
+
"reflect": false,
|
|
239
|
+
"attribute": "readonly-currency"
|
|
140
240
|
}
|
|
141
241
|
};
|
|
142
242
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discount-coupon.js","sourceRoot":"","sources":["../../../../src/components/checkout/discount-coupon/discount-coupon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACxF,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAEhE,IAAK,aAIJ;AAJD,WAAK,aAAa;IAChB,oCAAmB,CAAA;IACnB,oCAAmB,CAAA;IACnB,4CAA2B,CAAA;AAC7B,CAAC,EAJI,aAAa,KAAb,aAAa,QAIjB;AAOD,MAAM,OAAO,cAAc;IACd,EAAE,CAAc;IACnB,SAAS,GAAY,KAAK,CAAC;IAC1B,UAAU,GAAW,EAAE,CAAC;IACxB,YAAY,GAAkB,aAAa,CAAC,WAAW,CAAC;IACxD,SAAS,GAAY,KAAK,CAAC;IAC3B,OAAO,GAAY,KAAK,CAAC;IACzB,aAAa,GAAW,YAAY,C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AAiB,IACvE,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAC3B;wBACpB,0EAAmB,OAAO,EAAC,UAAU,EAAC,KAAK,EAAE,WAAW,CAAC,KAAK;;4BAE3D,2BAA2B,CAC1B,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,EACxC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CACnC,CACiB,CAChB;oBACN,4DACE,KAAK,EAAC,cAAc,EACpB,OAAO,EAAE,GAAG,EAAE;4BACZ,IAAI,CAAC,YAAY,GAAG,aAAa,CAAC,WAAW,CAAC;4BAC9C,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;4BACrB,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;4BAC/B,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;wBACnC,CAAC;wBAED,oEAAa,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,WAAW,CAAC,iBAAiB,GAAI,CACtE,CACF,CACP,CACG,CACF,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Prop, State } from '@stencil/core';\nimport { api } from '../../../api';\nimport { I18nService } from '../../../i18n/i18n.service';\nimport { sessionState, SessionStore } from '../../../store/session.store';\nimport { formatAmountWithoutCurrency } from '../../../utils';\nimport { COLORS_ENUM } from '../../../utils/color-class-mapper';\n\nenum ACTION_STATUS {\n EDITING = 'editing',\n APPLIED = 'applied',\n NOT_APPLIED = 'not_applied',\n}\n\n@Component({\n tag: 'discount-coupon',\n styleUrl: 'discount-coupon.css',\n shadow: false,\n})\nexport class DiscountCoupon {\n @Element() el: HTMLElement;\n @Prop() hideLabel: boolean = false;\n @State() couponCode: string = '';\n @State() actionStatus: ACTION_STATUS = ACTION_STATUS.NOT_APPLIED;\n @State() isLoading: boolean = false;\n @State() isError: boolean = false;\n @State() currentLocale: string = sessionState.currentLocale;\n @Event() discountApplied: EventEmitter<boolean>;\n private inputRef: HTMLRebillInputTextElement;\n private unsubscribeCurrentLocaleStore?: () => void;\n\n componentWillLoad() {\n this.unsubscribeCurrentLocaleStore = SessionStore.onChange('currentLocale', () => {\n this.currentLocale = sessionState.currentLocale;\n });\n\n if (\n sessionState.data.pricing.discountCouponCode &&\n sessionState.data.pricing.discountAmount > 0\n ) {\n this.actionStatus = ACTION_STATUS.APPLIED;\n this.couponCode = sessionState.data.pricing.discountCouponCode;\n }\n }\n\n disconnectedCallback() {\n if (this.unsubscribeCurrentLocaleStore) {\n this.unsubscribeCurrentLocaleStore();\n }\n }\n componentDidUpdate() {\n if (this.actionStatus === ACTION_STATUS.EDITING && this.inputRef) {\n setTimeout(async () => {\n const inputElement = await this.inputRef.getInputElement();\n if (inputElement) {\n inputElement.focus();\n }\n }, 0);\n }\n }\n\n private async onApplyCoupon() {\n const sessionId = sessionState.data.sessionId;\n if (!sessionId) {\n return;\n }\n this.isLoading = true;\n try {\n const response = await api.discountCoupon.applyDiscountCoupon({\n couponCode: this.couponCode,\n quantity: 1,\n sessionId: sessionId,\n organizationId: sessionState.data.organization.id,\n });\n this.actionStatus = ACTION_STATUS.APPLIED;\n SessionStore.setDiscount({\n couponCode: this.couponCode,\n amount: response.amount,\n discountType: response.discountType,\n discountAmount: response.discountedAmount,\n discountedPercentage: response?.discountedPercentage || 0,\n discountDuration: response?.discountDuration || null,\n });\n this.discountApplied.emit(true);\n } catch (error) {\n this.actionStatus = ACTION_STATUS.EDITING;\n this.discountApplied.emit(false);\n this.isError = true;\n SessionStore.setDiscount(null);\n } finally {\n this.isLoading = false;\n }\n }\n\n private onCancelCoupon() {\n this.actionStatus = ACTION_STATUS.NOT_APPLIED;\n this.couponCode = '';\n this.isError = false;\n }\n\n render() {\n return (\n <div>\n <div\n class=\"summary-row\"\n style={{\n alignItems: this.actionStatus === ACTION_STATUS.EDITING ? 'flex-start' : 'center',\n display: 'flex',\n }}\n >\n {!this.hideLabel && (\n <rebill-typography\n variant=\"body2\"\n style={{ marginTop: this.actionStatus === ACTION_STATUS.EDITING ? '7px' : '0px' }}\n >\n {I18nService.translate('discountCoupons.discount')}\n </rebill-typography>\n )}\n {this.actionStatus === ACTION_STATUS.NOT_APPLIED && (\n <rebill-button\n variant=\"filled\"\n size=\"small\"\n theme=\"primary-dark\"\n onClick={() => (this.actionStatus = ACTION_STATUS.EDITING)}\n >\n {I18nService.translate('discountCoupons.addDiscount')}\n </rebill-button>\n )}\n {this.actionStatus === ACTION_STATUS.EDITING && (\n <div class=\"summary-row\" style={{ alignItems: 'flex-start', display: 'flex' }}>\n <rebill-input-text\n ref={el => (this.inputRef = el)}\n id=\"discountCoupon\"\n value={this.couponCode}\n placeholder={I18nService.translate('discountCoupons.addDiscount')}\n disabled={this.isLoading}\n error={this.isError ? I18nService.translate('discountCoupons.error') : ''}\n clearable={true}\n uppercase={true}\n onInput={e => {\n e.stopPropagation();\n if (e.detail && e.detail.value !== undefined) {\n this.couponCode = e.detail.value;\n }\n }}\n onBlur={() => {\n if (!this.couponCode.trim()) {\n this.onCancelCoupon();\n }\n }}\n />\n <rebill-button\n variant=\"filled\"\n theme=\"primary-dark\"\n size=\"small\"\n loading={this.isLoading}\n disabled={this.isLoading || !this.couponCode.trim()}\n onClick={() => this.onApplyCoupon()}\n style={{ marginTop: this.actionStatus === ACTION_STATUS.EDITING ? '3px' : '0px' }}\n >\n {I18nService.translate('discountCoupons.apply')}\n </rebill-button>\n </div>\n )}\n {this.actionStatus === ACTION_STATUS.APPLIED && (\n <div class=\"coupon-chip\">\n <rebill-icon name=\"tag-sale\" size=\"16px\" />\n <div\n class=\"coupon-content\"\n onClick={() => (this.actionStatus = ACTION_STATUS.EDITING)}\n >\n <rebill-typography variant=\"overline\" color={COLORS_ENUM.PRIMARY_DARK_TEXT}>\n {sessionState.data.pricing.discountCouponCode}\n </rebill-typography>\n <rebill-typography variant=\"overline\" color={COLORS_ENUM.GREEN}>\n -$\n {formatAmountWithoutCurrency(\n sessionState.data.pricing.discountAmount,\n sessionState.data.pricing.currency,\n )}\n </rebill-typography>\n </div>\n <div\n class=\"coupon-close\"\n onClick={() => {\n this.actionStatus = ACTION_STATUS.NOT_APPLIED;\n this.couponCode = '';\n SessionStore.setDiscount(null);\n this.discountApplied.emit(false);\n }}\n >\n <rebill-icon name=\"x\" size=\"20px\" color={COLORS_ENUM.PRIMARY_DARK_TEXT} />\n </div>\n </div>\n )}\n </div>\n </div>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"discount-coupon.js","sourceRoot":"","sources":["../../../../src/components/checkout/discount-coupon/discount-coupon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACxF,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAEhE,IAAK,aAIJ;AAJD,WAAK,aAAa;IAChB,oCAAmB,CAAA;IACnB,oCAAmB,CAAA;IACnB,4CAA2B,CAAA;AAC7B,CAAC,EAJI,aAAa,KAAb,aAAa,QAIjB;AAOD,MAAM,OAAO,cAAc;IACd,EAAE,CAAc;IACnB,SAAS,GAAY,KAAK,CAAC;IAC3B,WAAW,GAA4B,UAAU,CAAC;IAClD,kBAAkB,CAAU;IAC5B,sBAAsB,CAAU;IAChC,gBAAgB,CAAU;IACzB,UAAU,GAAW,EAAE,CAAC;IACxB,YAAY,GAAkB,aAAa,CAAC,WAAW,CAA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CAAC,OAAO,CAAC,QAAQ,CACnC,CACiB,CAChB;oBACN,WACE,KAAK,EAAC,cAAc,EACpB,OAAO,EAAE,GAAG,EAAE;4BACZ,IAAI,CAAC,YAAY,GAAG,aAAa,CAAC,WAAW,CAAC;4BAC9C,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;4BACrB,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;4BAC/B,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;wBACnC,CAAC;wBAED,mBAAa,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,WAAW,CAAC,iBAAiB,GAAI,CACtE,CACF,CACP,CACG,CACF,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Prop, State } from '@stencil/core';\nimport { api } from '../../../api';\nimport { I18nService } from '../../../i18n/i18n.service';\nimport { sessionState, SessionStore } from '../../../store/session.store';\nimport { formatAmountWithoutCurrency } from '../../../utils';\nimport { COLORS_ENUM } from '../../../utils/color-class-mapper';\n\nenum ACTION_STATUS {\n EDITING = 'editing',\n APPLIED = 'applied',\n NOT_APPLIED = 'not_applied',\n}\n\n@Component({\n tag: 'discount-coupon',\n styleUrl: 'discount-coupon.css',\n shadow: false,\n})\nexport class DiscountCoupon {\n @Element() el: HTMLElement;\n @Prop() hideLabel: boolean = false;\n @Prop() displayMode: 'editable' | 'readonly' = 'editable';\n @Prop() readonlyCouponCode?: string;\n @Prop() readonlyDiscountAmount?: number;\n @Prop() readonlyCurrency?: string;\n @State() couponCode: string = '';\n @State() actionStatus: ACTION_STATUS = ACTION_STATUS.NOT_APPLIED;\n @State() isLoading: boolean = false;\n @State() isError: boolean = false;\n @State() currentLocale: string = sessionState.currentLocale;\n @Event() discountApplied: EventEmitter<boolean>;\n private inputRef: HTMLRebillInputTextElement;\n private unsubscribeCurrentLocaleStore?: () => void;\n\n componentWillLoad() {\n this.unsubscribeCurrentLocaleStore = SessionStore.onChange('currentLocale', () => {\n this.currentLocale = sessionState.currentLocale;\n });\n\n if (this.readonlyCouponCode) {\n return;\n }\n\n if (\n sessionState.data.pricing.discountCouponCode &&\n sessionState.data.pricing.discountAmount > 0\n ) {\n this.actionStatus = ACTION_STATUS.APPLIED;\n this.couponCode = sessionState.data.pricing.discountCouponCode;\n }\n }\n\n disconnectedCallback() {\n if (this.unsubscribeCurrentLocaleStore) {\n this.unsubscribeCurrentLocaleStore();\n }\n }\n componentDidUpdate() {\n if (this.readonlyCouponCode) {\n return;\n }\n\n if (this.actionStatus === ACTION_STATUS.EDITING && this.inputRef) {\n setTimeout(async () => {\n const inputElement = await this.inputRef.getInputElement();\n if (inputElement) {\n inputElement.focus();\n }\n }, 0);\n }\n }\n\n private async onApplyCoupon() {\n if (this.readonlyCouponCode) return;\n const sessionId = sessionState.data.sessionId;\n if (!sessionId) {\n return;\n }\n this.isLoading = true;\n try {\n const response = await api.discountCoupon.applyDiscountCoupon({\n couponCode: this.couponCode,\n quantity: 1,\n sessionId: sessionId,\n organizationId: sessionState.data.organization.id,\n });\n this.actionStatus = ACTION_STATUS.APPLIED;\n SessionStore.setDiscount({\n couponCode: this.couponCode,\n amount: response.amount,\n discountType: response.discountType,\n discountAmount: response.discountedAmount,\n discountedPercentage: response?.discountedPercentage || 0,\n discountDuration: response?.discountDuration || null,\n });\n this.discountApplied.emit(true);\n } catch (error) {\n this.actionStatus = ACTION_STATUS.EDITING;\n this.discountApplied.emit(false);\n this.isError = true;\n SessionStore.setDiscount(null);\n } finally {\n this.isLoading = false;\n }\n }\n\n private onCancelCoupon() {\n if (this.readonlyCouponCode) return;\n this.actionStatus = ACTION_STATUS.NOT_APPLIED;\n this.couponCode = '';\n this.isError = false;\n }\n\n private renderReadonlyView() {\n if (!this.readonlyCouponCode && this.readonlyDiscountAmount) {\n return null;\n }\n\n return (\n <div class=\"coupon-chip coupon-chip--readonly\">\n <rebill-icon name=\"tag-sale\" size=\"16px\" />\n <div class=\"coupon-content\">\n <rebill-typography variant=\"overline\" color={COLORS_ENUM.PRIMARY_DARK_TEXT}>\n {this.readonlyCouponCode}\n </rebill-typography>\n {this.readonlyDiscountAmount && (\n <rebill-typography variant=\"overline\" color={COLORS_ENUM.GREEN}>\n -$\n {formatAmountWithoutCurrency(\n this.readonlyDiscountAmount,\n this.readonlyCurrency as any,\n )}\n </rebill-typography>\n )}\n </div>\n </div>\n );\n }\n\n render() {\n if (this.readonlyCouponCode) {\n return this.renderReadonlyView();\n }\n\n return (\n <div>\n <div\n class=\"summary-row\"\n style={{\n alignItems: this.actionStatus === ACTION_STATUS.EDITING ? 'flex-start' : 'center',\n display: 'flex',\n }}\n >\n {!this.hideLabel && (\n <rebill-typography\n variant=\"body2\"\n style={{ marginTop: this.actionStatus === ACTION_STATUS.EDITING ? '7px' : '0px' }}\n >\n {I18nService.translate('discountCoupons.discount')}\n </rebill-typography>\n )}\n {this.actionStatus === ACTION_STATUS.NOT_APPLIED && (\n <rebill-button\n variant=\"filled\"\n size=\"small\"\n theme=\"primary-dark\"\n onClick={() => (this.actionStatus = ACTION_STATUS.EDITING)}\n >\n {I18nService.translate('discountCoupons.addDiscount')}\n </rebill-button>\n )}\n {this.actionStatus === ACTION_STATUS.EDITING && (\n <div class=\"summary-row\" style={{ alignItems: 'flex-start', display: 'flex' }}>\n <rebill-input-text\n ref={el => (this.inputRef = el)}\n id=\"discountCoupon\"\n value={this.couponCode}\n placeholder={I18nService.translate('discountCoupons.addDiscount')}\n disabled={this.isLoading}\n error={this.isError ? I18nService.translate('discountCoupons.error') : ''}\n clearable={true}\n uppercase={true}\n onInput={e => {\n e.stopPropagation();\n if (e.detail && e.detail.value !== undefined) {\n this.couponCode = e.detail.value;\n }\n }}\n onBlur={() => {\n if (!this.couponCode.trim()) {\n this.onCancelCoupon();\n }\n }}\n />\n <rebill-button\n variant=\"filled\"\n theme=\"primary-dark\"\n size=\"small\"\n loading={this.isLoading}\n disabled={this.isLoading || !this.couponCode.trim()}\n onClick={() => this.onApplyCoupon()}\n style={{ marginTop: this.actionStatus === ACTION_STATUS.EDITING ? '3px' : '0px' }}\n >\n {I18nService.translate('discountCoupons.apply')}\n </rebill-button>\n </div>\n )}\n {this.actionStatus === ACTION_STATUS.APPLIED && (\n <div class=\"coupon-chip\">\n <rebill-icon name=\"tag-sale\" size=\"16px\" />\n <div\n class=\"coupon-content\"\n onClick={() => (this.actionStatus = ACTION_STATUS.EDITING)}\n >\n <rebill-typography variant=\"overline\" color={COLORS_ENUM.PRIMARY_DARK_TEXT}>\n {sessionState.data.pricing.discountCouponCode}\n </rebill-typography>\n <rebill-typography variant=\"overline\" color={COLORS_ENUM.GREEN}>\n -$\n {formatAmountWithoutCurrency(\n sessionState.data.pricing.discountAmount,\n sessionState.data.pricing.currency,\n )}\n </rebill-typography>\n </div>\n <div\n class=\"coupon-close\"\n onClick={() => {\n this.actionStatus = ACTION_STATUS.NOT_APPLIED;\n this.couponCode = '';\n SessionStore.setDiscount(null);\n this.discountApplied.emit(false);\n }}\n >\n <rebill-icon name=\"x\" size=\"20px\" color={COLORS_ENUM.PRIMARY_DARK_TEXT} />\n </div>\n </div>\n )}\n </div>\n </div>\n );\n }\n}\n"]}
|
|
@@ -94,17 +94,17 @@ export class Otp {
|
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
96
|
render() {
|
|
97
|
-
return (h("div", { key: '
|
|
97
|
+
return (h("div", { key: 'a60f4778e7b8c9d12db4f91f1052efb529421f61', class: "otp__otp-container" }, h("div", { key: '27f07a33bb7f89884e9f7c7451dde4d45ec70fa0', class: "otp__user-information" }, h("div", { key: 'dff426cbad1d5104cb190b577b62ace1f80c0397', class: "otp__otp-description-container" }, h("rebill-typography", { key: '46056e3d98013ec69b2f94ce09453741393a84d5', variant: "body2", class: "otp__otp-description" }, I18nService.translate('otp.description')), h("rebill-typography", { key: '1ce410c937cc81a6d3d94ba9ba324463c17d2e1a', variant: "subtitle-bold", class: "otp__otp-description-digits" }, ' ', h("strong", { key: '5cb7f9fc7dc6bcb884719bc6dfb36d46d67e7c3b' }, I18nService.translate('otp.descriptionDigits')), ' '), h("rebill-typography", { key: '08374eda7ff4ae8deadfec171a086d31c4c9160d', variant: "body2", class: "otp__otp-description-email" }, I18nService.translate('otp.descriptionEmail'))), h("rebill-typography", { key: '3bca7a94df9819bd9a235c0963b2190a0f7dcb2f', variant: "body2", class: "otp__otp-email-line" }, sessionState.data.userInformation.email, ' ', !sessionState.data.prefilledData?.email && (h("span", { key: '53ac959b54950773538dbce0c236bbd2a75fa906', class: "otp__change-email", onClick: () => {
|
|
98
98
|
this.otpValue = '';
|
|
99
99
|
this.error = false;
|
|
100
100
|
this.returnForm.emit(false);
|
|
101
|
-
} }, I18nService.translate('otp.change'))))), h("input-otp", { key: '
|
|
101
|
+
} }, I18nService.translate('otp.change'))))), h("input-otp", { key: '53416598d254b6f42b1771136d43f8ac612f3b43', otp: this.otpValue, onOtpChange: event => this.handleOtpChange(event.detail), error: this.error ? I18nService.translate('otp.error') : '' }), this.isVerifying && (h("div", { key: '41c766a5e21c9d810dca97de5c720450df6924af', class: "otp__verifying-container" }, h("rebill-typography", { key: '93ba72b7c85cb622f8fd3d1b1175817a736c7ede', variant: "subtitle2", color: COLORS_ENUM.PRIMARY }, I18nService.translate('otp.verifyingCode')), h("div", { key: 'd8b11cf317c4d8cbbb3f840fe8c411738c8f095c', class: "otp__spinner" }))), h("rebill-button", { key: 'c07d1abbce11ca0a2f1f139d9b93c6808c85bfd0', type: "button", variant: "outline", theme: this.isTimerRunning ? 'secondary' : 'primary', disabled: this.isTimerRunning, onClick: this.handleResendCode, size: "small", style: { height: '24px', marginBottom: '8px' } }, this.isTimerRunning
|
|
102
102
|
? `${I18nService.translate('otp.resendCodeIn')} (${this.timer.getFormattedTime()})`
|
|
103
|
-
: I18nService.translate('otp.resendCode')), this.codeResent && (h("div", { key: '
|
|
103
|
+
: I18nService.translate('otp.resendCode')), this.codeResent && (h("div", { key: '04892ba96af1f0cc56e8a662b4e758f8539d8181', class: "otp__code-resent-container" }, h("rebill-typography", { key: 'd5406c0cb371a85f796bb33950db186703aa2a96', variant: "subtitle2", color: COLORS_ENUM.GREEN }, h("rebill-icon", { key: 'd125a0363f9b5b584638b148e285323d57c507ee', name: "check-radio" }), I18nService.translate('otp.codeResent')))), h("rebill-alert", { key: '00f6d0350530b1ec22027a91dcafa7bd6de2887d', class: "otp__rebill-alert", type: "secure", variant: "variant-info", message: I18nService.translate('otp.infoMessage'), icon: "circle-info", alertTitle: I18nService.translate('otp.infoTitle'), colorIcon: COLORS_ENUM.PRIMARY_DARK_LIGHT }), h("div", { key: '9a8c49f2d07459f11f447a430c5addf11da5d68c', class: "otp__alternative" }, h("rebill-typography", { key: 'aa6421edade435a60f2086666aadee7059c4381b', variant: "body2", color: COLORS_ENUM.PRIMARY_DARK }, "o")), h("div", { key: 'cd8efa383a62cc1362e50dd854812bf80c3a930c', class: "otp__guest-options" }, h("rebill-button", { key: '95db9dfa82140c9de4fcf22d513f8401779d0bb5', type: "button", variant: "outline", theme: "secondary", size: "medium", onClick: () => {
|
|
104
104
|
this.otpValue = '';
|
|
105
105
|
this.error = false;
|
|
106
106
|
this.returnForm.emit(false);
|
|
107
|
-
} }, I18nService.translate('otp.continueAsGuest')), h("rebill-alert", { key: '
|
|
107
|
+
} }, I18nService.translate('otp.continueAsGuest')), h("rebill-alert", { key: 'd1f56385971910aed328b740498945e05d6a91ac', type: "secure", variant: "variant-secure", icon: "lock-outline", message: I18nService.translate('otp.secureMessage') }))));
|
|
108
108
|
}
|
|
109
109
|
static get is() { return "otp-component"; }
|
|
110
110
|
static get originalStyleUrls() {
|
|
@@ -9,9 +9,9 @@ export class CardFieldsWrapper {
|
|
|
9
9
|
showDocument;
|
|
10
10
|
customCSS;
|
|
11
11
|
render() {
|
|
12
|
-
return (h("div", { key: '
|
|
12
|
+
return (h("div", { key: '5f1248723599b981c30f9a54124b5a94a5f53dad', style: { display: 'flex', flexDirection: 'column', gap: '16px' } }, h("card-iframe", { key: '8bfe7e4a7b26c30bf1de8c4d937690a429429f3a', customCSS: this.customCSS }), !renewalState.isInitialized &&
|
|
13
13
|
sessionState.data?.itemInformation?.type !== SESSION_ITEM_TYPE_ENUM.PLAN &&
|
|
14
|
-
sessionState.data.cardInformation?.installments?.installments.length > 0 && (h("rebill-installments", { key: '
|
|
14
|
+
sessionState.data.cardInformation?.installments?.installments.length > 0 && (h("rebill-installments", { key: 'd95b4b20414db198f5483cb1dc1ac070e0204009', error: this.installmentsError })), this.showDocument && (h("card-identification", { key: '11d048b3a791db2061befd07a4b33a039e03de24', documentTypeError: this.documentTypeError, documentNumberError: this.documentNumberError }))));
|
|
15
15
|
}
|
|
16
16
|
static get is() { return "card-fields-wrapper"; }
|
|
17
17
|
static get properties() {
|
|
@@ -62,7 +62,7 @@ export class Identification {
|
|
|
62
62
|
label: documentType.value,
|
|
63
63
|
value: documentType.value,
|
|
64
64
|
}));
|
|
65
|
-
return (h(h.Fragment, null, h("rebill-input-combo", { key: '
|
|
65
|
+
return (h(h.Fragment, null, h("rebill-input-combo", { key: '075b874873f297d3e2e72e54625db2d5cc49c619', "select-id": "documentType", "input-id": "documentNumber", "on-input": this.handleInputChange, "select-placeholder": I18nService.translate('document.typePlaceholder'), "input-placeholder": I18nService.translate('document.numberPlaceholder'), error: I18nService.translate(error), options: options, disabled: this.disabled })));
|
|
66
66
|
}
|
|
67
67
|
static get is() { return "card-identification"; }
|
|
68
68
|
static get properties() {
|
package/dist/collection/components/checkout/payment-method-selector/card-fields/iframe/CardIframe.js
CHANGED
|
@@ -326,12 +326,12 @@ export class CardIframe {
|
|
|
326
326
|
}
|
|
327
327
|
};
|
|
328
328
|
render() {
|
|
329
|
-
return (h("div", { key: '
|
|
329
|
+
return (h("div", { key: '21cee6426b31b15e214272bed3b893a89cfebdc3', style: {
|
|
330
330
|
width: '100%',
|
|
331
331
|
height: this.iframeHeight,
|
|
332
332
|
position: 'relative',
|
|
333
333
|
overflow: 'hidden',
|
|
334
|
-
} }, !this.iframeLoaded && h("card-skeleton", { key: '
|
|
334
|
+
} }, !this.iframeLoaded && h("card-skeleton", { key: '66bbb20d750975f5e6a15a72c55f21ac209c9a10' }), h("iframe", { key: '8f9c689ea04b5b88511cbcc69b792454460b2a48', ref: el => (this.iframeRef = el), src: this.getIframeURL(), style: {
|
|
335
335
|
width: '100%',
|
|
336
336
|
height: '100%',
|
|
337
337
|
border: 'none',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
export class CardSkeleton {
|
|
3
3
|
render() {
|
|
4
|
-
return (h("div", { key: '
|
|
4
|
+
return (h("div", { key: '76c432f43c597f9ff92b949c16d70b1b6840e378', class: "iframe-skeleton" }, h("div", { key: '9c77a9eeda10a23004890c934f30f8d25be7fbf1', class: "input-skeleton" }), h("div", { key: 'd26032fe4bbb41dd0107e9fa5d8bd041da401351', class: "input-skeleton" })));
|
|
5
5
|
}
|
|
6
6
|
static get is() { return "card-skeleton"; }
|
|
7
7
|
static get originalStyleUrls() {
|
|
@@ -40,11 +40,11 @@ export class Installments {
|
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
render() {
|
|
43
|
-
return (h("div", { key: '
|
|
43
|
+
return (h("div", { key: 'a7e2147789a5664d4b5857c86652c85f78a88872' }, h("rebill-input-select", { key: this.isDisabled.toString(), id: "installments", variant: "outlined", value: this.value, options: sessionState.data.cardInformation?.installments?.installments.map(installment => ({
|
|
44
44
|
label: getInstallmentLabel(installment.installment, getRecalculatedInstallmentAmount(installment.installmentAmount), sessionState.data.pricing?.currency, installment.cft, installment.model),
|
|
45
45
|
value: installment?.installment?.toString(),
|
|
46
46
|
})) || [], loading: sessionState.data.fetchingInstallments, placeholder: this.placeholder, disabled: this.isDisabled, "on-input": this.handleInstallments, error: I18nService.translate(this.error) }), sessionState.data.cardInformation?.installments?.installments.find(installment => installment.installment ===
|
|
47
|
-
sessionState.data.cardInformation?.installments?.selectedInstallment?.installment)?.model === ENUM_INSTALLMENT_MODEL.CUSTOMER_FINANCED && (h("rebill-typography", { key: '
|
|
47
|
+
sessionState.data.cardInformation?.installments?.selectedInstallment?.installment)?.model === ENUM_INSTALLMENT_MODEL.CUSTOMER_FINANCED && (h("rebill-typography", { key: '77b18f5f22cf47c79a6a2f30655117f4aaa60987', variant: "italic", color: COLORS_ENUM.SECONDARY }, I18nService.translate('installments.interest')))));
|
|
48
48
|
}
|
|
49
49
|
static get is() { return "rebill-installments"; }
|
|
50
50
|
static get originalStyleUrls() {
|