Plugin Directory

Changeset 2730820


Ignore:
Timestamp:
05/25/2022 01:27:21 PM (4 years ago)
Author:
PerfectSolution
Message:

Update trunk/ - 1.0.0

Location:
wc-unzer-direct/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • wc-unzer-direct/trunk/README.txt

    r2729310 r2730820  
    3232
    3333== Changelog ==
     34= 1.4.4 =
     35* Fix: Disable Unzer Denit Invoice if country is not CH as well.
     36* Feat: Hide Unzer specific gateways if "Ship to different address" is enabled since the addresses must match.
     37
    3438= 1.4.3 =
    3539* Fix: Remove VISA Electron card logo
  • wc-unzer-direct/trunk/classes/instances/instance.php

    r2481316 r2730820  
    5454            'section' => 'unzer_direct'
    5555        ];
    56         $html = sprintf( "<p><small>Version: %s</small>", WC_UNZER_DIRECT_VERSION );
    57         $html .= "<p>" . sprintf( __( 'Allows you to receive payments via %s', 'wc-unzer-direct' ), $this->method_title ) . "</p>";
    58         $html .= "<p>" . sprintf( __( 'This module has it\'s main configuration inside the \'Unzer Direct\' tab.', 'wc-unzer-direct' ), 's' ) . "</p>";
    59         $html .= "<p>" . sprintf( __( 'Click <a href="%s">here</a> to access the main configuration.', 'wc-unzer-direct' ), add_query_arg( $main_settings_args, admin_url( 'admin.php' ) ) ) . "</p>";
     56        $html               = sprintf( "<p><small>Version: %s</small>", WC_UNZER_DIRECT_VERSION );
     57        $html               .= "<p>" . sprintf( __( 'Allows you to receive payments via %s', 'wc-unzer-direct' ), $this->method_title ) . "</p>";
     58        $html               .= "<p>" . sprintf( __( 'This module has it\'s main configuration inside the \'Unzer Direct\' tab.', 'wc-unzer-direct' ), 's' ) . "</p>";
     59        $html               .= "<p>" . sprintf( __( 'Click <a href="%s">here</a> to access the main configuration.', 'wc-unzer-direct' ), add_query_arg( $main_settings_args, admin_url( 'admin.php' ) ) ) . "</p>";
    6060
    6161        $html .= get_parent_class( get_parent_class( get_parent_class( $this ) ) )::generate_settings_html( $form_fields, $echo );
     
    115115        return str_replace( 'Unzer Direct - ', '', $this->method_title );
    116116    }
     117
     118    /**
     119     * @return bool
     120     */
     121    protected function is_checkout_different_shipping_address_enabled() {
     122        parse_str( wc()->checkout()->get_value( 'post_data' ), $data );
     123
     124        return isset( $data['ship_to_different_address'] ) && wc_string_to_bool( $data['ship_to_different_address'] );
     125    }
    117126}
  • wc-unzer-direct/trunk/classes/instances/unzer-direct-debit.php

    r2729310 r2730820  
    9696            $country    = strtoupper( WC()->checkout()->get_value( 'billing_country' ) );
    9797
    98             if ( ! ( $cart_total >= $cart_min && $cart_total <= $cart_max ) || ( 'EUR' !== $currency && 'CHF' !== $currency ) || ( 'DE' !== $country && 'AT' !== $country ) ) {
     98            if ( ! ( $cart_total >= $cart_min && $cart_total <= $cart_max ) || ( 'EUR' !== $currency && 'CHF' !== $currency ) || ( 'DE' !== $country && 'AT' !== $country ) || $this->is_checkout_different_shipping_address_enabled() ) {
    9999                unset( $gateways[ $this->id ] );
    100100            }
  • wc-unzer-direct/trunk/classes/instances/unzer-direct-invoice.php

    r2729310 r2730820  
    7979    public function filter_icon( $icon ) {
    8080        if ( 'invoice' === $icon ) {
    81             $icon     = 'unzer';
     81            $icon = 'unzer';
    8282        }
     83
    8384        return $icon;
    8485    }
     
    8990    public function maybe_disable_gateway( $gateways ) {
    9091        if ( isset( $gateways[ $this->id ] ) && is_checkout() && ( $cart = WC()->cart ) ) {
    91             $cart_total = (float) $cart->get_total( 'edit' );
    92             $cart_min   = 10;
    93             $cart_max   = 3500;
    94             $currency   = strtoupper( get_woocommerce_currency() );
     92            $cart_total  = (float) $cart->get_total( 'edit' );
     93            $cart_min    = 10;
     94            $cart_max    = 3500;
     95            $currency    = strtoupper( get_woocommerce_currency() );
     96            $country     = strtoupper( WC()->checkout()->get_value( 'billing_country' ) );
    9597
    96             if ( ! ( $cart_total >= $cart_min && $cart_total <= $cart_max ) || ( 'EUR' !== $currency && 'CHF' !== $currency ) ) {
     98            if ( ! ( $cart_total >= $cart_min && $cart_total <= $cart_max ) || ( 'EUR' !== $currency && 'CHF' !== $currency ) || ( 'DE' !== $country && 'AT' !== $country && 'CH' !== $country ) || $this->is_checkout_different_shipping_address_enabled() ) {
    9799                unset( $gateways[ $this->id ] );
    98100            }
  • wc-unzer-direct/trunk/wc-unzer-direct.php

    r2729310 r2730820  
    44 * Plugin URI: http://wordpress.org/plugins/wc-unzer-direct/
    55 * Description: Integrate Unzer Direct payment gateway with WooCommerce
    6  * Version: 1.4.3
     6 * Version: 1.4.4
    77 * Author: Unzer
    88 * Text Domain: wc-unzer-direct
     
    1717}
    1818
    19 define( 'WC_UNZER_DIRECT_VERSION', '1.4.3' );
     19define( 'WC_UNZER_DIRECT_VERSION', '1.4.4' );
    2020define( 'WC_UNZER_DIRECT_URL', plugins_url( __FILE__ ) );
    2121define( 'WC_UNZER_DIRECT_PATH', plugin_dir_path( __FILE__ ) );
Note: See TracChangeset for help on using the changeset viewer.