From f62d234c131566c3467b6bb2f31082d97d302988 Mon Sep 17 00:00:00 2001 From: Leonardo Matos Date: Thu, 21 Sep 2023 00:08:34 -0300 Subject: [PATCH] feat(app/checkout): update with new opt prop `isPayerDocRequired` Set default value with global `window.ecomCreditCardDocRequired` May fix https://github.com/ecomplus/storefront/pull/951 --- .../src/components/html/CreditCardForm.html | 2 ++ .../storefront-app/src/components/js/CreditCardForm.js | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/@ecomplus/storefront-app/src/components/html/CreditCardForm.html b/@ecomplus/storefront-app/src/components/html/CreditCardForm.html index cd25bde50..83d14c1be 100644 --- a/@ecomplus/storefront-app/src/components/html/CreditCardForm.html +++ b/@ecomplus/storefront-app/src/components/html/CreditCardForm.html @@ -113,6 +113,7 @@ @@ -124,6 +125,7 @@ id="credit-card-doc" :is-company="isCompany" v-model="card.doc" + :required="isPayerDocRequired" /> diff --git a/@ecomplus/storefront-app/src/components/js/CreditCardForm.js b/@ecomplus/storefront-app/src/components/js/CreditCardForm.js index 592836e5f..910264bb3 100644 --- a/@ecomplus/storefront-app/src/components/js/CreditCardForm.js +++ b/@ecomplus/storefront-app/src/components/js/CreditCardForm.js @@ -52,7 +52,13 @@ export default { installmentOptions: Array, gatewayOptions: Array, jsClient: Object, - jsClientLoad: Promise + jsClientLoad: Promise, + isPayerDocRequired: { + type: Boolean, + default () { + return window.ecomCreditCardDocRequired === true + } + } }, data () {