Skip to content

Commit

Permalink
Merge pull request #701 from ebanx/fix/one-click-error
Browse files Browse the repository at this point in the history
Solved one click error
  • Loading branch information
frop authored Oct 18, 2018
2 parents 67f3200 + 2436c14 commit 4822c98
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion services/class-wc-ebanx-one-click.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class WC_EBANX_One_Click {
public function __construct() {
$this->user_id = get_current_user_id();
$this->user_country = trim( strtolower( get_user_meta( $this->user_id, 'billing_country', true ) ) );
$this->gateway = $this->user_country ? ( WC_EBANX_Constants::COUNTRY_BRAZIL === $this->user_country ? new WC_EBANX_Credit_Card_BR_Gateway() : new WC_EBANX_Credit_Card_MX_Gateway() ) : false;

switch ( $this->user_country ) {
case WC_EBANX_Constants::COUNTRY_ARGENTINA:
Expand All @@ -61,6 +60,8 @@ public function __construct() {
case WC_EBANX_Constants::COUNTRY_MEXICO:
$this->gateway = new WC_EBANX_Credit_Card_MX_Gateway();
break;
default:
$this->gateway = false;
}

if ( ! $this->gateway
Expand Down
2 changes: 1 addition & 1 deletion tests/woocommerce/lib/shop/pages/checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const fillDebitCardNumber = Symbol('fillDebitCardNumber');
const fillCreditCardNumber = Symbol('fillCreditCardNumber');
const fillCreditCardExpiryDate = Symbol('fillCreditCardExpiryDate');
const fillDebitCardExpiryDate = Symbol('fillDebitCardExpiryDate');
const simulatorUrl = `${pay.api.url}/directtefredirect/execute`;
const simulatorUrl = `${pay.api.url}/simulator/confirm`;

export default class Checkout {
constructor(cy) {
Expand Down

0 comments on commit 4822c98

Please sign in to comment.