Skip to content

Commit

Permalink
Merge pull request #1106 from buckaroo-it/BP-3817-Riverty-terms-and-c…
Browse files Browse the repository at this point in the history
…onditions-changes

Bp 3817 riverty terms and conditions changes
  • Loading branch information
AlbinaBaraliu authored Nov 22, 2024
2 parents 9a553ad + 5384a17 commit 7cadc5d
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 43 deletions.
4 changes: 2 additions & 2 deletions etc/adminhtml/system/payment_methods/afterpay.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<comment><![CDATA[This controls the description which the user sees during checkout.]]></comment>
<config_path>payment/buckaroo_magento2_afterpay/subtext</config_path>
</field>

<field id="subtext_style" translate="label comment" type="select" sortOrder="26" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Frontend subtext style</label>
<comment><![CDATA[Choose a font style for the subtext.]]></comment>
Expand Down Expand Up @@ -91,7 +91,7 @@
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<config_path>payment/buckaroo_magento2_afterpay/financial_warning</config_path>
</field>

<field id="high_tax" translate="label comment" type="multiselect" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
<label> High VAT tax classes</label>
<comment><![CDATA[Select which tax classes count as 'high' VAT.]]></comment>
Expand Down
2 changes: 1 addition & 1 deletion etc/adminhtml/system/payment_methods/afterpay2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<comment><![CDATA[This controls the description which the user sees during checkout.]]></comment>
<config_path>payment/buckaroo_magento2_afterpay2/subtext</config_path>
</field>

<field id="subtext_style" translate="label comment" type="select" sortOrder="26" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Frontend subtext style</label>
<comment><![CDATA[Choose a font style for the subtext.]]></comment>
Expand Down
11 changes: 2 additions & 9 deletions etc/adminhtml/system/payment_methods/afterpay20.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<comment><![CDATA[This controls the description which the user sees during checkout.]]></comment>
<config_path>payment/buckaroo_magento2_afterpay20/subtext</config_path>
</field>

<field id="subtext_style" translate="label comment" type="select" sortOrder="26" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Frontend subtext style</label>
<comment><![CDATA[Choose a font style for the subtext.]]></comment>
Expand Down Expand Up @@ -93,7 +93,7 @@
<field id="customer_type" separator=",">both,b2b</field>
</depends>
</field>


<group id="buckaroo_magento2_default" translate="label" type="text" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Default Configuration</label>
Expand All @@ -105,13 +105,6 @@
<config_path>payment/buckaroo_magento2_afterpay20/payment_email</config_path>
</field>

<field id="financial_warning" translate="label comment" type="select" sortOrder="35" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Consumer Financial Warning</label>
<comment><![CDATA[Due to the regulations for BNPL methods in The Netherlands you’ll have to warn customers about using a BNPL plan because it can be easy to get into debt. When enabled a warning will be showed in the checkout. Please note that this setting only applies for customers in The Netherlands.]]></comment>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<config_path>payment/buckaroo_magento2_afterpay20/financial_warning</config_path>
</field>

</group>

