Skip to content

Commit

Permalink
Do not require brithdate for riverty
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaymo committed Aug 1, 2024
1 parent ae98d4d commit 2583fb6
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/PaymentMethods/Riverty.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,12 @@ public function addPhoneWhenRest($arrayContext)
*/
public function addBirthdateWhenRest($context)
{
$birthMandatoryGateways = ['mollie_wc_gateway_riverty'];
$paymentMethod = $context->payment_data['payment_method'] ?? null;
if ($paymentMethod && in_array($paymentMethod, $birthMandatoryGateways)) {
if ($paymentMethod) {
$billingBirthdate = $context->payment_data['billing_birthdate'] ?? null;
if ($billingBirthdate && $this->isBirthValid($billingBirthdate)) {
$context->order->update_meta_data('billing_birthdate', $billingBirthdate);
$context->order->save();
} else {
$message = __('Please introduce a valid birthdate number.', 'mollie-payments-for-woocommerce');
throw new RouteException(
'woocommerce_rest_checkout_process_payment_error',
$message,
402
);
}
}
}
Expand Down

0 comments on commit 2583fb6

Please sign in to comment.