Skip to content

Commit

Permalink
Merge pull request #385 from PluginAndPartners/hotfix/release-5.7.0-j…
Browse files Browse the repository at this point in the history
…s-and-gateway-loads

Hotfix/release 5.7.0 js and gateway loads
  • Loading branch information
lira authored Feb 14, 2022
2 parents 252958b + 962a626 commit a7427fc
Show file tree
Hide file tree
Showing 8 changed files with 213 additions and 187 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [5.7.1] - 2022-02-14

### Changed Bug fixes
- Adjusted js and css load of mercado pago pool
- Repass all active gateways

## [5.7.0] - 2022-02-14

### Added
Expand Down
4 changes: 4 additions & 0 deletions changelog.log
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
CHANGELOG:
== Changelog ==
= v5.7.1 (14/02/2022) =
* Bug fixes
- Adjusted js and css load of mercado pago pool
- Repass all active gateways

= v5.7.0 (14/02/2022) =
* Features
Expand Down
138 changes: 71 additions & 67 deletions includes/module/class-wc-woomercadopago-configs.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ private function update_token_new_version() {
$this->update_token();
}
}
if ( empty( strtolower(get_option( '_site_id_v1' )) ) || empty( get_option( '_collector_id_v1' ) ) ) {
if ( empty( strtolower( get_option( '_site_id_v1' ) ) ) || empty( get_option( '_collector_id_v1' ) ) ) {
WC_WooMercadoPago_Credentials::validate_credentials_v1();
}

Expand Down Expand Up @@ -171,7 +171,7 @@ public function plugin_review() {
* Saved Cards Notice
*
* @return false
*/
*/
public function saved_cards_notice() {
if ( $this->must_not_show_saved_cards_notice() ) {
return false;
Expand Down Expand Up @@ -300,102 +300,106 @@ public static function get_country_configs() {
public function get_categories() {
return array(
'store_categories_id' =>
array(
'art',
'baby',
'coupons',
'donations',
'computing',
'cameras',
'video games',
'television',
'car electronics',
'electronics',
'automotive',
'entertainment',
'fashion',
'games',
'home',
'musical',
'phones',
'services',
'learnings',
'tickets',
'travels',
'virtual goods',
'others',
),
array(
'art',
'baby',
'coupons',
'donations',
'computing',
'cameras',
'video games',
'television',
'car electronics',
'electronics',
'automotive',
'entertainment',
'fashion',
'games',
'home',
'musical',
'phones',
'services',
'learnings',
'tickets',
'travels',
'virtual goods',
'others',
),
'store_categories_description' =>
array(
'Collectibles & Art',
'Toys for Baby, Stroller, Stroller Accessories, Car Safety Seats',
'Coupons',
'Donations',
'Computers & Tablets',
'Cameras & Photography',
'Video Games & Consoles',
'LCD, LED, Smart TV, Plasmas, TVs',
'Car Audio, Car Alarm Systems & Security, Car DVRs, Car Video Players, Car PC',
'Audio & Surveillance, Video & GPS, Others',
'Parts & Accessories',
'Music, Movies & Series, Books, Magazines & Comics, Board Games & Toys',
"Men's, Women's, Kids & baby, Handbags & Accessories, Health & Beauty, Shoes, Jewelry & Watches",
'Online Games & Credits',
'Home appliances. Home & Garden',
'Instruments & Gear',
'Cell Phones & Accessories',
'General services',
'Trainings, Conferences, Workshops',
'Tickets for Concerts, Sports, Arts, Theater, Family, Excursions tickets, Events & more',
'Plane tickets, Hotel vouchers, Travel vouchers',
'E-books, Music Files, Software, Digital Images, PDF Files and any item which can be electronically stored in a file, Mobile Recharge, DTH Recharge and any Online Recharge',
'Other categories',
),
array(
'Collectibles & Art',
'Toys for Baby, Stroller, Stroller Accessories, Car Safety Seats',
'Coupons',
'Donations',
'Computers & Tablets',
'Cameras & Photography',
'Video Games & Consoles',
'LCD, LED, Smart TV, Plasmas, TVs',
'Car Audio, Car Alarm Systems & Security, Car DVRs, Car Video Players, Car PC',
'Audio & Surveillance, Video & GPS, Others',
'Parts & Accessories',
'Music, Movies & Series, Books, Magazines & Comics, Board Games & Toys',
"Men's, Women's, Kids & baby, Handbags & Accessories, Health & Beauty, Shoes, Jewelry & Watches",
'Online Games & Credits',
'Home appliances. Home & Garden',
'Instruments & Gear',
'Cell Phones & Accessories',
'General services',
'Trainings, Conferences, Workshops',
'Tickets for Concerts, Sports, Arts, Theater, Family, Excursions tickets, Events & more',
'Plane tickets, Hotel vouchers, Travel vouchers',
'E-books, Music Files, Software, Digital Images, PDF Files and any item which can be electronically stored in a file, Mobile Recharge, DTH Recharge and any Online Recharge',
'Other categories',
),
);
}

/**
* Set payment
*
* @param array|null $methods Methods.
*
* @return array
*/
public function set_payment_gateway( $methods = null ) {
global $wp;
if ( ! empty( $wp ) && isset( $wp->query_vars['wc-api'] ) ) {
$api_request = wc_clean( $wp->query_vars['wc-api'] );
if ( ! empty( $api_request ) && in_array(
strtolower( $api_request ),
array(
'wc_woomercadopago_basic_gateway',
'wc_woomercadopago_custom_gateway',
'wc_woomercadopago_ticket_gateway',
'wc_woomercadopago_pix_gateway',
'wc_woomercadopago_basicgateway',
'wc_woomercadopago_customgateway',
'wc_woomercadopago_ticketgateway',
),
true
) ) {
strtolower( $api_request ),
array(
'wc_woomercadopago_basic_gateway',
'wc_woomercadopago_custom_gateway',
'wc_woomercadopago_ticket_gateway',
'wc_woomercadopago_pix_gateway',
'wc_woomercadopago_basicgateway',
'wc_woomercadopago_customgateway',
'wc_woomercadopago_ticketgateway',
),
true
) ) {
if ( ! preg_match( '/(_gateway)/i', $api_request ) ) {
$api_request = preg_replace( '/gateway/i', '_Gateway', $api_request );
}
$methods[] = $api_request;
}

return $methods;
}

return $this->get_available_payment_methods();
return $this->get_available_payment_methods( $methods );
}

/**
* Get available payment methods
*
* @param array|null $methods
*
* @return array
*/
public function get_available_payment_methods() {
public function get_available_payment_methods( $methods ) {
$wc_country = WC_WooMercadoPago_Module::get_woocommerce_default_country();
$site_id = strtolower(get_option( '_site_id_v1', '' ));
$site_id = strtolower( get_option( '_site_id_v1', '' ) );

$methods[] = 'WC_WooMercadoPago_Basic_Gateway';
$methods[] = 'WC_WooMercadoPago_Custom_Gateway';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class WC_WooMercadoPago_Constants {
const PRODUCT_ID_DESKTOP = 'BT7OF5FEOO6G01NJK3QG';
const PRODUCT_ID_MOBILE = 'BT7OFH09QS3001K5A0H0';
const PLATAFORM_ID = 'bo2hnr2ic4p001kbgpt0';
const VERSION = '5.7.0';
const VERSION = '5.7.1';
const MIN_PHP = 5.6;
const API_MP_BASE_URL = 'https://api.mercadopago.com';
const PAYMENT_GATEWAYS = array(
Expand Down
Loading

0 comments on commit a7427fc

Please sign in to comment.