Skip to content

Commit

Permalink
OX6-150: Add B2B checkout for BNPL Invoice
Browse files Browse the repository at this point in the history
+ Add different delivery address option for all BNPL
  • Loading branch information
Vincent Boulanger committed Oct 2, 2023
1 parent 29cae55 commit 27a7775
Show file tree
Hide file tree
Showing 15 changed files with 234 additions and 146 deletions.
4 changes: 4 additions & 0 deletions application/translations/de/fcPayOne_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@
'FCPO_AMAZON_ERROR_900' => 'Entschuldigung, die Transaktion mit Amazon Pay war nicht erfolgreich. Bitte wählen Sie eine andere Zahlart.',
'FCPO_AMAZON_LOGIN' => 'Mit Amazon einloggen.',
'FCPO_SECINVOICE_BIRTHDATE' => 'Geburtsdatum',
'FCPO_SECINVOICE_BIRTHDATE_B2B' => 'Geburtsdatum des Bestellers',
'FCPO_SECINVOICE_USTID' => 'Umsatzsteueridentifiationsnummer',
'FCPO_SECINVOICE_NO_COMPANY' => 'Keine Firma? Klicken Sie <a href="index.php?cl=account_user" style="color:green;">hier</a> um Ihre Addresse zu ändern.',
'FCPO_NOT_ADULT' => 'Sie sind aufgrund Ihres Alters leider nicht berechtigt die gewählte Zahlart zu verwenden. Bitte wählen Sie eine andere Zahlart.',
Expand All @@ -201,6 +202,7 @@

'FCPO_BNPL_TNC_DATAPROTECTION_NOTICE' => 'Mit Abschluss dieser Bestellung erkläre ich mich mit den <span style="color: black; font-weight: bold; text-decoration: underline"><a href="https://legal.paylater.payone.com/de/terms-of-payment.html" target="_blank" rel="noreferrer noopener">ergänzenden Zahlungsbedingungen</a></span> und der Durchführung einer Risikoprüfung für die ausgewählte Zahlungsart einverstanden. Den <span style="color: black; font-weight: bold; text-decoration: underline"><a href="https://legal.paylater.payone.com/de/data-protection-payments.html" target="_blank" rel="noreferrer noopener">ergänzenden Datenschutzhinweis</a></span> habe ich zur Kenntnis genommen.',
'FCPO_BNPL_FON' => 'Telefonnummer',
'FCPO_BNPL_FON_B2B' => 'Telefonnummer des Bestellers',
'FCPO_BNPL_IBAN' => 'IBAN',
'FCPO_BNPL_SECINSTALLMENT_UNAVAILABLE' => 'Gesicherter Ratenkauf wird für Ihren aktuellen Warenkorb nicht unterstützt. Bitte wählen Sie eine andere Zahlart.',
'FCPO_BNPL_SECINSTALLMENT_SELECTION' => 'Anzahl von Raten',
Expand All @@ -213,6 +215,8 @@
'FCPO_BNPL_SECINSTALLMENT_OVW_MONTHLYRATE' => 'Monatliche Rate',
'FCPO_BNPL_SECINSTALLMENT_OVW_DL_CREDINFO' => '&gt;&nbsp;Ratenkauf Informationen herunterladen',
'FCPO_BNPL_SECINSTALLMENT_PLAN_INVALID' => 'Bitte wählen Sie Ihre gewünschte Anzahl von Raten',
'FCPO_BNPL_USTID' => 'Umsatzsteueridentifiationsnummer',
'FCPO_BNPL_NO_COMPANY' => 'Keine Firma? Klicken Sie <a href="index.php?cl=account_user" style="color:green;">hier</a> um Ihre Addresse zu ändern.',

