Skip to content

Commit

Permalink
UNZER-514 Add a descriptor to the prepayment thankyou page
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniil Tkachev committed Nov 11, 2024
1 parent e4041e2 commit 105a05d
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Controller/ThankYouController.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,19 @@ public function getUnzerPrePaymentHolder(): ?string
return $result;
}

/** Template variable getter. Returns Unzer PrePayment Holder */
public function getUnzerPrePaymentDescriptor(): ?string
{
$result = null;
$unzerOrderNumber = $this->getUnzerOrderNumberForPrePayments();
if ($unzerOrderNumber) {
$result = $this->getPrePaymentBankAccountService()->getDescriptor(
$unzerOrderNumber
);
}
return $result;
}

private function getPrePaymentBankAccountService(): PrePaymentBankAccountService
{
return $this->getServiceFromContainer(PrePaymentBankAccountService::class);
Expand Down
7 changes: 7 additions & 0 deletions src/Service/PrePaymentBankAccountService.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ public function getHolder(string $unzerOrderNumber): ?string
);
}

public function getDescriptor(string $unzerOrderNumber): ?string
{
return $this->getStringVarFromSession(
$this->getSessionVariableName($unzerOrderNumber, 'getDescriptor')
);
}

private function getStringVarFromSession(string $varName): string
{
$result = $this->session->getVariable($varName);
Expand Down
1 change: 1 addition & 0 deletions translations/de/oscunzer_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,5 @@
'OSCUNZER_PREPAYMENT_BANK_ACCOUNT_INFO_BANK_HOLDER' => 'Kontoinhaber',
'OSCUNZER_FIX_ROUNDING' => 'Korrektur Rundung',
'OSCUNZER_NOT_SERIALIZABLE' => 'NOT SERIALIZABLE: ',
'OSCUNZER_PREPAYMENT_BANK_ACCOUNT_INFO_BANK_DESCRIPTOR' => 'Descriptor',
];
1 change: 1 addition & 0 deletions translations/en/oscunzer_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,5 @@
'OSCUNZER_PREPAYMENT_BANK_ACCOUNT_INFO_BANK_HOLDER' => 'Account Holder',
'OSCUNZER_FIX_ROUNDING' => 'Fix rounding item',
'OSCUNZER_NOT_SERIALIZABLE' => 'NOT SERIALIZABLE: ',
'OSCUNZER_PREPAYMENT_BANK_ACCOUNT_INFO_BANK_DESCRIPTOR' => 'Descriptor',
];
3 changes: 3 additions & 0 deletions views/frontend/blocks/page/checkout/thank_you_info.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
[{if $oView->getUnzerPrePaymentHolder()}]
[{oxmultilang ident="OSCUNZER_PREPAYMENT_BANK_ACCOUNT_INFO_BANK_HOLDER"}]: [{$oView->getUnzerPrePaymentHolder()}]<br/>
[{/if}]
[{if $oView->getUnzerPrePaymentDescriptor()}]
[{oxmultilang ident="OSCUNZER_PREPAYMENT_BANK_ACCOUNT_INFO_DESCRIPTOR"}]: [{$oView->getUnzerPrePaymentDescriptor()}]<br/>
[{/if}]
[{if $oView->getUnzerPrePaymentIban()}]
<br/>
[{/if}]

0 comments on commit 105a05d

Please sign in to comment.