Skip to content

Commit

Permalink
Use different field name for company billie
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaymo committed Dec 23, 2024
1 parent 4f2674d commit 84dbc00
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/Gateway/GatewayModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,11 @@ static function () {
11,
2
);
add_action(
'woocommerce_checkout_posted_data',
[$this, 'switchFields'],
11
);
}
$isIn3Enabled = mollieWooCommerceIsGatewayEnabled('mollie_wc_gateway_in3_settings', 'enabled');
if ($isIn3Enabled) {
Expand Down Expand Up @@ -657,7 +662,7 @@ protected function instantiatePaymentMethods($container): array
public function BillieFieldsMandatory($fields, $errors)
{
$gatewayName = "mollie_wc_gateway_billie";
$field = 'billing_company';
$field = 'billing_company_billie';
$companyLabel = __('Company', 'mollie-payments-for-woocommerce');
return $this->addPaymentMethodMandatoryFields($fields, $gatewayName, $field, $companyLabel, $errors);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Payment/MollieObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,7 @@ private function checkBillieCompanyField($order)
$isBillieMethodId = $gateway->id === 'mollie_wc_gateway_billie';
if ($isBillieMethodId) {
//phpcs:ignore WordPress.Security.NonceVerification, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
$fieldPosted = wc_clean(wp_unslash($_POST["billing_company"] ?? ''));
$fieldPosted = wc_clean(wp_unslash($_POST["billing_company_billie"] ?? ''));
if ($fieldPosted === '' || !is_string($fieldPosted)) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class BillieFieldsStrategy implements PaymentFieldsStrategyI
{
const FIELD_COMPANY = "billing_company";
const FIELD_COMPANY = "billing_company_billie";

public function execute($gateway, $dataHelper)
{
Expand Down

0 comments on commit 84dbc00

Please sign in to comment.