'FCPO_CONFIG_GROUP_APPLE_PAY' => "Apple Pay",
'FCPO_HELP_APPLE_PAY_MERCHANT_ID' => "Merchant ID",
Expand Down
4 changes: 4 additions & 0 deletions application/translations/en/fcPayOne_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@
'FCPO_AMAZON_ERROR_SHIPPING_ADDRESS_NOT_SET' => 'Please choose an address',
'FCPO_AMAZON_ERROR_900' => 'Please choose another payment method.',
'FCPO_SECINVOICE_BIRTHDATE' => 'Please enter your birthday',
'FCPO_SECINVOICE_BIRTHDATE_B2B' => 'Date of birth of the subscriber',
'FCPO_SECINVOICE_USTID' => 'Tax Identification Number',
'FCPO_SECINVOICE_NO_COMPANY' => 'Not a company? Click <a href="index.php?cl=account_user" style="color:green;">here</a> for changing your address.',
'FCPO_NOT_ADULT' => 'Due to your age you are not allowed to use this payment. Please select another payment method',
Expand All @@ -212,6 +213,7 @@

'FCPO_BNPL_TNC_DATAPROTECTION_NOTICE' => 'By placing this order, I agree to the <span style="color: black; font-weight: bold; text-decoration: underline"><a href="https://legal.paylater.payone.com/en/terms-of-payment.html" target="_blank" rel="noreferrer noopener">supplementary payment terms</a></span> and the performance of a risk assessment for the selected payment method. I am aware of the <span style="color: black; font-weight: bold; text-decoration: underline"><a href="https://legal.paylater.payone.com/en/data-protection-payments.html" target="_blank" rel="noreferrer noopener">supplementary data protection notice</a></span>.',
'FCPO_BNPL_FON' => 'Phone',
'FCPO_BNPL_FON_B2B' => 'Phone number of the subscriber',
'FCPO_BNPL_IBAN' => 'IBAN',
'FCPO_BNPL_SECINSTALLMENT_UNAVAILABLE' => 'Safe installment is not available for your current basket. Please choose another payment method.',
'FCPO_BNPL_SECINSTALLMENT_SELECTION' => 'Desired installment plan',
Expand All @@ -224,6 +226,8 @@
'FCPO_BNPL_SECINSTALLMENT_OVW_MONTHLYRATE' => 'Monthly amount',
'FCPO_BNPL_SECINSTALLMENT_OVW_DL_CREDINFO' => '&gt;&nbsp;Download Installment information',
'FCPO_BNPL_SECINSTALLMENT_PLAN_INVALID' => 'Please select the desired installment plan',
'FCPO_BNPL_USTID' => 'Tax Identification Number',
'FCPO_BNPL_NO_COMPANY' => 'Not a company? Click <a href="index.php?cl=account_user" style="color:green;">here</a> for changing your address.',

