Plugin Directory

Changeset 2299357


Ignore:
Timestamp:
05/06/2020 01:53:11 PM (6 years ago)
Author:
postpay
Message:

v0.1.8

Location:
postpay
Files:
4 added
4 deleted
14 edited
7 copied

Legend:

Unmodified
Added
Removed
  • postpay/tags/0.1.8/includes/class-wc-postpay-gateway.php

    r2290456 r2299357  
    3636        $this->title       = $this->get_option( 'title' );
    3737        $this->description = $this->get_option( 'description' );
     38        $this->theme       = $this->get_option( 'theme' );
    3839        $this->token_param = $this->id . '-token';
    3940        $this->sandbox     = 'yes' === $this->get_option( 'sandbox', 'yes' );
     
    4243        $this->max_amount  = $this->get_option( 'max_amount', 0 );
    4344        $this->min_amount  = $this->get_option( 'min_amount', 0 );
    44         $this->icon        = WC_POSTPAY_DIR_URL . 'assets/images/logo-' . $this->get_option( 'icon' ) . '.png';
     45        $this->icon        = WC_POSTPAY_DIR_URL . 'assets/images/logo-' . $this->get_option( 'theme' ) . '.png';
    4546
    4647        require_once WC_POSTPAY_DIR_PATH . 'includes/class-wc-postpay-api.php';
  • postpay/tags/0.1.8/includes/wc-postpay-settings.php

    r2290456 r2299357  
    2727        'default'     => __( 'Buy now and pay later with zero interest and zero fees.', 'postpay' ),
    2828    ),
    29     'icon'               => array(
    30         'title'       => __( 'Icon Color', 'postpay' ),
     29    'theme'              => array(
     30        'title'       => __( 'Theme', 'postpay' ),
    3131        'type'        => 'select',
    3232        'desc_tip'    => true,
    33         'description' => __( 'This controls the color of the icon which the user sees during checkout.', 'postpay' ),
    34         'default'     => 'blue',
     33        'description' => __( 'This controls the color to coordinate and contrast with different backgrounds.', 'postpay' ),
     34        'default'     => 'light',
    3535        'options'     => array(
    36             'blue'  => __( 'Blue', 'postpay' ),
    37             'white' => __( 'White', 'postpay' ),
     36            'light' => __( 'Light', 'postpay' ),
     37            'dark'  => __( 'Dark', 'postpay' ),
    3838        ),
    3939    ),
  • postpay/tags/0.1.8/languages/postpay-es_ES.po

    r2298511 r2299357  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Postpay 0.1.7\n"
     5"Project-Id-Version: WooCommerce Postpay Payment Gateway 0.1.8\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/postpay\n"
    77"Language-Team: Spanish (Spain)\n"
     
    1010"Content-Transfer-Encoding: 8bit\n"
    1111"X-Generator: Poedit 2.3\n"
    12 "POT-Creation-Date: 2020-04-23T19:30:34+00:00\n"
    13 "PO-Revision-Date: 2020-04-23 19:40+0000\n"
     12"POT-Creation-Date: 2020-05-06T13:21:35+00:00\n"
     13"PO-Revision-Date: 2020-05-06 13:24+0000\n"
    1414"X-Domain: postpay\n"
    1515"Last-Translator: mongkok <dani@postpay.io>\n"
     
    4949
    5050#. translators: %1$s: transaction id %2$s: error code
    51 #: includes/class-wc-postpay-gateway.php:154
     51#: includes/class-wc-postpay-gateway.php:155
    5252msgid "Postpay capture failed. ID: %1$s. Code: %2$s."
    5353msgstr "La captura con Postpay falló. ID: %1$s. Código: %2$s."
    5454
    55 #: includes/class-wc-postpay-gateway.php:163
     55#: includes/class-wc-postpay-gateway.php:164
    5656msgid "Postpay capture error."
    5757msgstr "Postpay error de captura."
    5858
    5959#. translators: %1$s: transaction id %2$s: order status
    60 #: includes/class-wc-postpay-gateway.php:179
     60#: includes/class-wc-postpay-gateway.php:180
    6161msgid "Postpay order cancelled. ID: %1$s. Status: %2$s."
    6262msgstr "Postpay pedido cancelado. ID: %1$s. Estado: %2$s."
    6363
    64 #: includes/class-wc-postpay-gateway.php:185
     64#: includes/class-wc-postpay-gateway.php:186
    6565msgid "Postpay order cancelled."
    6666msgstr "Postpay pedido cancelado."
    6767
    6868#. translators: %1$s: transaction id %2$s: error code
    69 #: includes/class-wc-postpay-gateway.php:209
     69#: includes/class-wc-postpay-gateway.php:210
    7070msgid "Postpay refund failed. ID: %1$s. Code: %2$s."
    7171msgstr "La devolución con Postpay falló. ID: %1$s. Código: %2$s."
     
    106106
    107107#: includes/wc-postpay-settings.php:30
    108 msgid "Icon Color"
    109 msgstr "Color del Icono"
     108msgid "Theme"
     109msgstr "Tema"
    110110
    111111#: includes/wc-postpay-settings.php:33
    112112msgid ""
    113 "This controls the color of the icon which the user sees during checkout."
    114 msgstr ""
    115 "Esto controla el color del icono que el usuario ve durante el proceso de "
    116 "compra."
     113"This controls the color to coordinate and contrast with different "
     114"backgrounds."
     115msgstr ""
     116"Esto controla el color para coordinar y contrastar con diferentes fondos."
    117117
    118118#: includes/wc-postpay-settings.php:36
    119 msgid "Blue"
    120 msgstr "Azul"
     119msgid "Light"
     120msgstr "Claro"
    121121
    122122#: includes/wc-postpay-settings.php:37
    123 msgid "White"
    124 msgstr "Blanco"
     123msgid "Dark"
     124msgstr "Oscuro"
    125125
    126126#: includes/wc-postpay-settings.php:41
  • postpay/tags/0.1.8/languages/postpay.pot

    r2298511 r2299357  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: WooCommerce Postpay Payment Gateway 0.1.7\n"
     5"Project-Id-Version: WooCommerce Postpay Payment Gateway 0.1.8\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/postpay\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2020-04-23T19:30:34+00:00\n"
     12"POT-Creation-Date: 2020-05-06T13:21:35+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.4.0\n"
     
    4747
    4848#. translators: %1$s: transaction id %2$s: error code
    49 #: includes/class-wc-postpay-gateway.php:154
     49#: includes/class-wc-postpay-gateway.php:155
    5050msgid "Postpay capture failed. ID: %1$s. Code: %2$s."
    5151msgstr ""
    5252
    53 #: includes/class-wc-postpay-gateway.php:163
     53#: includes/class-wc-postpay-gateway.php:164
    5454msgid "Postpay capture error."
    5555msgstr ""
    5656
    5757#. translators: %1$s: transaction id %2$s: order status
    58 #: includes/class-wc-postpay-gateway.php:179
     58#: includes/class-wc-postpay-gateway.php:180
    5959msgid "Postpay order cancelled. ID: %1$s. Status: %2$s."
    6060msgstr ""
    6161
    62 #: includes/class-wc-postpay-gateway.php:185
     62#: includes/class-wc-postpay-gateway.php:186
    6363msgid "Postpay order cancelled."
    6464msgstr ""
    6565
    6666#. translators: %1$s: transaction id %2$s: error code
    67 #: includes/class-wc-postpay-gateway.php:209
     67#: includes/class-wc-postpay-gateway.php:210
    6868msgid "Postpay refund failed. ID: %1$s. Code: %2$s."
    6969msgstr ""
     
    102102
    103103#: includes/wc-postpay-settings.php:30
    104 msgid "Icon Color"
     104msgid "Theme"
    105105msgstr ""
    106106
    107107#: includes/wc-postpay-settings.php:33
    108 msgid "This controls the color of the icon which the user sees during checkout."
     108msgid "This controls the color to coordinate and contrast with different backgrounds."
    109109msgstr ""
    110110
    111111#: includes/wc-postpay-settings.php:36
    112 msgid "Blue"
     112msgid "Light"
    113113msgstr ""
    114114
    115115#: includes/wc-postpay-settings.php:37
    116 msgid "White"
     116msgid "Dark"
    117117msgstr ""
    118118
  • postpay/tags/0.1.8/postpay.php

    r2298511 r2299357  
    22/**
    33 * Plugin Name: WooCommerce Postpay Payment Gateway
    4  * Version: 0.1.7
     4 * Version: 0.1.8
    55 * Plugin URI: https://github.com/postpayio/woocommerce
    66 * Description: Buy now and pay later with zero interest and zero fees.
     
    127127                    'sandbox'    => 'yes' === $this->settings['sandbox'],
    128128                    'merchantId' => $this->settings['merchant_id'],
     129                    'theme'      => $this->settings['theme'] ?? 'light',
    129130                )
    130131            );
    131132        }
    132     }
    133 
    134     /**
    135      * Return if the amount is between maximum and minimum.
    136      *
    137      * @param float $amount Amount.
    138      *
    139      * @return boolean
    140      */
    141     protected function is_valid_amount( $amount ) {
    142         $max_amount = $this->settings['max_amount'];
    143         $min_amount = $this->settings['min_amount'];
    144 
    145         return ( ( 0 < $amount ) &&
    146             ( empty( $max_amount ) || $max_amount > $amount ) &&
    147             ( empty( $min_amount ) || $min_amount < $amount )
    148         );
    149133    }
    150134
     
    154138    public function product_widget() {
    155139        if ( $this->enabled && 'yes' === $this->settings['product_widget'] ) {
    156             global $product;
    157             $price = wc_get_price_including_tax( $product );
    158 
    159             if ( $this->is_valid_amount( $price ) ) {
    160                 wc_get_postpay_template( 'widgets/product.php', array( 'price' => $price ) );
    161             }
     140            wc_get_postpay_template( 'widgets/product.php' );
    162141        }
    163142    }
     
    168147    public function cart_widget() {
    169148        if ( $this->enabled && 'yes' === $this->settings['cart_widget'] ) {
    170             $total = WC()->cart->total;
    171 
    172             if ( $this->is_valid_amount( $total ) ) {
    173                 wc_get_postpay_template( 'widgets/cart.php', array( 'total' => $total ) );
    174             }
     149            wc_get_postpay_template( 'widgets/cart.php' );
    175150        }
    176151    }
  • postpay/tags/0.1.8/readme.txt

    r2298511 r2299357  
    44Tested up to: 5.4
    55Requires PHP: 5.6
    6 Stable tag: 0.1.7
    7 Version: 0.1.7
     6Stable tag: 0.1.8
     7Version: 0.1.8
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    7373== Changelog ==
    7474
     75= 0.1.8 - 2020-05-06 =
     76* Added theme to settings
     77* Removed widget amount validation
     78
    7579= 0.1.7 - 2020-05-05 =
    7680* Fixed interface declaration compatible
  • postpay/tags/0.1.8/templates/widgets/cart.php

    r2287781 r2299357  
    1010    class="postpay-widget"
    1111    data-type="cart"
    12     data-amount="<?php echo WC_Postpay_Adapter::decimal( $total )->jsonSerialize(); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped ?>"
     12    data-amount="<?php echo WC_Postpay_Adapter::decimal( WC()->cart->total )->jsonSerialize(); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped ?>"
    1313    data-currency="<?php echo get_woocommerce_currency(); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped ?>"
    1414></div>
  • postpay/tags/0.1.8/templates/widgets/product.php

    r2287781 r2299357  
    55
    66defined( 'ABSPATH' ) || exit;
     7
     8global $product;
     9
     10$price = wc_get_price_including_tax( $product );
    711?>
    812
  • postpay/trunk/includes/class-wc-postpay-gateway.php

    r2290456 r2299357  
    3636        $this->title       = $this->get_option( 'title' );
    3737        $this->description = $this->get_option( 'description' );
     38        $this->theme       = $this->get_option( 'theme' );
    3839        $this->token_param = $this->id . '-token';
    3940        $this->sandbox     = 'yes' === $this->get_option( 'sandbox', 'yes' );
     
    4243        $this->max_amount  = $this->get_option( 'max_amount', 0 );
    4344        $this->min_amount  = $this->get_option( 'min_amount', 0 );
    44         $this->icon        = WC_POSTPAY_DIR_URL . 'assets/images/logo-' . $this->get_option( 'icon' ) . '.png';
     45        $this->icon        = WC_POSTPAY_DIR_URL . 'assets/images/logo-' . $this->get_option( 'theme' ) . '.png';
    4546
    4647        require_once WC_POSTPAY_DIR_PATH . 'includes/class-wc-postpay-api.php';
  • postpay/trunk/includes/wc-postpay-settings.php

    r2290456 r2299357  
    2727        'default'     => __( 'Buy now and pay later with zero interest and zero fees.', 'postpay' ),
    2828    ),
    29     'icon'               => array(
    30         'title'       => __( 'Icon Color', 'postpay' ),
     29    'theme'              => array(
     30        'title'       => __( 'Theme', 'postpay' ),
    3131        'type'        => 'select',
    3232        'desc_tip'    => true,
    33         'description' => __( 'This controls the color of the icon which the user sees during checkout.', 'postpay' ),
    34         'default'     => 'blue',
     33        'description' => __( 'This controls the color to coordinate and contrast with different backgrounds.', 'postpay' ),
     34        'default'     => 'light',
    3535        'options'     => array(
    36             'blue'  => __( 'Blue', 'postpay' ),
    37             'white' => __( 'White', 'postpay' ),
     36            'light' => __( 'Light', 'postpay' ),
     37            'dark'  => __( 'Dark', 'postpay' ),
    3838        ),
    3939    ),
  • postpay/trunk/languages/postpay-es_ES.po

    r2298511 r2299357  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Postpay 0.1.7\n"
     5"Project-Id-Version: WooCommerce Postpay Payment Gateway 0.1.8\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/postpay\n"
    77"Language-Team: Spanish (Spain)\n"
     
    1010"Content-Transfer-Encoding: 8bit\n"
    1111"X-Generator: Poedit 2.3\n"
    12 "POT-Creation-Date: 2020-04-23T19:30:34+00:00\n"
    13 "PO-Revision-Date: 2020-04-23 19:40+0000\n"
     12"POT-Creation-Date: 2020-05-06T13:21:35+00:00\n"
     13"PO-Revision-Date: 2020-05-06 13:24+0000\n"
    1414"X-Domain: postpay\n"
    1515"Last-Translator: mongkok <dani@postpay.io>\n"
     
    4949
    5050#. translators: %1$s: transaction id %2$s: error code
    51 #: includes/class-wc-postpay-gateway.php:154
     51#: includes/class-wc-postpay-gateway.php:155
    5252msgid "Postpay capture failed. ID: %1$s. Code: %2$s."
    5353msgstr "La captura con Postpay falló. ID: %1$s. Código: %2$s."
    5454
    55 #: includes/class-wc-postpay-gateway.php:163
     55#: includes/class-wc-postpay-gateway.php:164
    5656msgid "Postpay capture error."
    5757msgstr "Postpay error de captura."
    5858
    5959#. translators: %1$s: transaction id %2$s: order status
    60 #: includes/class-wc-postpay-gateway.php:179
     60#: includes/class-wc-postpay-gateway.php:180
    6161msgid "Postpay order cancelled. ID: %1$s. Status: %2$s."
    6262msgstr "Postpay pedido cancelado. ID: %1$s. Estado: %2$s."
    6363
    64 #: includes/class-wc-postpay-gateway.php:185
     64#: includes/class-wc-postpay-gateway.php:186
    6565msgid "Postpay order cancelled."
    6666msgstr "Postpay pedido cancelado."
    6767
    6868#. translators: %1$s: transaction id %2$s: error code
    69 #: includes/class-wc-postpay-gateway.php:209
     69#: includes/class-wc-postpay-gateway.php:210
    7070msgid "Postpay refund failed. ID: %1$s. Code: %2$s."
    7171msgstr "La devolución con Postpay falló. ID: %1$s. Código: %2$s."
     
    106106
    107107#: includes/wc-postpay-settings.php:30
    108 msgid "Icon Color"
    109 msgstr "Color del Icono"
     108msgid "Theme"
     109msgstr "Tema"
    110110
    111111#: includes/wc-postpay-settings.php:33
    112112msgid ""
    113 "This controls the color of the icon which the user sees during checkout."
    114 msgstr ""
    115 "Esto controla el color del icono que el usuario ve durante el proceso de "
    116 "compra."
     113"This controls the color to coordinate and contrast with different "
     114"backgrounds."
     115msgstr ""
     116"Esto controla el color para coordinar y contrastar con diferentes fondos."
    117117
    118118#: includes/wc-postpay-settings.php:36
    119 msgid "Blue"
    120 msgstr "Azul"
     119msgid "Light"
     120msgstr "Claro"
    121121
    122122#: includes/wc-postpay-settings.php:37
    123 msgid "White"
    124 msgstr "Blanco"
     123msgid "Dark"
     124msgstr "Oscuro"
    125125
    126126#: includes/wc-postpay-settings.php:41
  • postpay/trunk/languages/postpay.pot

    r2298511 r2299357  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: WooCommerce Postpay Payment Gateway 0.1.7\n"
     5"Project-Id-Version: WooCommerce Postpay Payment Gateway 0.1.8\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/postpay\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2020-04-23T19:30:34+00:00\n"
     12"POT-Creation-Date: 2020-05-06T13:21:35+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.4.0\n"
     
    4747
    4848#. translators: %1$s: transaction id %2$s: error code
    49 #: includes/class-wc-postpay-gateway.php:154
     49#: includes/class-wc-postpay-gateway.php:155
    5050msgid "Postpay capture failed. ID: %1$s. Code: %2$s."
    5151msgstr ""
    5252
    53 #: includes/class-wc-postpay-gateway.php:163
     53#: includes/class-wc-postpay-gateway.php:164
    5454msgid "Postpay capture error."
    5555msgstr ""
    5656
    5757#. translators: %1$s: transaction id %2$s: order status
    58 #: includes/class-wc-postpay-gateway.php:179
     58#: includes/class-wc-postpay-gateway.php:180
    5959msgid "Postpay order cancelled. ID: %1$s. Status: %2$s."
    6060msgstr ""
    6161
    62 #: includes/class-wc-postpay-gateway.php:185
     62#: includes/class-wc-postpay-gateway.php:186
    6363msgid "Postpay order cancelled."
    6464msgstr ""
    6565
    6666#. translators: %1$s: transaction id %2$s: error code
    67 #: includes/class-wc-postpay-gateway.php:209
     67#: includes/class-wc-postpay-gateway.php:210
    6868msgid "Postpay refund failed. ID: %1$s. Code: %2$s."
    6969msgstr ""
     
    102102
    103103#: includes/wc-postpay-settings.php:30
    104 msgid "Icon Color"
     104msgid "Theme"
    105105msgstr ""
    106106
    107107#: includes/wc-postpay-settings.php:33
    108 msgid "This controls the color of the icon which the user sees during checkout."
     108msgid "This controls the color to coordinate and contrast with different backgrounds."
    109109msgstr ""
    110110
    111111#: includes/wc-postpay-settings.php:36
    112 msgid "Blue"
     112msgid "Light"
    113113msgstr ""
    114114
    115115#: includes/wc-postpay-settings.php:37
    116 msgid "White"
     116msgid "Dark"
    117117msgstr ""
    118118
  • postpay/trunk/postpay.php

    r2298511 r2299357  
    22/**
    33 * Plugin Name: WooCommerce Postpay Payment Gateway
    4  * Version: 0.1.7
     4 * Version: 0.1.8
    55 * Plugin URI: https://github.com/postpayio/woocommerce
    66 * Description: Buy now and pay later with zero interest and zero fees.
     
    127127                    'sandbox'    => 'yes' === $this->settings['sandbox'],
    128128                    'merchantId' => $this->settings['merchant_id'],
     129                    'theme'      => $this->settings['theme'] ?? 'light',
    129130                )
    130131            );
    131132        }
    132     }
    133 
    134     /**
    135      * Return if the amount is between maximum and minimum.
    136      *
    137      * @param float $amount Amount.
    138      *
    139      * @return boolean
    140      */
    141     protected function is_valid_amount( $amount ) {
    142         $max_amount = $this->settings['max_amount'];
    143         $min_amount = $this->settings['min_amount'];
    144 
    145         return ( ( 0 < $amount ) &&
    146             ( empty( $max_amount ) || $max_amount > $amount ) &&
    147             ( empty( $min_amount ) || $min_amount < $amount )
    148         );
    149133    }
    150134
     
    154138    public function product_widget() {
    155139        if ( $this->enabled && 'yes' === $this->settings['product_widget'] ) {
    156             global $product;
    157             $price = wc_get_price_including_tax( $product );
    158 
    159             if ( $this->is_valid_amount( $price ) ) {
    160                 wc_get_postpay_template( 'widgets/product.php', array( 'price' => $price ) );
    161             }
     140            wc_get_postpay_template( 'widgets/product.php' );
    162141        }
    163142    }
     
    168147    public function cart_widget() {
    169148        if ( $this->enabled && 'yes' === $this->settings['cart_widget'] ) {
    170             $total = WC()->cart->total;
    171 
    172             if ( $this->is_valid_amount( $total ) ) {
    173                 wc_get_postpay_template( 'widgets/cart.php', array( 'total' => $total ) );
    174             }
     149            wc_get_postpay_template( 'widgets/cart.php' );
    175150        }
    176151    }
  • postpay/trunk/readme.txt

    r2298511 r2299357  
    44Tested up to: 5.4
    55Requires PHP: 5.6
    6 Stable tag: 0.1.7
    7 Version: 0.1.7
     6Stable tag: 0.1.8
     7Version: 0.1.8
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    7373== Changelog ==
    7474
     75= 0.1.8 - 2020-05-06 =
     76* Added theme to settings
     77* Removed widget amount validation
     78
    7579= 0.1.7 - 2020-05-05 =
    7680* Fixed interface declaration compatible
  • postpay/trunk/templates/widgets/cart.php

    r2287781 r2299357  
    1010    class="postpay-widget"
    1111    data-type="cart"
    12     data-amount="<?php echo WC_Postpay_Adapter::decimal( $total )->jsonSerialize(); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped ?>"
     12    data-amount="<?php echo WC_Postpay_Adapter::decimal( WC()->cart->total )->jsonSerialize(); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped ?>"
    1313    data-currency="<?php echo get_woocommerce_currency(); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped ?>"
    1414></div>
  • postpay/trunk/templates/widgets/product.php

    r2287781 r2299357  
    55
    66defined( 'ABSPATH' ) || exit;
     7
     8global $product;
     9
     10$price = wc_get_price_including_tax( $product );
    711?>
    812
Note: See TracChangeset for help on using the changeset viewer.