Skip to content

Commit

Permalink
Add HPOS compatability (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
onurpolattimur authored Mar 19, 2024
1 parent fc02205 commit bca4693
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
22 changes: 17 additions & 5 deletions craftgate-payment-gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
* Description: Accept debit/credit card payments easily and directly on your WordPress site using Craftgate.
* Author: Craftgate
* Author URI: https://craftgate.io/
* Version: 1.0.10
* Version: 1.0.11
* Requires at least: 4.4
* Tested up to: 6.0
* WC requires at least: 3.0.0
* WC tested up to: 8.5.2
* WC tested up to: 8.6.1
* Requires PHP: 5.6
* License: GPLv3
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
Expand Down Expand Up @@ -360,8 +360,8 @@ private function update_order_for_installment($order, $checkout_form_result)
$order_fee->tax_class = '';
$order->add_fee($order_fee);
$order->calculate_totals(true);
update_post_meta($order->id, 'craftgate_installment_number', esc_sql($installment));
update_post_meta($order->id, 'craftgate_installment_fee', $installment_fee);
$order->update_meta_data('craftgate_installment_number', esc_sql($installment));
$order->update_meta_data('craftgate_installment_fee', $installment_fee);
}

private function retrieve_card_user_key($customer_id, $api_key)
Expand Down Expand Up @@ -706,7 +706,8 @@ private function set_cookie($name, $value, $expire, $path, $domain, $secure, $ht
}
}

public function get_icon_url() {
public function get_icon_url()
{
return $this->icon;
}
}
Expand Down Expand Up @@ -785,7 +786,18 @@ function add_blocks_compatibility_support()
}
}

/**
* Add custom order tables compatibility support
*/
function add_custom_order_tables_compatibility_support()
{
if (class_exists(\Automattic\WooCommerce\Utilities\FeaturesUtil::class)) {
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility('custom_order_tables', __FILE__, true);
}
}

add_action('before_woocommerce_init', 'add_blocks_compatibility_support');
add_action('before_woocommerce_init', 'add_custom_order_tables_compatibility_support');

/**
* Register payment method type
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: craftgate, payment gateway, kredi kartı, banka kartı, ödeme, sanal pos,
Requires at least: 4.4
Tested up to: 6.4.3
Requires PHP: 5.6
Stable tag: 1.0.10
Stable tag: 1.0.11
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -68,6 +68,9 @@ WooCommerce eklentisi üzerinden Craftgate ödeme geçidini kullanmaya başlamak
6. Sipariş Yönetim Sayfası

== Changelog ==
= 1.0.11 - 2024-03-19 =
* adds woocommerce hpos support

= 1.0.10 - 2024-02-13 =
* adds woocommerce checkout blocks support

Expand Down

0 comments on commit bca4693

Please sign in to comment.