'FCPO_CONFIG_GROUP_APPLE_PAY' => "Apple Pay",
'FCPO_HELP_APPLE_PAY_MERCHANT_ID' => "Merchant ID",
Expand Down
1 change: 1 addition & 0 deletions application/views/admin/de/fcPayOne_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@
'FCPO_SECINVOICE_PORTAL_KEY' => 'PAYONE Portal Key (für Zahlart Gesicherter Rechnungskauf)',
'FCPO_BNPL_PORTAL_KEY' => 'PAYONE Portal Key (für Zahlart BNPL)',
'FCPO_BNPL_ALLOW_DIFF_ADDRESS' => 'Abweichende Lieferadresse zulassen',
'FCPO_HELP_BNPL_ALLOW_DIFF_ADDRESS' => 'Muss im PAYONE-Konto freigeschaltet sein!',
'FCPO_BNPL_ADMIN_DEBIT_REASON_TITLE' => 'Stornierungsgrund',
'FCPO_BNPL_CANCELLATION_REASON_CRQ' => 'Der Verbraucher hat eine Stornierung der Bestellung beantragt',
'FCPO_BNPL_CANCELLATION_REASON_DUP' => 'Die Bestellung wurde versehentlich zweimal erstellt',
Expand Down
1 change: 1 addition & 0 deletions application/views/admin/en/fcPayOne_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@
'FCPO_SECINVOICE_PORTAL_KEY' => 'PAYONE Portal Key (for payment Secure Invoice)',
'FCPO_BNPL_PORTAL_KEY' => 'PAYONE Portal Key (for payment BNPL)',
'FCPO_BNPL_ALLOW_DIFF_ADDRESS' => 'Allow different shipping address',
'FCPO_HELP_BNPL_ALLOW_DIFF_ADDRESS' => 'Attention: has to be enabled in the PAYONE account',
'FCPO_BNPL_ADMIN_DEBIT_REASON_TITLE' => 'Cancellation reason',
'FCPO_BNPL_CANCELLATION_REASON_CRQ' => 'The consumer requested a cancellation of the Order',
'FCPO_BNPL_CANCELLATION_REASON_DUP' => 'The Order was created twice accidentally',
Expand Down
6 changes: 2 additions & 4 deletions application/views/admin/tpl/fcpayone_main.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -899,12 +899,10 @@
</dd>
<div class="spacer"></div>
</dl>
<!-- OX6-133 : Remove css hidding to show this feature *}] -->
<dl style="display:none;">
<dl>
<dt>
<input type="hidden" name="confbools[blFCPOPLAllowDiffAddress]" value="false">
<!-- OX6-133 : Replace below the value="false" by value="true" to allow usage of this feature -->
<input type="checkbox" name="confbools[blFCPOPLAllowDiffAddress]" value="false" [{if ($confbools.blFCPOPLAllowDiffAddress)}]checked[{/if}] [{$readonly}]>
<input type="checkbox" name="confbools[blFCPOPLAllowDiffAddress]" value="true" [{if ($confbools.blFCPOPLAllowDiffAddress)}]checked[{/if}] [{$readonly}]>
[{oxinputhelp ident="FCPO_HELP_BNPL_ALLOW_DIFF_ADDRESS"}]
</dt>
<dd>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<input type="hidden" name="dynvalue[fcpopl_secdebitnote_account_holder]" value="[{$oView->fcpoGetAccountHolder()}]" />
<ul class="form">
[{if $oView->fcpoBNPLShowBirthdate()}]
<li>
<li>
<label>[{oxmultilang ident="FCPO_SECINVOICE_BIRTHDATE"}]:</label>
<select name="dynvalue[fcpopl_secdebitnote_birthdate_day]">
[{foreach from=$oView->fcpoGetDayRange() item='sDay'}]
Expand All @@ -30,7 +30,7 @@
</li>
[{/if}]

[{if $oView->fcpoBNPLShowFon()}]
[{if $oView->fcpoBNPLShowFon($sPaymentID)}]
<li>
<label class="req control-label col-lg-3">[{oxmultilang ident="FCPO_BNPL_FON"}]:</label>
<div class="col-lg-9">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
</li>
[{/if}]

