Plugin Directory

Changeset 1787546


Ignore:
Timestamp:
12/15/2017 10:56:46 AM (8 years ago)
Author:
andsnleo
Message:

Release v1.0.14

Location:
iugu-woocommerce
Files:
45 added
3 edited

Legend:

Unmodified
Added
Removed
  • iugu-woocommerce/trunk/includes/class-wc-iugu-api.php

    r1781523 r1787546  
    889889
    890890                    foreach ( $error as $_error ) {
    891                         $this->add_error( $name . ' ' . $_error . '.');
     891                        $this->add_error( $this->convert_API_param($name) . ' ' . $_error . '.');
    892892                    }
    893893                }
     
    10511051        wp_die( __( 'The request failed!', 'iugu-woocommerce' ), __( 'The request failed!', 'iugu-woocommerce' ), array( 'response' => 200 ) );
    10521052    }
     1053
     1054    /**
     1055     * Convert iugu API parameters from the most common error responses
     1056     * to make them more human-readabale and match fields' names
     1057     * on the checkout page if necessary.
     1058     *
     1059     * @param string $param
     1060     *
     1061     * @return string
     1062    */
     1063
     1064    protected function convert_API_param( $param ) {
     1065        $param = end( explode( '.', $param ) );
     1066
     1067        $map = array(
     1068            'email' => 'Email address',
     1069            'cpf_cnpj' => 'CPF/CNPJ',
     1070            'street' => 'Street address',
     1071            'district' => 'Neighborhood',
     1072            'city' => 'Town / City',
     1073            'state' => 'State / County',
     1074            'zip_code' => 'Postcode / ZIP'
     1075        );
     1076
     1077        if ( array_key_exists($param, $map) ) {
     1078            return $map[$param];
     1079        }
     1080
     1081        return ucfirst( str_replace( '_', ' ', $param ) );
     1082    }
    10531083}
  • iugu-woocommerce/trunk/iugu-woocommerce.php

    r1781523 r1787546  
    66 * Author: iugu
    77 * Author URI: https://iugu.com/
    8  * Version: 1.0.13
     8 * Version: 1.0.14
    99 * License: GPLv2 or later
    1010 * Text Domain: iugu-woocommerce
     
    2929     */
    3030    const CLIENT_NAME = 'plugin-iugu-woocommerce';
    31     const CLIENT_VERSION = '1.0.13';
     31    const CLIENT_VERSION = '1.0.14';
    3232
    3333    /**
  • iugu-woocommerce/trunk/readme.txt

    r1781523 r1787546  
    44Requires at least: 3.9
    55Tested up to: 4.9
    6 Stable tag: 1.0.13
     6Stable tag: 1.0.14
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8989== Changelog ==
    9090
     91= 1.0.14 =
     92* **Melhoria**: Erros da API da iugu mais claros na página de checkout.
     93
    9194= 1.0.13 - 2017/12/4 =
    9295* **Adição**: As chamadas de API da iugu agora recebem a versão do plugin utilizada para facilitar o debugging e o suporte.
     
    146149== Upgrade Notice ==
    147150
    148 = 1.0.13 =
    149 Coisa rápida: incluímos a versão do iugu WooCommerce nas chamadas da nossa API para ajudar o desenvolvimento e o suporte do plugin.
     151= 1.0.14 =
     152Pequena atualização para melhorar o texto dos erros da API da iugu que podem surgir na página de checkout.
    150153
    151154
Note: See TracChangeset for help on using the changeset viewer.