Plugin Directory

Changeset 3141395


Ignore:
Timestamp:
08/26/2024 04:26:04 AM (20 months ago)
Author:
fxholl
Message:

added filter exchange by payment method

Location:
kiskadi
Files:
11 edited
1 copied

Legend:

Unmodified
Added
Removed
  • kiskadi/tags/1.3.0/includes/class-kiskadi.php

    r3103793 r3141395  
    1212
    1313    /** @var string */
    14     public $version = '1.2.6';
     14    public $version = '1.3.0';
    1515
    1616    /** @var self */
  • kiskadi/tags/1.3.0/includes/integration/woocommerce/admin/class-kiskadi-integration-admin.php

    r3095899 r3141395  
    2626    /** @return array<string,array<string,mixed>> */
    2727    private function form_fields() : array {
     28
     29        $gateways = WC()->payment_gateways->get_available_payment_gateways();
     30        $active_gateways = [];
     31        foreach($gateways as $id => $gateway) {
     32            $active_gateways[$id] = $gateway->get_title();
     33        }
     34
    2835        return array(
    2936            'user'            => array(
     
    5461                'default'     => 'yes',
    5562                'description' => __( 'Enable the option to send transaction to Kiskadi', 'kiskadi' ),
     63            ),
     64            'enable_transaction_by_payment_methods' => array(
     65                'title'       => __( 'Transactions by Payment Methods', 'kiskadi' ),
     66                'type'        => 'multiselect',
     67                'description' => __( 'Choose the Payment Methods.', 'kiskadi' ),
     68                'default'     => array_keys($active_gateways),
     69                'desc_tip'    => true,
     70                'options'     => $active_gateways
    5671            ),
    5772            'debug'           => array(
     
    95110        return true;
    96111    }
     112
     113    public function payment_methods_enable() : array {
     114        return $this->get_option( 'enable_transaction_by_payment_methods' );
     115    }
    97116}
  • kiskadi/tags/1.3.0/includes/integration/woocommerce/class-order-status.php

    r3095899 r3141395  
    4545        }
    4646
     47        $payment_methods_enable = ( new Kiskadi_Integration_Admin() )->payment_methods_enable();
     48        if (!in_array($order->get_payment_method(),$payment_methods_enable)) {
     49            return;
     50        }
     51
    4752        try {
    4853            $this->send_order_data( $order, $branch_data );
  • kiskadi/tags/1.3.0/kiskadi.php

    r3103793 r3141395  
    88 * Text Domain:     kiskadi
    99 * Domain Path:     /languages
    10  * Version:         1.2.6
     10 * Version:         1.3.0
    1111 *
    1212 * @package         Kiskadi
  • kiskadi/tags/1.3.0/readme.txt

    r3103793 r3141395  
    66Tested up to: 6.5.3
    77Requires PHP: 7.2
    8 Stable tag: 1.2.6
     8Stable tag: 1.3.0
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    3434
    3535== Changelog ==
     36
     37= 1.3.0 =
     38* Feature - add option transaction by payment method selected
    3639
    3740= 1.2.6 =
  • kiskadi/trunk/includes/class-kiskadi.php

    r3103793 r3141395  
    1212
    1313    /** @var string */
    14     public $version = '1.2.6';
     14    public $version = '1.3.0';
    1515
    1616    /** @var self */
  • kiskadi/trunk/includes/integration/woocommerce/admin/class-kiskadi-integration-admin.php

    r3095899 r3141395  
    2626    /** @return array<string,array<string,mixed>> */
    2727    private function form_fields() : array {
     28
     29        $gateways = WC()->payment_gateways->get_available_payment_gateways();
     30        $active_gateways = [];
     31        foreach($gateways as $id => $gateway) {
     32            $active_gateways[$id] = $gateway->get_title();
     33        }
     34
    2835        return array(
    2936            'user'            => array(
     
    5461                'default'     => 'yes',
    5562                'description' => __( 'Enable the option to send transaction to Kiskadi', 'kiskadi' ),
     63            ),
     64            'enable_transaction_by_payment_methods' => array(
     65                'title'       => __( 'Transactions by Payment Methods', 'kiskadi' ),
     66                'type'        => 'multiselect',
     67                'description' => __( 'Choose the Payment Methods.', 'kiskadi' ),
     68                'default'     => array_keys($active_gateways),
     69                'desc_tip'    => true,
     70                'options'     => $active_gateways
    5671            ),
    5772            'debug'           => array(
     
    95110        return true;
    96111    }
     112
     113    public function payment_methods_enable() : array {
     114        return $this->get_option( 'enable_transaction_by_payment_methods' );
     115    }
    97116}
  • kiskadi/trunk/includes/integration/woocommerce/class-order-status.php

    r3095899 r3141395  
    4545        }
    4646
     47        $payment_methods_enable = ( new Kiskadi_Integration_Admin() )->payment_methods_enable();
     48        if (!in_array($order->get_payment_method(),$payment_methods_enable)) {
     49            return;
     50        }
     51
    4752        try {
    4853            $this->send_order_data( $order, $branch_data );
  • kiskadi/trunk/includes/integration/woocommerce/order/class-order-consumer-extractor.php

    r2800910 r3141395  
    3434    private function person() : Person_Data {
    3535        $email     = $this->order_billing_data( 'email' );
    36         $cpf       = $this->order_billing_data( 'cpf' );
    37         $phone     = $this->order_billing_data( 'phone' );
    38         $cellphone = $this->order_billing_data( 'cellphone' );
     36//      $cpf       = $this->order_billing_data( 'cpf' );
     37//      $phone     = $this->order_billing_data( 'phone' );
     38//      $cellphone = $this->order_billing_data( 'cellphone' );
    3939
    4040        $person_data = new Person_Data(
  • kiskadi/trunk/kiskadi.php

    r3103793 r3141395  
    88 * Text Domain:     kiskadi
    99 * Domain Path:     /languages
    10  * Version:         1.2.6
     10 * Version:         1.3.0
    1111 *
    1212 * @package         Kiskadi
  • kiskadi/trunk/readme.txt

    r3103793 r3141395  
    66Tested up to: 6.5.3
    77Requires PHP: 7.2
    8 Stable tag: 1.2.6
     8Stable tag: 1.3.0
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    3434
    3535== Changelog ==
     36
     37= 1.3.0 =
     38* Feature - add option transaction by payment method selected
    3639
    3740= 1.2.6 =
Note: See TracChangeset for help on using the changeset viewer.