Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAYOSWXP-100: Unzer invoice purchase: if the customer has a company address, the birthday is not required #279

Merged
merged 1 commit into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ public function getValidationDefinitions(SalesChannelContext $salesChannelContex
$definitions = parent::getValidationDefinitions($salesChannelContext);

$definitions['payolutionConsent'] = [new NotBlank()];
$definitions['payolutionBirthday'] = [new NotBlank(), new Birthday(['value' => $this->getMinimumDate()])];

// if the customer has a company address, the birthday is not required
if ($salesChannelContext->getCustomer()?->getDefaultBillingAddress()?->getCompany() === null) {
$definitions['payolutionBirthday'] = [new NotBlank(), new Birthday(['value' => $this->getMinimumDate()])];
}

$configuration = $this->configReader->read($salesChannelContext->getSalesChannel()->getId());

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{% block payone_payolution_consent_checkbox %}

{% if context.customer.activeBillingAddress and context.customer.activeBillingAddress.company is empty %}
<div class="row consent-row">
<div class="col-12">
<label class="form-label" for="payolutionBirthday">
Expand All @@ -17,6 +19,7 @@
/>
</div>
</div>
{% endif %}

<div class="row consent-row">
<div class="col-12">
Expand Down
Loading