[{if $oView->fcpoBNPLShowFon()}]
[{if $oView->fcpoBNPLShowFon($sPaymentID)}]
<li>
<label class="req control-label col-lg-3">[{oxmultilang ident="FCPO_BNPL_FON"}]:</label>
<div class="col-lg-9">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,62 @@
<input type="hidden" name="fcpo_mode_[{$sPaymentID}]" value="[{$paymentmethod->fcpoGetOperationMode()}]">
<ul class="form">
[{if $oView->fcpoBNPLShowBirthdate()}]
<li>
<label>[{oxmultilang ident="FCPO_SECINVOICE_BIRTHDATE"}]:</label>
<select name="dynvalue[fcpopl_secinvoice_birthdate_day]">
[{foreach from=$oView->fcpoGetDayRange() item='sDay'}]
<option value="[{$sDay}]" [{if $sDay == $oView->fcpoGetBirthdayField('day')}]selected[{/if}]>[{$sDay}]</option>
[{/foreach}]
</select>
&nbsp;
<select name="dynvalue[fcpopl_secinvoice_birthdate_month]">
[{foreach from=$oView->fcpoGetMonthRange() item='sMonth'}]
<option value="[{$sMonth}]" [{if $sMonth == $oView->fcpoGetBirthdayField('month')}]selected[{/if}]>[{$sMonth}]</option>
[{/foreach}]
</select>
&nbsp;
<select name="dynvalue[fcpopl_secinvoice_birthdate_year]">
[{foreach from=$oView->fcpoGetYearRange() item='sYear'}]
<option value="[{$sYear}]" [{if $sYear == $oView->fcpoGetBirthdayField('year')}]selected[{/if}]>[{$sYear}]</option>
[{/foreach}]
</select>
<li>
[{if $oView->fcpoIsB2BPov()}]
<label class="req control-label col-lg-3">[{oxmultilang ident="FCPO_SECINVOICE_BIRTHDATE_B2B"}]:</label>
[{else}]
<label class="req control-label col-lg-3">[{oxmultilang ident="FCPO_SECINVOICE_BIRTHDATE"}]:</label>
[{/if}]
&nbsp;
<select style="width:15%" name="dynvalue[fcpopl_secinvoice_birthdate_day]">
[{foreach from=$oView->fcpoGetDayRange() item='sDay'}]
<option value="[{$sDay}]" [{if $sDay == $oView->fcpoGetBirthdayField('day')}]selected[{/if}]>[{$sDay}]</option>
[{/foreach}]
</select>
&nbsp;
<select style="width:15%" name="dynvalue[fcpopl_secinvoice_birthdate_month]">
[{foreach from=$oView->fcpoGetMonthRange() item='sMonth'}]
<option value="[{$sMonth}]" [{if $sMonth == $oView->fcpoGetBirthdayField('month')}]selected[{/if}]>[{$sMonth}]</option>
[{/foreach}]
</select>
&nbsp;
<select style="width:15%" name="dynvalue[fcpopl_secinvoice_birthdate_year]">
[{foreach from=$oView->fcpoGetYearRange() item='sYear'}]
<option value="[{$sYear}]" [{if $sYear == $oView->fcpoGetBirthdayField('year')}]selected[{/if}]>[{$sYear}]</option>
[{/foreach}]
</select>
</li>
[{/if}]

[{if $oView->fcpoBNPLShowFon()}]
[{if $oView->fcpoBNPLShowFon($sPaymentID)}]
<li>
[{if $oView->fcpoIsB2BPov()}]
<label class="req control-label col-lg-3">[{oxmultilang ident="FCPO_BNPL_FON_B2B"}]:</label>
[{else}]
<label class="req control-label col-lg-3">[{oxmultilang ident="FCPO_BNPL_FON"}]:</label>
[{/if}]
<div class="col-lg-9">
<input placeholder="[{oxmultilang ident="FCPO_BNPL_FON"}]" class="form-control" type="text" size="20" maxlength="64" name="dynvalue[fcpopl_secinvoice_fon]" value="[{$oView->fcpoGetUserValue('oxfon')}]" required="required">
</div>
</li>
[{/if}]

[{if $oView->fcpoIsB2BPov()}]
[{if ! $oView->fcpoGetUserValue('oxustid')}]
<li>
<label class="control-label col-lg-3" style="word-break: break-word">[{oxmultilang ident="FCPO_BNPL_USTID"}]:</label>
<div class="col-lg-7">
<input placeholder="[{oxmultilang ident="FCPO_BNPL_USTID"}]" class="form-control" type="text" size="20" maxlength="64" name="dynvalue[fcpopl_secinvoice_ustid]" value="[{$oView->fcpoGetUserValue('oxustid')}]">
</div>
</li>
<li>
<p class="col-lg-12" style="padding-left: 25px">
[{oxmultilang ident="FCPO_BNPL_NO_COMPANY"}]
</p>
</li>
[{/if}]
[{/if}]

</ul>