<group id="buckaroo_magento2_advanced" translate="label" type="text" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1">
Expand Down
1 change: 1 addition & 0 deletions i18n/de_DE.csv
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@
"Please make sure all fields are filled in correctly before proceeding.","Bitte stellen Sie sicher, dass alle Felder korrekt ausgefüllt sind, bevor Sie fortfahren."
"Not Applicable","Unzutreffend"
"Yes, I accept the terms and condition for the use of Riverty.","Ja, ich akzeptiere die Nutzungsbedingungen für Riverty."
"The general Terms and Conditions for the Riverty payment method apply. The privacy policy of Riverty can be found here.","Es gelten die allgemeinen Geschäftsbedingungen für die Zahlungsmethode Riverty. Die Datenschutzbestimmungen von Riverty findest Du hier."
"Accept terms of use","Akzeptieren Sie die Allgemeinen Geschäftsbedingungen"
"(DD/MM/YYYY)","(DD/MM/JJJJ)"
"Any comments about this Beta release? <a target=\"_blank\" href=\"%s\"> Please let us know! </a>","Irgendwelche Kommentare zu dieser Beta-Version? <a target=\"_blank\" href=\"%s\"> Lass uns wissen! </a>"
Expand Down
1 change: 1 addition & 0 deletions i18n/nl_BE.csv
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@
"Please make sure all fields are filled in correctly before proceeding.","Zorg ervoor dat alle velden correct ingevuld zijn voordat u doorgaat."
"Not Applicable","Niet van toepassing"
"Yes, I accept the terms and condition for the use of Riverty.","Ja, ik accepteer de algemene voorwaarden voor het gebruik van Riverty"
"The general Terms and Conditions for the Riverty payment method apply. The privacy policy of Riverty can be found here.","De Algemene Voorwaarden voor de betaalmethode Riverty zijn van toepassing. Het privacybeleid van Riverty vind je hier."
"Accept terms of use","Accepteer algemene voorwaarden"
"(DD/MM/YYYY)","(DD/MM/JJJJ)"
"Any comments about this Beta release? <a target=\"_blank\" href=\"%s\"> Please let us know! </a>","Heeft u opmerkingen over deze Beta release? <a target=\"_blank\" href=\"%s\"> Laat het ons weten! </a>"
Expand Down
1 change: 1 addition & 0 deletions i18n/nl_NL.csv
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@
"Please make sure all fields are filled in correctly before proceeding.","Zorg ervoor dat alle velden correct ingevuld zijn voordat u doorgaat."
"Not Applicable","Niet van toepassing"
"Yes, I accept the terms and condition for the use of Riverty.","Ja, ik accepteer de algemene voorwaarden voor het gebruik van Riverty."
"The general Terms and Conditions for the Riverty payment method apply. The privacy policy of Riverty can be found here.","De Algemene Voorwaarden voor de betaalmethode Riverty zijn van toepassing. Het privacybeleid van Riverty vind je hier."
"Accept terms of use","Accepteer algemene voorwaarden"
"(DD/MM/YYYY)","(DD/MM/JJJJ)"
"Any comments about this Beta release? <a target=\"_blank\" href=\"%s\"> Please let us know! </a>","Heeft u opmerkingen over deze Beta release? <a target=\"_blank\" href=\"%s\"> Laat het ons weten! </a>"
Expand Down
37 changes: 21 additions & 16 deletions view/frontend/web/js/view/payment/method-renderer/afterpay20.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,7 @@ define(
this.showFinancialWarning = ko.computed(
function () {
return quote.billingAddress() !== null &&
quote.billingAddress().countryId == 'NL' &&
window.checkoutConfig.payment.buckaroo.afterpay20.showFinancialWarning
quote.billingAddress().countryId == 'NL'
},
this
);
Expand All @@ -205,7 +204,7 @@ define(
return quote.shippingAddress();
}
);

this.country = ko.computed(
function() {
return this.activeAddress().countryId;
Expand Down Expand Up @@ -432,36 +431,42 @@ define(
let url = 'https://documents.riverty.com/terms_conditions/payment_methods/invoice';
const cc = country.toLowerCase()

if ( b2b === false ) {
if (b2b === true) {
url = 'https://documents.riverty.com/terms_conditions/payment_methods/b2b_invoice';
if (['NL','DE'].indexOf(country) !== -1) {
lang = `${cc}_${cc}`;
}

if (['AT','CH'].indexOf(country) !== -1) {
lang = `${cc}_de`;
}
}
else
{
if (country === 'BE') {
lang = 'be_nl';
}

if (['NL','DE'].indexOf(country) !== -1) {
lang = `${cc}_${cc}`;
}

if (['AT','DK', 'FI', 'SE', 'CH', 'NO'].indexOf(country) !== -1) {
if (['AT', 'CH'].indexOf(country) !== -1) {
const cc = country.toLowerCase()
lang = `${cc}_en`;
}
} else {
url = 'https://documents.riverty.com/terms_conditions/payment_methods/b2b_invoice';
if (['NL','DE'].indexOf(country) !== -1) {
lang = `${cc}_${cc}`;
lang = `${cc}_de`;
}

if (['AT','CH'].indexOf(country) !== -1) {
if (['DK', 'FI', 'SE', 'NO'].indexOf(country) !== -1) {
const cc = country.toLowerCase()
lang = `${cc}_en`;
}
}

return `${url}/${lang}/`;
},

getFrenchTos: function () {
return $.mage
.__('(Or click here for the French translation: <a target="_blank" href="%s">terms and condition</a>.)')
.__('(Or click here for the French translation: <a target="_blank" href="%s">terms and condition</a>. )')
.replace('%s', 'https://documents.riverty.com/terms_conditions/payment_methods/invoice/be_fr/');
},

Expand All @@ -471,4 +476,4 @@ define(
}
);
}
);
);
21 changes: 12 additions & 9 deletions view/frontend/web/js/view/payment/method-renderer/billink.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,14 @@ define(
]
);

