Plugin Directory

Changeset 2816138


Ignore:
Timestamp:
11/10/2022 05:21:28 PM (3 years ago)
Author:
ventipay
Message:

Update to version 2.0.0 from GitHub

Location:
ventipay
Files:
2 deleted
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • ventipay/tags/2.0.0/LICENSE

    r2595906 r2816138  
    11MIT License
    22
    3 Copyright (c) 2021 Venti / VentiPay / Singular Banking (https://www.ventipay.com/)
     3Copyright (c) 2022 VentiPay / Singular Banking (https://www.ventipay.com/)
    44
    55Permission is hereby granted, free of charge, to any person obtaining a copy
  • ventipay/tags/2.0.0/README.md

    r2595906 r2816138  
    1 # Plugin oficial de Venti para WooCommerce
     1# Plugin oficial de VentiPay para WooCommerce
    22
    3 Acepta pagos con Venti en tiendas WooCommerce
     3Acepta pagos con VentiPay en tiendas WooCommerce
    44
    55## Requisitos
     
    2424Lo primero es conseguir tu API Key. Puedes obtenerla desde el [Dashboard](https://dashboard.ventipay.com/).
    2525
    26 Luego, en la sección Pagos de la configuración de WooCommerce, debes habilitar el método de pago "Venti", configurar tu API Key y decidir si trabajarás en modo live o pruebas.
     26Luego, en la sección Pagos de la configuración de WooCommerce, debes habilitar el método de pago "VentiPay", configurar tu API Key y decidir si trabajarás en modo live o test.
    2727
    2828## Licencia
  • ventipay/tags/2.0.0/assets/css/ventipay-style.css

    r2635881 r2816138  
    1 .ventipay-bnpl-product-button-container {
    2   margin: 0px;
    3   margin-top: 20px;
    4   margin-bottom: 20px;
    5 }
    6 
    7 .ventipay-bnpl-product-button-image-container {
    8   margin: 0px;
    9   padding: 0px;
    10   display: block;
    11 }
    12 
    13 .ventipay-bnpl-product-button-text-container {
    14   margin: 0px;
    15   margin-top: 5px;
    16   padding: 0px;
    17   display: block;
    18 }
  • ventipay/tags/2.0.0/includes/class-wc-gateway-ventipay.php

    r2635881 r2816138  
    1717  {
    1818    $this->id = 'ventipay';
    19     $this->icon = 'https://pay.ventipay.com/assets/apps/woocommerce/plugin-woocommerce-icon-cards.svg';
     19    $this->icon = 'https://wallet.ventipay.com/assets/apps/woocommerce/plugin-woocommerce-icon-checkout.svg';
    2020    $this->has_fields = false;
    21     $this->method_title = __('Venti', 'ventipay');
     21    $this->method_title = __('VentiPay', 'ventipay');
    2222    $this->method_description = __(
    23       'Acepta pagos con tarjetas',
     23      'Paga como quieras',
    2424      'ventipay'
    2525    );
     
    4949      'enabled' => [
    5050        'title' => __('Habilitar/Deshabilitar', 'ventipay'),
    51         'label' => __('Aceptar pagos con Venti', 'ventipay'),
     51        'label' => __('Aceptar pagos con VentiPay', 'ventipay'),
    5252        'type' => 'checkbox',
    5353        'description' => '',
     
    6262        ),
    6363        'default' => __(
    64           'Venti: Tarjeta de Crédito/Débito/Prepago',
     64          'VentiPay',
    6565          'ventipay'
    6666        ),
     
    7575        ),
    7676        'default' => __(
    77           'Paga con tarjetas de Crédito, Débito o Prepago. Procesado por Venti.',
     77          'Paga en cuotas con débito y crédito, y transferencia bancaria.',
    7878          'ventipay'
    7979        ),
     
    9191      ],
    9292      'test_api_key' => [
    93         'title' => __('API Key modo Pruebas', 'ventipay'),
     93        'title' => __('API Key (llave secreta) modo test', 'ventipay'),
    9494        'type' => 'text',
    9595        'placeholder' => 'key_test_...',
    9696      ],
    9797      'live_api_key' => [
    98         'title' => __('API Key modo Live', 'ventipay'),
     98        'title' => __('API Key (llave secreta) modo live', 'ventipay'),
    9999        'type' => 'text',
    100100        'placeholder' => 'key_live_...',
     
    132132       */
    133133      $create_payment = wp_remote_post(
    134         self::API_ENDPOINT . '/payments',
     134        self::API_ENDPOINT . '/checkouts',
    135135        [
    136136          'headers' => [
     
    141141          'data_format' => 'body',
    142142          'body' => wp_json_encode([
    143             'amount' => $amount,
     143            'authorize' => true,
    144144            'currency' => $currency,
    145             'capture' => false,
    146145            'cancel_url' => $return_url,
    147146            'cancel_url_method' => 'post',
     147            'items' => array(
     148              [
     149                'unit_price' => $amount,
     150                'quantity' => 1
     151              ],
     152            ),
     153            'notification_url' => $notification_url,
     154            'notification_events' => ['checkout.paid'],
    148155            'success_url' => $return_url,
    149156            'success_url_method' => 'post',
    150             'notification_url' => $notification_url,
    151             'notification_events' => ['payment.authorized'],
    152157            'metadata' => [
    153158              'wp_order_id' => $order_id,
     
    168173        if (isset($new_payment)
    169174          && !empty($new_payment->object)
    170           && 'payment' === $new_payment->object
     175          && 'checkout' === $new_payment->object
    171176          && !empty($new_payment->id)
    172177          && !empty($new_payment->status)
    173           && 'requires_authorization' === $new_payment->status
     178          && 'unpaid' === $new_payment->status
    174179          && !empty($new_payment->url))
    175180        {
     
    178183           */
    179184          $order->add_meta_data(
    180             'ventipay_payment_id',
     185            'ventipay_checkout_id',
    181186            $new_payment->id,
    182187            true
     
    258263       * Stored payment ID
    259264       */
    260       $meta_payment_id = $order->get_meta('ventipay_payment_id');
     265      $meta_payment_id = $order->get_meta('ventipay_checkout_id');
    261266
    262267      /**
     
    272277       */
    273278      if (!empty($meta_payment_id)
    274         && substr($meta_payment_id, 0, 4) === 'pay_'
     279        && substr($meta_payment_id, 0, 4) === 'chk_'
    275280        && !empty($posted_payment_id)
    276281        && $meta_payment_id === $posted_payment_id)
    277282      {
    278283        /**
    279          * We attempt to capture the payment.
    280          * If it wasn't authorized or it's already captured, the API will sent an error.
     284         * We check the checkout status.
    281285         */
    282         $capture_payment = wp_remote_post(
    283           self::API_ENDPOINT . '/payments/' . $meta_payment_id . '/capture',
     286        $capture_payment = wp_remote_get(
     287          self::API_ENDPOINT . '/checkouts/' . $meta_payment_id,
    284288          [
    285289            'headers' => [
     
    298302
    299303          /**
    300            * Check if the payment was properly captured
     304           * Check if the payment was properly captured/paid
    301305           */
    302306          if (isset($captured_payment)
     
    304308            && !$captured_payment->refunded
    305309            && !$captured_payment->disputed
    306             && 'succeeded' === $captured_payment->status)
     310            && 'paid' === $captured_payment->status)
    307311          {
    308312            $order->payment_complete();
     
    325329    $order = wc_get_order($order_id);
    326330    if (isset($order) && ($order->get_id())) {
    327       $meta_payment_id = $order->get_meta('ventipay_payment_id');
     331      $meta_payment_id = $order->get_meta('ventipay_checkout_id');
    328332      if (!empty($meta_payment_id)) {
    329333        if ('pending' === $order->get_status()) {
     
    346350            '<span>',
    347351            __(
    348               '¡Tu pago ha sido acreditado!',
     352              '¡Tu pago está listo!',
    349353              'ventipay'
    350354            ),
  • ventipay/tags/2.0.0/readme.txt

    r2635904 r2816138  
    11=== VentiPay ===
    22Contributors: VentiPay
    3 Tags: ventipay, transbank, webpay
     3Tags: ventipay, transbank, webpay, bnpl, chile
    44Requires at least: 5.7
    55Tested up to: 5.8
    6 Stable tag: 1.2.1
     6Stable tag: 2.0.0
    77Requires PHP: 7.0
    88License: MIT
    99License URI: https://github.com/ventipay/ventipay-plugin-woocommerce/blob/main/LICENSE
    1010
    11 Plugin oficial de Venti para WooCommerce
     11Plugin oficial de VentiPay para WooCommerce
    1212
    1313== Description ==
    1414
    15 Acepta pagos con Venti en tiendas WooCommerce
     15Acepta pagos con VentiPay en tiendas WooCommerce
    1616
    1717## Requisitos
     
    3636Lo primero es conseguir tu API Key. Puedes obtenerla desde el [Dashboard](https://dashboard.ventipay.com/).
    3737
    38 Luego, en la sección Pagos de la configuración de WooCommerce, debes habilitar el método de pago "Venti", configurar tu API Key y decidir si trabajarás en modo live o pruebas.
     38Luego, en la sección Pagos de la configuración de WooCommerce, debes habilitar el método de pago "VentiPay", configurar tu API Key y decidir si trabajarás en modo live o test.
    3939
    4040## Licencia
  • ventipay/tags/2.0.0/ventipay.php

    r2635904 r2816138  
    33 * Plugin Name: VentiPay
    44 * Plugin URI: https://docs.ventipay.com/
    5  * Description: Acepta pagos en cuotas sin intereses y pagos con tarjeta.
     5 * Description: Cobra como quieras
    66 * Author: VentiPay
    77 * Author URI: https://www.ventipay.com/
    8  * Version: 1.2.1
     8 * Version: 2.0.0
    99 * Requires at least: 5.7
    1010 * Tested up to: 5.8
     
    3333{
    3434  $methods[] = WC_Gateway_VentiPay::class;
    35   $methods[] = WC_Gateway_VentiPay_BNPL::class;
    3635  return $methods;
    3736}
     
    4342add_action('plugins_loaded', 'ventipay_init_gateway_class');
    4443add_action('wp_enqueue_scripts', 'ventipay_setup_scripts');
    45 
    46 /**
    47  * Add BNPL button in product page
    48  */
    49 function venti_show_bnpl_button_in_product_page()
    50 {
    51   global $product;
    52   $payment_gateways_obj = new WC_Payment_Gateways();
    53   $enabled_payment_gateways = $payment_gateways_obj->payment_gateways();
    54   if (isset($enabled_payment_gateways)
    55     && isset($enabled_payment_gateways['ventipay_bnpl'])
    56     && $enabled_payment_gateways['ventipay_bnpl']->enabled === 'yes'
    57   ) {
    58     $venti_min_installment_amount = ceil((int) number_format($product->get_price(), 0, ',', '') / 4);
    59     if ($venti_min_installment_amount > 0) {
    60       echo '<div class="ventipay-bnpl-product-button-container">';
    61       echo '<div class="ventipay-bnpl-product-button-image-container"><img src="https://pay.ventipay.com/assets/apps/woocommerce/plugin-woocommerce-icon-bnpl-button-product-page.svg" alt="Venti" border="0" /></div>';
    62       echo '<div class="ventipay-bnpl-product-button-text-container">Paga en cuotas con débito desde ' . wc_price($venti_min_installment_amount) . ' al mes</div>';
    63       echo '</div>';
    64     }
    65   }
    66 }
    6744
    6845/**
     
    8158{
    8259  require_once dirname( __FILE__ ) . '/includes/class-wc-gateway-ventipay.php';
    83   require_once dirname( __FILE__ ) . '/includes/class-wc-gateway-ventipay-bnpl.php';
    8460}
    8561?>
  • ventipay/trunk/LICENSE

    r2595906 r2816138  
    11MIT License
    22
    3 Copyright (c) 2021 Venti / VentiPay / Singular Banking (https://www.ventipay.com/)
     3Copyright (c) 2022 VentiPay / Singular Banking (https://www.ventipay.com/)
    44
    55Permission is hereby granted, free of charge, to any person obtaining a copy
  • ventipay/trunk/README.md

    r2595906 r2816138  
    1 # Plugin oficial de Venti para WooCommerce
     1# Plugin oficial de VentiPay para WooCommerce
    22
    3 Acepta pagos con Venti en tiendas WooCommerce
     3Acepta pagos con VentiPay en tiendas WooCommerce
    44
    55## Requisitos
     
    2424Lo primero es conseguir tu API Key. Puedes obtenerla desde el [Dashboard](https://dashboard.ventipay.com/).
    2525
    26 Luego, en la sección Pagos de la configuración de WooCommerce, debes habilitar el método de pago "Venti", configurar tu API Key y decidir si trabajarás en modo live o pruebas.
     26Luego, en la sección Pagos de la configuración de WooCommerce, debes habilitar el método de pago "VentiPay", configurar tu API Key y decidir si trabajarás en modo live o test.
    2727
    2828## Licencia
  • ventipay/trunk/assets/css/ventipay-style.css

    r2635881 r2816138  
    1 .ventipay-bnpl-product-button-container {
    2   margin: 0px;
    3   margin-top: 20px;
    4   margin-bottom: 20px;
    5 }
    6 
    7 .ventipay-bnpl-product-button-image-container {
    8   margin: 0px;
    9   padding: 0px;
    10   display: block;
    11 }
    12 
    13 .ventipay-bnpl-product-button-text-container {
    14   margin: 0px;
    15   margin-top: 5px;
    16   padding: 0px;
    17   display: block;
    18 }
  • ventipay/trunk/includes/class-wc-gateway-ventipay.php

    r2635881 r2816138  
    1717  {
    1818    $this->id = 'ventipay';
    19     $this->icon = 'https://pay.ventipay.com/assets/apps/woocommerce/plugin-woocommerce-icon-cards.svg';
     19    $this->icon = 'https://wallet.ventipay.com/assets/apps/woocommerce/plugin-woocommerce-icon-checkout.svg';
    2020    $this->has_fields = false;
    21     $this->method_title = __('Venti', 'ventipay');
     21    $this->method_title = __('VentiPay', 'ventipay');
    2222    $this->method_description = __(
    23       'Acepta pagos con tarjetas',
     23      'Paga como quieras',
    2424      'ventipay'
    2525    );
     
    4949      'enabled' => [
    5050        'title' => __('Habilitar/Deshabilitar', 'ventipay'),
    51         'label' => __('Aceptar pagos con Venti', 'ventipay'),
     51        'label' => __('Aceptar pagos con VentiPay', 'ventipay'),
    5252        'type' => 'checkbox',
    5353        'description' => '',
     
    6262        ),
    6363        'default' => __(
    64           'Venti: Tarjeta de Crédito/Débito/Prepago',
     64          'VentiPay',
    6565          'ventipay'
    6666        ),
     
    7575        ),
    7676        'default' => __(
    77           'Paga con tarjetas de Crédito, Débito o Prepago. Procesado por Venti.',
     77          'Paga en cuotas con débito y crédito, y transferencia bancaria.',
    7878          'ventipay'
    7979        ),
     
    9191      ],
    9292      'test_api_key' => [
    93         'title' => __('API Key modo Pruebas', 'ventipay'),
     93        'title' => __('API Key (llave secreta) modo test', 'ventipay'),
    9494        'type' => 'text',
    9595        'placeholder' => 'key_test_...',
    9696      ],
    9797      'live_api_key' => [
    98         'title' => __('API Key modo Live', 'ventipay'),
     98        'title' => __('API Key (llave secreta) modo live', 'ventipay'),
    9999        'type' => 'text',
    100100        'placeholder' => 'key_live_...',
     
    132132       */
    133133      $create_payment = wp_remote_post(
    134         self::API_ENDPOINT . '/payments',
     134        self::API_ENDPOINT . '/checkouts',
    135135        [
    136136          'headers' => [
     
    141141          'data_format' => 'body',
    142142          'body' => wp_json_encode([
    143             'amount' => $amount,
     143            'authorize' => true,
    144144            'currency' => $currency,
    145             'capture' => false,
    146145            'cancel_url' => $return_url,
    147146            'cancel_url_method' => 'post',
     147            'items' => array(
     148              [
     149                'unit_price' => $amount,
     150                'quantity' => 1
     151              ],
     152            ),
     153            'notification_url' => $notification_url,
     154            'notification_events' => ['checkout.paid'],
    148155            'success_url' => $return_url,
    149156            'success_url_method' => 'post',
    150             'notification_url' => $notification_url,
    151             'notification_events' => ['payment.authorized'],
    152157            'metadata' => [
    153158              'wp_order_id' => $order_id,
     
    168173        if (isset($new_payment)
    169174          && !empty($new_payment->object)
    170           && 'payment' === $new_payment->object
     175          && 'checkout' === $new_payment->object
    171176          && !empty($new_payment->id)
    172177          && !empty($new_payment->status)
    173           && 'requires_authorization' === $new_payment->status
     178          && 'unpaid' === $new_payment->status
    174179          && !empty($new_payment->url))
    175180        {
     
    178183           */
    179184          $order->add_meta_data(
    180             'ventipay_payment_id',
     185            'ventipay_checkout_id',
    181186            $new_payment->id,
    182187            true
     
    258263       * Stored payment ID
    259264       */
    260       $meta_payment_id = $order->get_meta('ventipay_payment_id');
     265      $meta_payment_id = $order->get_meta('ventipay_checkout_id');
    261266
    262267      /**
     
    272277       */
    273278      if (!empty($meta_payment_id)
    274         && substr($meta_payment_id, 0, 4) === 'pay_'
     279        && substr($meta_payment_id, 0, 4) === 'chk_'
    275280        && !empty($posted_payment_id)
    276281        && $meta_payment_id === $posted_payment_id)
    277282      {
    278283        /**
    279          * We attempt to capture the payment.
    280          * If it wasn't authorized or it's already captured, the API will sent an error.
     284         * We check the checkout status.
    281285         */
    282         $capture_payment = wp_remote_post(
    283           self::API_ENDPOINT . '/payments/' . $meta_payment_id . '/capture',
     286        $capture_payment = wp_remote_get(
     287          self::API_ENDPOINT . '/checkouts/' . $meta_payment_id,
    284288          [
    285289            'headers' => [
     
    298302
    299303          /**
    300            * Check if the payment was properly captured
     304           * Check if the payment was properly captured/paid
    301305           */
    302306          if (isset($captured_payment)
     
    304308            && !$captured_payment->refunded
    305309            && !$captured_payment->disputed
    306             && 'succeeded' === $captured_payment->status)
     310            && 'paid' === $captured_payment->status)
    307311          {
    308312            $order->payment_complete();
     
    325329    $order = wc_get_order($order_id);
    326330    if (isset($order) && ($order->get_id())) {
    327       $meta_payment_id = $order->get_meta('ventipay_payment_id');
     331      $meta_payment_id = $order->get_meta('ventipay_checkout_id');
    328332      if (!empty($meta_payment_id)) {
    329333        if ('pending' === $order->get_status()) {
     
    346350            '<span>',
    347351            __(
    348               '¡Tu pago ha sido acreditado!',
     352              '¡Tu pago está listo!',
    349353              'ventipay'
    350354            ),
  • ventipay/trunk/readme.txt

    r2635904 r2816138  
    11=== VentiPay ===
    22Contributors: VentiPay
    3 Tags: ventipay, transbank, webpay
     3Tags: ventipay, transbank, webpay, bnpl, chile
    44Requires at least: 5.7
    55Tested up to: 5.8
    6 Stable tag: 1.2.1
     6Stable tag: 2.0.0
    77Requires PHP: 7.0
    88License: MIT
    99License URI: https://github.com/ventipay/ventipay-plugin-woocommerce/blob/main/LICENSE
    1010
    11 Plugin oficial de Venti para WooCommerce
     11Plugin oficial de VentiPay para WooCommerce
    1212
    1313== Description ==
    1414
    15 Acepta pagos con Venti en tiendas WooCommerce
     15Acepta pagos con VentiPay en tiendas WooCommerce
    1616
    1717## Requisitos
     
    3636Lo primero es conseguir tu API Key. Puedes obtenerla desde el [Dashboard](https://dashboard.ventipay.com/).
    3737
    38 Luego, en la sección Pagos de la configuración de WooCommerce, debes habilitar el método de pago "Venti", configurar tu API Key y decidir si trabajarás en modo live o pruebas.
     38Luego, en la sección Pagos de la configuración de WooCommerce, debes habilitar el método de pago "VentiPay", configurar tu API Key y decidir si trabajarás en modo live o test.
    3939
    4040## Licencia
  • ventipay/trunk/ventipay.php

    r2635904 r2816138  
    33 * Plugin Name: VentiPay
    44 * Plugin URI: https://docs.ventipay.com/
    5  * Description: Acepta pagos en cuotas sin intereses y pagos con tarjeta.
     5 * Description: Cobra como quieras
    66 * Author: VentiPay
    77 * Author URI: https://www.ventipay.com/
    8  * Version: 1.2.1
     8 * Version: 2.0.0
    99 * Requires at least: 5.7
    1010 * Tested up to: 5.8
     
    3333{
    3434  $methods[] = WC_Gateway_VentiPay::class;
    35   $methods[] = WC_Gateway_VentiPay_BNPL::class;
    3635  return $methods;
    3736}
     
    4342add_action('plugins_loaded', 'ventipay_init_gateway_class');
    4443add_action('wp_enqueue_scripts', 'ventipay_setup_scripts');
    45 
    46 /**
    47  * Add BNPL button in product page
    48  */
    49 function venti_show_bnpl_button_in_product_page()
    50 {
    51   global $product;
    52   $payment_gateways_obj = new WC_Payment_Gateways();
    53   $enabled_payment_gateways = $payment_gateways_obj->payment_gateways();
    54   if (isset($enabled_payment_gateways)
    55     && isset($enabled_payment_gateways['ventipay_bnpl'])
    56     && $enabled_payment_gateways['ventipay_bnpl']->enabled === 'yes'
    57   ) {
    58     $venti_min_installment_amount = ceil((int) number_format($product->get_price(), 0, ',', '') / 4);
    59     if ($venti_min_installment_amount > 0) {
    60       echo '<div class="ventipay-bnpl-product-button-container">';
    61       echo '<div class="ventipay-bnpl-product-button-image-container"><img src="https://pay.ventipay.com/assets/apps/woocommerce/plugin-woocommerce-icon-bnpl-button-product-page.svg" alt="Venti" border="0" /></div>';
    62       echo '<div class="ventipay-bnpl-product-button-text-container">Paga en cuotas con débito desde ' . wc_price($venti_min_installment_amount) . ' al mes</div>';
    63       echo '</div>';
    64     }
    65   }
    66 }
    6744
    6845/**
     
    8158{
    8259  require_once dirname( __FILE__ ) . '/includes/class-wc-gateway-ventipay.php';
    83   require_once dirname( __FILE__ ) . '/includes/class-wc-gateway-ventipay-bnpl.php';
    8460}
    8561?>
Note: See TracChangeset for help on using the changeset viewer.