Skip to content

Commit

Permalink
Merge pull request #740 from mollie/Fix/MOL-972
Browse files Browse the repository at this point in the history
Fix/mol 972
  • Loading branch information
mmaymo authored Nov 28, 2022
2 parents 7888516 + dd2302b commit 50cc3f8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/Gateway/GatewayModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ function ($paymentContext) {
*/
public function maybeDisableBankTransferGateway(array $gateways): array
{
$isWcApiRequest = (bool)sanitize_text_field(wp_unslash($_GET['wc-api']));
$isWcApiRequest = isset($_GET['wc-api']) && sanitize_text_field(wp_unslash($_GET['wc-api']));
$bankTransferSettings = get_option('mollie_wc_gateway_banktransfer_settings', false);
$isSettingActivated = $bankTransferSettings && isset($bankTransferSettings['activate_expiry_days_setting']) && $bankTransferSettings['activate_expiry_days_setting'] === "yes";
if ($isSettingActivated && isset($bankTransferSettings['order_dueDate'])) {
Expand Down Expand Up @@ -294,7 +294,7 @@ public function maybeDisableBankTransferGateway(array $gateways): array
*/
public function maybeDisableApplePayGateway(array $gateways): array
{
$isWcApiRequest = (bool)sanitize_text_field(wp_unslash($_GET['wc-api']));
$isWcApiRequest = isset($_GET['wc-api']) && sanitize_text_field(wp_unslash($_GET['wc-api']));
$wooCommerceSession = mollieWooCommerceSession();

/*
Expand Down
9 changes: 6 additions & 3 deletions src/Payment/MolliePayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,12 @@ public function getPaymentRequestData($order, $customerId, $voucherDefaultCatego
'method' => $gateway->paymentMethod->getProperty('id'),
'issuer' => $selectedIssuer,
'locale' => $paymentLocale,
'metadata' => [
'order_id' => $orderId,
],
'metadata' => apply_filters(
$this->pluginId . '_payment_object_metadata',
[
'order_id' => $order->get_id(),
]
),
];

$paymentRequestData = $this->addSequenceTypeForSubscriptionsFirstPayments($order->get_id(), $gateway, $paymentRequestData);
Expand Down

0 comments on commit 50cc3f8

Please sign in to comment.