this.isB2B = ko.computed(
function () {
const billingAddress = quote.billingAddress();
return billingAddress && billingAddress.company;
},
this
);

this.showFinancialWarning = ko.computed(
function () {
return quote.billingAddress() !== null &&
Expand All @@ -178,7 +186,7 @@ define(
);
this.billingName = ko.computed(
function () {
if(this.isB2B() && quote.billingAddress() !== null) {
if(this.isB2B && quote.billingAddress() !== null) {
return quote.billingAddress().company;
}
if(quote.billingAddress() !== null) {
Expand All @@ -200,7 +208,7 @@ define(
return (
quote.billingAddress() === null ||
!validPhone(quote.billingAddress().telephone)
) && !this.isB2B();
) && !this.isB2B;
},
this
);
Expand Down Expand Up @@ -249,7 +257,7 @@ define(
fields.push('buckaroo_magento2_billink_Telephone')
}

if(this.isB2B()) {
if(this.isB2B) {
fields.push('buckaroo_magento2_billink_chamberOfCommerce')
} else {
fields = fields.concat([
Expand Down Expand Up @@ -309,11 +317,6 @@ define(
return true;
},

isB2B: function () {
const billingAddress = quote.billingAddress();
return billingAddress && billingAddress.company;
},

getData: function () {
let phone = this.phone();
if(!this.showPhone() && quote.billingAddress() !== null) {
Expand All @@ -327,7 +330,7 @@ define(
"termsCondition": this.tos(),
};

if (this.isB2B()) {
if (this.isB2B) {
additionalData["customer_chamberOfCommerce"] = this.cocNumber();
additionalData["customer_VATNumber"] = this.vatNumber();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,10 @@
</div>
</div>

<!-- ko if: showFinancialWarning -->
<!-- ko if: showFinancialWarning -->
<span data-bind="i18n: `Je moet minimaal 18+ zijn om deze dienst te gebruiken. Als je op tijd betaalt, voorkom je extra kosten en zorg je dat je in de toekomst nogmaals gebruik kunt maken van de diensten van ${getTitle()}. Door verder te gaan, accepteer je de Algemene Voorwaarden en bevestig je dat je de Privacyverklaring en Cookieverklaring hebt gelezen.`"> </span>
<!-- /ko -->

<div class="field">
<span data-bind="i18n: 'Please make sure all fields are filled in correctly before proceeding.' "> </span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
</div>
</div>

<!-- ko if: showFinancialWarning -->
<!-- ko if: showFinancialWarning -->
<span data-bind="i18n: `Je moet minimaal 18+ zijn om deze dienst te gebruiken. Als je op tijd betaalt, voorkom je extra kosten en zorg je dat je in de toekomst nogmaals gebruik kunt maken van de diensten van ${getTitle()}. Door verder te gaan, accepteer je de Algemene Voorwaarden en bevestig je dat je de Privacyverklaring en Cookieverklaring hebt gelezen.`"> </span>
<!-- /ko -->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
placeholder: $t('DD/MM/YYYY')
}"
name="payment[buckaroo_magento2_afterpay20][customer_DoB]">

</div>
</div>
<!-- /ko -->
Expand All @@ -128,7 +128,7 @@
<a target="_blank"
rel="noopener"
data-bind="
i18n: 'Yes, I accept the terms and condition for the use of Riverty.',
i18n: 'The general Terms and Conditions for the Riverty payment method apply. The privacy policy of Riverty can be found here.',
attr: { 'href': termsUrl }
">
</a>
Expand All @@ -143,7 +143,6 @@
<!-- ko if: showFinancialWarning -->
<span data-bind="i18n: `Je moet minimaal 18+ zijn om deze dienst te gebruiken. Als je op tijd betaalt, voorkom je extra kosten en zorg je dat je in de toekomst nogmaals gebruik kunt maken van de diensten van ${getTitle()}. Door verder te gaan, accepteer je de Algemene Voorwaarden en bevestig je dat je de Privacyverklaring en Cookieverklaring hebt gelezen.`"> </span>
<!-- /ko -->

<div class="field">
<span data-bind="i18n: 'Please make sure all fields are filled in correctly before proceeding.' "> </span>
</div>
Expand Down

0 comments on commit 7cadc5d

Please sign in to comment.