diff --git a/composer.json b/composer.json index c60a2e63..2b46575d 100644 --- a/composer.json +++ b/composer.json @@ -20,10 +20,10 @@ } }, "require": { - "berlindb/core": "2.0", + "berlindb/core": "2.0.1", "league/container": "2.5.0", "psr/container": "1.0.0", - "stripe/stripe-php": "7.97.0" + "stripe/stripe-php": "10.6.0-beta.1" }, "scripts": { "mozart": "~/.composer/vendor/bin/mozart compose && composer dump-autoload" diff --git a/composer.lock b/composer.lock index eaa93ad8..76cb66de 100644 --- a/composer.lock +++ b/composer.lock @@ -272,5 +272,5 @@ "prefer-lowest": false, "platform": [], "platform-dev": [], - "plugin-api-version": "2.1.0" + "plugin-api-version": "2.3.0" } diff --git a/data/templates/overlay-payment-form.json b/data/templates/overlay-payment-form.json index eaccf025..c2eb142e 100644 --- a/data/templates/overlay-payment-form.json +++ b/data/templates/overlay-payment-form.json @@ -29,6 +29,9 @@ }, { "type": "checkout_button" + }, + { + "type": "payment_button" } ], "prices": [ diff --git a/includes/core/abstracts/abstract-form.php b/includes/core/abstracts/abstract-form.php index fcd59ead..f47f6316 100644 --- a/includes/core/abstracts/abstract-form.php +++ b/includes/core/abstracts/abstract-form.php @@ -94,6 +94,14 @@ abstract class Form { */ public $payment_success_page = ''; + /** + * Payment Confirmation: Cancel. + * + * @since 3.0.0 + * @var string + */ + public $payment_cancelled_page = ''; + /** * Payment Confirmation: Failure. * @@ -110,6 +118,14 @@ abstract class Form { */ public $locale = ''; + /** + * Stripe Checkout submit type. + * + * @since 4.7.0 + * @var string + */ + public $checkout_submit_type = 'pay'; + /** * Country code. * @@ -194,9 +210,17 @@ abstract class Form { * Stripe Checkout: Billing address * * @since 3.0.0 - * @var string + * @var bool */ - public $enable_billing_address = ''; + public $enable_billing_address = false; + + /** + * Stripe Checkout: Shipping address + * + * @since 3.0.0 + * @var bool + */ + public $enable_shipping_address = false; /** * Form ID. @@ -747,6 +771,16 @@ public function get_stripe_script_variables() { return apply_filters( 'simpay_stripe_script_variables', array_merge( $strings, $bools ) ); } + /** + * Determines if the payment form has fee recovery enabled for any of the payment methods. + * + * @since 4.7.0 + * + * @param \SimplePay\Core\Abstracts\Form $form The payment form. + * @return bool + */ + abstract public function has_fee_recovery(); + /** * Determines if the payment form forces fee recovery to be paid. * diff --git a/includes/core/admin/class-assets.php b/includes/core/admin/class-assets.php index 1d156d30..be29f614 100644 --- a/includes/core/admin/class-assets.php +++ b/includes/core/admin/class-assets.php @@ -166,12 +166,30 @@ public function register() { 'simpay-admin', 'simpayAdmin', array( - 'siteTitle' => get_bloginfo( 'name' ), - 'ajaxUrl' => admin_url( 'admin-ajax.php' ), - 'nonce' => wp_create_nonce( 'simpay-admin' ), - 'licenseLevel' => simpay_get_license()->get_level(), - 'i18n' => array( + 'siteTitle' => get_bloginfo( 'name' ), + 'ajaxUrl' => admin_url( 'admin-ajax.php' ), + 'nonce' => wp_create_nonce( 'simpay-admin' ), + 'licenseLevel' => simpay_get_license()->get_level(), + 'currency' => simpay_get_setting( 'currency', 'USD' ), + 'currencySymbol' => html_entity_decode( + simpay_get_saved_currency_symbol() + ), + 'currencyPosition' => simpay_get_currency_position(), + 'decimalSeparator' => simpay_get_decimal_separator(), + 'thousandSeparator' => simpay_get_thousand_separator(), + 'decimalPlaces' => simpay_get_decimal_places(), + 'minAmount' => simpay_global_minimum_amount(), + 'isUpe' => simpay_is_upe(), + 'i18n' => array( 'dateFormat' => simpay_get_date_format(), + 'mediaTitle' => esc_html__( + 'Insert Media', + 'stripe' + ), + 'mediaButtonText' => esc_html__( + 'Use Image', + 'stripe' + ), 'leavePageConfirm' => esc_html__( 'The changes you made will be lost if you navigate away from this page.', 'stripe' @@ -228,6 +246,15 @@ public function register() { 'Warning: Removing a payment form will prevent active subscriptions from sending upcoming invoice and invoice receipt emails. It is recommended to leave payment forms that have accepted Live Mode payments published.', 'stripe' ), + /* translators: Minimum payment amount. */ + 'customAmountLabel' => esc_html__( 'starting at %s', 'stripe' ), + 'recurringIntervals' => simpay_get_recurring_intervals(), + /* translators: %1$s Recurring amount. %2$s Recurring interval count. %3$s Recurring interval. */ + 'recurringIntervalDisplay' => esc_html_x( + '%1$s every %2$s %3$s', + 'recurring interval', + 'stripe' + ), ), ) ); diff --git a/includes/core/admin/fields/class-checkbox.php b/includes/core/admin/fields/class-checkbox.php index 2b183785..9b37f956 100644 --- a/includes/core/admin/fields/class-checkbox.php +++ b/includes/core/admin/fields/class-checkbox.php @@ -51,7 +51,7 @@ public function html() { } ?> -
style ) ? 'style="' . $this->style . '"' : ''; ?>> +
style ) ? 'style="' . $this->style . '"' : ''; ?>> title ) ) { @@ -65,7 +65,7 @@ public function html() {