Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
juanfdp committed Aug 1, 2024
1 parent 2d6fece commit cf852ca
Show file tree
Hide file tree
Showing 21 changed files with 3,056 additions and 0 deletions.
Binary file added assets/animations/new_notification.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 49 additions & 0 deletions assets/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
li.wc_payment_method.payment_method_woocommerce_wompi_pse > label[for=payment_method_woocommerce_wompi_pse] > img {
margin-left: 6px;
margin-top: -7px;
max-height: 40px;
}

li.wc_payment_method.payment_method_woocommerce_wompi_credit_cards > label[for=payment_method_woocommerce_wompi_credit_cards] > img {
margin-left: 6px;
margin-top: -7px;
max-height: 40px;
}

li.wc_payment_method.payment_method_payulatam_co > label[for=payment_method_payulatam_co] > img {
margin-left: 6px;
margin-top: -7px;
max-height: 40px;
}

li.wc_payment_method.payment_method_woocommerce_wompi_cash_bancolombia > label[for=payment_method_woocommerce_wompi_cash_bancolombia] > img {
margin-left: 6px;
margin-top: -7px;
max-height: 40px;
}

li.wc_payment_method.payment_method_woocommerce_wompi_bancolombia_button > label[for=payment_method_woocommerce_wompi_bancolombia_button] > img {
margin-left: 6px;
margin-top: -7px;
max-height: 40px;
}
li.wc_payment_method.payment_method_woocommerce_wompi_nequi > label[for=payment_method_woocommerce_wompi_nequi] > img {
margin-left: 6px;
margin-top: -7px;
max-height: 40px;
}

div.card-js > .installments-wrapper > select {
padding-left: 10px;
}

.card-js .installments-wrapper {
-webkit-box-shadow: 0 1px 0 rgba(255,255,255,.7), inset 0 1px 0 rgba(255,255,255,.7);
-moz-box-shadow: 0 1px 0 rgba(255,255,255,.7),inset 0 1px 0 rgba(255,255,255,.7);
-ms-box-shadow: 0 1px 0 rgba(255,255,255,.7),inset 0 1px 0 rgba(255,255,255,.7);
-o-box-shadow: 0 1px 0 rgba(255,255,255,.7),inset 0 1px 0 rgba(255,255,255,.7);
box-shadow: 0 1px 0 rgba(255,255,255,.7), inset 0 1px 0 rgba(255,255,255,.7);
position: relative;
display: inline-block;
width: 100%;
}
50 changes: 50 additions & 0 deletions assets/js/wompi-payments-plugin-card-js.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
(function($){
'use strict';
$( 'body' ).on( 'updated_checkout', function() {
$(".card-js").CardJs();
} );


var checkout_form = $( 'form.checkout' );

$(document.body).on('checkout_error', function () {
swal.close();
Cookies.remove('woocommerce_wompi_credit_cards_intent');
});

checkout_form.on( 'checkout_place_order', function() {

var form_checkout_payment = $('form[name="checkout"] input[name="payment_method"]:checked');

if(form_checkout_payment.val() === 'woocommerce_wompi_credit_cards'){

if( typeof Cookies.get('woocommerce_wompi_credit_cards_intent') === 'undefined' ){
var inFiveMinutes = new Date(new Date().getTime() + 5 * 60 * 1000);
Cookies.set('woocommerce_wompi_credit_cards_intent', 0, { expires: inFiveMinutes, path: '/' })
}

//Sweetalert to show the loading spinner
Swal.fire({
title: 'Procesando tu pago',
html: 'Por favor espera un momento...',
imageWidth: "200px",
timerProgressBar: true,
allowOutsideClick: false,
allowEscapeKey: false,
allowEnterKey: false,
showCancelButton: false,
showConfirmButton: false,
showCloseButton: false,
didOpen: () => {
Swal.showLoading();
}
})
}
});




})(jQuery);


10 changes: 10 additions & 0 deletions assets/js/wompi-payments-plugin-core.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
(function($){
'use strict';
if( typeof Cookies.get('wompi_sessionId') === 'undefined' ){
$wompi.initialize( function ( data, error ) {
if ( error === null ) {
Cookies.set('wompi_sessionId', data.sessionId, { expires: 90, path: '/' })
}
})
}
})(jQuery);
54 changes: 54 additions & 0 deletions assets/js/wompi-payments-plugin-nequi.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
;(function( $ ) {
'use strict';

const checkout_form = $( 'form.checkout' );

$(document.body).on('checkout_error', function () {
swal.close();
});

checkout_form.on( 'checkout_place_order', function() {

const form_checkout_payment = $('form[name="checkout"] input[name="payment_method"]:checked');

if(form_checkout_payment.val() === 'woocommerce_wompi_nequi'){

Swal.fire({
title: 'Verifica tu celular',
html: wompi_payments_plugin_nequi.check_your_phone_msg,
imageUrl: wompi_payments_plugin_nequi.logo_url,
imageWidth: "200px",
timer: wompi_payments_plugin_nequi.seconds_to_wait * 1000,
timerProgressBar: true,
allowOutsideClick: false,
allowEscapeKey: false,
allowEnterKey: false,
showCancelButton: false,
showConfirmButton: false,
showCloseButton: false,
didOpen: () => {
Swal.showLoading();
const timer = Swal.getPopup().querySelector("b");
timerInterval = setInterval(() => {
const timerLeft = Swal.getTimerLeft();
let minutes = Math.floor(timerLeft / 60000);
let seconds = Math.floor((timerLeft % 60000) / 1000);

if(minutes < 10){ minutes = `0${minutes}`; }
if(seconds < 10){ seconds = `0${seconds}`; }
timer.textContent = `${minutes}:${seconds}`;

}, 500);
},
willClose: () => {
if(typeof timerInterval !== 'undefined'){
clearInterval(timerInterval);
}
}
})
}
});



})( jQuery );
1 change: 1 addition & 0 deletions assets/libs/card-js/card-js.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit cf852ca

Please sign in to comment.