Changeset 2816138
- Timestamp:
- 11/10/2022 05:21:28 PM (3 years ago)
- Location:
- ventipay
- Files:
-
- 2 deleted
- 12 edited
- 1 copied
-
tags/2.0.0 (copied) (copied from ventipay/trunk)
-
tags/2.0.0/LICENSE (modified) (1 diff)
-
tags/2.0.0/README.md (modified) (2 diffs)
-
tags/2.0.0/assets/css/ventipay-style.css (modified) (1 diff)
-
tags/2.0.0/includes/class-wc-gateway-ventipay-bnpl.php (deleted)
-
tags/2.0.0/includes/class-wc-gateway-ventipay.php (modified) (15 diffs)
-
tags/2.0.0/readme.txt (modified) (2 diffs)
-
tags/2.0.0/ventipay.php (modified) (4 diffs)
-
trunk/LICENSE (modified) (1 diff)
-
trunk/README.md (modified) (2 diffs)
-
trunk/assets/css/ventipay-style.css (modified) (1 diff)
-
trunk/includes/class-wc-gateway-ventipay-bnpl.php (deleted)
-
trunk/includes/class-wc-gateway-ventipay.php (modified) (15 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/ventipay.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ventipay/tags/2.0.0/LICENSE
r2595906 r2816138 1 1 MIT License 2 2 3 Copyright (c) 202 1 Venti /VentiPay / Singular Banking (https://www.ventipay.com/)3 Copyright (c) 2022 VentiPay / Singular Banking (https://www.ventipay.com/) 4 4 5 5 Permission 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 WooCommerce1 # Plugin oficial de VentiPay para WooCommerce 2 2 3 Acepta pagos con Venti en tiendas WooCommerce3 Acepta pagos con VentiPay en tiendas WooCommerce 4 4 5 5 ## Requisitos … … 24 24 Lo primero es conseguir tu API Key. Puedes obtenerla desde el [Dashboard](https://dashboard.ventipay.com/). 25 25 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.26 Luego, 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. 27 27 28 28 ## 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 17 17 { 18 18 $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'; 20 20 $this->has_fields = false; 21 $this->method_title = __('Venti ', 'ventipay');21 $this->method_title = __('VentiPay', 'ventipay'); 22 22 $this->method_description = __( 23 ' Acepta pagos con tarjetas',23 'Paga como quieras', 24 24 'ventipay' 25 25 ); … … 49 49 'enabled' => [ 50 50 'title' => __('Habilitar/Deshabilitar', 'ventipay'), 51 'label' => __('Aceptar pagos con Venti ', 'ventipay'),51 'label' => __('Aceptar pagos con VentiPay', 'ventipay'), 52 52 'type' => 'checkbox', 53 53 'description' => '', … … 62 62 ), 63 63 'default' => __( 64 'Venti : Tarjeta de Crédito/Débito/Prepago',64 'VentiPay', 65 65 'ventipay' 66 66 ), … … 75 75 ), 76 76 '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.', 78 78 'ventipay' 79 79 ), … … 91 91 ], 92 92 'test_api_key' => [ 93 'title' => __('API Key modo Pruebas', 'ventipay'),93 'title' => __('API Key (llave secreta) modo test', 'ventipay'), 94 94 'type' => 'text', 95 95 'placeholder' => 'key_test_...', 96 96 ], 97 97 'live_api_key' => [ 98 'title' => __('API Key modo Live', 'ventipay'),98 'title' => __('API Key (llave secreta) modo live', 'ventipay'), 99 99 'type' => 'text', 100 100 'placeholder' => 'key_live_...', … … 132 132 */ 133 133 $create_payment = wp_remote_post( 134 self::API_ENDPOINT . '/ payments',134 self::API_ENDPOINT . '/checkouts', 135 135 [ 136 136 'headers' => [ … … 141 141 'data_format' => 'body', 142 142 'body' => wp_json_encode([ 143 'a mount' => $amount,143 'authorize' => true, 144 144 'currency' => $currency, 145 'capture' => false,146 145 'cancel_url' => $return_url, 147 146 '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'], 148 155 'success_url' => $return_url, 149 156 'success_url_method' => 'post', 150 'notification_url' => $notification_url,151 'notification_events' => ['payment.authorized'],152 157 'metadata' => [ 153 158 'wp_order_id' => $order_id, … … 168 173 if (isset($new_payment) 169 174 && !empty($new_payment->object) 170 && ' payment' === $new_payment->object175 && 'checkout' === $new_payment->object 171 176 && !empty($new_payment->id) 172 177 && !empty($new_payment->status) 173 && ' requires_authorization' === $new_payment->status178 && 'unpaid' === $new_payment->status 174 179 && !empty($new_payment->url)) 175 180 { … … 178 183 */ 179 184 $order->add_meta_data( 180 'ventipay_ payment_id',185 'ventipay_checkout_id', 181 186 $new_payment->id, 182 187 true … … 258 263 * Stored payment ID 259 264 */ 260 $meta_payment_id = $order->get_meta('ventipay_ payment_id');265 $meta_payment_id = $order->get_meta('ventipay_checkout_id'); 261 266 262 267 /** … … 272 277 */ 273 278 if (!empty($meta_payment_id) 274 && substr($meta_payment_id, 0, 4) === ' pay_'279 && substr($meta_payment_id, 0, 4) === 'chk_' 275 280 && !empty($posted_payment_id) 276 281 && $meta_payment_id === $posted_payment_id) 277 282 { 278 283 /** 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. 281 285 */ 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, 284 288 [ 285 289 'headers' => [ … … 298 302 299 303 /** 300 * Check if the payment was properly captured 304 * Check if the payment was properly captured/paid 301 305 */ 302 306 if (isset($captured_payment) … … 304 308 && !$captured_payment->refunded 305 309 && !$captured_payment->disputed 306 && ' succeeded' === $captured_payment->status)310 && 'paid' === $captured_payment->status) 307 311 { 308 312 $order->payment_complete(); … … 325 329 $order = wc_get_order($order_id); 326 330 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'); 328 332 if (!empty($meta_payment_id)) { 329 333 if ('pending' === $order->get_status()) { … … 346 350 '<span>', 347 351 __( 348 '¡Tu pago ha sido acreditado!',352 '¡Tu pago está listo!', 349 353 'ventipay' 350 354 ), -
ventipay/tags/2.0.0/readme.txt
r2635904 r2816138 1 1 === VentiPay === 2 2 Contributors: VentiPay 3 Tags: ventipay, transbank, webpay 3 Tags: ventipay, transbank, webpay, bnpl, chile 4 4 Requires at least: 5.7 5 5 Tested up to: 5.8 6 Stable tag: 1.2.16 Stable tag: 2.0.0 7 7 Requires PHP: 7.0 8 8 License: MIT 9 9 License URI: https://github.com/ventipay/ventipay-plugin-woocommerce/blob/main/LICENSE 10 10 11 Plugin oficial de Venti para WooCommerce11 Plugin oficial de VentiPay para WooCommerce 12 12 13 13 == Description == 14 14 15 Acepta pagos con Venti en tiendas WooCommerce15 Acepta pagos con VentiPay en tiendas WooCommerce 16 16 17 17 ## Requisitos … … 36 36 Lo primero es conseguir tu API Key. Puedes obtenerla desde el [Dashboard](https://dashboard.ventipay.com/). 37 37 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.38 Luego, 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. 39 39 40 40 ## Licencia -
ventipay/tags/2.0.0/ventipay.php
r2635904 r2816138 3 3 * Plugin Name: VentiPay 4 4 * Plugin URI: https://docs.ventipay.com/ 5 * Description: Acepta pagos en cuotas sin intereses y pagos con tarjeta.5 * Description: Cobra como quieras 6 6 * Author: VentiPay 7 7 * Author URI: https://www.ventipay.com/ 8 * Version: 1.2.18 * Version: 2.0.0 9 9 * Requires at least: 5.7 10 10 * Tested up to: 5.8 … … 33 33 { 34 34 $methods[] = WC_Gateway_VentiPay::class; 35 $methods[] = WC_Gateway_VentiPay_BNPL::class;36 35 return $methods; 37 36 } … … 43 42 add_action('plugins_loaded', 'ventipay_init_gateway_class'); 44 43 add_action('wp_enqueue_scripts', 'ventipay_setup_scripts'); 45 46 /**47 * Add BNPL button in product page48 */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 }67 44 68 45 /** … … 81 58 { 82 59 require_once dirname( __FILE__ ) . '/includes/class-wc-gateway-ventipay.php'; 83 require_once dirname( __FILE__ ) . '/includes/class-wc-gateway-ventipay-bnpl.php';84 60 } 85 61 ?> -
ventipay/trunk/LICENSE
r2595906 r2816138 1 1 MIT License 2 2 3 Copyright (c) 202 1 Venti /VentiPay / Singular Banking (https://www.ventipay.com/)3 Copyright (c) 2022 VentiPay / Singular Banking (https://www.ventipay.com/) 4 4 5 5 Permission is hereby granted, free of charge, to any person obtaining a copy -
ventipay/trunk/README.md
r2595906 r2816138 1 # Plugin oficial de Venti para WooCommerce1 # Plugin oficial de VentiPay para WooCommerce 2 2 3 Acepta pagos con Venti en tiendas WooCommerce3 Acepta pagos con VentiPay en tiendas WooCommerce 4 4 5 5 ## Requisitos … … 24 24 Lo primero es conseguir tu API Key. Puedes obtenerla desde el [Dashboard](https://dashboard.ventipay.com/). 25 25 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.26 Luego, 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. 27 27 28 28 ## 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 17 17 { 18 18 $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'; 20 20 $this->has_fields = false; 21 $this->method_title = __('Venti ', 'ventipay');21 $this->method_title = __('VentiPay', 'ventipay'); 22 22 $this->method_description = __( 23 ' Acepta pagos con tarjetas',23 'Paga como quieras', 24 24 'ventipay' 25 25 ); … … 49 49 'enabled' => [ 50 50 'title' => __('Habilitar/Deshabilitar', 'ventipay'), 51 'label' => __('Aceptar pagos con Venti ', 'ventipay'),51 'label' => __('Aceptar pagos con VentiPay', 'ventipay'), 52 52 'type' => 'checkbox', 53 53 'description' => '', … … 62 62 ), 63 63 'default' => __( 64 'Venti : Tarjeta de Crédito/Débito/Prepago',64 'VentiPay', 65 65 'ventipay' 66 66 ), … … 75 75 ), 76 76 '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.', 78 78 'ventipay' 79 79 ), … … 91 91 ], 92 92 'test_api_key' => [ 93 'title' => __('API Key modo Pruebas', 'ventipay'),93 'title' => __('API Key (llave secreta) modo test', 'ventipay'), 94 94 'type' => 'text', 95 95 'placeholder' => 'key_test_...', 96 96 ], 97 97 'live_api_key' => [ 98 'title' => __('API Key modo Live', 'ventipay'),98 'title' => __('API Key (llave secreta) modo live', 'ventipay'), 99 99 'type' => 'text', 100 100 'placeholder' => 'key_live_...', … … 132 132 */ 133 133 $create_payment = wp_remote_post( 134 self::API_ENDPOINT . '/ payments',134 self::API_ENDPOINT . '/checkouts', 135 135 [ 136 136 'headers' => [ … … 141 141 'data_format' => 'body', 142 142 'body' => wp_json_encode([ 143 'a mount' => $amount,143 'authorize' => true, 144 144 'currency' => $currency, 145 'capture' => false,146 145 'cancel_url' => $return_url, 147 146 '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'], 148 155 'success_url' => $return_url, 149 156 'success_url_method' => 'post', 150 'notification_url' => $notification_url,151 'notification_events' => ['payment.authorized'],152 157 'metadata' => [ 153 158 'wp_order_id' => $order_id, … … 168 173 if (isset($new_payment) 169 174 && !empty($new_payment->object) 170 && ' payment' === $new_payment->object175 && 'checkout' === $new_payment->object 171 176 && !empty($new_payment->id) 172 177 && !empty($new_payment->status) 173 && ' requires_authorization' === $new_payment->status178 && 'unpaid' === $new_payment->status 174 179 && !empty($new_payment->url)) 175 180 { … … 178 183 */ 179 184 $order->add_meta_data( 180 'ventipay_ payment_id',185 'ventipay_checkout_id', 181 186 $new_payment->id, 182 187 true … … 258 263 * Stored payment ID 259 264 */ 260 $meta_payment_id = $order->get_meta('ventipay_ payment_id');265 $meta_payment_id = $order->get_meta('ventipay_checkout_id'); 261 266 262 267 /** … … 272 277 */ 273 278 if (!empty($meta_payment_id) 274 && substr($meta_payment_id, 0, 4) === ' pay_'279 && substr($meta_payment_id, 0, 4) === 'chk_' 275 280 && !empty($posted_payment_id) 276 281 && $meta_payment_id === $posted_payment_id) 277 282 { 278 283 /** 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. 281 285 */ 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, 284 288 [ 285 289 'headers' => [ … … 298 302 299 303 /** 300 * Check if the payment was properly captured 304 * Check if the payment was properly captured/paid 301 305 */ 302 306 if (isset($captured_payment) … … 304 308 && !$captured_payment->refunded 305 309 && !$captured_payment->disputed 306 && ' succeeded' === $captured_payment->status)310 && 'paid' === $captured_payment->status) 307 311 { 308 312 $order->payment_complete(); … … 325 329 $order = wc_get_order($order_id); 326 330 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'); 328 332 if (!empty($meta_payment_id)) { 329 333 if ('pending' === $order->get_status()) { … … 346 350 '<span>', 347 351 __( 348 '¡Tu pago ha sido acreditado!',352 '¡Tu pago está listo!', 349 353 'ventipay' 350 354 ), -
ventipay/trunk/readme.txt
r2635904 r2816138 1 1 === VentiPay === 2 2 Contributors: VentiPay 3 Tags: ventipay, transbank, webpay 3 Tags: ventipay, transbank, webpay, bnpl, chile 4 4 Requires at least: 5.7 5 5 Tested up to: 5.8 6 Stable tag: 1.2.16 Stable tag: 2.0.0 7 7 Requires PHP: 7.0 8 8 License: MIT 9 9 License URI: https://github.com/ventipay/ventipay-plugin-woocommerce/blob/main/LICENSE 10 10 11 Plugin oficial de Venti para WooCommerce11 Plugin oficial de VentiPay para WooCommerce 12 12 13 13 == Description == 14 14 15 Acepta pagos con Venti en tiendas WooCommerce15 Acepta pagos con VentiPay en tiendas WooCommerce 16 16 17 17 ## Requisitos … … 36 36 Lo primero es conseguir tu API Key. Puedes obtenerla desde el [Dashboard](https://dashboard.ventipay.com/). 37 37 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.38 Luego, 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. 39 39 40 40 ## Licencia -
ventipay/trunk/ventipay.php
r2635904 r2816138 3 3 * Plugin Name: VentiPay 4 4 * Plugin URI: https://docs.ventipay.com/ 5 * Description: Acepta pagos en cuotas sin intereses y pagos con tarjeta.5 * Description: Cobra como quieras 6 6 * Author: VentiPay 7 7 * Author URI: https://www.ventipay.com/ 8 * Version: 1.2.18 * Version: 2.0.0 9 9 * Requires at least: 5.7 10 10 * Tested up to: 5.8 … … 33 33 { 34 34 $methods[] = WC_Gateway_VentiPay::class; 35 $methods[] = WC_Gateway_VentiPay_BNPL::class;36 35 return $methods; 37 36 } … … 43 42 add_action('plugins_loaded', 'ventipay_init_gateway_class'); 44 43 add_action('wp_enqueue_scripts', 'ventipay_setup_scripts'); 45 46 /**47 * Add BNPL button in product page48 */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 }67 44 68 45 /** … … 81 58 { 82 59 require_once dirname( __FILE__ ) . '/includes/class-wc-gateway-ventipay.php'; 83 require_once dirname( __FILE__ ) . '/includes/class-wc-gateway-ventipay-bnpl.php';84 60 } 85 61 ?>
Note: See TracChangeset
for help on using the changeset viewer.