From 789ce950339255b7a83872cd2332dd274d8d68ab Mon Sep 17 00:00:00 2001
From: Rafik Adiche
Date: Thu, 10 Aug 2023 13:37:32 +0200
Subject: [PATCH] feat(projects.new): implement the checkbox fof legal
agreement
ref: TAPC-150
Signed-off-by: Rafik Adiche
---
.../new/payment/components/add/controller.js | 24 +++++++++++++
.../new/payment/components/add/index.html | 15 ++++++--
.../pci/src/projects/new/payment/constants.js | 9 +++++
.../src/projects/new/payment/controller.js | 35 +++++++++++++++++--
.../pci/src/projects/new/payment/index.html | 10 +++---
.../pci/src/projects/new/payment/index.js | 1 +
.../pci/src/projects/new/payment/index.scss | 5 +++
7 files changed, 88 insertions(+), 11 deletions(-)
create mode 100644 packages/manager/modules/pci/src/projects/new/payment/constants.js
create mode 100644 packages/manager/modules/pci/src/projects/new/payment/index.scss
diff --git a/packages/manager/modules/pci/src/projects/new/payment/components/add/controller.js b/packages/manager/modules/pci/src/projects/new/payment/components/add/controller.js
index 6d974af30aeb..4254c9ec9057 100644
--- a/packages/manager/modules/pci/src/projects/new/payment/components/add/controller.js
+++ b/packages/manager/modules/pci/src/projects/new/payment/components/add/controller.js
@@ -150,6 +150,30 @@ export default class PciProjectNewPaymentMethodAddCtrl {
});
}
+ resetLegalAgreements() {
+ this.model.legalAgreements = {
+ credit: false,
+ payPal: false,
+ bankAccount: false,
+ };
+ return null;
+ }
+
+ onCreditCardAgreementCheckboxChange(modelValue) {
+ this.resetLegalAgreements();
+ this.model.legalAgreements.credit = modelValue;
+ }
+
+ onBankAccountAgreementCheckboxChange(modelValue) {
+ this.resetLegalAgreements();
+ this.model.legalAgreements.bankAccount = modelValue;
+ }
+
+ onPaypalAgreementCheckboxChange(modelValue) {
+ this.resetLegalAgreements();
+ this.model.legalAgreements.paypal = modelValue;
+ }
+
showSpecificCrossBorderSentenceForCardPayment() {
return (
this.hasSpecificCrossBorderSentenceForCardPayment &&
diff --git a/packages/manager/modules/pci/src/projects/new/payment/components/add/index.html b/packages/manager/modules/pci/src/projects/new/payment/components/add/index.html
index 1c8a15ccd454..de33722ae32b 100644
--- a/packages/manager/modules/pci/src/projects/new/payment/components/add/index.html
+++ b/packages/manager/modules/pci/src/projects/new/payment/components/add/index.html
@@ -42,7 +42,10 @@
-
+
-
+
-
+