Changeset 2963879
- Timestamp:
- 09/07/2023 03:56:18 AM (3 years ago)
- Location:
- metrepay/trunk
- Files:
-
- 3 edited
-
includes/shortcode.php (modified) (1 diff)
-
metrepay.php (modified) (7 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
metrepay/trunk/includes/shortcode.php
r2962760 r2963879 6 6 $mg = new WC_Metrepay_Gateway; 7 7 8 if (isset($_GET['metrepayid'])) { 9 // ID del link de pago generado 10 $metrepayid = sanitize_text_field($_GET['metrepayid']); 11 // Slug predefinido del comercio 12 $slug = $mg->get_provider_slug(); 13 // Sitio de MetrePay dependiendo del ambiente 14 $site = ($mg->get_staging() === "yes") 15 ? "test" 16 : "portal"; 8 if (isset($_GET['order_id'])) { 9 $order_id = sanitize_text_field($_GET['order_id']); 10 $order = new WC_Order($order_id); 11 $order->update_status('completed', 'order_note'); 17 12 ?> 18 <iframe class='metrepayiframe' src='https://<?php echo esc_attr( $site ); ?>.metrepay.com/pay/<?php echo esc_attr( $slug ); ?>/item/<?php echo esc_attr( $metrepayid ); ?>'></iframe> 19 <?php 20 echo '<style> 21 .metrepayiframe{ 22 width: 100%; 23 height: 950px; 24 border: unset; 25 } 26 </style>'; 13 <h2>¡Gracias por realizar su compra!</h2> 14 <?php 27 15 } else { 28 16 ?> -
metrepay/trunk/metrepay.php
r2963323 r2963879 4 4 Plugin URI: https://wordpress.org/plugins/metrepay 5 5 Description: Pasarela de pago para integracion con MetrePay y Woocomerce 6 Version: 1. 1.26 Version: 1.2.0 7 7 Author: Rugertek 8 8 Author URI: https://rugertek.com/ … … 151 151 'default' => 'yes' 152 152 ), 153 'purchase_page' => array(154 'title' => 'Página de fin de compra',155 'type' => 'text'156 ),157 153 ); 158 154 } … … 168 164 $data = array( 169 165 "label" => "Pago a " . get_bloginfo("name"), 170 "amount" => $order->get_total(),166 "amount" => intval($order->get_total()), 171 167 "handleValue" => $order->get_billing_email(), 172 168 "handleLabel" => "{$order->get_billing_first_name()} {$order->get_billing_last_name()}", … … 174 170 "singlePayment" => true, 175 171 "creditAndDebitCard" => true, 172 "redirectUrl" => get_bloginfo("url") . "/pago-metrepay/?order_id=" . $order_id, 176 173 ); 177 174 } else { … … 196 193 "monthForSecondInstallment" => 1, 197 194 "payWaitHours" => 96, 195 "redirectUrl" => get_bloginfo("url") . "/pago-metrepay/?order_id=" . $order_id, 198 196 ); 199 197 } … … 211 209 error_log(json_encode($result)); 212 210 213 // Finish shopping process214 $woocommerce->cart->empty_cart();215 211 // Delete the cookie 216 212 $this->mpay_local_delete_cookie('mp_installments_quantity'); … … 218 214 return array( 219 215 'result' => 'success', 220 'redirect' => get_bloginfo("url") . "/pago-metrepay/?metrepayid={$result['slug']}"216 'redirect' => $result['publicPayUrl'] 221 217 ); 222 218 } -
metrepay/trunk/readme.txt
r2963323 r2963879 4 4 Requires at least: 5.3 5 5 Tested up to: 6.3.1 6 Stable tag: 1. 1.26 Stable tag: 1.2.0 7 7 Requires PHP: 7.3.5 8 8 License: GPLv3 … … 31 31 = 1.1.2 = 32 32 * Improve texts into configuration form fields 33 34 = 1.2.0 = 35 * Remove use of iframe to process payment 36 * Update correctly the order status to "completed"
Note: See TracChangeset
for help on using the changeset viewer.