Skip to content

Commit

Permalink
PIWOO-389 apply filter only on payments
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaymo committed Feb 22, 2024
1 parent 656ee8f commit 273f8e4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions src/Payment/PaymentService.php
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,14 @@ protected function processAsMollieOrder(
$data,
$order
);
$this->logger->debug(
json_encode($data, JSON_PRETTY_PRINT)
);
/*$data = apply_filters(
'woocommerce_mollie_wc_gateway_' . $this->gateway->id . '_args',
$data,
$order
);*/

do_action(
$this->pluginId . '_create_payment',
Expand Down Expand Up @@ -467,6 +475,11 @@ protected function processAsMolliePayment(
$data,
$order
);
$data = apply_filters(
'woocommerce_' . $this->gateway->id . 'payment_args',
$data,
$order
);

try {
// Only enable this for hardcore debugging!
Expand Down
2 changes: 1 addition & 1 deletion src/PaymentMethods/Banktransfer.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function getFormFields($generalFormFields): array

public function filtersOnBuild()
{
add_filter('woocommerce_mollie_wc_gateway_' . $this->getProperty('id') . '_args', function (array $args, \WC_Order $order): array {
add_filter('woocommerce_mollie_wc_gateway_' . $this->getProperty('id') . 'payment_args', function (array $args, \WC_Order $order): array {
return $this->addPaymentArguments($args, $order);
}, 10, 2);
}
Expand Down

0 comments on commit 273f8e4

Please sign in to comment.