Changeset 2589980
- Timestamp:
- 08/27/2021 06:19:52 PM (4 years ago)
- Location:
- appmax-woocommerce/trunk
- Files:
-
- 4 edited
-
appmax-woocommerce.php (modified) (1 diff)
-
assets/js/my-scripts/awc_pix.js (modified) (3 diffs)
-
assets/js/my-scripts/awc_pix.min.js (modified) (1 diff)
-
templates/views/pix/pix-payment.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
appmax-woocommerce/trunk/appmax-woocommerce.php
r2589822 r2589980 144 144 public function awc_show_pix_qrcode( $order ) 145 145 { 146 if ( $order->get_meta( '_appmax_type_payment' ) == AWC_Payment_Type::AWC_PIX ) {146 if ( $order->get_meta( '_appmax_type_payment' ) == AWC_Payment_Type::AWC_PIX && $order->get_meta('_appmax_woocommerce_transaction_data') ) { 147 147 148 148 $pix_template = dirname( __FILE__ ) . '/templates/views/checkout/pix/pix-payment.php'; -
appmax-woocommerce/trunk/assets/js/my-scripts/awc_pix.js
r2589822 r2589980 6 6 }); 7 7 8 $(function () {8 if (document.getElementById("pix-order-id")) { 9 9 10 10 const key = "c8db72fbdb177a2a4a8a"; … … 82 82 83 83 }); 84 85 }); 84 } 86 85 87 86 function formatDate(currentMinutes) { … … 95 94 }).join(':'); 96 95 } 97 98 96 }(jQuery)); -
appmax-woocommerce/trunk/assets/js/my-scripts/awc_pix.min.js
r2589822 r2589980 1 !function(e){"use strict"; e(function(){e("#cpf_pix").mask("999.999.999-99")}),e(function(){const t=new Pusher("c8db72fbdb177a2a4a8a",{cluster:"us2",encrypted:!0});t.logToConsole=0;const o=document.getElementById("pix-order-id").value,n=t.subscribe(`pix.notification.${o}`),a=document.getElementById("wrapper");window.localStorage[`${o}`]&&(a.innerHTML="<h2>Pagamento confirmado!</h2>");const c=document.getElementById("pix_emv"),i=document.getElementById("get-qrcode"),d=document.getElementById("countdown");if(e("#get-qrcode").on("click",function(e){e.preventDefault(),c.select(),navigator.clipboard.writeText(c.value),i.classList.add("disabled"),i.textContent="Código copiado com sucesso!"}),!window.localStorage[`${o}`]){const e=document.getElementById("expiration_date").value;let t=new Date(e).getTime();const o=setInterval(function(){let e=(new Date).getTime(),n=t-e,a=Math.floor(n%864e5/36e5),c=Math.floor(n%36e5/6e4),i=Math.floor(n%6e4/1e3);d.innerHTML=`${a}:${c}:${i}`.split(":").map(e=>(e<10&&(e="0"+e),e)).join(":"),n<0&&(clearInterval(o),document.getElementById("wrapper").innerHTML="<h2>Atingido o tempo limite para pagamento.</h2>")},1e3)}const r=document.getElementById("wp_order_id").value;n.bind("pix.order-paid",function(t){window.localStorage[`${o}`]=!0,a.innerHTML="<h2>Pagamento confirmado!</h2>",e.ajax({type:"POST",dataType:"json",url:woocommerce_params.ajax_url,data:{action:"update_order_status",order_id:r},success:function(e){console.log(e)}})})})}(jQuery);1 !function(e){"use strict";if(e(function(){e("#cpf_pix").mask("999.999.999-99")}),document.getElementById("pix-order-id")){const t=new Pusher("c8db72fbdb177a2a4a8a",{cluster:"us2",encrypted:!0});t.logToConsole=0;const o=document.getElementById("pix-order-id").value,n=t.subscribe(`pix.notification.${o}`),a=document.getElementById("wrapper");window.localStorage[`${o}`]&&(a.innerHTML="<h2>Pagamento confirmado!</h2>");const d=document.getElementById("pix_emv"),i=document.getElementById("get-qrcode"),c=document.getElementById("countdown");if(e("#get-qrcode").on("click",function(e){e.preventDefault(),d.select(),navigator.clipboard.writeText(d.value),i.classList.add("disabled"),i.textContent="Código copiado com sucesso!"}),!window.localStorage[`${o}`]){const e=document.getElementById("expiration_date").value;let t=new Date(e).getTime();const o=setInterval(function(){let e=(new Date).getTime(),n=t-e,a=Math.floor(n%864e5/36e5),d=Math.floor(n%36e5/6e4),i=Math.floor(n%6e4/1e3);c.innerHTML=`${a}:${d}:${i}`.split(":").map(e=>(e<10&&(e="0"+e),e)).join(":"),n<0&&(clearInterval(o),document.getElementById("wrapper").innerHTML="<h2>Atingido o tempo limite para pagamento.</h2>")},1e3)}const r=document.getElementById("wp_order_id").value;n.bind("pix.order-paid",function(t){window.localStorage[`${o}`]=!0,a.innerHTML="<h2>Pagamento confirmado!</h2>",e.ajax({type:"POST",dataType:"json",url:woocommerce_params.ajax_url,data:{action:"update_order_status",order_id:r},success:function(e){console.log(e)}})})}}(jQuery); -
appmax-woocommerce/trunk/templates/views/pix/pix-payment.php
r2589822 r2589980 1 1 <fieldset> 2 <input id="pix-order-id" type="hidden" value="<?php echo $order->get_meta('_appmax_woocommerce_transaction_data')["post_payment"]["order_id"]; ?>"> 3 <input id="wp_order_id" type="hidden" value="<?php echo $order->get_meta('_appmax_woocommerce_transaction_id'); ?>"> 4 <input id="expiration_date" type="hidden" value="<?php echo $order->get_meta('_appmax_woocommerce_transaction_data')["post_payment"]["pix_expiration_date"] ?>"> 2 5 <div id="wrapper"> 3 6 <div class="text-header"> 4 7 <div> 5 <input id="pix-order-id" type="hidden" value="<?php echo $order->get_meta('_appmax_woocommerce_transaction_data')["post_payment"]["order_id"]; ?>">6 <input id="wp_order_id" type="hidden" value="<?php echo $order->get_meta('_appmax_woocommerce_transaction_id'); ?>">7 <input id="expiration_date" type="hidden" value="<?php echo $order->get_meta('_appmax_woocommerce_transaction_data')["post_payment"]["pix_expiration_date"] ?>">8 8 <h2>Seu pedido foi reservado!</h2> 9 9 <h2>Efetue o pagamento dentro de <span id="countdown"></span>
Note: See TracChangeset
for help on using the changeset viewer.