Skip to content

Commit

Permalink
Merge pull request #201 from awesomemotive/release/4.7.7.3
Browse files Browse the repository at this point in the history
`release/4.7.7.3`
  • Loading branch information
spencerfinnell authored Jul 25, 2023
2 parents 6c5aff4 + 1dbf777 commit 67bae83
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 48 deletions.
4 changes: 2 additions & 2 deletions includes/core/assets/js/admin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -566,8 +566,6 @@ let spAdmin = {};
success( response ) {
const temp = $( '<div/>' ).append( response );

spAdmin.orderFields();

if (
[ 'payment_button', 'checkout_button' ].includes(
fieldType
Expand All @@ -581,6 +579,8 @@ let spAdmin = {};
// Reset <select>.
selectField.prop( 'selectedIndex', 0 );

spAdmin.orderFields();

hooks.doAction( 'customFieldAdded', response );
},
error( response ) {
Expand Down
2 changes: 1 addition & 1 deletion includes/core/assets/js/simpay-admin.min.js

Large diffs are not rendered by default.

8 changes: 1 addition & 7 deletions includes/core/payments/class-stripe-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,9 @@ public static function request(
}
}

// Special handling for tax calculations in beta.
// Special handling for tax calculations.
// If the request starts with Tax, handle it.
// https://stripe.com/docs/api/tax/calculations?lang=php
if ( simpay_is_upe() && false !== strpos( $class, 'Tax' ) ) {
$betas = 'tax_calc_beta=v1; tax_txns_beta=v1';
$version = SIMPLE_PAY_STRIPE_API_VERSION . ';' . $betas;

Stripe::setApiVersion( $version );

switch ( $function ) {
case 'allLineItems':
return call_user_func(
Expand Down
19 changes: 0 additions & 19 deletions includes/core/post-types/simple-pay/actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,25 +169,6 @@ function save( $post_id, $post, $update ) {
? $_POST['_simpay_custom_field']
: array();

$order = 0;

// Re-index the array so if fields were removed we don't overwrite the index with a new field.
foreach ( $fields as $k => $v ) {
$fields[ $k ] = array_values( $v );

// Order the fields based on the order they are sent.
foreach ( $fields[ $k ] as $i => $field ) {
$fields[ $k ][ $i ] = array_merge(
$field,
array(
'order' => $order,
)
);

$order++;
}
}

update_post_meta( $post_id, '_custom_fields', $fields );

// Payment Methods.
Expand Down
6 changes: 3 additions & 3 deletions includes/core/settings/register-general.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ function register_advanced_settings( $settings ) {
'stripe'
)
: esc_html_x(
'Try the new payment experience (early access)',
'Use the new payment experience ✨',
'setting input label',
'stripe'
),
Expand All @@ -270,9 +270,9 @@ function register_advanced_settings( $settings ) {
: wpautop(
wp_kses(
sprintf(
/* translators: %1$s Opening <strong>, do not translate. %2$s Closing </strong>, do not translate. %3$s Opening <a> tag, do not translate. %4$s Closing </a> tag, do not translate. */
/* translators: %3$s Opening <a> tag, do not translate. %4$s Closing </a> tag, do not translate. */
__(
'Get early acess to a new, smarter payment experience. %1$sNot recommended for merchants with a custom payment flow/custom code%2$s. Have questions about upgrading? %3$sContact us%4$s',
'Enable the new, smarter payment experience. Have questions about opting in or managing customizations? %3$sContact us%4$s',
'stripe'
),
'<strong>',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "wp-simple-pay-lite",
"title": "WP Simple Pay Lite for Stripe",
"description": "Add high conversion Stripe Checkout forms to your WordPress site and start accepting payments in minutes. **Lite Version**",
"version": "4.7.7",
"version": "4.7.7.3",
"license": "GPL-2.0-or-later",
"homepage": "https://wpsimplepay.com/",
"repository": {
Expand Down
9 changes: 5 additions & 4 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,11 @@ No. WP Simple Pay is a standalone Stripe payments plugin and does not integrate

== Changelog ==

= Stripe Payment Forms v4.7.7.3 - July 25, 2023 =

* Stripe Tax - update for general availability.
* Lite Connect - improve connection process.

= Stripe Payment Forms v4.7.7 - June 28, 2023 =

* New: Add support for adding custom fields to Stripe Checkout.
Expand All @@ -295,7 +300,3 @@ No. WP Simple Pay is a standalone Stripe payments plugin and does not integrate
= Stripe Payment Forms v4.7.3.1 - March 31, 2023 =

* Fix: Check that `jddayofweek()` is available before use.

= Stripe Payment Forms v4.7.3 - March 30, 2023 =

* New: Add a "Summary Report" email to stay up to date with payment form performance.
8 changes: 5 additions & 3 deletions src/Connect/ConnectSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ public function generate_connect_url() {
update_option( 'simpay_license_key', $key );

// Set OTH.
$oth = hash( 'sha512', (string) wp_rand() );
$oth = hash( 'sha512', (string) wp_rand() );
$hashed_oth = hash_hmac( 'sha512', $oth, wp_salt() );

update_option( 'simpay_connect_token', $oth );

$version = SIMPLE_PAY_VERSION; // @phpstan-ignore-line
Expand All @@ -167,7 +169,7 @@ public function generate_connect_url() {
$url = add_query_arg(
array(
'key' => $key,
'oth' => $oth,
'oth' => $hashed_oth,
'endpoint' => $endpoint,
'version' => $version,
'siteurl' => $siteurl,
Expand Down Expand Up @@ -248,7 +250,7 @@ public function process() {
);
}

if ( ! hash_equals( $oth, $post_oth ) ) {
if ( hash_hmac( 'sha512', $oth, wp_salt() ) !== $post_oth ) {
wp_send_json_error(
array(
'message' => $error,
Expand Down
4 changes: 2 additions & 2 deletions stripe-checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: Add high conversion Stripe payment forms to your WordPress site in minutes.
* Author: WP Simple Pay
* Author URI: https://wpsimplepay.com
* Version: 4.7.7
* Version: 4.7.7.3
* Text Domain: stripe
* Domain Path: /languages
*/
Expand Down Expand Up @@ -54,7 +54,7 @@
//
// Lite/Pro-specific.
//
define( 'SIMPLE_PAY_VERSION', '4.7.7' );
define( 'SIMPLE_PAY_VERSION', '4.7.7.3' );

if ( ! defined( 'SIMPLE_PAY_PLUGIN_NAME' ) ) {
define( 'SIMPLE_PAY_PLUGIN_NAME', 'WP Simple Pay Lite' );
Expand Down
12 changes: 6 additions & 6 deletions views/admin-education-upgrade-modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
<p class="simpay-upgrade-modal__description">
<?php
esc_html_e(
'While we have tried to ensure new payment experience is an easy transition, some user-facing changes as well changes to payment processing were required.',
'While we have done our best to ensure the new payment experience is a simple transition, some user-facing and payment processing changes were required.',
'stripe'
);
?>
Expand All @@ -120,12 +120,12 @@
?>
</p>

<a href="<?php echo esc_url( untrailingslashit( simpay_docs_link( '', 'how-to-enable-the-new-payment-experience#review-your-payment-forms', 'enable-upe', true ) ) ); ?>" target="_blank" rel="noopener noreferrer" class="simpay-upgrade-modal__upgrade-url button button-primary button-large">
<?php esc_html_e( 'Learn How to Test Live Mode Payment Forms →', 'stripe' ); ?>
</a>

<button class="button button-link dismiss-modal" style="font-size: 15px; text-decoration: none;">
<button class="button button-primary button-large dismiss-modal" style="font-size: 15px; text-decoration: none; margin-bottom: 8px">
<?php esc_html_e( 'I understand, I will review my payment forms', 'stripe' ); ?>
</button>

<a href="<?php echo esc_url( untrailingslashit( simpay_docs_link( '', 'how-to-enable-the-new-payment-experience#review-your-payment-forms', 'enable-upe', true ) ) ); ?>" target="_blank" rel="noopener noreferrer" class="simpay-upgrade-modal__upgrade-url button button-link">
<?php esc_html_e( 'Learn How to Test Live Mode Payment Forms →', 'stripe' ); ?>
</a>
</div>
</div>

0 comments on commit 67bae83

Please sign in to comment.