Skip to content

Commit

Permalink
Sync from Pro
Browse files Browse the repository at this point in the history
  • Loading branch information
spencerfinnell committed Feb 23, 2023
1 parent 3cae993 commit 62cd5f9
Show file tree
Hide file tree
Showing 11 changed files with 163 additions and 202 deletions.
33 changes: 0 additions & 33 deletions includes/core/post-types/simple-pay/edit-form-payment-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,39 +17,6 @@
exit;
}

/**
* Adds dismissible (1 year) education about payment pages.
*
* @since 4.5.0
*
* @return void
*/
function payment_page_education() {
// Dismissed temporary notice.
$dismissed_notice = (bool) Persistent_Dismissible::get(
array(
'id' => 'simpay-form-settings-payment-page-education',
)
);

if ( true === $dismissed_notice ) {
return;
}

$features_url = simpay_docs_link(
'Payment Pages',
'how-to-use-payment-pages',
'form-payment-page-settings',
true
);

include_once SIMPLE_PAY_DIR . '/views/admin-education-payment-form-payment-page-settings.php'; // @phpstan-ignore-line
}
add_action(
'simpay_form_settings_payment_page_panel',
__NAMESPACE__ . '\\payment_page_education'
);

/**
* Adds the "Payment Page Mode" setting.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,9 @@ class="simpay-field simpay-field-checkbox simpay-field simpay-field-checkboxes"
data-upgrade-purchased-url="<?php echo esc_url( $upgrade_purchased_url ); ?>"
/><?php esc_html_e( 'Collect Tax ID', 'stripe' ); ?>
</label>
<p class="description">
<?php esc_html_e( 'When enabled Stripe Checkout displays the tax ID inputs depending on your customer’s location.', 'stripe' ); ?> <a href="#help/stripe%20checkout"><?php esc_html_e( 'Learn more', 'stripe' ); ?></a>
</p>
</td>
</tr>

Expand Down
88 changes: 51 additions & 37 deletions includes/core/settings/register-general.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ function register_currency_settings( $settings ) {
)
),
'priority' => 30,
'schema' => array(
'schema' => array(
'type' => 'string',
'enum' => array( 'yes', 'no' ),
),
Expand All @@ -231,44 +231,58 @@ function register_advanced_settings( $settings ) {
'id' => 'is_upe',
'section' => 'general',
'subsection' => 'advanced',
'label' => esc_html_x(
'New Payment Experience',
'setting label',
'stripe'
),
'input_label' => esc_html_x(
'✨ Try the new payment experience (early access) ✨',
'setting input label',
'stripe'
),
'label' => true === $license->is_lite()
? esc_html_x(
'Use the Latest API Version',
'setting label',
'stripe'
)
: esc_html_x(
'New Payment Experience',
'setting label',
'stripe'
),
'input_label' => true === $license->is_lite()
? esc_html_x(
'Use Stripe API version 2022-11-15',
'setting input label',
'stripe'
)
: esc_html_x(
'✨ Try the new payment experience (early access) ✨',
'setting input label',
'stripe'
),
'value' => simpay_get_setting( 'is_upe', 'no' ),
'description' => 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. */
__(
'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',
'stripe'
),
'<strong>',
'</strong>',
'<a href="' . esc_url( 'https://wpsimplepay.com/my-account/support/?a=I%20have%20questions%20about%20the%20new%20payment%20flow' ) . '" target="_blank" rel="noopener noreferrer" class="simpay-external-link">',
Utils\get_external_link_markup() . '</a>'
),
array(
'strong' => array(),
'a' => array(
'href' => true,
'rel' => true,
'target' => true,
'class' => true,
),
'span' => array(
'class' => true,
'description' => true === $license->is_lite()
? ''
: 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. */
__(
'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',
'stripe'
),
'<strong>',
'</strong>',
'<a href="' . esc_url( 'https://wpsimplepay.com/my-account/support/?a=I%20have%20questions%20about%20the%20new%20payment%20flow' ) . '" target="_blank" rel="noopener noreferrer" class="simpay-external-link">',
Utils\get_external_link_markup() . '</a>'
),
array(
'strong' => array(),
'a' => array(
'href' => true,
'rel' => true,
'target' => true,
'class' => true,
),
'span' => array(
'class' => true,
),
)
)
)
),
),
'priority' => 0,
'schema' => array(
'type' => 'string',
Expand Down Expand Up @@ -359,4 +373,4 @@ function register_advanced_settings( $settings ) {
)
)
);
}
}
18 changes: 18 additions & 0 deletions src/Admin/SiteHealth/SiteHealthDebugInformation.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,20 @@ private function get_test_or_live_mode() {
: __( 'Live Mode', 'stripe' );
}

/**
* Returns "Yes" or "No" depending on if UPE is being used
*
* @since 4.7.0
*
* @return string
*/
private function get_upe_yes_or_upe_no() {
return simpay_is_upe()
? __( 'Yes', 'stripe' )
: __( 'No', 'stripe' );
}


