Skip to content

Commit

Permalink
fix: Minor fix to logic
Browse files Browse the repository at this point in the history
  • Loading branch information
brtkwr committed Dec 4, 2024
1 parent ec509e2 commit 88d750b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions class/WC_Twoinc.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function () {

$general_error_message = sprintf(__('Failed to verify API key.', 'twoinc-payment-gateway'), self::PRODUCT_NAME);
if (isset($result['body']) && isset($result['code'])) {
if ($result['code'] == 200 && $result['body']['id']) {
if ($result['code'] == 200) {
WC_Admin_Settings::add_message(sprintf(__('%s API key verified.', 'twoinc-payment-gateway'), self::PRODUCT_NAME));
} else {
if ($result['code'] == 401) {
Expand Down Expand Up @@ -2243,9 +2243,9 @@ private function get_save_twoinc_meta($order, $optional_order_id = null)
}

$order_reference = $order->get_meta('_twoinc_order_reference') ?? $order->get_meta('_tillit_order_reference');
$merchant_id = $order->get_meta('_twoinc_merchant_id') ?? $order->get_meta('_tillit_merchant_id');
$merchant_id = $order->get_meta('_twoinc_merchant_id');
if (!$merchant_id) {
$merchant_id = $this->get_merchant_id();
$merchant_id = $order->get_meta('_tillit_merchant_id') ?? $this->get_merchant_id();
$order->update_meta_data('_twoinc_merchant_id', $merchant_id);
$order->save();
}
Expand Down

0 comments on commit 88d750b

Please sign in to comment.