[{oxid_include_dynamic file=$oViewConf->fcpoGetAbsModuleTemplateFrontendPath('fcpo_payment_bnpl_snippet.tpl')}]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</div>
[{/if}]

[{if $oView->fcpoBNPLShowFon()}]
[{if $oView->fcpoBNPLShowFon($sPaymentID)}]
<div class="form-group">
<label class="req control-label col-lg-3">[{oxmultilang ident="FCPO_BNPL_FON"}]:</label>
<div class="col-lg-9">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
</div>
[{/if}]

[{if $oView->fcpoBNPLShowFon()}]
[{if $oView->fcpoBNPLShowFon($sPaymentID)}]
<div class="form-group">
<label class="req control-label col-lg-3">[{oxmultilang ident="FCPO_BNPL_FON"}]:</label>
<div class="col-lg-9">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
<input type="hidden" name="fcpo_mode_[{$sPaymentID}]" value="[{$paymentmethod->fcpoGetOperationMode()}]">
[{if $oView->fcpoBNPLShowBirthdate()}]
<div class="form-group">
[{if $oView->fcpoIsB2BPov()}]
<label class="req control-label col-lg-3">[{oxmultilang ident="FCPO_SECINVOICE_BIRTHDATE_B2B"}]:</label>
[{else}]
<label class="req control-label col-lg-3">[{oxmultilang ident="FCPO_SECINVOICE_BIRTHDATE"}]:</label>
[{/if}]
<div class="col-lg-9">
<select name="dynvalue[fcpopl_secinvoice_birthdate_day]">
[{foreach from=$oView->fcpoGetDayRange() item='sDay'}]
Expand All @@ -30,13 +34,31 @@
</div>
[{/if}]

[{if $oView->fcpoBNPLShowFon()}]
<div class="form-group">
<label class="req control-label col-lg-3">[{oxmultilang ident="FCPO_BNPL_FON"}]:</label>
<div class="col-lg-9">
<input placeholder="[{oxmultilang ident="FCPO_BNPL_FON"}]" class="form-control" type="text" size="20" maxlength="64" name="dynvalue[fcpopl_secinvoice_fon]" value="[{$oView->fcpoGetUserValue('oxfon')}]" required="required">
</div>
[{if $oView->fcpoBNPLShowFon($sPaymentID)}]
<div class="form-group">
[{if $oView->fcpoIsB2BPov()}]
<label class="req control-label col-lg-3">[{oxmultilang ident="FCPO_BNPL_FON_B2B"}]:</label>
[{else}]
<label class="req control-label col-lg-3">[{oxmultilang ident="FCPO_BNPL_FON"}]:</label>
[{/if}]
<div class="col-lg-9">
<input placeholder="[{oxmultilang ident="FCPO_BNPL_FON"}]" class="form-control" type="text" size="20" maxlength="64" name="dynvalue[fcpopl_secinvoice_fon]" value="[{$oView->fcpoGetUserValue('oxfon')}]" required="required">
</div>
</div>
[{/if}]

[{if $oView->fcpoIsB2BPov()}]
[{if ! $oView->fcpoGetUserValue('oxustid')}]
<div class="form-group">
<label class="control-label col-lg-3">[{oxmultilang ident="FCPO_BNPL_USTID"}]:</label>
<div class="col-lg-7">
<input placeholder="[{oxmultilang ident="FCPO_BNPL_USTID"}]" class="form-control" type="text" size="20" maxlength="64" name="dynvalue[fcpopl_secinvoice_ustid]" value="[{$oView->fcpoGetUserValue('oxustid')}]">
</div>
<label class="col-lg-12" style="padding-left: 25px">
[{oxmultilang ident="FCPO_BNPL_NO_COMPANY"}]
</label>
</div>
[{/if}]
[{/if}]

[{oxid_include_dynamic file=$oViewConf->fcpoGetAbsModuleTemplateFrontendPath('fcpo_payment_bnpl_snippet.tpl')}]
Expand Down
Loading

0 comments on commit 27a7775

Please sign in to comment.