Skip to content

Commit

Permalink
Merge pull request #9769 from awesomemotive/release/3.3.5.1
Browse files Browse the repository at this point in the history
Adding 3.3.5.1 changes
  • Loading branch information
cklosowski authored Nov 14, 2024
2 parents 61a1188 + c6d1154 commit 48f9e60
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 35 deletions.
2 changes: 2 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ module.exports = function ( grunt ) {
'vendor/symfony/deprecation-contracts/**',
'vendor/symfony/polyfill-php80/**',
'vendor/symfony/polyfill-mbstring/**',
'!crowdin.yml',
'!sonar-project.properties',
],
dest: 'build/<%= pkg.name %>-public/',
}
Expand Down
4 changes: 0 additions & 4 deletions assets/css/components/toggle-checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@
border: none;
}

.label {
white-space: nowrap;
}

input[type="checkbox"]:before {
position: absolute;
content: "";
Expand Down
2 changes: 1 addition & 1 deletion assets/css/edd-admin-rtl.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/edd-admin.min.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions easy-digital-downloads.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: The easiest way to sell digital products with WordPress.
* Author: Easy Digital Downloads
* Author URI: https://easydigitaldownloads.com
* Version: 3.3.5
* Version: 3.3.5.1
* Text Domain: easy-digital-downloads
* Domain Path: /languages
* Requires at least: 6.0
Expand All @@ -27,7 +27,7 @@
* @package EDD
* @category Core
* @author Easy Digital Downloads
* @version 3.3.5
* @version 3.3.5.1
*/

// Exit if accessed directly.
Expand Down
2 changes: 1 addition & 1 deletion includes/class-easy-digital-downloads.php
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ private function setup_constants() {

// Plugin version.
if ( ! defined( 'EDD_VERSION' ) ) {
define( 'EDD_VERSION', '3.3.5' );
define( 'EDD_VERSION', '3.3.5.1' );
}

// Make sure CAL_GREGORIAN is defined.
Expand Down
20 changes: 10 additions & 10 deletions languages/easy-digital-downloads.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# This file is distributed under the same license as the Easy Digital Downloads plugin.
msgid ""
msgstr ""
"Project-Id-Version: Easy Digital Downloads 3.3.5\n"
"Project-Id-Version: Easy Digital Downloads 3.3.5.1\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/easy-digital-downloads-public\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2024-11-13T18:26:41+00:00\n"
"POT-Creation-Date: 2024-11-14T23:08:35+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.11.0\n"

Expand Down Expand Up @@ -21414,40 +21414,40 @@ msgstr ""
msgid "Card Elements is the legacy Stripe integration. Easy Digital Downloads has updated to use the more secure and reliable Payment Elements feature of Stripe. This toggle allows sites without access to Card Elements to enable or disable it."
msgstr ""

#: src/Gateways/Stripe/Admin/Settings.php:492
#: src/Gateways/Stripe/Admin/Settings.php:495
msgid "One-time payments"
msgstr ""

#: src/Gateways/Stripe/Admin/Settings.php:494
#: src/Gateways/Stripe/Admin/Settings.php:497
msgid "subscriptions"
msgstr ""

#: src/Gateways/Stripe/Admin/Settings.php:497
#: src/Gateways/Stripe/Admin/Settings.php:500
msgid "subscriptions with trials"
msgstr ""

#. translators: 1: opening strong tag, 2: closing strong tag, 3: payment types
#: src/Gateways/Stripe/Admin/Settings.php:502
#: src/Gateways/Stripe/Admin/Settings.php:505
msgid "%1$sPayment types:%2$s %3$s"
msgstr ""

#. translators: 1: opening strong tag, 2: closing strong tag, 3: supported currencies
#: src/Gateways/Stripe/Admin/Settings.php:511
#: src/Gateways/Stripe/Admin/Settings.php:514
msgid "%1$sSupported currencies:%2$s %3$s"
msgstr ""

#. translators: 1: opening strong tag, 2: closing strong tag, 3: supported countries
#: src/Gateways/Stripe/Admin/Settings.php:520
#: src/Gateways/Stripe/Admin/Settings.php:523
msgid "%1$sSupported countries:%2$s %3$s"
msgstr ""

#. translators: 1: opening strong tag, 2: closing strong tag
#: src/Gateways/Stripe/Admin/Settings.php:535
#: src/Gateways/Stripe/Admin/Settings.php:538
msgid "%1$sStatus:%2$s You can test this, but to use it in Live mode, you must request access to this payment method from your Stripe account."
msgstr ""

#. translators: 1: opening strong tag, 2: closing strong tag
#: src/Gateways/Stripe/Admin/Settings.php:541
#: src/Gateways/Stripe/Admin/Settings.php:544
msgid "%1$sStatus:%2$s You must request access to this payment method from your Stripe account."
msgstr ""

Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Tags: ecommerce, payments, sell, digital store, stripe
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
Stable Tag: 3.3.5
Stable Tag: 3.3.5.1
License: GPLv2 or later

The #1 eCommerce plugin to sell digital products & subscriptions. Accept credit card payments with Stripe & PayPal and start your store today.
Expand Down Expand Up @@ -237,6 +237,9 @@ Check out some of our popular posts for actionable advice for running your busin
8. Checkout Form Block - Default Theme

== Changelog ==
= 3.3.5.1 =
* Stripe: Fixed issues with displaying and saving Stripe settings.

= 3.3.5 =
* NEW! Added Support for more Stripe Payment Methods, including more wallets, mobile payment methods, and some bank redirects.
* Stripe: Improved accessibility of the checkout form.
Expand Down
4 changes: 4 additions & 0 deletions src/Admin/Extensions/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,10 @@ protected function current_user_can( $capability = 'activate_plugins' ) {
* @return array
*/
public function add_wrap_class( $classes ) {
$tab = filter_input( INPUT_GET, 'section', FILTER_SANITIZE_SPECIAL_CHARS );
if ( 'edd-stripe' === $tab ) {
return $classes;
}
if ( ! in_array( 'has-product-education', $classes, true ) && $this->can_show_product_section() ) {
$classes[] = 'has-product-education';
}
Expand Down
38 changes: 26 additions & 12 deletions src/Admin/Settings/Sanitize/Tabs/Gateways/EddStripe.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@ private static function maybe_update_configurations( $input ) {
return;
}

if ( ! self::update_configuration( $configuration, $input ) ) {
$updated_configuration_id = self::update_configuration( $configuration, $input );
if ( ! $updated_configuration_id ) {
return;
}

delete_option( $configuration->id );
delete_option( $updated_configuration_id );

$recurring_configurations = array( 'subscriptions', 'trials' );
foreach ( $recurring_configurations as $id ) {
Expand All @@ -71,7 +72,15 @@ private static function maybe_update_configurations( $input ) {
$configuration_id
);

self::update_configuration( $configuration, $input );
$methods = array();
foreach ( \EDD\Gateways\Stripe\PaymentMethods::list() as $method => $label ) {
if ( ! isset( $configuration->$method ) ) {
continue;
}
$methods[ $method ] = $configuration->$method;
}

self::update_configuration( $methods, $input, $configuration_id );
} catch ( \Exception $e ) {
edd_debug_log( $e->getMessage(), true );
continue;
Expand All @@ -83,21 +92,22 @@ private static function maybe_update_configurations( $input ) {
* Update the configuration.
*
* @since 3.3.5
* @param object $configuration The configuration object.
* @param array $input The input array.
* @return bool
* @param object $configuration The configuration object.
* @param array $input The input array.
* @param string $configuration_id The configuration ID.
* @return bool|string False if no changes were made, otherwise the configuration ID.
*/
private static function update_configuration( $configuration, $input ) {
private static function update_configuration( $configuration, $input, $configuration_id = null ) {
$args = array();
foreach ( $input as $method => $enabled ) {
if ( ! isset( $configuration->$method ) || 'card' === $method ) {
if ( ! isset( $configuration[ $method ] ) || 'card' === $method ) {
continue;
}
if ( empty( $configuration->$method->display_preference->overridable ) ) {
if ( empty( $configuration[ $method ]['display_preference']['overridable'] ) ) {
continue;
}
$new_value = $enabled ? 'on' : 'off';
if ( $new_value === $configuration->$method->display_preference->preference ) {
if ( $new_value === $configuration[ $method ]['display_preference']['preference'] ) {
continue;
}
$args[ $method ]['display_preference']['preference'] = $new_value;
Expand All @@ -107,18 +117,22 @@ private static function update_configuration( $configuration, $input ) {
return false;
}

if ( ! $configuration_id ) {
$configuration_id = \EDD\Gateways\Stripe\PaymentMethods::get_configuration_id();
}

try {
edds_api_request(
'PaymentMethodConfiguration',
'update',
$configuration->id,
$configuration_id,
$args
);
} catch ( \Exception $e ) {
edd_debug_log( $e->getMessage(), true );
return false;
}

return true;
return $configuration_id;
}
}
5 changes: 4 additions & 1 deletion src/Gateways/Stripe/Admin/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,10 @@ private static function get_payment_method_options( $configuration ) {
$is_test_mode = edd_is_test_mode();
foreach ( $configuration as $method => $parameters ) {
$payment_method = PaymentMethods::get_payment_method( $method );
$payment_types = __( 'One-time payments', 'easy-digital-downloads' );
if ( ! $payment_method ) {
continue;
}
$payment_types = __( 'One-time payments', 'easy-digital-downloads' );
if ( $payment_method::$subscriptions ) {
$payment_types .= ', ' . __( 'subscriptions', 'easy-digital-downloads' );
}
Expand Down
4 changes: 2 additions & 2 deletions src/Gateways/Stripe/PaymentMethods.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public static function get_configuration_id( $type = '' ) {
* Retrieves the base configuration for the payment methods.
*
* @since 3.3.5
* @return object The base configuration for the payment methods.
* @return array The array of payment methods in the base configuration.
*/
public static function get_base_configuration() {
$configuration_id = self::get_configuration_id();
Expand Down Expand Up @@ -215,7 +215,7 @@ private static function get_registered_methods() {
*
* @since 3.3.5
* @param string $method The payment method.
* @return string The class name for the specified payment method.
* @return string|false The class name for the specified payment method, or false if not found.
*/
public static function get_payment_method( $method ) {
$method = str_replace( '_', ' ', $method );
Expand Down

0 comments on commit 48f9e60

Please sign in to comment.