/**
* Returns the CAPTCHA type.
*
Expand Down Expand Up @@ -444,6 +458,10 @@ public function debug_information( $debug_info ) {
'label' => __( 'Webhook Secret', 'stripe' ),
'value' => $this->get_webhook_secret(),
),
'upe' => array(
'label' => __( 'Using UPE', 'stripe' ),
'value' => $this->get_upe_yes_or_upe_no(),
),
),
);

Expand Down
2 changes: 1 addition & 1 deletion vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderIniteb20a6b5c85ce8289da621e475237b5b::getLoader();
return ComposerAutoloaderInit6a66df1ef797fcdfb799866defc62aa2::getLoader();
5 changes: 0 additions & 5 deletions vendor/composer/autoload_psr4.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@
$baseDir = dirname($vendorDir);

return array(
'Stripe\\' => array($vendorDir . '/stripe/stripe-php/lib'),
'SimplePay\\Vendor\\Stripe\\' => array($baseDir . '/lib/Stripe/lib'),
'SimplePay\\Vendor\\' => array($baseDir . '/lib'),
'SimplePay\\Core\\' => array($baseDir . '/src'),
'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
'League\\Container\\' => array($vendorDir . '/league/container/src'),
'Interop\\Container\\' => array($vendorDir . '/container-interop/container-interop/src/Interop/Container'),
'BerlinDB\\' => array($vendorDir . '/berlindb/core/src'),
);
8 changes: 4 additions & 4 deletions vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_real.php @generated by Composer

class ComposerAutoloaderIniteb20a6b5c85ce8289da621e475237b5b
class ComposerAutoloaderInit6a66df1ef797fcdfb799866defc62aa2
{
private static $loader;

Expand All @@ -22,12 +22,12 @@ public static function getLoader()
return self::$loader;
}

spl_autoload_register(array('ComposerAutoloaderIniteb20a6b5c85ce8289da621e475237b5b', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit6a66df1ef797fcdfb799866defc62aa2', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderIniteb20a6b5c85ce8289da621e475237b5b', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit6a66df1ef797fcdfb799866defc62aa2', 'loadClassLoader'));

require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticIniteb20a6b5c85ce8289da621e475237b5b::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit6a66df1ef797fcdfb799866defc62aa2::getInitializer($loader));

$loader->register(true);

Expand Down
45 changes: 4 additions & 41 deletions vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,18 @@

namespace Composer\Autoload;

class ComposerStaticIniteb20a6b5c85ce8289da621e475237b5b
class ComposerStaticInit6a66df1ef797fcdfb799866defc62aa2
{
public static $prefixLengthsPsr4 = array (
'S' =>
array (
'Stripe\\' => 7,
'SimplePay\\Vendor\\Stripe\\' => 24,
'SimplePay\\Vendor\\' => 17,
'SimplePay\\Core\\' => 15,
),
'P' =>
array (
'Psr\\Container\\' => 14,
),
'L' =>
array (
'League\\Container\\' => 17,
),
'I' =>
array (
'Interop\\Container\\' => 18,
),
'B' =>
array (
'BerlinDB\\' => 9,
),
);

public static $prefixDirsPsr4 = array (
'Stripe\\' =>
array (
0 => __DIR__ . '/..' . '/stripe/stripe-php/lib',
),
'SimplePay\\Vendor\\Stripe\\' =>
array (
0 => __DIR__ . '/../..' . '/lib/Stripe/lib',
Expand All @@ -49,22 +28,6 @@ class ComposerStaticIniteb20a6b5c85ce8289da621e475237b5b
array (
0 => __DIR__ . '/../..' . '/src',
),
'Psr\\Container\\' =>
array (
0 => __DIR__ . '/..' . '/psr/container/src',
),
'League\\Container\\' =>
array (
0 => __DIR__ . '/..' . '/league/container/src',
),
'Interop\\Container\\' =>
array (
0 => __DIR__ . '/..' . '/container-interop/container-interop/src/Interop/Container',
),
'BerlinDB\\' =>
array (
0 => __DIR__ . '/..' . '/berlindb/core/src',
),
);

public static $classMap = array (
Expand All @@ -74,9 +37,9 @@ class ComposerStaticIniteb20a6b5c85ce8289da621e475237b5b
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticIniteb20a6b5c85ce8289da621e475237b5b::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticIniteb20a6b5c85ce8289da621e475237b5b::$prefixDirsPsr4;
$loader->classMap = ComposerStaticIniteb20a6b5c85ce8289da621e475237b5b::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit6a66df1ef797fcdfb799866defc62aa2::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit6a66df1ef797fcdfb799866defc62aa2::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit6a66df1ef797fcdfb799866defc62aa2::$classMap;

}, null, ClassLoader::class);
}
Expand Down
Loading

0 comments on commit 62cd5f9

Please sign in to comment.