Plugin Directory

Changeset 3279051


Ignore:
Timestamp:
04/22/2025 12:36:01 PM (11 months ago)
Author:
CardGate
Message:

removed all issuer code

Location:
cardgate
Files:
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • cardgate/tags/3.2.4/cardgate.php

    r3218324 r3279051  
    77 * Author: CardGate
    88 * Author URI: https://www.cardgate.com
    9  * Version: 3.2.3
     9 * Version: 3.2.4
    1010 * Text Domain: cardgate
    1111 * Domain Path: /i18n/languages
     
    195195                update_option('cgp_merchant_api_key', $_POST['cgp_merchant_api_key']);
    196196                update_option('cgp_checkoutdisplay', $_POST['cgp_checkoutdisplay']);
    197                 update_option('cgp_checkoutidealissuers', $_POST['cgp_checkoutidealissuers']);
    198 
    199                 //This wil refresh the bank issuer cache
    200                 update_option('IssuerRefresh', 0, true);
    201197               
    202198                $bIsTest = ($_POST['cgp_mode'] == 1 ? TRUE : FALSE);
     
    286282                                    <option value="withlogo"<?php echo (get_option('cgp_checkoutdisplay') == 'withlogo' ? ('selected="selected"') : '') ?> > <?php echo __('With Logo','cardgate') ?></option>
    287283                                </select>
    288                         </td>
    289                     </tr>
    290                     <tr>
    291                         <th scope="row">
    292                         <label for="cgp_checkoutidealissuers"><?php echo __('Show ideal issuers', 'cardgate') ?></label>
    293                         </th>
    294                         <td>
    295                                 <select style="width:140px;" id="cgp_checkoutidealissuers" name="cgp_checkoutidealissuers">
    296                                     <option value="0"<?php echo (get_option('cgp_checkoutidealissuers') == '0' ? ('selected="selected"') : '') ?> > <?php echo __('Without issuers','cardgate')?></option>
    297                                     <option value="1"<?php echo (get_option('cgp_checkoutidealissuers') == '1' ? ('selected="selected"') : '') ?> > <?php echo __('With issuers','cardgate') ?></option>
    298                                 </select><br>
    299                             <?php echo __('iDEAL v2 will not show issuers any more by default (Mandatory by iDEAL).', 'cardgate') ?>
    300284                        </td>
    301285                    </tr>
  • cardgate/tags/3.2.4/classes/CGP_Common_Gateway.php

    r3218324 r3279051  
    4343            echo wpautop( wptexturize( $this->description ) );
    4444        }
    45         if (
    46             $this->has_fields
    47             && get_option( 'cgp_checkoutidealissuers' ) == '1'
    48         ) {
    49             $this->generate_bank_html();
    50         }
    5145    }
    5246
     
    5953        }
    6054    }
    61 
    62     /**
    63      * Generate the bank options
    64      */
    65     public function generate_bank_html() {
    66         $aIssuers = $this->getBankOptions();
    67         $html = '<fieldset>
    68                 <p class="form-row form-row-first ">
    69                 <label for="cc-expire-month">' . __( 'Bank Options', 'cardgate' ) . '</label>';
    70         $html .= '<select name="cgp_bank_options" id="cgp_bank_options" class="woocommerce-select">';
    71         $html .= '<option value="0">' . __( 'Choose Bank', 'cardgate' ) . '</option>';
    72         foreach ( $aIssuers as $id => $name ) {
    73             $html .= '<option value="' . $id;
    74             $html .= ( ( isset( $this->bankOption ) && $id == $this->bankOption ) ? ' selected="selected" ' : '' );
    75             $html .= '">' . $name . '</option>';
    76         }
    77         $html .= '</select></p></fieldset>';
    78         echo $html;
    79     }
    80 
    81     // ////////////////////////////////////////////////
    82 
    83     /**
    84      * Fetch bank options from Card Gate
    85      */
    86     public function getBankOptions() {
    87         $this->checkBankOptions();
    88         $aIssuers = get_option( 'sIssuers' );
    89         return $aIssuers;
    90     }
    91 
    92     private function checkBankOptions() {
    93         if ( get_option( 'IssuerRefresh' ) ) {
    94             $iIssuerRefresh = (int) get_option( 'IssuerRefresh' );
    95             if ( $iIssuerRefresh < time() ) {
    96                 $this->cacheBankOptions();
    97             }
    98         } else {
    99             $this->cacheBankOptions();
    100         }
    101     }
    102 
    103     private function cacheBankOptions() {
    104         $iCacheTime     = 24 * 60 * 60;
    105         $iIssuerRefresh = time() + $iCacheTime;
    106         update_option( 'IssuerRefresh', $iIssuerRefresh, true );
    107 
    108         try {
    109             $iMerchantId     = ( get_option( 'cgp_merchant_id' ) ? get_option( 'cgp_merchant_id' ) : 0 );
    110             $sMerchantApiKey = ( get_option( 'cgp_merchant_api_key' ) ? get_option( 'cgp_merchant_api_key' ) : 0 );
    111             $bIsTest         = ( get_option( 'cgp_mode' ) == 1 ? true : false );
    112 
    113             $oCardGate = new cardgate\api\Client( (int) $iMerchantId, $sMerchantApiKey, $bIsTest );
    114             $oCardGate->setIp( $_SERVER['REMOTE_ADDR'] );
    115 
    116             $aIssuers = $oCardGate->methods()
    117                                   ->get( cardgate\api\Method::IDEAL )
    118                                   ->getIssuers();
    119         } catch ( cardgate\api\Exception $oException_ ) {
    120             $aIssuers[0] = [
    121                 'id'   => 0,
    122                 'name' => htmlspecialchars( $oException_->getMessage() )
    123             ];
    124         }
    125 
    126         foreach ( $aIssuers as $aIssuer ) {
    127             $aOptions[ $aIssuer['id'] ] = $aIssuer['name'];
    128         }
    129         $bIsValid = array_key_exists('INGBNL2A', $aOptions);
    130         if ($bIsValid) {
    131             update_option( 'sIssuers', $aOptions, true );
    132         }
    133     }
    13455
    13556    // //////////////////////////////////////////////
     
    231152            // Configure payment option.
    232153            $oTransaction->setPaymentMethod( $this->payment_method );
    233             if ( $this->payment_method == 'ideal' && get_option('cgp_checkoutidealissuers') == '1') {
    234                 $oTransaction->setIssuer( $this->bankOption );
    235             }
    236154
    237155            method_exists( $oOrder, 'get_billing_email' ) ? $billing_email = $oOrder->get_billing_email() : $billing_email = $oOrder->billing_email;
     
    816734     */
    817735    public function validate_fields() {
    818         global $woocommerce;
    819         if ( key_exists('wc-cardgateideal-new-payment-method', $_POST) && get_option('cgp_checkoutidealissuers') == '1' ) {
    820             if ( empty( $_POST['cardgateideal_issuer'] ) || $_POST['cardgateideal_issuer'] == '0' ) {
    821                 wc_add_notice( __( ' Choose your bank first, please', 'cardgate' ), 'error' );
    822                 return false;
    823             } else {
    824                 $this->bankOption = $_POST['cardgateideal_issuer'];
    825             }
    826         } elseif ( key_exists('payment_method', $_POST) && $_POST['payment_method'] == 'cardgateideal' && get_option('cgp_checkoutidealissuers') == '1' ) {
    827             if ( empty( $_POST['cgp_bank_options'] ) || $_POST['cgp_bank_options'] == '0' ) {
    828                 wc_add_notice( __( ' Choose your bank first, please', 'cardgate' ), 'error' );
    829                 return false;
    830             } else {
    831                 $this->bankOption = $_POST['cgp_bank_options'];
    832             }
    833         } else {
    834             return true;
    835         }
     736        return true;
    836737    }
    837738
  • cardgate/tags/3.2.4/classes/WC_CardgateIdeal.php

    r2491968 r3279051  
    1919    var $company = 'CardGate';
    2020    public $supports = ['products', 'refunds'];
    21     var $has_fields = true; //extra field for bank data
     21    var $has_fields = false; // no more bank field
    2222   
    2323    public function __construct() {
  • cardgate/tags/3.2.4/classes/woocommerce-blocks/ideal/IdealCardgate.php

    r3218324 r3279051  
    6363            'icon'                              => $this->iconpath.'ideal.svg',
    6464            'show_icon'                         => $this->settings['show_icon'],
    65             'show_issuers'                      => $this->settings['show_issuers'],
    6665            'supports'                          => ['products'],
    67             'issuers'                           => $this->settings['issuers'],
    6866            'feeUrl'                            => $this->settings['feeUrl'],
    6967        );
     
    7573        $settings['show_icon'] = ($use_icon == 'withlogo');
    7674        $settings['show_issuers'] = false;
    77         $aIssuers = [];
    78 
    79         if ( get_option( 'cgp_checkoutidealissuers' ) == '1' ) {
    80             $settings['show_issuers'] = true;
    81             $settings['issuers'] = get_option( 'sIssuers' );
    82 
    83             $aIssuers[] = [ 'value' => '', 'name' => __( 'Choose Bank', 'cardgate' )];
    84             $availableGateways = WC()->payment_gateways()->get_available_payment_gateways();
    85             foreach ($availableGateways as $key => $gateway) {
    86                 if ( $key == 'cardgateideal' ) {
    87                     $issuers = $gateway->getBankoptions();
    88                     foreach ( $issuers as $key => $value ) {
    89                         $aIssuers[] = [ 'value' => $key, 'name' => $value ];
    90                     }
    91                 }
    92             }
    93         }
    94 
    95         $settings['issuers'] = json_encode(($aIssuers));
    9675        $settings['feeUrl'] =  admin_url('admin-ajax.php');
    9776        return $settings;
  • cardgate/tags/3.2.4/classes/woocommerce-blocks/ideal/build/index.js

    r3218324 r3279051  
    1 (()=>{"use strict";let e=window.wc.wcBlocksRegistry,t=window.wp.i18n,a=window.wc.wcSettings,o=window.wp.htmlEntities,c=window.React,n=window.JSON,l=(0,a.getSetting)("cardgateideal_data",{}),s=(0,t.__)("iDEAL","wc_payment_method_cardgateideal"),r=(0,o.decodeEntities)(l.title)||s,m=n.parse(l.issuers),i=e=>{let[a,n]=(0,c.useState)(""),{eventRegistration:s,emitResponse:r}=e,{onPaymentSetup:i}=s;if(c.useEffect(()=>{let t=(e,t)=>{let a="<span class='wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value'>"+(t+e)+"</span>";jQuery(".wc-block-components-totals-footer-item .wc-block-formatted-money-amount:first").replaceWith(a)},a=(e,t)=>{let a="<span class='wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value'>"+(t+e)+"</span>";jQuery("div.wp-block-woocommerce-checkout-order-summary-taxes-block.wc-block-components-totals-wrapper > div > span.wc-block-formatted-money-amount.wc-block-components-formatted-money-amount.wc-block-components-totals-item__value:first").replaceWith(a)};jQuery.ajax({url:l.feeUrl,method:"POST",data:{action:"wp_ajax_cardgate_checkout_fees",method:e.activePaymentMethod},complete:function e(t,a){},success:function e(o,c,n){let l=jQuery(".wc-block-components-totals-fees");if(o.data.amount){let s="<div class='wc-block-components-totals-item wc-block-components-totals-fees'><span class='wc-block-components-totals-item__label'>"+o.data.name+"</span><span class='wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value'>"+o.data.currency+o.data.amount.toFixed(2).replace(".",",")+"</span><div class='wc-block-components-totals-item__description'></div></div>";l.length?(l.replaceWith(s),t(o.data.newTotal.toFixed(2).replace(".",","),o.data.currency),a(o.data.totalTax.toFixed(2).replace(".",","),o.data.currency)):(jQuery(".wc-block-components-totals-item:first").after(s),t(o.data.newTotal.toFixed(2).replace(".",","),o.data.currency),a(o.data.totalTax.toFixed(2).replace(".",","),o.data.currency))}else null==l||l.hide(),t(o.data.newTotal.toFixed(2).replace(".",","),o.data.currency),a(o.data.totalTax.toFixed(2).replace(".",","),o.data.currency)},error:function e(t,a,o){console.warn(a,o)}})}),(0,c.useEffect)(()=>{let e=i(async()=>{let e=a;return l.show_issuers?e.length?{type:r.responseTypes.SUCCESS,meta:{paymentMethodData:{cardgateideal_issuer:e}}}:{type:r.responseTypes.ERROR,message:(0,t.__)(" Choose your bank first, please","cardgate")}:()=>{e()}});return()=>{e()}},[r.responseTypes.ERROR,r.responseTypes.SUCCESS,i,a]),l.show_issuers){let d=c.createElement("div",null,(0,o.decodeEntities)(l.description||"")),p=c.createElement("select",{name:"issuers",value:a,onChange(e){n(e.target.value)}},...m.map((e,t)=>c.createElement("option",{value:e.value},e.name)));return c.createElement("div",null,p,d)}},d={name:"cardgateideal",label:c.createElement(e=>{var t=c.createElement("img",{src:l.icon,width:28,height:24,style:{display:"inline"}});return l.show_icon||(t=null),c.createElement("span",{className:"wc-block-components-payment-method-label wc-block-components-payment-method-label--with-icon"},t,(0,o.decodeEntities)(l.title)||s)},null),content:c.createElement(i,null),edit:c.createElement(i,null),icons:null,canMakePayment:e=>!0,ariaLabel:r,supports:{features:c.supports}};(0,e.registerPaymentMethod)(d)})();
     1(()=>{"use strict";let t=window.wc.wcBlocksRegistry,e=window.wp.i18n,a=window.wc.wcSettings,o=window.wp.htmlEntities,c=window.React,n=(0,a.getSetting)("cardgateideal_data",{}),l=(0,e.__)("iDEAL","wc_payment_method_cardgateideal"),s=(0,o.decodeEntities)(n.title)||l,r=t=>{let[e,a]=(0,c.useState)(""),{eventRegistration:l,emitResponse:s}=t,{onPaymentSetup:r}=l;return c.useEffect(()=>{let e=(t,e)=>{var a,o,c="<span class='wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value'>"+(e+t)+"</span>";jQuery(".wc-block-components-totals-footer-item .wc-block-formatted-money-amount:first").replaceWith(c)},a=(t,e)=>{var a,o,c="<span class='wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value'>"+(e+t)+"</span>";jQuery("div.wp-block-woocommerce-checkout-order-summary-taxes-block.wc-block-components-totals-wrapper > div > span.wc-block-formatted-money-amount.wc-block-components-formatted-money-amount.wc-block-components-totals-item__value:first").replaceWith(c)};jQuery.ajax({url:n.feeUrl,method:"POST",data:{action:"wp_ajax_cardgate_checkout_fees",method:t.activePaymentMethod},complete:function t(e,a){},success:function t(o,c,n){let l=jQuery(".wc-block-components-totals-fees");if(o.data.amount){let s="<div class='wc-block-components-totals-item wc-block-components-totals-fees'><span class='wc-block-components-totals-item__label'>"+o.data.name+"</span><span class='wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value'>"+o.data.currency+o.data.amount.toFixed(2)+"</span><div class='wc-block-components-totals-item__description'></div></div>";l.length?(l.replaceWith(s),e(o.data.newTotal.toFixed(2).replace(".",","),o.data.currency),a(o.data.totalTax.toFixed(2).replace(".",","),o.data.currency)):(jQuery(".wc-block-components-totals-item:first").after(s),e(o.data.newTotal.toFixed(2).replace(".",","),o.data.currency),a(o.data.totalTax.toFixed(2).replace(".",","),o.data.currency))}else null==l||l.hide(),e(o.data.newTotal.toFixed(2).replace(".",","),o.data.currency),a(o.data.totalTax.toFixed(2).replace(".",","),o.data.currency)},error:function t(e,a,o){console.warn(a,o)}})}),c.createElement("div",null,(0,o.decodeEntities)(n.description||""))},m={name:"cardgateideal",label:c.createElement(t=>{var e=c.createElement("img",{src:n.icon,width:28,height:24,style:{display:"inline"}});return n.show_icon||(e=null),c.createElement("span",{className:"wc-block-components-payment-method-label wc-block-components-payment-method-label--with-icon"},e,(0,o.decodeEntities)(n.title)||l)},null),content:c.createElement(r,null),edit:c.createElement(r,null),icons:null,canMakePayment:t=>!0,ariaLabel:s,supports:{features:c.supports}};(0,t.registerPaymentMethod)(m)})();
  • cardgate/tags/3.2.4/readme.txt

    r3269659 r3279051  
    55Requires at least: 4.4
    66Tested up to: 6.8
    7 Stable tag: 3.2.3
     7Stable tag: 3.2.4
    88License: GPLv3 or later
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
  • cardgate/trunk/cardgate.php

    r3218324 r3279051  
    77 * Author: CardGate
    88 * Author URI: https://www.cardgate.com
    9  * Version: 3.2.3
     9 * Version: 3.2.4
    1010 * Text Domain: cardgate
    1111 * Domain Path: /i18n/languages
     
    195195                update_option('cgp_merchant_api_key', $_POST['cgp_merchant_api_key']);
    196196                update_option('cgp_checkoutdisplay', $_POST['cgp_checkoutdisplay']);
    197                 update_option('cgp_checkoutidealissuers', $_POST['cgp_checkoutidealissuers']);
    198 
    199                 //This wil refresh the bank issuer cache
    200                 update_option('IssuerRefresh', 0, true);
    201197               
    202198                $bIsTest = ($_POST['cgp_mode'] == 1 ? TRUE : FALSE);
     
    286282                                    <option value="withlogo"<?php echo (get_option('cgp_checkoutdisplay') == 'withlogo' ? ('selected="selected"') : '') ?> > <?php echo __('With Logo','cardgate') ?></option>
    287283                                </select>
    288                         </td>
    289                     </tr>
    290                     <tr>
    291                         <th scope="row">
    292                         <label for="cgp_checkoutidealissuers"><?php echo __('Show ideal issuers', 'cardgate') ?></label>
    293                         </th>
    294                         <td>
    295                                 <select style="width:140px;" id="cgp_checkoutidealissuers" name="cgp_checkoutidealissuers">
    296                                     <option value="0"<?php echo (get_option('cgp_checkoutidealissuers') == '0' ? ('selected="selected"') : '') ?> > <?php echo __('Without issuers','cardgate')?></option>
    297                                     <option value="1"<?php echo (get_option('cgp_checkoutidealissuers') == '1' ? ('selected="selected"') : '') ?> > <?php echo __('With issuers','cardgate') ?></option>
    298                                 </select><br>
    299                             <?php echo __('iDEAL v2 will not show issuers any more by default (Mandatory by iDEAL).', 'cardgate') ?>
    300284                        </td>
    301285                    </tr>
  • cardgate/trunk/classes/CGP_Common_Gateway.php

    r3218324 r3279051  
    4343            echo wpautop( wptexturize( $this->description ) );
    4444        }
    45         if (
    46             $this->has_fields
    47             && get_option( 'cgp_checkoutidealissuers' ) == '1'
    48         ) {
    49             $this->generate_bank_html();
    50         }
    5145    }
    5246
     
    5953        }
    6054    }
    61 
    62     /**
    63      * Generate the bank options
    64      */
    65     public function generate_bank_html() {
    66         $aIssuers = $this->getBankOptions();
    67         $html = '<fieldset>
    68                 <p class="form-row form-row-first ">
    69                 <label for="cc-expire-month">' . __( 'Bank Options', 'cardgate' ) . '</label>';
    70         $html .= '<select name="cgp_bank_options" id="cgp_bank_options" class="woocommerce-select">';
    71         $html .= '<option value="0">' . __( 'Choose Bank', 'cardgate' ) . '</option>';
    72         foreach ( $aIssuers as $id => $name ) {
    73             $html .= '<option value="' . $id;
    74             $html .= ( ( isset( $this->bankOption ) && $id == $this->bankOption ) ? ' selected="selected" ' : '' );
    75             $html .= '">' . $name . '</option>';
    76         }
    77         $html .= '</select></p></fieldset>';
    78         echo $html;
    79     }
    80 
    81     // ////////////////////////////////////////////////
    82 
    83     /**
    84      * Fetch bank options from Card Gate
    85      */
    86     public function getBankOptions() {
    87         $this->checkBankOptions();
    88         $aIssuers = get_option( 'sIssuers' );
    89         return $aIssuers;
    90     }
    91 
    92     private function checkBankOptions() {
    93         if ( get_option( 'IssuerRefresh' ) ) {
    94             $iIssuerRefresh = (int) get_option( 'IssuerRefresh' );
    95             if ( $iIssuerRefresh < time() ) {
    96                 $this->cacheBankOptions();
    97             }
    98         } else {
    99             $this->cacheBankOptions();
    100         }
    101     }
    102 
    103     private function cacheBankOptions() {
    104         $iCacheTime     = 24 * 60 * 60;
    105         $iIssuerRefresh = time() + $iCacheTime;
    106         update_option( 'IssuerRefresh', $iIssuerRefresh, true );
    107 
    108         try {
    109             $iMerchantId     = ( get_option( 'cgp_merchant_id' ) ? get_option( 'cgp_merchant_id' ) : 0 );
    110             $sMerchantApiKey = ( get_option( 'cgp_merchant_api_key' ) ? get_option( 'cgp_merchant_api_key' ) : 0 );
    111             $bIsTest         = ( get_option( 'cgp_mode' ) == 1 ? true : false );
    112 
    113             $oCardGate = new cardgate\api\Client( (int) $iMerchantId, $sMerchantApiKey, $bIsTest );
    114             $oCardGate->setIp( $_SERVER['REMOTE_ADDR'] );
    115 
    116             $aIssuers = $oCardGate->methods()
    117                                   ->get( cardgate\api\Method::IDEAL )
    118                                   ->getIssuers();
    119         } catch ( cardgate\api\Exception $oException_ ) {
    120             $aIssuers[0] = [
    121                 'id'   => 0,
    122                 'name' => htmlspecialchars( $oException_->getMessage() )
    123             ];
    124         }
    125 
    126         foreach ( $aIssuers as $aIssuer ) {
    127             $aOptions[ $aIssuer['id'] ] = $aIssuer['name'];
    128         }
    129         $bIsValid = array_key_exists('INGBNL2A', $aOptions);
    130         if ($bIsValid) {
    131             update_option( 'sIssuers', $aOptions, true );
    132         }
    133     }
    13455
    13556    // //////////////////////////////////////////////
     
    231152            // Configure payment option.
    232153            $oTransaction->setPaymentMethod( $this->payment_method );
    233             if ( $this->payment_method == 'ideal' && get_option('cgp_checkoutidealissuers') == '1') {
    234                 $oTransaction->setIssuer( $this->bankOption );
    235             }
    236154
    237155            method_exists( $oOrder, 'get_billing_email' ) ? $billing_email = $oOrder->get_billing_email() : $billing_email = $oOrder->billing_email;
     
    816734     */
    817735    public function validate_fields() {
    818         global $woocommerce;
    819         if ( key_exists('wc-cardgateideal-new-payment-method', $_POST) && get_option('cgp_checkoutidealissuers') == '1' ) {
    820             if ( empty( $_POST['cardgateideal_issuer'] ) || $_POST['cardgateideal_issuer'] == '0' ) {
    821                 wc_add_notice( __( ' Choose your bank first, please', 'cardgate' ), 'error' );
    822                 return false;
    823             } else {
    824                 $this->bankOption = $_POST['cardgateideal_issuer'];
    825             }
    826         } elseif ( key_exists('payment_method', $_POST) && $_POST['payment_method'] == 'cardgateideal' && get_option('cgp_checkoutidealissuers') == '1' ) {
    827             if ( empty( $_POST['cgp_bank_options'] ) || $_POST['cgp_bank_options'] == '0' ) {
    828                 wc_add_notice( __( ' Choose your bank first, please', 'cardgate' ), 'error' );
    829                 return false;
    830             } else {
    831                 $this->bankOption = $_POST['cgp_bank_options'];
    832             }
    833         } else {
    834             return true;
    835         }
     736        return true;
    836737    }
    837738
  • cardgate/trunk/classes/WC_CardgateIdeal.php

    r2491968 r3279051  
    1919    var $company = 'CardGate';
    2020    public $supports = ['products', 'refunds'];
    21     var $has_fields = true; //extra field for bank data
     21    var $has_fields = false; // no more bank field
    2222   
    2323    public function __construct() {
  • cardgate/trunk/classes/woocommerce-blocks/ideal/IdealCardgate.php

    r3218324 r3279051  
    6363            'icon'                              => $this->iconpath.'ideal.svg',
    6464            'show_icon'                         => $this->settings['show_icon'],
    65             'show_issuers'                      => $this->settings['show_issuers'],
    6665            'supports'                          => ['products'],
    67             'issuers'                           => $this->settings['issuers'],
    6866            'feeUrl'                            => $this->settings['feeUrl'],
    6967        );
     
    7573        $settings['show_icon'] = ($use_icon == 'withlogo');
    7674        $settings['show_issuers'] = false;
    77         $aIssuers = [];
    78 
    79         if ( get_option( 'cgp_checkoutidealissuers' ) == '1' ) {
    80             $settings['show_issuers'] = true;
    81             $settings['issuers'] = get_option( 'sIssuers' );
    82 
    83             $aIssuers[] = [ 'value' => '', 'name' => __( 'Choose Bank', 'cardgate' )];
    84             $availableGateways = WC()->payment_gateways()->get_available_payment_gateways();
    85             foreach ($availableGateways as $key => $gateway) {
    86                 if ( $key == 'cardgateideal' ) {
    87                     $issuers = $gateway->getBankoptions();
    88                     foreach ( $issuers as $key => $value ) {
    89                         $aIssuers[] = [ 'value' => $key, 'name' => $value ];
    90                     }
    91                 }
    92             }
    93         }
    94 
    95         $settings['issuers'] = json_encode(($aIssuers));
    9675        $settings['feeUrl'] =  admin_url('admin-ajax.php');
    9776        return $settings;
  • cardgate/trunk/classes/woocommerce-blocks/ideal/build/index.js

    r3218324 r3279051  
    1 (()=>{"use strict";let e=window.wc.wcBlocksRegistry,t=window.wp.i18n,a=window.wc.wcSettings,o=window.wp.htmlEntities,c=window.React,n=window.JSON,l=(0,a.getSetting)("cardgateideal_data",{}),s=(0,t.__)("iDEAL","wc_payment_method_cardgateideal"),r=(0,o.decodeEntities)(l.title)||s,m=n.parse(l.issuers),i=e=>{let[a,n]=(0,c.useState)(""),{eventRegistration:s,emitResponse:r}=e,{onPaymentSetup:i}=s;if(c.useEffect(()=>{let t=(e,t)=>{let a="<span class='wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value'>"+(t+e)+"</span>";jQuery(".wc-block-components-totals-footer-item .wc-block-formatted-money-amount:first").replaceWith(a)},a=(e,t)=>{let a="<span class='wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value'>"+(t+e)+"</span>";jQuery("div.wp-block-woocommerce-checkout-order-summary-taxes-block.wc-block-components-totals-wrapper > div > span.wc-block-formatted-money-amount.wc-block-components-formatted-money-amount.wc-block-components-totals-item__value:first").replaceWith(a)};jQuery.ajax({url:l.feeUrl,method:"POST",data:{action:"wp_ajax_cardgate_checkout_fees",method:e.activePaymentMethod},complete:function e(t,a){},success:function e(o,c,n){let l=jQuery(".wc-block-components-totals-fees");if(o.data.amount){let s="<div class='wc-block-components-totals-item wc-block-components-totals-fees'><span class='wc-block-components-totals-item__label'>"+o.data.name+"</span><span class='wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value'>"+o.data.currency+o.data.amount.toFixed(2).replace(".",",")+"</span><div class='wc-block-components-totals-item__description'></div></div>";l.length?(l.replaceWith(s),t(o.data.newTotal.toFixed(2).replace(".",","),o.data.currency),a(o.data.totalTax.toFixed(2).replace(".",","),o.data.currency)):(jQuery(".wc-block-components-totals-item:first").after(s),t(o.data.newTotal.toFixed(2).replace(".",","),o.data.currency),a(o.data.totalTax.toFixed(2).replace(".",","),o.data.currency))}else null==l||l.hide(),t(o.data.newTotal.toFixed(2).replace(".",","),o.data.currency),a(o.data.totalTax.toFixed(2).replace(".",","),o.data.currency)},error:function e(t,a,o){console.warn(a,o)}})}),(0,c.useEffect)(()=>{let e=i(async()=>{let e=a;return l.show_issuers?e.length?{type:r.responseTypes.SUCCESS,meta:{paymentMethodData:{cardgateideal_issuer:e}}}:{type:r.responseTypes.ERROR,message:(0,t.__)(" Choose your bank first, please","cardgate")}:()=>{e()}});return()=>{e()}},[r.responseTypes.ERROR,r.responseTypes.SUCCESS,i,a]),l.show_issuers){let d=c.createElement("div",null,(0,o.decodeEntities)(l.description||"")),p=c.createElement("select",{name:"issuers",value:a,onChange(e){n(e.target.value)}},...m.map((e,t)=>c.createElement("option",{value:e.value},e.name)));return c.createElement("div",null,p,d)}},d={name:"cardgateideal",label:c.createElement(e=>{var t=c.createElement("img",{src:l.icon,width:28,height:24,style:{display:"inline"}});return l.show_icon||(t=null),c.createElement("span",{className:"wc-block-components-payment-method-label wc-block-components-payment-method-label--with-icon"},t,(0,o.decodeEntities)(l.title)||s)},null),content:c.createElement(i,null),edit:c.createElement(i,null),icons:null,canMakePayment:e=>!0,ariaLabel:r,supports:{features:c.supports}};(0,e.registerPaymentMethod)(d)})();
     1(()=>{"use strict";let t=window.wc.wcBlocksRegistry,e=window.wp.i18n,a=window.wc.wcSettings,o=window.wp.htmlEntities,c=window.React,n=(0,a.getSetting)("cardgateideal_data",{}),l=(0,e.__)("iDEAL","wc_payment_method_cardgateideal"),s=(0,o.decodeEntities)(n.title)||l,r=t=>{let[e,a]=(0,c.useState)(""),{eventRegistration:l,emitResponse:s}=t,{onPaymentSetup:r}=l;return c.useEffect(()=>{let e=(t,e)=>{var a,o,c="<span class='wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value'>"+(e+t)+"</span>";jQuery(".wc-block-components-totals-footer-item .wc-block-formatted-money-amount:first").replaceWith(c)},a=(t,e)=>{var a,o,c="<span class='wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value'>"+(e+t)+"</span>";jQuery("div.wp-block-woocommerce-checkout-order-summary-taxes-block.wc-block-components-totals-wrapper > div > span.wc-block-formatted-money-amount.wc-block-components-formatted-money-amount.wc-block-components-totals-item__value:first").replaceWith(c)};jQuery.ajax({url:n.feeUrl,method:"POST",data:{action:"wp_ajax_cardgate_checkout_fees",method:t.activePaymentMethod},complete:function t(e,a){},success:function t(o,c,n){let l=jQuery(".wc-block-components-totals-fees");if(o.data.amount){let s="<div class='wc-block-components-totals-item wc-block-components-totals-fees'><span class='wc-block-components-totals-item__label'>"+o.data.name+"</span><span class='wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value'>"+o.data.currency+o.data.amount.toFixed(2)+"</span><div class='wc-block-components-totals-item__description'></div></div>";l.length?(l.replaceWith(s),e(o.data.newTotal.toFixed(2).replace(".",","),o.data.currency),a(o.data.totalTax.toFixed(2).replace(".",","),o.data.currency)):(jQuery(".wc-block-components-totals-item:first").after(s),e(o.data.newTotal.toFixed(2).replace(".",","),o.data.currency),a(o.data.totalTax.toFixed(2).replace(".",","),o.data.currency))}else null==l||l.hide(),e(o.data.newTotal.toFixed(2).replace(".",","),o.data.currency),a(o.data.totalTax.toFixed(2).replace(".",","),o.data.currency)},error:function t(e,a,o){console.warn(a,o)}})}),c.createElement("div",null,(0,o.decodeEntities)(n.description||""))},m={name:"cardgateideal",label:c.createElement(t=>{var e=c.createElement("img",{src:n.icon,width:28,height:24,style:{display:"inline"}});return n.show_icon||(e=null),c.createElement("span",{className:"wc-block-components-payment-method-label wc-block-components-payment-method-label--with-icon"},e,(0,o.decodeEntities)(n.title)||l)},null),content:c.createElement(r,null),edit:c.createElement(r,null),icons:null,canMakePayment:t=>!0,ariaLabel:s,supports:{features:c.supports}};(0,t.registerPaymentMethod)(m)})();
  • cardgate/trunk/readme.txt

    r3269659 r3279051  
    55Requires at least: 4.4
    66Tested up to: 6.8
    7 Stable tag: 3.2.3
     7Stable tag: 3.2.4
    88License: GPLv3 or later
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
Note: See TracChangeset for help on using the changeset viewer.