Skip to content

Commit

Permalink
Merge pull request #50 from pallomabritoGN/master
Browse files Browse the repository at this point in the history
Release 2.1.0
  • Loading branch information
guilhermecotaGn committed Jun 20, 2023
2 parents 4d12cb9 + 3c204d3 commit 7676c1e
Show file tree
Hide file tree
Showing 182 changed files with 11,758 additions and 5,053 deletions.
2 changes: 1 addition & 1 deletion assets/js/payment-token-efi.min.js

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions assets/js/scripts-cartao.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ jQuery(document).ready(function ($) {


// Buscar Parcelas
jQuery("#gn_cartao_number").keyup(function () {
jQuery("#gn_cartao_number").on('keyup mouseout', function () {

let total = document.querySelector("#gn_payment_total").value;
total = parseInt(total.replace('.', ''));
console.log(total);

if (jQuery("#gn_cartao_number").val().length >= 19) {
if (jQuery("#gn_cartao_number").val().length >= 15) {

EfiJs.CreditCard
// .debugger(true)
Expand Down Expand Up @@ -105,7 +105,7 @@ jQuery(document).ready(function ($) {
}
})


if (document.getElementById('gn_cartao_cpf_cnpj')) {
jQuery('#gn_cartao_cpf_cnpj').keyup(
function () {
Expand Down Expand Up @@ -159,7 +159,7 @@ jQuery(document).ready(function ($) {
}

if (document.getElementById('gn_cartao_number')) {
VMasker(document.querySelector("#gn_cartao_number")).maskPattern("9999 9999 9999 99999");
VMasker(document.querySelector("#gn_cartao_number")).maskPattern("9999 9999 9999 9999");
}

if (typeof jQuery('#billing_cpf').val() !== 'undefined') {
Expand Down Expand Up @@ -295,11 +295,13 @@ jQuery(document).ready(function ($) {
}

function validate_cartao_expiration(exp) {
if (exp == "" || exp.length < 6)
return false;
exp = exp.split('/');
const newDate = new Date();
const year = newDate.getFullYear();

if ((parseInt(exp[0]) > 12 || (parseInt(exp[0] < 0)) || (parseInt(exp[1] < year)))) {
if ((parseInt(exp[0]) > 12 || (parseInt(exp[0] < 0)) || (parseInt(exp[1]) < parseInt(year)))) {
return false;
}
return true;
Expand Down
4 changes: 2 additions & 2 deletions gerencianet-oficial.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Plugin Name: Efí by Gerencianet Oficial
* Plugin URI: https://wordpress.org/plugins/woo-gerencianet-official/
* Description: Gateway de pagamento Efi by Gerencianet para WooCommerce
* Version: 2.0.12
* Version: 2.1.0
* Author: Efi by Gerencianet
* Author URI: https://www.sejaefi.com.br
* License: GPL-2.0+
Expand All @@ -25,7 +25,7 @@
die;
}

define( 'GERENCIANET_OFICIAL_VERSION', '2.0.12' );
define( 'GERENCIANET_OFICIAL_VERSION', '2.1.0' );
define( 'GERENCIANET_BOLETO_ID', 'WC_Gerencianet_Boleto' );
define( 'GERENCIANET_CARTAO_ID', 'WC_Gerencianet_Cartao' );
define( 'GERENCIANET_PIX_ID', 'WC_Gerencianet_Pix' );
Expand Down
6 changes: 3 additions & 3 deletions includes/lib/class-gerencianet-integration.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function get_credentials( $paymentMethod ) {
}

}
$gn_credentials['pix_cert'] = $certificatePath;
$gn_credentials['certificate'] = $certificatePath;
}
return $gn_credentials;
}
Expand Down Expand Up @@ -143,7 +143,7 @@ public function one_step_billet( $order_id, $items, $shipping, $notification_url

try {
$api = new Gerencianet( $this->get_credentials( GERENCIANET_BOLETO_ID ) );
$response = $api->oneStep( array(), $body );
$response = $api->createOneStepCharge( array(), $body );
return self::result_api( $response, true );
} catch ( GerencianetException $e ) {
$errorResponse = array(
Expand Down Expand Up @@ -270,7 +270,7 @@ public function one_step_card( $order_id, $items, $shipping, $notification_url,

try {
$api = new Gerencianet( $this->get_credentials( GERENCIANET_CARTAO_ID ) );
$card_charge = $api->oneStep( array(), $body );
$card_charge = $api->createOneStepCharge( array(), $body );
return self::result_api( $card_charge, true );
} catch ( GerencianetException $e ) {
$errorResponse = array(
Expand Down
7 changes: 6 additions & 1 deletion includes/lib/gerencianet/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

// autoload.php @generated by Composer

if (PHP_VERSION_ID < 50600) {
echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
exit(1);
}

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInitb46737289d75b56207057dd01dec455c::getLoader();
return ComposerAutoloaderInit267982b7ecef0964d0a174af6268f3cd::getLoader();
Loading

0 comments on commit 7676c1e

Please sign in to comment.