Plugin Directory

Changeset 3063373


Ignore:
Timestamp:
04/03/2024 07:51:32 AM (2 years ago)
Author:
payping
Message:

add block support

Location:
woo-payping-gateway
Files:
15 added
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • woo-payping-gateway/trunk/class-wc-gateway-payping.php

    r2947982 r3063373  
    162162
    163163            $CallbackUrl = add_query_arg('wc_order', $order_id, WC()->api_request_url('WC_payping'));
    164 
    165164            $products = array();
    166165            $order_items = $order->get_items();
  • woo-payping-gateway/trunk/index.php

    r2944873 r3063373  
    22/*
    33Plugin Name: Gateway for PayPing on WooCommerce
    4 Version: 4.3.0
     4Version: 4.4.0
    55Description:  افزونه درگاه پرداخت پی‌پینگ برای ووکامرس
    66Plugin URI: https://www.payping.ir/
     
    5050    }
    5151    require_once( WOO_GPPDIR . 'class-wc-gateway-payping.php' );
     52    //require_once( WOO_GPPDIR . 'block-support.php' );
    5253}
    5354add_action('plugins_loaded', 'load_payping_woo_gateway', 0);
     55
     56
     57/**
     58 * Custom function to declare compatibility with cart_checkout_blocks feature
     59*/
     60function declare_payping_cart_checkout_blocks_compatibility() {
     61    // Check if the required class exists
     62    if (class_exists('\Automattic\WooCommerce\Utilities\FeaturesUtil')) {
     63        // Declare compatibility for 'cart_checkout_blocks'
     64        \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility('cart_checkout_blocks', __FILE__, true);
     65    }
     66}
     67// Hook the custom function to the 'before_woocommerce_init' action
     68add_action('before_woocommerce_init', 'declare_payping_cart_checkout_blocks_compatibility');
     69
     70
     71// Hook the custom function to the 'woocommerce_blocks_loaded' action
     72add_action( 'woocommerce_blocks_loaded', 'payping_register_order_approval_payment_method_type' );
     73
     74/**
     75 * Custom function to register a payment method type
     76
     77 */
     78function payping_register_order_approval_payment_method_type() {
     79    // Check if the required class exists
     80    if ( ! class_exists( 'Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType' ) ) {
     81        return;
     82    }
     83
     84    // Include the custom Blocks Checkout class
     85    require_once plugin_dir_path(__FILE__) . 'class-block.php';
     86
     87    // Hook the registration function to the 'woocommerce_blocks_payment_method_type_registration' action
     88    add_action(
     89        'woocommerce_blocks_payment_method_type_registration',
     90        function( Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry $payment_method_registry ) {
     91            $payment_method_registry->register( new Payping_Gateway_Blocks );
     92        }
     93    );
     94}
  • woo-payping-gateway/trunk/readme.txt

    r3063369 r3063373  
    11=== Gateway for PayPing on WooCommerce ===
    2 Contributors: payping, hadihosseini, mahdisarani
     2Contributors: payping, mahdisarani, hadihosseini
    33Tags: woocommerce, payment, payping, افزونه پرداخت, ووکامرس, ووکامرس فارسی, درگاه پرداخت, gateway, iran, persian, پی پینگ, pay ping
    44Donate link: https://payping.ir
    55Requires at least: 4.0.0
    6 Tested up to: 6.2.2
    7 Requires PHP: 7.0.0
    8 Stable tag: 4.3.0
     6Tested up to: 6.5
     7Requires PHP: 7.4.0
     8Stable tag: 4.4.0
    99License: GPLv3 or later
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    1313
    1414== Description ==
    15 با استفاده از این افزونه فروشگاه خود را به دروازه آنلاین پرداخت بانکی متصل کنید.
     15با استفاده از این افزونه فروشگاه خود را به درگاه آنلاین پرداخت بانکی متصل کنید.
    1616
    1717== Installation ==
     
    2121
    2222== Changelog ==
     23
     24== 4.4.0 ==
     25سازگاری با نسخه جدید ووکامرس و ویرایشگر بلوک.
    2326
    2427== 4.3.0 ==
Note: See TracChangeset for help on using the changeset viewer.