Skip to content

Commit

Permalink
Fix empty array issue in gateway settings
Browse files Browse the repository at this point in the history
  • Loading branch information
vyskoczilova committed Aug 17, 2021
1 parent b805c84 commit 8b758f0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
*.swp
*.out
.svn/
.vscode
.vscode
vendor
8 changes: 6 additions & 2 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: https://paypal.me/KarolinaVyskocilova
Tags: ecommerce, woocommerce, payment gateway, fee
Requires at least: 4.6
Tested up to: 5.8
Stable tag: 2.1.0
Stable tag: 2.1.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -35,7 +35,7 @@ Requires at least WooCommerce 2.6, compatible with WooCommerce 3.2+ (recommended
- [WooCommerce Multi-Currency](https://woocommerce.com/products/multi-currency/) when the store currency is USD

= Limitations =
- It seems that Mercadopago gateway is not handling WC_Fee correctly. Get in touch with Mercadopago support.
- It seems that Mercadopago gateway is not handling WC_Fee correctly. Get in touch with Mercadopago support (and I'm happy to help them fix the issue)
- Better not use it with PayPal. (Legal issue, see FAQ as well.)
- Doesn't work on "Pay for order" pages (manually created orders or canceled payments), because of [WC limitations](https://github.com/woocommerce/woocommerce/issues/17794)

Expand Down Expand Up @@ -100,6 +100,10 @@ Either post it on [GitHub](https://github.com/vyskoczilova/woocommerce-payforpay

== Changelog ==

= 2.1.1 (2021-08-17) =

* Fix - check if array passe in gateway settings (fixes [Mercadopago error](https://wordpress.org/support/topic/fatal-error-mercado-pago-compatibility/))

= 2.1.0 (2021-07-30) =

* New filter introduced `woocommerce_pay4pay_get_current_gateway_settings` ([#61](https://github.com/vyskoczilova/woocommerce-payforpayment/pull/61))
Expand Down
2 changes: 1 addition & 1 deletion inc/class-pay4pay-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public function add_payment_options( ) {

foreach ( WC()->payment_gateways()->payment_gateways() as $gateway_id => $gateway ) {
$form_fields['pay4pay_item_title']['default'] = $gateway->title;
$gateway->form_fields = array_merge($gateway->form_fields, $form_fields); // Fix Mercadopago integration
$gateway->form_fields = array_merge(is_array($gateway->form_fields) ? $gateway->form_fields : [], $form_fields);
if ( version_compare( WC_VERSION, '3.7', '<' )) {
add_action( 'woocommerce_update_options_payment_gateways_' . $gateway->id, array( $this,'update_payment_options' ), 20 );
}
Expand Down
2 changes: 1 addition & 1 deletion woocommerce-payforpayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Pay for Payment for WooCommerce
Plugin URI: https://kybernaut.cz/pluginy/woocommerce-pay-for-payment/
Description: Setup individual charges for each payment method in WooCommerce.
Version: 2.1.0
Version: 2.1.1
Author: Karolína Vyskočilová
Author URI: https://kybernaut.cz
License: GPL-2.0+
Expand Down

0 comments on commit 8b758f0

Please sign in to comment.