Version Description
- TUESDAY, 22ND FEBRUARY 2022 =
- New: Supports SEPA payment method.
- New: Supports WeChat payment method.
- Fix: Onboarding menu icon appears even if stripe is connected.
- Fix: Critical error with webhook description fixed.
- Fix: 3ds cards issue on pay order and change payment methods page.
Download this release
Release Info
Developer | brainstormworg |
Plugin | Stripe Payments For WooCommerce by Checkout Plugins |
Version | 1.4.0 |
Comparing to | |
See all releases |
Code changes from version 1.3.1 to 1.4.0
- admin/admin-controller.php +115 -4
- admin/assets/js/stripe-elements.js +13 -0
- assets/css/stripe-elements.css +15 -0
- assets/icon/bancontact.svg +80 -80
- assets/icon/sepa.svg +1 -0
- assets/icon/wechat.svg +1 -0
- assets/js/stripe-elements.js +271 -29
- autoloader.php +4 -0
- checkout-plugins-stripe-woo.php +4 -4
- gateway/abstract-payment-gateway.php +375 -18
- gateway/local-gateway.php +18 -50
- gateway/stripe/card-payments.php +23 -281
- gateway/stripe/frontend-scripts.php +54 -12
- gateway/stripe/payment-request-api.php +1 -0
- gateway/stripe/sepa.php +560 -0
- gateway/stripe/webhook.php +9 -3
- gateway/stripe/wechat.php +198 -0
- inc/helper.php +1 -1
- inc/token.php +145 -0
- inc/traits/subscriptions.php +24 -8
- languages/checkout-plugins-stripe-woo.pot +620 -460
- postcss.config.js +0 -6
- readme.txt +8 -1
- tailwind.config.js +0 -25
- wizard/build/app.asset.php +1 -1
- wizard/build/app.css +121 -266
- wizard/build/app.js +1 -3304
- wizard/onboarding.php +13 -18
- wizard/src/pages/HomePage.js +9 -3
- wizard/src/pages/WooCommerce.js +25 -6
admin/admin-controller.php
CHANGED
@@ -82,7 +82,9 @@ class Admin_Controller {
|
|
82 |
'cpsw_alipay' => __( 'Alipay', 'checkout-plugins-stripe-woo' ),
|
83 |
'cpsw_ideal' => __( 'iDEAL', 'checkout-plugins-stripe-woo' ),
|
84 |
'cpsw_klarna' => __( 'Klarna', 'checkout-plugins-stripe-woo' ),
|
|
|
85 |
'cpsw_p24' => __( 'Przelewy24', 'checkout-plugins-stripe-woo' ),
|
|
|
86 |
'cpsw_bancontact' => __( 'Bancontact', 'checkout-plugins-stripe-woo' ),
|
87 |
]
|
88 |
);
|
@@ -212,13 +214,36 @@ class Admin_Controller {
|
|
212 |
'cpsw_alipay',
|
213 |
'cpsw_ideal',
|
214 |
'cpsw_klarna',
|
|
|
215 |
'cpsw_bancontact',
|
216 |
'cpsw_p24',
|
|
|
217 |
]
|
218 |
);
|
219 |
|
220 |
-
if (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
221 |
|
|
|
222 |
wp_register_style( 'cpsw-admin-style', plugins_url( 'assets/css/admin.css', __FILE__ ), [], $version, 'all' );
|
223 |
wp_enqueue_style( 'cpsw-admin-style' );
|
224 |
|
@@ -297,13 +322,17 @@ class Admin_Controller {
|
|
297 |
|
298 |
/**
|
299 |
* Keys are not set.
|
|
|
|
|
|
|
|
|
300 |
*/
|
301 |
public function are_keys_set_check() {
|
302 |
if ( ! isset( $_GET['cpsw_connect_nonce'] ) ) { //phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
303 |
if ( isset( $_GET['tab'] ) && 'checkout' === $_GET['tab'] ) { //phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
304 |
/* translators: %1$1s HTML Markup */
|
305 |
echo wp_kses_post( sprintf( '<div class="notice notice-error"><p>' . __( 'You Stripe Publishable and Secret Keys are not set correctly. You can connect to Stripe and correct them from <a href="%1$1s">here.</a>', 'checkout-plugins-stripe-woo' ) . '</p></div>', admin_url( 'admin.php?page=wc-settings&tab=cpsw_api_settings' ) ) );
|
306 |
-
} elseif ( isset( $_GET['page'] ) && 'wc-settings' === $_GET['page'] && 'cpsw_api_settings' === $_GET['tab'] ) { //phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
307 |
$mode = '';
|
308 |
if ( 'live' === $this->settings['cpsw_mode'] && ( empty( $this->settings['cpsw_pub_key'] ) || empty( $this->settings['cpsw_secret_key'] ) ) ) {
|
309 |
$mode = 'live';
|
@@ -328,6 +357,10 @@ class Admin_Controller {
|
|
328 |
|
329 |
/**
|
330 |
* Check for SSL and show warning.
|
|
|
|
|
|
|
|
|
331 |
*/
|
332 |
public function ssl_not_connect() {
|
333 |
echo wp_kses_post( '<div class="notice notice-error"><p>' . __( 'No SSL was detected, Stripe live mode requires SSL.', 'checkout-plugins-stripe-woo' ) . '</p></div>' );
|
@@ -335,6 +368,10 @@ class Admin_Controller {
|
|
335 |
|
336 |
/**
|
337 |
* Connection success notice.
|
|
|
|
|
|
|
|
|
338 |
*/
|
339 |
public function connect_success_notice() {
|
340 |
echo wp_kses_post( '<div class="notice notice-success is-dismissible"><p>' . __( 'Your Stripe account has been connected to your WooCommerce store. You may now accept payments in live and test mode.', 'checkout-plugins-stripe-woo' ) . '</p></div>' );
|
@@ -342,6 +379,10 @@ class Admin_Controller {
|
|
342 |
|
343 |
/**
|
344 |
* Connection failed notice.
|
|
|
|
|
|
|
|
|
345 |
*/
|
346 |
public function connect_failed_notice() {
|
347 |
echo wp_kses_post( '<div class="notice notice-error is-dismissible"><p>' . __( 'We were not able to connect your Stripe account. Please try again. ', 'checkout-plugins-stripe-woo' ) . '</p></div>' );
|
@@ -350,6 +391,8 @@ class Admin_Controller {
|
|
350 |
/**
|
351 |
* Insufficient permission notice.
|
352 |
*
|
|
|
|
|
353 |
* @return void
|
354 |
*/
|
355 |
public function insufficient_permission() {
|
@@ -359,6 +402,8 @@ class Admin_Controller {
|
|
359 |
/**
|
360 |
* This method is used to update stripe options to the database.
|
361 |
*
|
|
|
|
|
362 |
* @param array $options settings array of the stripe.
|
363 |
*/
|
364 |
public function update_options( $options ) {
|
@@ -378,6 +423,8 @@ class Admin_Controller {
|
|
378 |
/**
|
379 |
* This method is used to stripe connect button.
|
380 |
*
|
|
|
|
|
381 |
* @param string $value Field name in string.
|
382 |
*/
|
383 |
public function stripe_connect( $value ) {
|
@@ -436,6 +483,8 @@ class Admin_Controller {
|
|
436 |
/**
|
437 |
* This method is used to display stripe account ID block.
|
438 |
*
|
|
|
|
|
439 |
* @param string $value Field name in string.
|
440 |
*/
|
441 |
public function account_id( $value ) {
|
@@ -524,6 +573,8 @@ class Admin_Controller {
|
|
524 |
/**
|
525 |
* This method is used to display block for Stripe webhook url.
|
526 |
*
|
|
|
|
|
527 |
* @param string $value Name of the field.
|
528 |
*/
|
529 |
public function webhook_url( $value ) {
|
@@ -557,6 +608,8 @@ class Admin_Controller {
|
|
557 |
/**
|
558 |
* Displays express checkout button preview
|
559 |
*
|
|
|
|
|
560 |
* @param array $value settings data.
|
561 |
*
|
562 |
* @return void
|
@@ -616,6 +669,8 @@ class Admin_Controller {
|
|
616 |
/**
|
617 |
* Displays express checkout button preview
|
618 |
*
|
|
|
|
|
619 |
* @param array $value settings data.
|
620 |
*
|
621 |
* @return void
|
@@ -631,7 +686,11 @@ class Admin_Controller {
|
|
631 |
/**
|
632 |
* This method is used to display Stripe Account key information on the settings page.
|
633 |
*
|
|
|
|
|
634 |
* @param string $value Name of the field.
|
|
|
|
|
635 |
*/
|
636 |
public function account_keys( $value ) {
|
637 |
if ( empty( Helper::get_setting( 'cpsw_pub_key' ) ) && empty( Helper::get_setting( 'cpsw_test_pub_key' ) ) ) {
|
@@ -669,7 +728,11 @@ class Admin_Controller {
|
|
669 |
/**
|
670 |
* This method is used to display block for Stripe Connect Button.
|
671 |
*
|
|
|
|
|
672 |
* @param string $value Name of the field.
|
|
|
|
|
673 |
*/
|
674 |
public function connect_button( $value ) {
|
675 |
$data = WC_Admin_Settings::get_field_description( $value );
|
@@ -743,7 +806,10 @@ class Admin_Controller {
|
|
743 |
/**
|
744 |
* This method is used to initialize the Stripe settings tab inside the WooCommerce settings.
|
745 |
*
|
|
|
|
|
746 |
* @param array $settings_tabs Adding settings tab to existing WooCommerce tabs array.
|
|
|
747 |
* @return mixed
|
748 |
*/
|
749 |
public function add_settings_tab( $settings_tabs ) {
|
@@ -754,8 +820,12 @@ class Admin_Controller {
|
|
754 |
/**
|
755 |
* Uses the WooCommerce admin fields API to output settings via the @see woocommerce_admin_fields() function.
|
756 |
*
|
|
|
|
|
757 |
* @uses woocommerce_admin_fields()
|
758 |
* @uses $this->get_settings()
|
|
|
|
|
759 |
*/
|
760 |
public function settings_tab() {
|
761 |
woocommerce_admin_fields( $this->get_settings() );
|
@@ -763,6 +833,10 @@ class Admin_Controller {
|
|
763 |
|
764 |
/**
|
765 |
* Uses the WooCommerce options API to save settings via the @see woocommerce_update_options() function.
|
|
|
|
|
|
|
|
|
766 |
*/
|
767 |
public function update_settings() {
|
768 |
woocommerce_update_options( $this->get_settings() );
|
@@ -794,7 +868,7 @@ class Admin_Controller {
|
|
794 |
'state' => base64_encode( //phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode
|
795 |
wp_json_encode(
|
796 |
[
|
797 |
-
'redirect' => add_query_arg( 'cpsw_connect_nonce', wp_create_nonce( 'stripe-connect' ),
|
798 |
]
|
799 |
)
|
800 |
),
|
@@ -806,6 +880,8 @@ class Admin_Controller {
|
|
806 |
/**
|
807 |
* This method is used to initialize all stripe configuration fields.
|
808 |
*
|
|
|
|
|
809 |
* @return mixed
|
810 |
*/
|
811 |
public function get_settings() {
|
@@ -922,6 +998,8 @@ class Admin_Controller {
|
|
922 |
/**
|
923 |
* Checks for response after stripe onboarding process
|
924 |
*
|
|
|
|
|
925 |
* @return void
|
926 |
*/
|
927 |
public function admin_options() {
|
@@ -987,6 +1065,8 @@ class Admin_Controller {
|
|
987 |
/**
|
988 |
* Perform a connection test
|
989 |
*
|
|
|
|
|
990 |
* @return $mixed
|
991 |
*/
|
992 |
public function connection_test() {
|
@@ -1087,6 +1167,8 @@ class Admin_Controller {
|
|
1087 |
/**
|
1088 |
* Checks for response after stripe onboarding process
|
1089 |
*
|
|
|
|
|
1090 |
* @return $mixed
|
1091 |
*/
|
1092 |
public function disconnect_account() {
|
@@ -1107,6 +1189,8 @@ class Admin_Controller {
|
|
1107 |
/**
|
1108 |
* Logs js errors
|
1109 |
*
|
|
|
|
|
1110 |
* @return json
|
1111 |
*/
|
1112 |
public function js_errors() {
|
@@ -1126,6 +1210,8 @@ class Admin_Controller {
|
|
1126 |
/**
|
1127 |
* This method is used get account information from stripe.
|
1128 |
*
|
|
|
|
|
1129 |
* @param string $account_id Account ID of a stripe user.
|
1130 |
*/
|
1131 |
public function get_account_info( $account_id = '' ) {
|
@@ -1146,6 +1232,8 @@ class Admin_Controller {
|
|
1146 |
/**
|
1147 |
* Apply filters on cpsw_settings var to filter settings fields.
|
1148 |
*
|
|
|
|
|
1149 |
* @param array $array cpsw_settings values array.
|
1150 |
* @return $array array It returns cpsw_settings array.
|
1151 |
*/
|
@@ -1204,6 +1292,8 @@ class Admin_Controller {
|
|
1204 |
/**
|
1205 |
* Checks if stripe is connected or not.
|
1206 |
*
|
|
|
|
|
1207 |
* @return $mixed
|
1208 |
*/
|
1209 |
public function is_stripe_connected() {
|
@@ -1216,6 +1306,8 @@ class Admin_Controller {
|
|
1216 |
/**
|
1217 |
* Checks if stripe is connected or not.
|
1218 |
*
|
|
|
|
|
1219 |
* @return $mixed
|
1220 |
*/
|
1221 |
public function check_connection_on_updates() {
|
@@ -1324,6 +1416,8 @@ class Admin_Controller {
|
|
1324 |
/**
|
1325 |
* Update the stripe payment mode on submit.
|
1326 |
*
|
|
|
|
|
1327 |
* @param string $old_value Old value of the option.
|
1328 |
* @param strign $value New value of the option.
|
1329 |
*
|
@@ -1343,6 +1437,10 @@ class Admin_Controller {
|
|
1343 |
|
1344 |
/**
|
1345 |
* Adds custom css to hide navigation menu item.
|
|
|
|
|
|
|
|
|
1346 |
*/
|
1347 |
public function add_custom_css() {
|
1348 |
?>
|
@@ -1355,6 +1453,8 @@ class Admin_Controller {
|
|
1355 |
/**
|
1356 |
* Adds custom breadcrumb on payment method's pages.
|
1357 |
*
|
|
|
|
|
1358 |
* @return void
|
1359 |
*/
|
1360 |
public function add_breadcrumb() {
|
@@ -1385,6 +1485,8 @@ class Admin_Controller {
|
|
1385 |
/**
|
1386 |
* Adds settings link to the checkout section.
|
1387 |
*
|
|
|
|
|
1388 |
* @param array $settings_tab Settings tabs array.
|
1389 |
*
|
1390 |
* @return array $settings_tab Settings tabs array returned.
|
@@ -1400,6 +1502,8 @@ class Admin_Controller {
|
|
1400 |
/**
|
1401 |
* Adds manual api keys links.
|
1402 |
*
|
|
|
|
|
1403 |
* @param string $links default copyright link with text.
|
1404 |
*
|
1405 |
* @return string $links Return customized copyright text with link.
|
@@ -1426,6 +1530,10 @@ class Admin_Controller {
|
|
1426 |
|
1427 |
/**
|
1428 |
* Adds manual api keys links.
|
|
|
|
|
|
|
|
|
1429 |
*/
|
1430 |
public function redirect_if_manually_saved() {
|
1431 |
if ( isset( $_GET['connect'] ) && 'manually' === $_GET['connect'] && ( ! empty( get_option( 'cpsw_secret_key' ) ) || ! empty( get_option( 'cpsw_test_secret_key' ) ) ) ) { //phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
@@ -1437,13 +1545,16 @@ class Admin_Controller {
|
|
1437 |
/**
|
1438 |
* Add settings for section checkout
|
1439 |
*
|
|
|
|
|
1440 |
* @param array $settings existing settings.
|
1441 |
* @param string $current_section section.
|
|
|
1442 |
* @return array
|
1443 |
*/
|
1444 |
public function checkout_settings( $settings, $current_section ) {
|
1445 |
if ( 'cpsw_api_settings' === $current_section ) {
|
1446 |
-
|
1447 |
exit();
|
1448 |
}
|
1449 |
if ( 'cpsw_express_checkout' === $current_section ) {
|
82 |
'cpsw_alipay' => __( 'Alipay', 'checkout-plugins-stripe-woo' ),
|
83 |
'cpsw_ideal' => __( 'iDEAL', 'checkout-plugins-stripe-woo' ),
|
84 |
'cpsw_klarna' => __( 'Klarna', 'checkout-plugins-stripe-woo' ),
|
85 |
+
'cpsw_sepa' => __( 'SEPA', 'checkout-plugins-stripe-woo' ),
|
86 |
'cpsw_p24' => __( 'Przelewy24', 'checkout-plugins-stripe-woo' ),
|
87 |
+
'cpsw_wechat' => __( 'WeChat', 'checkout-plugins-stripe-woo' ),
|
88 |
'cpsw_bancontact' => __( 'Bancontact', 'checkout-plugins-stripe-woo' ),
|
89 |
]
|
90 |
);
|
214 |
'cpsw_alipay',
|
215 |
'cpsw_ideal',
|
216 |
'cpsw_klarna',
|
217 |
+
'cpsw_sepa',
|
218 |
'cpsw_bancontact',
|
219 |
'cpsw_p24',
|
220 |
+
'cpsw_wechat',
|
221 |
]
|
222 |
);
|
223 |
|
224 |
+
if ( false !== get_transient( 'cpsw_stripe_sepa_client_secret' ) ) {
|
225 |
+
wp_register_script( 'cpsw-stripe-elements-external', 'https://js.stripe.com/v3/', [], $version, true );
|
226 |
+
wp_enqueue_script( 'cpsw-stripe-elements-external' );
|
227 |
+
|
228 |
+
wp_register_script( 'cpsw-stripe-elements', plugins_url( 'assets/js/stripe-elements.js', __FILE__ ), [ 'jquery', 'cpsw-stripe-elements-external' ], $version, true );
|
229 |
+
wp_enqueue_script( 'cpsw-stripe-elements' );
|
230 |
+
|
231 |
+
$public_key = ( 'live' === Helper::get_payment_mode() ) ? Helper::get_setting( 'cpsw_pub_key' ) : Helper::get_setting( 'cpsw_test_pub_key' );
|
232 |
+
wp_localize_script(
|
233 |
+
'cpsw-stripe-elements',
|
234 |
+
'cpsw_admin_stripe_elements',
|
235 |
+
[
|
236 |
+
'public_key' => $public_key,
|
237 |
+
'is_ssl' => is_ssl(),
|
238 |
+
'mode' => Helper::get_payment_mode(),
|
239 |
+
'client_secret' => get_transient( 'cpsw_stripe_sepa_client_secret' ),
|
240 |
+
'get_home_url' => get_home_url(),
|
241 |
+
]
|
242 |
+
);
|
243 |
+
delete_transient( 'cpsw_stripe_sepa_client_secret' );
|
244 |
+
}
|
245 |
|
246 |
+
if ( isset( $_GET['page'] ) && 'wc-settings' === $_GET['page'] && isset( $_GET['tab'] ) && ( 'cpsw_api_settings' === $_GET['tab'] || isset( $_GET['section'] ) && ( in_array( sanitize_text_field( $_GET['section'] ), $allow_scripts_methods, true ) ) ) ) { //phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
247 |
wp_register_style( 'cpsw-admin-style', plugins_url( 'assets/css/admin.css', __FILE__ ), [], $version, 'all' );
|
248 |
wp_enqueue_style( 'cpsw-admin-style' );
|
249 |
|
322 |
|
323 |
/**
|
324 |
* Keys are not set.
|
325 |
+
*
|
326 |
+
* @since 1.0.0
|
327 |
+
*
|
328 |
+
* @return void
|
329 |
*/
|
330 |
public function are_keys_set_check() {
|
331 |
if ( ! isset( $_GET['cpsw_connect_nonce'] ) ) { //phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
332 |
if ( isset( $_GET['tab'] ) && 'checkout' === $_GET['tab'] ) { //phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
333 |
/* translators: %1$1s HTML Markup */
|
334 |
echo wp_kses_post( sprintf( '<div class="notice notice-error"><p>' . __( 'You Stripe Publishable and Secret Keys are not set correctly. You can connect to Stripe and correct them from <a href="%1$1s">here.</a>', 'checkout-plugins-stripe-woo' ) . '</p></div>', admin_url( 'admin.php?page=wc-settings&tab=cpsw_api_settings' ) ) );
|
335 |
+
} elseif ( isset( $_GET['page'] ) && 'wc-settings' === $_GET['page'] && isset( $_GET['tab'] ) && 'cpsw_api_settings' === $_GET['tab'] ) { //phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
336 |
$mode = '';
|
337 |
if ( 'live' === $this->settings['cpsw_mode'] && ( empty( $this->settings['cpsw_pub_key'] ) || empty( $this->settings['cpsw_secret_key'] ) ) ) {
|
338 |
$mode = 'live';
|
357 |
|
358 |
/**
|
359 |
* Check for SSL and show warning.
|
360 |
+
*
|
361 |
+
* @since 1.0.0
|
362 |
+
*
|
363 |
+
* @return void
|
364 |
*/
|
365 |
public function ssl_not_connect() {
|
366 |
echo wp_kses_post( '<div class="notice notice-error"><p>' . __( 'No SSL was detected, Stripe live mode requires SSL.', 'checkout-plugins-stripe-woo' ) . '</p></div>' );
|
368 |
|
369 |
/**
|
370 |
* Connection success notice.
|
371 |
+
*
|
372 |
+
* @since 1.0.0
|
373 |
+
*
|
374 |
+
* @return void
|
375 |
*/
|
376 |
public function connect_success_notice() {
|
377 |
echo wp_kses_post( '<div class="notice notice-success is-dismissible"><p>' . __( 'Your Stripe account has been connected to your WooCommerce store. You may now accept payments in live and test mode.', 'checkout-plugins-stripe-woo' ) . '</p></div>' );
|
379 |
|
380 |
/**
|
381 |
* Connection failed notice.
|
382 |
+
*
|
383 |
+
* @since 1.0.0
|
384 |
+
*
|
385 |
+
* @return void
|
386 |
*/
|
387 |
public function connect_failed_notice() {
|
388 |
echo wp_kses_post( '<div class="notice notice-error is-dismissible"><p>' . __( 'We were not able to connect your Stripe account. Please try again. ', 'checkout-plugins-stripe-woo' ) . '</p></div>' );
|
391 |
/**
|
392 |
* Insufficient permission notice.
|
393 |
*
|
394 |
+
* @since 1.0.0
|
395 |
+
*
|
396 |
* @return void
|
397 |
*/
|
398 |
public function insufficient_permission() {
|
402 |
/**
|
403 |
* This method is used to update stripe options to the database.
|
404 |
*
|
405 |
+
* @since 1.0.0
|
406 |
+
*
|
407 |
* @param array $options settings array of the stripe.
|
408 |
*/
|
409 |
public function update_options( $options ) {
|
423 |
/**
|
424 |
* This method is used to stripe connect button.
|
425 |
*
|
426 |
+
* @since 1.0.0
|
427 |
+
*
|
428 |
* @param string $value Field name in string.
|
429 |
*/
|
430 |
public function stripe_connect( $value ) {
|
483 |
/**
|
484 |
* This method is used to display stripe account ID block.
|
485 |
*
|
486 |
+
* @since 1.0.0
|
487 |
+
*
|
488 |
* @param string $value Field name in string.
|
489 |
*/
|
490 |
public function account_id( $value ) {
|
573 |
/**
|
574 |
* This method is used to display block for Stripe webhook url.
|
575 |
*
|
576 |
+
* @since 1.0.0
|
577 |
+
*
|
578 |
* @param string $value Name of the field.
|
579 |
*/
|
580 |
public function webhook_url( $value ) {
|
608 |
/**
|
609 |
* Displays express checkout button preview
|
610 |
*
|
611 |
+
* @since 1.0.0
|
612 |
+
*
|
613 |
* @param array $value settings data.
|
614 |
*
|
615 |
* @return void
|
669 |
/**
|
670 |
* Displays express checkout button preview
|
671 |
*
|
672 |
+
* @since 1.0.0
|
673 |
+
*
|
674 |
* @param array $value settings data.
|
675 |
*
|
676 |
* @return void
|
686 |
/**
|
687 |
* This method is used to display Stripe Account key information on the settings page.
|
688 |
*
|
689 |
+
* @since 1.0.0
|
690 |
+
*
|
691 |
* @param string $value Name of the field.
|
692 |
+
*
|
693 |
+
* @return void
|
694 |
*/
|
695 |
public function account_keys( $value ) {
|
696 |
if ( empty( Helper::get_setting( 'cpsw_pub_key' ) ) && empty( Helper::get_setting( 'cpsw_test_pub_key' ) ) ) {
|
728 |
/**
|
729 |
* This method is used to display block for Stripe Connect Button.
|
730 |
*
|
731 |
+
* @since 1.0.0
|
732 |
+
*
|
733 |
* @param string $value Name of the field.
|
734 |
+
*
|
735 |
+
* @return void
|
736 |
*/
|
737 |
public function connect_button( $value ) {
|
738 |
$data = WC_Admin_Settings::get_field_description( $value );
|
806 |
/**
|
807 |
* This method is used to initialize the Stripe settings tab inside the WooCommerce settings.
|
808 |
*
|
809 |
+
* @since 1.0.0
|
810 |
+
*
|
811 |
* @param array $settings_tabs Adding settings tab to existing WooCommerce tabs array.
|
812 |
+
*
|
813 |
* @return mixed
|
814 |
*/
|
815 |
public function add_settings_tab( $settings_tabs ) {
|
820 |
/**
|
821 |
* Uses the WooCommerce admin fields API to output settings via the @see woocommerce_admin_fields() function.
|
822 |
*
|
823 |
+
* @since 1.0.0
|
824 |
+
*
|
825 |
* @uses woocommerce_admin_fields()
|
826 |
* @uses $this->get_settings()
|
827 |
+
*
|
828 |
+
* @return void
|
829 |
*/
|
830 |
public function settings_tab() {
|
831 |
woocommerce_admin_fields( $this->get_settings() );
|
833 |
|
834 |
/**
|
835 |
* Uses the WooCommerce options API to save settings via the @see woocommerce_update_options() function.
|
836 |
+
*
|
837 |
+
* @since 1.0.0
|
838 |
+
*
|
839 |
+
* @return void
|
840 |
*/
|
841 |
public function update_settings() {
|
842 |
woocommerce_update_options( $this->get_settings() );
|
868 |
'state' => base64_encode( //phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode
|
869 |
wp_json_encode(
|
870 |
[
|
871 |
+
'redirect' => add_query_arg( 'cpsw_connect_nonce', wp_create_nonce( 'stripe-connect' ), $redirect_url ),
|
872 |
]
|
873 |
)
|
874 |
),
|
880 |
/**
|
881 |
* This method is used to initialize all stripe configuration fields.
|
882 |
*
|
883 |
+
* @since 1.0.0
|
884 |
+
*
|
885 |
* @return mixed
|
886 |
*/
|
887 |
public function get_settings() {
|
998 |
/**
|
999 |
* Checks for response after stripe onboarding process
|
1000 |
*
|
1001 |
+
* @since 1.0.0
|
1002 |
+
*
|
1003 |
* @return void
|
1004 |
*/
|
1005 |
public function admin_options() {
|
1065 |
/**
|
1066 |
* Perform a connection test
|
1067 |
*
|
1068 |
+
* @since 1.0.0
|
1069 |
+
*
|
1070 |
* @return $mixed
|
1071 |
*/
|
1072 |
public function connection_test() {
|
1167 |
/**
|
1168 |
* Checks for response after stripe onboarding process
|
1169 |
*
|
1170 |
+
* @since 1.0.0
|
1171 |
+
*
|
1172 |
* @return $mixed
|
1173 |
*/
|
1174 |
public function disconnect_account() {
|
1189 |
/**
|
1190 |
* Logs js errors
|
1191 |
*
|
1192 |
+
* @since 1.0.0
|
1193 |
+
*
|
1194 |
* @return json
|
1195 |
*/
|
1196 |
public function js_errors() {
|
1210 |
/**
|
1211 |
* This method is used get account information from stripe.
|
1212 |
*
|
1213 |
+
* @since 1.0.0
|
1214 |
+
*
|
1215 |
* @param string $account_id Account ID of a stripe user.
|
1216 |
*/
|
1217 |
public function get_account_info( $account_id = '' ) {
|
1232 |
/**
|
1233 |
* Apply filters on cpsw_settings var to filter settings fields.
|
1234 |
*
|
1235 |
+
* @since 1.0.0
|
1236 |
+
*
|
1237 |
* @param array $array cpsw_settings values array.
|
1238 |
* @return $array array It returns cpsw_settings array.
|
1239 |
*/
|
1292 |
/**
|
1293 |
* Checks if stripe is connected or not.
|
1294 |
*
|
1295 |
+
* @since 1.0.0
|
1296 |
+
*
|
1297 |
* @return $mixed
|
1298 |
*/
|
1299 |
public function is_stripe_connected() {
|
1306 |
/**
|
1307 |
* Checks if stripe is connected or not.
|
1308 |
*
|
1309 |
+
* @since 1.0.0
|
1310 |
+
*
|
1311 |
* @return $mixed
|
1312 |
*/
|
1313 |
public function check_connection_on_updates() {
|
1416 |
/**
|
1417 |
* Update the stripe payment mode on submit.
|
1418 |
*
|
1419 |
+
* @since 1.0.0
|
1420 |
+
*
|
1421 |
* @param string $old_value Old value of the option.
|
1422 |
* @param strign $value New value of the option.
|
1423 |
*
|
1437 |
|
1438 |
/**
|
1439 |
* Adds custom css to hide navigation menu item.
|
1440 |
+
*
|
1441 |
+
* @since 1.0.0
|
1442 |
+
*
|
1443 |
+
* @return void
|
1444 |
*/
|
1445 |
public function add_custom_css() {
|
1446 |
?>
|
1453 |
/**
|
1454 |
* Adds custom breadcrumb on payment method's pages.
|
1455 |
*
|
1456 |
+
* @since 1.0.0
|
1457 |
+
*
|
1458 |
* @return void
|
1459 |
*/
|
1460 |
public function add_breadcrumb() {
|
1485 |
/**
|
1486 |
* Adds settings link to the checkout section.
|
1487 |
*
|
1488 |
+
* @since 1.0.0
|
1489 |
+
*
|
1490 |
* @param array $settings_tab Settings tabs array.
|
1491 |
*
|
1492 |
* @return array $settings_tab Settings tabs array returned.
|
1502 |
/**
|
1503 |
* Adds manual api keys links.
|
1504 |
*
|
1505 |
+
* @since 1.0.0
|
1506 |
+
*
|
1507 |
* @param string $links default copyright link with text.
|
1508 |
*
|
1509 |
* @return string $links Return customized copyright text with link.
|
1530 |
|
1531 |
/**
|
1532 |
* Adds manual api keys links.
|
1533 |
+
*
|
1534 |
+
* @since 1.0.0
|
1535 |
+
*
|
1536 |
+
* @return void
|
1537 |
*/
|
1538 |
public function redirect_if_manually_saved() {
|
1539 |
if ( isset( $_GET['connect'] ) && 'manually' === $_GET['connect'] && ( ! empty( get_option( 'cpsw_secret_key' ) ) || ! empty( get_option( 'cpsw_test_secret_key' ) ) ) ) { //phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
1545 |
/**
|
1546 |
* Add settings for section checkout
|
1547 |
*
|
1548 |
+
* @since 1.0.0
|
1549 |
+
*
|
1550 |
* @param array $settings existing settings.
|
1551 |
* @param string $current_section section.
|
1552 |
+
*
|
1553 |
* @return array
|
1554 |
*/
|
1555 |
public function checkout_settings( $settings, $current_section ) {
|
1556 |
if ( 'cpsw_api_settings' === $current_section ) {
|
1557 |
+
wp_safe_redirect( admin_url() . 'admin.php?page=wc-settings&tab=cpsw_api_settings' );
|
1558 |
exit();
|
1559 |
}
|
1560 |
if ( 'cpsw_express_checkout' === $current_section ) {
|
admin/assets/js/stripe-elements.js
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
( function() {
|
2 |
+
const pubKey = cpsw_admin_stripe_elements.public_key;
|
3 |
+
const mode = cpsw_admin_stripe_elements.mode;
|
4 |
+
const clientSecret = cpsw_admin_stripe_elements.client_secret;
|
5 |
+
|
6 |
+
if ( '' === clientSecret || '' === pubKey || ( 'live' === mode && ! cpsw_admin_stripe_elements.is_ssl ) ) {
|
7 |
+
return;
|
8 |
+
}
|
9 |
+
|
10 |
+
const stripe = Stripe( pubKey );
|
11 |
+
|
12 |
+
stripe.confirmSepaDebitPayment( clientSecret, {} ).then( function() {} );
|
13 |
+
}( jQuery ) );
|
assets/css/stripe-elements.css
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
.cpsw-stripe-error,
|
2 |
.cpsw-number-error,
|
3 |
.cpsw-expiry-error,
|
|
|
4 |
.cpsw-cvc-error,
|
5 |
.cpsw_stripe_ideal_error {
|
6 |
padding-top: 3px;
|
@@ -65,6 +66,20 @@
|
|
65 |
cursor: not-allowed;
|
66 |
}
|
67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
.cpsw_stripe_ideal_form .cpsw_stripe_ideal_select,
|
69 |
.cpsw_stripe_p24_form .cpsw_stripe_p24_select {
|
70 |
margin: 0.5em 0;
|
1 |
.cpsw-stripe-error,
|
2 |
.cpsw-number-error,
|
3 |
.cpsw-expiry-error,
|
4 |
+
.cpsw_stripe_sepa_error,
|
5 |
.cpsw-cvc-error,
|
6 |
.cpsw_stripe_ideal_error {
|
7 |
padding-top: 3px;
|
66 |
cursor: not-allowed;
|
67 |
}
|
68 |
|
69 |
+
.cpsw_stripe_ideal_form .cpsw_stripe_ideal_select {
|
70 |
+
margin-top: 10px;
|
71 |
+
}
|
72 |
+
|
73 |
+
#cpsw_stripe_sepa_iban_element {
|
74 |
+
padding: 5px;
|
75 |
+
}
|
76 |
+
|
77 |
+
#cpsw-payment-request-button {
|
78 |
+
max-width: 100%;
|
79 |
+
border-radius: 3px;
|
80 |
+
box-shadow: 0 1px 2px rgb(0 0 0 / 50%);
|
81 |
+
}
|
82 |
+
|
83 |
.cpsw_stripe_ideal_form .cpsw_stripe_ideal_select,
|
84 |
.cpsw_stripe_p24_form .cpsw_stripe_p24_select {
|
85 |
margin: 0.5em 0;
|
assets/icon/bancontact.svg
CHANGED
@@ -1,80 +1,80 @@
|
|
1 |
-
<?xml version="1.0" encoding="utf-8"?>
|
2 |
-
<!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
3 |
-
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
4 |
-
width="256px" height="160px" viewBox="36 36 256 160" style="enable-background:new 0 0 326.1 230.5;" xml:space="preserve"
|
5 |
-
>
|
6 |
-
<style type="text/css">
|
7 |
-
.st0{fill:#FFFFFF;}
|
8 |
-
.st1{fill:#005498;}
|
9 |
-
.st2{fill:#FFD800;}
|
10 |
-
.st3{fill:none;}
|
11 |
-
</style>
|
12 |
-
<g>
|
13 |
-
<path class="st0" d="M326.1,210.7c0,10.9-8.9,19.8-19.8,19.8H19.9c-10.9,0-19.8-8.9-19.8-19.8V19.8C0.1,8.9,9,0,19.9,0h286.4
|
14 |
-
c10.9,0,19.8,8.9,19.8,19.8L326.1,210.7L326.1,210.7z"/>
|
15 |
-
</g>
|
16 |
-
<g>
|
17 |
-
<path class="st1" d="M262,64.4h-11.8h-54.6h-11.9l-8,9l-25.8,29.1l0,0l-8,9h-11.8H76.5H64.7l7.8-9.1l3.7-4.3L84,89H72.2H57h-8.5
|
18 |
-
c-6.5,0-11.8,5.5-11.8,12.1l0,0v23.4v2.2c0,6.7,5.3,12.1,11.8,12.1h3.3h124h8.9c6.5,0,15.4-4,19.7-9l20.6-23.4L262,64.4z"/>
|
19 |
-
<path class="st2" d="M277.7,37.1c6.5,0,11.8,5.5,11.8,12.1v25.5c0,6.7-5.3,12.1-11.8,12.1h-6.4h-17.2h-11.8l7.9-9l0,0l3.9-4.5
|
20 |
-
l7.9-9h-78.3l-41.7,47H64.3l55.7-63l2.1-2.4c4.4-4.9,13.3-9,19.8-9h2.7h133.1V37.1z"/>
|
21 |
-
</g>
|
22 |
-
<path class="st1" d="M289.5,192.4v-3.7c0-0.5-0.3-0.8-1-0.8h-2.4c-0.7,0-1.2-0.1-1.3-0.4c-0.2-0.3-0.2-0.9-0.2-1.9v-14h3.9
|
23 |
-
c0.3,0,0.5-0.1,0.7-0.3s0.3-0.4,0.3-0.7v-3.9c0-0.3-0.1-0.5-0.3-0.7c-0.2-0.2-0.4-0.3-0.7-0.3h-3.9v-5.1c0-0.3-0.1-0.5-0.2-0.6
|
24 |
-
c-0.2-0.1-0.4-0.2-0.6-0.2h-0.1l-5.8,1c-0.3,0.1-0.5,0.2-0.7,0.3c-0.2,0.2-0.3,0.4-0.3,0.6v3.9H273c-0.3,0-0.5,0.1-0.7,0.3
|
25 |
-
s-0.3,0.4-0.3,0.7v3.2c0,0.3,0.1,0.5,0.3,0.6c0.2,0.2,0.4,0.3,0.7,0.4l3.9,0.6v14c0,1.7,0.2,3.1,0.5,4.2c0.4,1.1,0.9,1.9,1.5,2.5
|
26 |
-
c0.7,0.6,1.5,1,2.5,1.2s2.2,0.3,3.5,0.3c0.7,0,1.3,0,1.9-0.1c0.5-0.1,1.2-0.2,1.9-0.3C289.2,193.2,289.5,192.9,289.5,192.4
|
27 |
-
M268.7,191.9v-4.3c0-0.3-0.1-0.5-0.3-0.6c-0.2-0.1-0.4-0.2-0.6-0.2h-0.1c-0.9,0.1-1.8,0.2-2.6,0.2c-0.8,0.1-1.9,0.1-3.3,0.1
|
28 |
-
c-0.5,0-1.1-0.1-1.5-0.3c-0.5-0.2-0.9-0.5-1.3-0.9s-0.6-1-0.8-1.7c-0.2-0.7-0.3-1.6-0.3-2.7v-4c0-1.1,0.1-2,0.3-2.7
|
29 |
-
c0.2-0.7,0.5-1.3,0.8-1.7c0.4-0.4,0.8-0.7,1.3-0.9s1-0.3,1.5-0.3c1.4,0,2.5,0,3.3,0.1s1.7,0.1,2.6,0.2h0.1c0.3,0,0.5-0.1,0.6-0.2
|
30 |
-
c0.2-0.1,0.3-0.3,0.3-0.6v-4.3c0-0.4-0.1-0.6-0.2-0.7c-0.2-0.1-0.4-0.3-0.8-0.4c-0.7-0.2-1.5-0.3-2.6-0.5s-2.3-0.2-3.8-0.2
|
31 |
-
c-3.4,0-6.1,1-8.2,3.1c-2,2.1-3.1,5.1-3.1,9.1v4c0,3.9,1,7,3.1,9.1c2,2.1,4.8,3.1,8.2,3.1c1.4,0,2.7-0.1,3.8-0.2
|
32 |
-
c1.1-0.2,2-0.3,2.6-0.5c0.4-0.1,0.6-0.2,0.8-0.4C268.7,192.5,268.7,192.2,268.7,191.9 M237.4,186.8c-0.6,0.3-1.2,0.5-1.9,0.7
|
33 |
-
c-0.7,0.2-1.4,0.3-2.1,0.3c-1,0-1.8-0.1-2.3-0.4s-0.7-0.9-0.7-2V185c0-0.6,0.1-1.1,0.2-1.5s0.4-0.8,0.7-1.1c0.3-0.3,0.8-0.5,1.3-0.6
|
34 |
-
s1.2-0.2,2.1-0.2h2.7L237.4,186.8L237.4,186.8z M245,175.1c0-1.8-0.3-3.3-0.8-4.5s-1.3-2.2-2.2-3c-1-0.8-2.1-1.4-3.5-1.7
|
35 |
-
c-1.4-0.4-3-0.6-4.7-0.6c-1.6,0-3.2,0.1-4.7,0.3s-2.7,0.4-3.6,0.7c-0.6,0.2-0.9,0.5-0.9,1.1v3.9c0,0.3,0.1,0.5,0.2,0.7
|
36 |
-
c0.2,0.1,0.4,0.2,0.6,0.2h0.2c0.4,0,0.9-0.1,1.4-0.1c0.6,0,1.2-0.1,1.9-0.1c0.7,0,1.5-0.1,2.3-0.1s1.6,0,2.3,0c1.1,0,2,0.2,2.6,0.6
|
37 |
-
c0.6,0.4,1,1.3,1,2.7v1.7h-2.6c-4.1,0-7.2,0.6-9,1.9c-1.9,1.3-2.8,3.4-2.8,6.2v0.4c0,1.6,0.2,2.9,0.7,3.9c0.5,1.1,1.1,1.9,1.9,2.6
|
38 |
-
c0.8,0.6,1.6,1.1,2.6,1.4s2,0.4,3.1,0.4c1.4,0,2.7-0.2,3.7-0.6s2-0.9,3-1.6v0.8c0,0.3,0.1,0.5,0.3,0.7c0.2,0.2,0.4,0.3,0.7,0.3h5.4
|
39 |
-
c0.3,0,0.5-0.1,0.7-0.3c0.2-0.2,0.3-0.4,0.3-0.7v-17.2H245z M219.3,192.4v-3.7c0-0.5-0.3-0.8-1-0.8h-2.4c-0.7,0-1.2-0.1-1.3-0.4
|
40 |
-
c-0.2-0.3-0.2-0.9-0.2-1.9v-14h3.9c0.3,0,0.5-0.1,0.7-0.3s0.3-0.4,0.3-0.7v-3.9c0-0.3-0.1-0.5-0.3-0.7s-0.4-0.3-0.7-0.3h-3.9v-5.1
|
41 |
-
c0-0.3-0.1-0.5-0.2-0.6c-0.2-0.1-0.4-0.2-0.6-0.2h-0.1l-5.8,1c-0.3,0.1-0.5,0.2-0.7,0.3c-0.2,0.2-0.3,0.4-0.3,0.6v3.9h-4
|
42 |
-
c-0.3,0-0.5,0.1-0.7,0.3s-0.3,0.4-0.3,0.7v3.2c0,0.3,0.1,0.5,0.3,0.6c0.2,0.2,0.4,0.3,0.7,0.4l3.9,0.6v14c0,1.7,0.2,3.1,0.5,4.2
|
43 |
-
c0.4,1.1,0.9,1.9,1.5,2.5c0.7,0.6,1.5,1,2.5,1.2s2.2,0.3,3.5,0.3c0.7,0,1.3,0,1.9-0.1c0.5-0.1,1.2-0.2,1.9-0.3
|
44 |
-
C219,193.2,219.3,192.9,219.3,192.4 M198.3,192.3v-16c0-1.5-0.1-2.9-0.4-4.3c-0.2-1.3-0.7-2.5-1.3-3.5c-0.6-1-1.5-1.8-2.6-2.3
|
45 |
-
c-1.1-0.6-2.5-0.9-4.3-0.9c-1.5,0-2.9,0.2-4.1,0.6c-1.2,0.4-2.4,1-3.8,2v-1.2c0-0.3-0.1-0.5-0.3-0.7s-0.4-0.3-0.7-0.3h-5.4
|
46 |
-
c-0.3,0-0.5,0.1-0.7,0.3s-0.3,0.4-0.3,0.7v25.6c0,0.3,0.1,0.5,0.3,0.7s0.4,0.3,0.7,0.3h5.8c0.3,0,0.5-0.1,0.7-0.3
|
47 |
-
c0.2-0.2,0.3-0.4,0.3-0.7v-18.9c0.8-0.4,1.6-0.8,2.4-1.1c0.7-0.3,1.5-0.4,2.2-0.4s1.3,0.1,1.8,0.2c0.5,0.1,0.8,0.4,1.1,0.7
|
48 |
-
c0.3,0.4,0.4,0.8,0.5,1.4c0.1,0.6,0.1,1.3,0.1,2.1v16c0,0.3,0.1,0.5,0.3,0.7c0.2,0.2,0.4,0.3,0.7,0.3h5.8c0.3,0,0.5-0.1,0.7-0.3
|
49 |
-
C198.2,192.8,198.3,192.5,198.3,192.3 M161.9,181.2c0,3.9-1.4,5.9-4.3,5.9c-1.4,0-2.5-0.5-3.2-1.5s-1.1-2.5-1.1-4.4v-3.4
|
50 |
-
c0-2,0.4-3.4,1.1-4.4c0.7-1,1.8-1.5,3.2-1.5c2.8,0,4.3,2,4.3,5.9V181.2z M169.7,177.8c0-1.9-0.3-3.7-0.8-5.2s-1.3-2.8-2.3-3.9
|
51 |
-
c-1-1.1-2.3-1.9-3.8-2.5s-3.2-0.9-5.2-0.9s-3.7,0.3-5.2,0.9c-1.5,0.6-2.8,1.4-3.8,2.5s-1.8,2.4-2.3,3.9s-0.8,3.3-0.8,5.2v3.4
|
52 |
-
c0,1.9,0.3,3.7,0.8,5.2s1.3,2.8,2.3,3.9s2.3,1.9,3.8,2.5s3.2,0.9,5.2,0.9s3.7-0.3,5.2-0.9s2.8-1.4,3.8-2.5s1.8-2.4,2.3-3.9
|
53 |
-
s0.8-3.3,0.8-5.2V177.8z M143,191.9v-4.3c0-0.3-0.1-0.5-0.3-0.6s-0.4-0.2-0.7-0.2h-0.1c-0.9,0.1-1.8,0.2-2.6,0.2
|
54 |
-
c-0.8,0.1-1.9,0.1-3.3,0.1c-0.5,0-1.1-0.1-1.5-0.3c-0.5-0.2-0.9-0.5-1.3-0.9c-0.4-0.4-0.6-1-0.8-1.7s-0.3-1.6-0.3-2.7v-4
|
55 |
-
c0-1.1,0.1-2,0.3-2.7s0.5-1.3,0.8-1.7c0.4-0.4,0.8-0.7,1.3-0.9s1-0.3,1.5-0.3c1.4,0,2.5,0,3.3,0.1s1.7,0.1,2.6,0.2h0.1
|
56 |
-
c0.3,0,0.5-0.1,0.7-0.2c0.2-0.1,0.3-0.3,0.3-0.6v-4.3c0-0.4-0.1-0.6-0.2-0.7c-0.2-0.1-0.4-0.3-0.8-0.4c-0.7-0.2-1.5-0.3-2.6-0.5
|
57 |
-
s-2.3-0.2-3.8-0.2c-3.4,0-6.1,1-8.2,3.1c-2,2.1-3.1,5.1-3.1,9.1v4c0,3.9,1,7,3.1,9.1c2,2.1,4.8,3.1,8.2,3.1c1.4,0,2.7-0.1,3.8-0.2
|
58 |
-
c1.1-0.2,1.9-0.3,2.6-0.5c0.4-0.1,0.6-0.2,0.8-0.4C142.9,192.5,143,192.2,143,191.9 M119.3,192.3v-16c0-1.5-0.1-2.9-0.4-4.3
|
59 |
-
c-0.2-1.3-0.7-2.5-1.3-3.5s-1.5-1.8-2.6-2.3c-1.1-0.6-2.5-0.9-4.3-0.9c-1.5,0-2.9,0.2-4.1,0.6c-1.2,0.4-2.4,1-3.8,2v-1.2
|
60 |
-
c0-0.3-0.1-0.5-0.3-0.7s-0.4-0.3-0.7-0.3h-5.4c-0.3,0-0.5,0.1-0.7,0.3s-0.3,0.4-0.3,0.7v25.6c0,0.3,0.1,0.5,0.3,0.7s0.4,0.3,0.7,0.3
|
61 |
-
h5.8c0.3,0,0.5-0.1,0.7-0.3c0.2-0.2,0.3-0.4,0.3-0.7v-18.9c0.8-0.4,1.6-0.8,2.4-1.1c0.7-0.3,1.5-0.4,2.2-0.4s1.3,0.1,1.8,0.2
|
62 |
-
c0.5,0.1,0.8,0.4,1.1,0.7c0.3,0.4,0.4,0.8,0.5,1.4c0.1,0.6,0.1,1.3,0.1,2.1v16c0,0.3,0.1,0.5,0.3,0.7s0.4,0.3,0.7,0.3h5.8
|
63 |
-
c0.3,0,0.5-0.1,0.7-0.3C119.2,192.8,119.3,192.5,119.3,192.3 M82.1,186.8c-0.6,0.3-1.2,0.5-1.9,0.7s-1.4,0.3-2.1,0.3
|
64 |
-
c-1,0-1.8-0.1-2.3-0.4s-0.7-0.9-0.7-2V185c0-0.6,0.1-1.1,0.2-1.5c0.1-0.4,0.4-0.8,0.7-1.1c0.3-0.3,0.8-0.5,1.3-0.6s1.2-0.2,2.1-0.2
|
65 |
-
h2.7V186.8z M89.8,175.1c0-1.8-0.3-3.3-0.8-4.5s-1.3-2.2-2.2-3c-1-0.8-2.1-1.4-3.5-1.7c-1.4-0.4-3-0.6-4.7-0.6
|
66 |
-
c-1.6,0-3.2,0.1-4.7,0.3s-2.7,0.4-3.6,0.7c-0.6,0.2-0.9,0.5-0.9,1.1v3.9c0,0.3,0.1,0.5,0.2,0.7c0.2,0.1,0.4,0.2,0.6,0.2h0.2
|
67 |
-
c0.4,0,0.9-0.1,1.4-0.1c0.6,0,1.2-0.1,2-0.1c0.7,0,1.5-0.1,2.3-0.1s1.6,0,2.3,0c1.1,0,2,0.2,2.6,0.6c0.6,0.4,1,1.3,1,2.7v1.7h-2.6
|
68 |
-
c-4.1,0-7.2,0.6-9,1.9c-1.9,1.3-2.8,3.4-2.8,6.2v0.4c0,1.6,0.2,2.9,0.7,3.9c0.5,1.1,1.1,1.9,1.9,2.6c0.8,0.6,1.6,1.1,2.6,1.4
|
69 |
-
s2,0.4,3.1,0.4c1.4,0,2.7-0.2,3.7-0.6s2-0.9,3-1.6v0.8c0,0.3,0.1,0.5,0.3,0.7s0.4,0.3,0.7,0.3H89c0.3,0,0.5-0.1,0.7-0.3
|
70 |
-
c0.2-0.2,0.3-0.4,0.3-0.7v-17.2H89.8z M55.4,182.7c0,1.3-0.5,2.4-1.4,3.1s-2.7,1.1-5.1,1.1h-0.8c-0.4,0-0.8,0-1.2,0
|
71 |
-
c-0.4,0-0.8,0-1.2,0h-0.8v-9h5.4c1.9,0,3.3,0.4,4,1.3c0.7,0.9,1.1,1.9,1.1,3V182.7z M55.2,168.4c0,0.5-0.1,1-0.2,1.5
|
72 |
-
c-0.2,0.5-0.4,0.9-0.8,1.2s-0.9,0.6-1.5,0.8s-1.4,0.3-2.4,0.3h-5.4v-8.3c0.2,0,0.4,0,0.7,0c0.3,0,0.7,0,1.1,0h1.1h0.8
|
73 |
-
c2.5,0,4.2,0.3,5.2,0.9c1,0.6,1.5,1.6,1.5,2.9L55.2,168.4L55.2,168.4z M63.4,182.2c0-1.7-0.4-3.1-1.2-4.3s-1.8-2.2-3.1-2.8
|
74 |
-
c1.3-0.6,2.3-1.6,3-2.8c0.7-1.3,1.1-2.7,1.1-4.2v-0.9c0-1.9-0.4-3.5-1.1-4.8c-0.7-1.3-1.8-2.3-3.1-3.1s-2.9-1.3-4.8-1.7
|
75 |
-
c-1.9-0.3-3.9-0.5-6.2-0.5c-0.8,0-1.6,0-2.4,0s-1.6,0.1-2.4,0.1s-1.5,0.1-2.2,0.2c-0.7,0.1-1.2,0.1-1.6,0.2c-0.9,0.2-1.6,0.4-2,0.9
|
76 |
-
c-0.4,0.4-0.6,1.2-0.6,2.3v29.3c0,1.1,0.2,1.8,0.6,2.3c0.4,0.4,1.1,0.7,2,0.9c0.5,0.1,1.1,0.2,1.7,0.2c0.7,0.1,1.4,0.1,2.2,0.2
|
77 |
-
s1.6,0.1,2.4,0.1s1.7,0,2.5,0c2.1,0,4.1-0.2,5.9-0.5c1.8-0.3,3.4-0.9,4.8-1.7c1.4-0.8,2.4-1.9,3.3-3.3c0.8-1.4,1.2-3.2,1.2-5.3
|
78 |
-
L63.4,182.2L63.4,182.2z"/>
|
79 |
-
<rect x="0" y="0" class="st3" width="326" height="230.5"/>
|
80 |
-
</svg>
|
1 |
+
<?xml version="1.0" encoding="utf-8"?>
|
2 |
+
<!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
3 |
+
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
4 |
+
width="256px" height="160px" viewBox="36 36 256 160" style="enable-background:new 0 0 326.1 230.5;" xml:space="preserve"
|
5 |
+
>
|
6 |
+
<style type="text/css">
|
7 |
+
.st0{fill:#FFFFFF;}
|
8 |
+
.st1{fill:#005498;}
|
9 |
+
.st2{fill:#FFD800;}
|
10 |
+
.st3{fill:none;}
|
11 |
+
</style>
|
12 |
+
<g>
|
13 |
+
<path class="st0" d="M326.1,210.7c0,10.9-8.9,19.8-19.8,19.8H19.9c-10.9,0-19.8-8.9-19.8-19.8V19.8C0.1,8.9,9,0,19.9,0h286.4
|
14 |
+
c10.9,0,19.8,8.9,19.8,19.8L326.1,210.7L326.1,210.7z"/>
|
15 |
+
</g>
|
16 |
+
<g>
|
17 |
+
<path class="st1" d="M262,64.4h-11.8h-54.6h-11.9l-8,9l-25.8,29.1l0,0l-8,9h-11.8H76.5H64.7l7.8-9.1l3.7-4.3L84,89H72.2H57h-8.5
|
18 |
+
c-6.5,0-11.8,5.5-11.8,12.1l0,0v23.4v2.2c0,6.7,5.3,12.1,11.8,12.1h3.3h124h8.9c6.5,0,15.4-4,19.7-9l20.6-23.4L262,64.4z"/>
|
19 |
+
<path class="st2" d="M277.7,37.1c6.5,0,11.8,5.5,11.8,12.1v25.5c0,6.7-5.3,12.1-11.8,12.1h-6.4h-17.2h-11.8l7.9-9l0,0l3.9-4.5
|
20 |
+
l7.9-9h-78.3l-41.7,47H64.3l55.7-63l2.1-2.4c4.4-4.9,13.3-9,19.8-9h2.7h133.1V37.1z"/>
|
21 |
+
</g>
|
22 |
+
<path class="st1" d="M289.5,192.4v-3.7c0-0.5-0.3-0.8-1-0.8h-2.4c-0.7,0-1.2-0.1-1.3-0.4c-0.2-0.3-0.2-0.9-0.2-1.9v-14h3.9
|
23 |
+
c0.3,0,0.5-0.1,0.7-0.3s0.3-0.4,0.3-0.7v-3.9c0-0.3-0.1-0.5-0.3-0.7c-0.2-0.2-0.4-0.3-0.7-0.3h-3.9v-5.1c0-0.3-0.1-0.5-0.2-0.6
|
24 |
+
c-0.2-0.1-0.4-0.2-0.6-0.2h-0.1l-5.8,1c-0.3,0.1-0.5,0.2-0.7,0.3c-0.2,0.2-0.3,0.4-0.3,0.6v3.9H273c-0.3,0-0.5,0.1-0.7,0.3
|
25 |
+
s-0.3,0.4-0.3,0.7v3.2c0,0.3,0.1,0.5,0.3,0.6c0.2,0.2,0.4,0.3,0.7,0.4l3.9,0.6v14c0,1.7,0.2,3.1,0.5,4.2c0.4,1.1,0.9,1.9,1.5,2.5
|
26 |
+
c0.7,0.6,1.5,1,2.5,1.2s2.2,0.3,3.5,0.3c0.7,0,1.3,0,1.9-0.1c0.5-0.1,1.2-0.2,1.9-0.3C289.2,193.2,289.5,192.9,289.5,192.4
|
27 |
+
M268.7,191.9v-4.3c0-0.3-0.1-0.5-0.3-0.6c-0.2-0.1-0.4-0.2-0.6-0.2h-0.1c-0.9,0.1-1.8,0.2-2.6,0.2c-0.8,0.1-1.9,0.1-3.3,0.1
|
28 |
+
c-0.5,0-1.1-0.1-1.5-0.3c-0.5-0.2-0.9-0.5-1.3-0.9s-0.6-1-0.8-1.7c-0.2-0.7-0.3-1.6-0.3-2.7v-4c0-1.1,0.1-2,0.3-2.7
|
29 |
+
c0.2-0.7,0.5-1.3,0.8-1.7c0.4-0.4,0.8-0.7,1.3-0.9s1-0.3,1.5-0.3c1.4,0,2.5,0,3.3,0.1s1.7,0.1,2.6,0.2h0.1c0.3,0,0.5-0.1,0.6-0.2
|
30 |
+
c0.2-0.1,0.3-0.3,0.3-0.6v-4.3c0-0.4-0.1-0.6-0.2-0.7c-0.2-0.1-0.4-0.3-0.8-0.4c-0.7-0.2-1.5-0.3-2.6-0.5s-2.3-0.2-3.8-0.2
|
31 |
+
c-3.4,0-6.1,1-8.2,3.1c-2,2.1-3.1,5.1-3.1,9.1v4c0,3.9,1,7,3.1,9.1c2,2.1,4.8,3.1,8.2,3.1c1.4,0,2.7-0.1,3.8-0.2
|
32 |
+
c1.1-0.2,2-0.3,2.6-0.5c0.4-0.1,0.6-0.2,0.8-0.4C268.7,192.5,268.7,192.2,268.7,191.9 M237.4,186.8c-0.6,0.3-1.2,0.5-1.9,0.7
|
33 |
+
c-0.7,0.2-1.4,0.3-2.1,0.3c-1,0-1.8-0.1-2.3-0.4s-0.7-0.9-0.7-2V185c0-0.6,0.1-1.1,0.2-1.5s0.4-0.8,0.7-1.1c0.3-0.3,0.8-0.5,1.3-0.6
|
34 |
+
s1.2-0.2,2.1-0.2h2.7L237.4,186.8L237.4,186.8z M245,175.1c0-1.8-0.3-3.3-0.8-4.5s-1.3-2.2-2.2-3c-1-0.8-2.1-1.4-3.5-1.7
|
35 |
+
c-1.4-0.4-3-0.6-4.7-0.6c-1.6,0-3.2,0.1-4.7,0.3s-2.7,0.4-3.6,0.7c-0.6,0.2-0.9,0.5-0.9,1.1v3.9c0,0.3,0.1,0.5,0.2,0.7
|
36 |
+
c0.2,0.1,0.4,0.2,0.6,0.2h0.2c0.4,0,0.9-0.1,1.4-0.1c0.6,0,1.2-0.1,1.9-0.1c0.7,0,1.5-0.1,2.3-0.1s1.6,0,2.3,0c1.1,0,2,0.2,2.6,0.6
|
37 |
+
c0.6,0.4,1,1.3,1,2.7v1.7h-2.6c-4.1,0-7.2,0.6-9,1.9c-1.9,1.3-2.8,3.4-2.8,6.2v0.4c0,1.6,0.2,2.9,0.7,3.9c0.5,1.1,1.1,1.9,1.9,2.6
|
38 |
+
c0.8,0.6,1.6,1.1,2.6,1.4s2,0.4,3.1,0.4c1.4,0,2.7-0.2,3.7-0.6s2-0.9,3-1.6v0.8c0,0.3,0.1,0.5,0.3,0.7c0.2,0.2,0.4,0.3,0.7,0.3h5.4
|
39 |
+
c0.3,0,0.5-0.1,0.7-0.3c0.2-0.2,0.3-0.4,0.3-0.7v-17.2H245z M219.3,192.4v-3.7c0-0.5-0.3-0.8-1-0.8h-2.4c-0.7,0-1.2-0.1-1.3-0.4
|
40 |
+
c-0.2-0.3-0.2-0.9-0.2-1.9v-14h3.9c0.3,0,0.5-0.1,0.7-0.3s0.3-0.4,0.3-0.7v-3.9c0-0.3-0.1-0.5-0.3-0.7s-0.4-0.3-0.7-0.3h-3.9v-5.1
|
41 |
+
c0-0.3-0.1-0.5-0.2-0.6c-0.2-0.1-0.4-0.2-0.6-0.2h-0.1l-5.8,1c-0.3,0.1-0.5,0.2-0.7,0.3c-0.2,0.2-0.3,0.4-0.3,0.6v3.9h-4
|
42 |
+
c-0.3,0-0.5,0.1-0.7,0.3s-0.3,0.4-0.3,0.7v3.2c0,0.3,0.1,0.5,0.3,0.6c0.2,0.2,0.4,0.3,0.7,0.4l3.9,0.6v14c0,1.7,0.2,3.1,0.5,4.2
|
43 |
+
c0.4,1.1,0.9,1.9,1.5,2.5c0.7,0.6,1.5,1,2.5,1.2s2.2,0.3,3.5,0.3c0.7,0,1.3,0,1.9-0.1c0.5-0.1,1.2-0.2,1.9-0.3
|
44 |
+
C219,193.2,219.3,192.9,219.3,192.4 M198.3,192.3v-16c0-1.5-0.1-2.9-0.4-4.3c-0.2-1.3-0.7-2.5-1.3-3.5c-0.6-1-1.5-1.8-2.6-2.3
|
45 |
+
c-1.1-0.6-2.5-0.9-4.3-0.9c-1.5,0-2.9,0.2-4.1,0.6c-1.2,0.4-2.4,1-3.8,2v-1.2c0-0.3-0.1-0.5-0.3-0.7s-0.4-0.3-0.7-0.3h-5.4
|
46 |
+
c-0.3,0-0.5,0.1-0.7,0.3s-0.3,0.4-0.3,0.7v25.6c0,0.3,0.1,0.5,0.3,0.7s0.4,0.3,0.7,0.3h5.8c0.3,0,0.5-0.1,0.7-0.3
|
47 |
+
c0.2-0.2,0.3-0.4,0.3-0.7v-18.9c0.8-0.4,1.6-0.8,2.4-1.1c0.7-0.3,1.5-0.4,2.2-0.4s1.3,0.1,1.8,0.2c0.5,0.1,0.8,0.4,1.1,0.7
|
48 |
+
c0.3,0.4,0.4,0.8,0.5,1.4c0.1,0.6,0.1,1.3,0.1,2.1v16c0,0.3,0.1,0.5,0.3,0.7c0.2,0.2,0.4,0.3,0.7,0.3h5.8c0.3,0,0.5-0.1,0.7-0.3
|
49 |
+
C198.2,192.8,198.3,192.5,198.3,192.3 M161.9,181.2c0,3.9-1.4,5.9-4.3,5.9c-1.4,0-2.5-0.5-3.2-1.5s-1.1-2.5-1.1-4.4v-3.4
|
50 |
+
c0-2,0.4-3.4,1.1-4.4c0.7-1,1.8-1.5,3.2-1.5c2.8,0,4.3,2,4.3,5.9V181.2z M169.7,177.8c0-1.9-0.3-3.7-0.8-5.2s-1.3-2.8-2.3-3.9
|
51 |
+
c-1-1.1-2.3-1.9-3.8-2.5s-3.2-0.9-5.2-0.9s-3.7,0.3-5.2,0.9c-1.5,0.6-2.8,1.4-3.8,2.5s-1.8,2.4-2.3,3.9s-0.8,3.3-0.8,5.2v3.4
|
52 |
+
c0,1.9,0.3,3.7,0.8,5.2s1.3,2.8,2.3,3.9s2.3,1.9,3.8,2.5s3.2,0.9,5.2,0.9s3.7-0.3,5.2-0.9s2.8-1.4,3.8-2.5s1.8-2.4,2.3-3.9
|
53 |
+
s0.8-3.3,0.8-5.2V177.8z M143,191.9v-4.3c0-0.3-0.1-0.5-0.3-0.6s-0.4-0.2-0.7-0.2h-0.1c-0.9,0.1-1.8,0.2-2.6,0.2
|
54 |
+
c-0.8,0.1-1.9,0.1-3.3,0.1c-0.5,0-1.1-0.1-1.5-0.3c-0.5-0.2-0.9-0.5-1.3-0.9c-0.4-0.4-0.6-1-0.8-1.7s-0.3-1.6-0.3-2.7v-4
|
55 |
+
c0-1.1,0.1-2,0.3-2.7s0.5-1.3,0.8-1.7c0.4-0.4,0.8-0.7,1.3-0.9s1-0.3,1.5-0.3c1.4,0,2.5,0,3.3,0.1s1.7,0.1,2.6,0.2h0.1
|
56 |
+
c0.3,0,0.5-0.1,0.7-0.2c0.2-0.1,0.3-0.3,0.3-0.6v-4.3c0-0.4-0.1-0.6-0.2-0.7c-0.2-0.1-0.4-0.3-0.8-0.4c-0.7-0.2-1.5-0.3-2.6-0.5
|
57 |
+
s-2.3-0.2-3.8-0.2c-3.4,0-6.1,1-8.2,3.1c-2,2.1-3.1,5.1-3.1,9.1v4c0,3.9,1,7,3.1,9.1c2,2.1,4.8,3.1,8.2,3.1c1.4,0,2.7-0.1,3.8-0.2
|
58 |
+
c1.1-0.2,1.9-0.3,2.6-0.5c0.4-0.1,0.6-0.2,0.8-0.4C142.9,192.5,143,192.2,143,191.9 M119.3,192.3v-16c0-1.5-0.1-2.9-0.4-4.3
|
59 |
+
c-0.2-1.3-0.7-2.5-1.3-3.5s-1.5-1.8-2.6-2.3c-1.1-0.6-2.5-0.9-4.3-0.9c-1.5,0-2.9,0.2-4.1,0.6c-1.2,0.4-2.4,1-3.8,2v-1.2
|
60 |
+
c0-0.3-0.1-0.5-0.3-0.7s-0.4-0.3-0.7-0.3h-5.4c-0.3,0-0.5,0.1-0.7,0.3s-0.3,0.4-0.3,0.7v25.6c0,0.3,0.1,0.5,0.3,0.7s0.4,0.3,0.7,0.3
|
61 |
+
h5.8c0.3,0,0.5-0.1,0.7-0.3c0.2-0.2,0.3-0.4,0.3-0.7v-18.9c0.8-0.4,1.6-0.8,2.4-1.1c0.7-0.3,1.5-0.4,2.2-0.4s1.3,0.1,1.8,0.2
|
62 |
+
c0.5,0.1,0.8,0.4,1.1,0.7c0.3,0.4,0.4,0.8,0.5,1.4c0.1,0.6,0.1,1.3,0.1,2.1v16c0,0.3,0.1,0.5,0.3,0.7s0.4,0.3,0.7,0.3h5.8
|
63 |
+
c0.3,0,0.5-0.1,0.7-0.3C119.2,192.8,119.3,192.5,119.3,192.3 M82.1,186.8c-0.6,0.3-1.2,0.5-1.9,0.7s-1.4,0.3-2.1,0.3
|
64 |
+
c-1,0-1.8-0.1-2.3-0.4s-0.7-0.9-0.7-2V185c0-0.6,0.1-1.1,0.2-1.5c0.1-0.4,0.4-0.8,0.7-1.1c0.3-0.3,0.8-0.5,1.3-0.6s1.2-0.2,2.1-0.2
|
65 |
+
h2.7V186.8z M89.8,175.1c0-1.8-0.3-3.3-0.8-4.5s-1.3-2.2-2.2-3c-1-0.8-2.1-1.4-3.5-1.7c-1.4-0.4-3-0.6-4.7-0.6
|
66 |
+
c-1.6,0-3.2,0.1-4.7,0.3s-2.7,0.4-3.6,0.7c-0.6,0.2-0.9,0.5-0.9,1.1v3.9c0,0.3,0.1,0.5,0.2,0.7c0.2,0.1,0.4,0.2,0.6,0.2h0.2
|
67 |
+
c0.4,0,0.9-0.1,1.4-0.1c0.6,0,1.2-0.1,2-0.1c0.7,0,1.5-0.1,2.3-0.1s1.6,0,2.3,0c1.1,0,2,0.2,2.6,0.6c0.6,0.4,1,1.3,1,2.7v1.7h-2.6
|
68 |
+
c-4.1,0-7.2,0.6-9,1.9c-1.9,1.3-2.8,3.4-2.8,6.2v0.4c0,1.6,0.2,2.9,0.7,3.9c0.5,1.1,1.1,1.9,1.9,2.6c0.8,0.6,1.6,1.1,2.6,1.4
|
69 |
+
s2,0.4,3.1,0.4c1.4,0,2.7-0.2,3.7-0.6s2-0.9,3-1.6v0.8c0,0.3,0.1,0.5,0.3,0.7s0.4,0.3,0.7,0.3H89c0.3,0,0.5-0.1,0.7-0.3
|
70 |
+
c0.2-0.2,0.3-0.4,0.3-0.7v-17.2H89.8z M55.4,182.7c0,1.3-0.5,2.4-1.4,3.1s-2.7,1.1-5.1,1.1h-0.8c-0.4,0-0.8,0-1.2,0
|
71 |
+
c-0.4,0-0.8,0-1.2,0h-0.8v-9h5.4c1.9,0,3.3,0.4,4,1.3c0.7,0.9,1.1,1.9,1.1,3V182.7z M55.2,168.4c0,0.5-0.1,1-0.2,1.5
|
72 |
+
c-0.2,0.5-0.4,0.9-0.8,1.2s-0.9,0.6-1.5,0.8s-1.4,0.3-2.4,0.3h-5.4v-8.3c0.2,0,0.4,0,0.7,0c0.3,0,0.7,0,1.1,0h1.1h0.8
|
73 |
+
c2.5,0,4.2,0.3,5.2,0.9c1,0.6,1.5,1.6,1.5,2.9L55.2,168.4L55.2,168.4z M63.4,182.2c0-1.7-0.4-3.1-1.2-4.3s-1.8-2.2-3.1-2.8
|
74 |
+
c1.3-0.6,2.3-1.6,3-2.8c0.7-1.3,1.1-2.7,1.1-4.2v-0.9c0-1.9-0.4-3.5-1.1-4.8c-0.7-1.3-1.8-2.3-3.1-3.1s-2.9-1.3-4.8-1.7
|
75 |
+
c-1.9-0.3-3.9-0.5-6.2-0.5c-0.8,0-1.6,0-2.4,0s-1.6,0.1-2.4,0.1s-1.5,0.1-2.2,0.2c-0.7,0.1-1.2,0.1-1.6,0.2c-0.9,0.2-1.6,0.4-2,0.9
|
76 |
+
c-0.4,0.4-0.6,1.2-0.6,2.3v29.3c0,1.1,0.2,1.8,0.6,2.3c0.4,0.4,1.1,0.7,2,0.9c0.5,0.1,1.1,0.2,1.7,0.2c0.7,0.1,1.4,0.1,2.2,0.2
|
77 |
+
s1.6,0.1,2.4,0.1s1.7,0,2.5,0c2.1,0,4.1-0.2,5.9-0.5c1.8-0.3,3.4-0.9,4.8-1.7c1.4-0.8,2.4-1.9,3.3-3.3c0.8-1.4,1.2-3.2,1.2-5.3
|
78 |
+
L63.4,182.2L63.4,182.2z"/>
|
79 |
+
<rect x="0" y="0" class="st3" width="326" height="230.5"/>
|
80 |
+
</svg>
|
assets/icon/sepa.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg version="1.1" id="svg10908" xmlns="http://www.w3.org/2000/svg" x="0" y="0" viewBox="0 0 750 205" xml:space="preserve"><style>.st0{fill:#10298e}</style><path id="path5689" class="st0" d="M167 65h-52c0-8-1-14-3-17-3-4-11-6-25-6-13 0-22 1-27 4s-6 8-6 16c0 7 2 12 6 14 3 2 7 3 11 3l10 1 42 3c17 2 30 7 38 14 6 6 10 14 11 23a156 156 0 01-4 56c-6 14-18 23-38 27l-39 2c-28 0-48-2-60-5-14-4-23-13-27-26-3-7-4-19-4-35h51v4c0 9 3 14 8 17 4 2 8 3 13 3h19l18-2c5-2 8-5 9-9l2-10c0-9-4-14-10-16l-35-3-34-4c-17-3-28-9-33-19-5-8-8-21-8-38 0-13 2-23 4-31s7-13 13-17C26 7 37 4 50 3a423 423 0 0184 2c22 6 33 23 33 50v10"/><path id="path5693" class="st0" d="M392 205V0h103c14 0 25 1 32 4 17 5 29 16 34 32 3 9 5 22 5 39 0 21-2 36-5 45-7 18-20 28-41 31l-31 1h-42v53h-55zm56-100h34l20-3c3-2 5-5 6-11l1-16c0-8 0-15-2-19-2-6-7-10-14-11h-46v60z"/><path id="path5697" class="st0" d="M684 170h-74l-10 35h-57L605 0h83l62 205h-56l-10-35zm-11-40l-26-89-25 89h51z"/><path id="path5701" d="M316 29c22 0 43 10 57 27l11-26a105 105 0 00-167 35h-23l-14 30h30l-1 8 1 10h-15l-14 29h36a105 105 0 00154 44v-36a73 73 0 01-116-8h76l14-29H244a78 78 0 010-18h110l13-30H253c13-22 37-36 63-36" fill="#ffbe00"/><path id="path5705" class="st0" d="M316 30c22 0 42 10 56 26l1 1v-1l12-25 1-1h-1a104 104 0 00-169 35l1-1h-24v1l-14 29v2h31l-1-1-1 8 1 10 1-1h-16l-14 30v1h38-1a105 105 0 00154 44h1v-39l-2 2a72 72 0 01-114-8v1h76l14-30 1-1H244l1 1a76 76 0 010-18l-1 1h110v-1l14-29 1-2H253l1 2c13-22 37-36 62-36m-63 36h114l-1-1-13 29H244v1l-1 7 1 11v1h102l-1-1-14 29 1-1h-77l1 2a73 73 0 00116 8l-1-1v37-1c-17 11-37 17-57 17-42 0-79-24-95-61v-1h-37l1 2 14-30-1 1h16v-1a111 111 0 010-18v-1h-31l1 1 13-29h24c7-19 20-34 37-46 40-27 94-22 129 11v-1l-12 25h1a74 74 0 00-121 10v1h1z"/></svg>
|
assets/icon/wechat.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 750 212.01" preserveAspectRatio="xMidYMid meet"><defs><style>.cls-1{fill:#2e3233;}.cls-2{fill:#9de60b;}</style></defs><title>wechat</title><path class="cls-1" d="M492.35,67.19c16.29-3.93,36.11-.27,46.75,13.64,4.53,5.45,6.45,12.4,8.14,19.16-7.16.11-14.35.11-21.5.11-3.12-15.41-24.28-21.57-35.51-11-7.91,8.61-9.34,21.4-7.7,32.57,1.75,8.56,5.2,18.52,14,22.07,12.6,4.7,27.48-3.69,29.17-17.26,7.29,0,14.61,0,21.93.14-1.52,13.05-7.82,26.64-20.59,32-19.83,8.61-48.21,6-59.69-14.48,1.82-8.36,3.86-17.07,2-25.62C468.3,112.17,465,106.6,463,100.6c0-16.32,14-30.19,29.39-33.41Z"/><path class="cls-2" d="M274.09,69.57c7.84-.06,15.68-.06,23.52-.09,4.66,20.57,7.25,41.62,12.93,62,5.7-16.87,8.34-34.57,13.19-51.68,1.43-5.19,5.5-10.66,11.45-10.28,6.46-.77,10.84,5.21,12.16,10.84C352,97.15,355,114.39,360.18,131.1c5.94-20.16,9.19-40.95,13.53-61.5,7.66-.09,15.3-.09,23,0-6.41,25.79-13.66,51.36-20.23,77.11-1.62,6.41-4.43,13.73-11.3,16.1-7.77,1.77-14.82-4.41-16.7-11.62-4.84-15.45-8.35-31.32-13.12-46.82-3.84,15.41-7.77,30.78-12,46.07-1.59,6.84-7.59,13.87-15.3,12.51-7.43-.85-11.09-8.23-12.72-14.69-7-26.23-14.19-52.44-21.21-78.67Z"/><path class="cls-1" d="M552.42,69.55l21.09,0c0,7.72-.11,15.45.5,23.13,11.3.8,23.69-2.41,34.1,3.32,9,4.82,14.16,15,14.09,25.05.14,14-.05,28,0,42q-10.26.06-20.48.08c-.14-13.43.16-26.86-.06-40.29.27-4.55-3-9.3-7.64-9.82-6.82-.87-13.71-.41-20.55-.28,0,16.78,0,33.57,0,50.37q-10.54,0-21.07,0c0-31.16,0-62.3,0-93.46Zm161.6,0h20c0,7,0,14,0,21,5.34,0,10.68,0,16,0,0,5.18,0,10.39,0,15.57H733.77c.41,11.86-.89,23.86.68,35.68,3.59,4.43,9.93,3.8,15,5.23-.06,5.3-.09,10.59-.09,15.91-11.47.25-27.16,1.75-33-10.73-5.08-14.7-1.28-30.79-2.41-46-5.14,0-10.28-.07-15.41-.14,0-5.14,0-10.28,0-15.39,5.19-.06,10.37-.11,15.57-.13Q714,80,714,69.53Z"/><path class="cls-2" d="M462.37,131.69c.37-13.43-2.62-28.59-14.5-36.64-15.55-9.88-40.43-8.54-50.91,8.16-8.76,14.73-9.23,35.59,2.63,48.85C411,164.9,431.1,165.58,446,159.15c8.21-3.34,12.73-11.32,15.82-19.14q-9.81-.31-19.64-.09c-5.79,6.88-16,9.66-24.13,5.34-5.16-2.5-6.21-8.54-7.82-13.41,17.38-.27,34.77,0,52.16-.16Zm-52.69-14c2.34-7.16,8.25-13.41,16.46-12.12,8.09-1.31,13.59,5.21,15.86,12.14q-16.15.48-32.32,0Z"/><path class="cls-1" d="M695,114c-.4-12.44-11.38-22.25-23.36-23.53s-25.3-1.22-35.1,6.64c-5.2,3.77-6.86,10.25-8.2,16.18,6.11.17,12.23.19,18.36.14,3.48-10.41,17.1-11.73,25.28-6.36,3.09,2.59,2.82,7,3.7,10.56-12.81.51-26.91-2-38.29,5.41-10.84,6.37-12.82,22-6.53,32.17,4.41,6.61,13,7.84,20.37,7.82,14.64.06,29.27,0,43.91,0C695,146.65,695.45,130.3,695,114Zm-47,29.93c-1-3.59,1.08-6.87,2.27-10.07,8.13-1.84,16.5-2.09,24.84-1.91,0,5.71,0,11.39,0,17.1-9-.58-20.15,2.29-27.14-5.12Z"/><path class="cls-2" d="M145,13.23C118.42-1.72,85.33-4,56.75,6.35,38,13.11,21,25.67,10.48,42.78,1,58.21-2.61,77.45,2,95.1c4.6,19.6,18.18,36,34.72,47-3.11,9-6.18,18.09-9.07,27.2,10.46-5.43,20.79-11.09,31.21-16.62a115.88,115.88,0,0,0,39,5.53,67,67,0,0,1-2.69-31.44c2.5-14.59,10.39-27.94,21.29-37.83,18.36-17.2,44.39-24.46,69.16-22.71C181,43.51,165,24.31,145,13.23ZM73.8,54.42C72,63.31,60,67.6,53.06,61.64,45,56,47.25,41.82,56.74,39,66,35.39,76.59,44.83,73.8,54.42Zm64.49-2.58c.08,10.24-13.56,16.62-21.23,9.67-8-5.7-5.7-19.56,3.64-22.44,8.35-3.28,18.24,3.76,17.59,12.77Z"/><path class="cls-1" d="M250.61,114c-6.48-14.68-18.71-26.31-32.91-33.5a90.58,90.58,0,0,0-81.21.29c-17.37,8.93-31.86,24.9-36,44.33-3.4,14.3-.34,29.7,7.23,42.18C119,186,139.44,198,160.67,201.79c15.37,3.13,31.26,1.29,46.18-3,8.94,3.49,17,9.11,25.63,13.27q-3.33-11.26-7.17-22.36c9.71-6.94,18.56-15.55,23.89-26.38a57.19,57.19,0,0,0,1.41-49.3Zm-87.21,5.61c-2.2,6.93-12.32,9-17.18,3.73-5.38-4.88-3.29-15.1,3.76-17.27,7.84-3.3,16.85,5.71,13.42,13.54Zm51,1c-2.68,6.25-12,7.69-16.65,2.85-2.24-2-2.79-5.06-3.68-7.76,1.19-4.87,4.44-9.93,10-10.15C211.73,104.43,218.44,113.71,214.45,120.54Z"/></svg>
|
assets/js/stripe-elements.js
CHANGED
@@ -26,6 +26,9 @@
|
|
26 |
let selectedGatewayId = '';
|
27 |
let selectedIdealBank = '';
|
28 |
let selectedP24Bank = '';
|
|
|
|
|
|
|
29 |
|
30 |
const style = {
|
31 |
base: {
|
@@ -33,6 +36,28 @@
|
|
33 |
},
|
34 |
};
|
35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
if ( 'yes' === inlineCC ) {
|
37 |
card = elements.create( 'card', {
|
38 |
style,
|
@@ -142,6 +167,14 @@
|
|
142 |
$( '.cpsw_stripe_ideal_error' ).html( '' );
|
143 |
} );
|
144 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
p24.on( 'change', function( event ) {
|
146 |
selectedP24Bank = event.value;
|
147 |
$( '.cpsw_stripe_p24_error' ).html( '' );
|
@@ -166,6 +199,15 @@
|
|
166 |
}
|
167 |
}
|
168 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
169 |
function mountIdeal() {
|
170 |
$( '.cpsw_stripe_ideal_form' ).show();
|
171 |
if ( 0 === $( '.cpsw_stripe_ideal_form' ).length ) {
|
@@ -190,6 +232,7 @@
|
|
190 |
mountCard();
|
191 |
mountIdeal();
|
192 |
mountP24();
|
|
|
193 |
}
|
194 |
|
195 |
function createStripePaymentMethod() {
|
@@ -203,56 +246,88 @@
|
|
203 |
type: 'card',
|
204 |
card,
|
205 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
206 |
break;
|
|
|
|
|
|
|
|
|
207 |
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
.createPaymentMethod( paymentObject )
|
214 |
-
.then( function( result ) {
|
215 |
// Handle result.error or result.paymentMethod
|
216 |
if ( result.paymentMethod ) {
|
217 |
paymentMethod = result.paymentMethod.id;
|
218 |
-
const brand = result.paymentMethod.card.brand;
|
219 |
-
$( '.cpsw_payment_method' ).remove();
|
220 |
-
$( '.cpsw_card_brand' ).remove();
|
221 |
paymentForm.append(
|
222 |
"<input type='hidden' class='cpsw_payment_method' name='payment_method_created' value='" +
|
223 |
paymentMethod +
|
224 |
-
"'/><input type='hidden' class='cpsw_card_brand' name='card_brand' value='" +
|
225 |
-
brand +
|
226 |
"'/>",
|
227 |
);
|
228 |
-
|
229 |
-
confirmCardSetup( paymentMethod );
|
230 |
-
} else if ( $( 'form#add_payment_method' ).length ) {
|
231 |
-
confirmCardSetup( paymentMethod );
|
232 |
-
} else {
|
233 |
-
paymentForm.trigger( 'submit' );
|
234 |
-
}
|
235 |
} else if ( result.error ) {
|
236 |
$( '.woocommerce-error' ).remove();
|
237 |
$( 'form.woocommerce-checkout' ).unblock();
|
238 |
logError( result.error );
|
239 |
$( '.woocommerce-notices-wrapper:first-child' ).html( '<div class="woocommerce-error cpsw-errors">' + result.error.message + '</div>' ).show();
|
240 |
window.scrollTo( { top: 0, behavior: 'smooth' } );
|
|
|
|
|
241 |
return false;
|
242 |
}
|
243 |
} );
|
|
|
|
|
|
|
|
|
244 |
}
|
245 |
return true;
|
246 |
}
|
247 |
|
248 |
-
function confirmStripePayment( clientSecret, redirectURL ) {
|
|
|
|
|
249 |
switch ( selectedGatewayId ) {
|
250 |
case 'cpsw_stripe':
|
251 |
stripe.confirmCardPayment( clientSecret, {} ).then( function( result ) {
|
252 |
if ( result.error ) {
|
253 |
// Show error to your customer (e.g., insufficient funds)
|
254 |
$( '.woocommerce-error' ).remove();
|
255 |
-
|
256 |
logError( result.error );
|
257 |
$( '.woocommerce-notices-wrapper:first-child' ).html( '<div class="woocommerce-error cpsw-errors">' + result.error.message + '</div>' ).show();
|
258 |
window.scrollTo( { top: 0, behavior: 'smooth' } );
|
@@ -275,7 +350,7 @@
|
|
275 |
if ( result.error ) {
|
276 |
// Show error to your customer (e.g., insufficient funds)
|
277 |
$( '.woocommerce-error' ).remove();
|
278 |
-
|
279 |
logError( result.error );
|
280 |
$( '.woocommerce-notices-wrapper:first-child' ).html( '<div class="woocommerce-error cpsw-errors">' + result.error.message + '</div>' ).show();
|
281 |
window.scrollTo( { top: 0, behavior: 'smooth' } );
|
@@ -292,10 +367,11 @@
|
|
292 |
if ( result.error ) {
|
293 |
// Show error to your customer (e.g., insufficient funds)
|
294 |
$( '.woocommerce-error' ).remove();
|
295 |
-
|
296 |
logError( result.error );
|
297 |
$( '.woocommerce-notices-wrapper:first-child' ).html( '<div class="woocommerce-error cpsw-errors">' + result.error.message + '</div>' ).show();
|
298 |
window.scrollTo( { top: 0, behavior: 'smooth' } );
|
|
|
299 |
}
|
300 |
} );
|
301 |
break;
|
@@ -309,10 +385,11 @@
|
|
309 |
if ( result.error ) {
|
310 |
// Show error to your customer (e.g., insufficient funds)
|
311 |
$( '.woocommerce-error' ).remove();
|
312 |
-
|
313 |
logError( result.error );
|
314 |
$( '.woocommerce-notices-wrapper:first-child' ).html( '<div class="woocommerce-error cpsw-errors">' + result.error.message + '</div>' ).show();
|
315 |
window.scrollTo( { top: 0, behavior: 'smooth' } );
|
|
|
316 |
}
|
317 |
} );
|
318 |
break;
|
@@ -326,12 +403,56 @@
|
|
326 |
if ( result.error ) {
|
327 |
// Show error to your customer (e.g., insufficient funds)
|
328 |
$( '.woocommerce-error' ).remove();
|
329 |
-
|
330 |
logError( result.error );
|
331 |
$( '.woocommerce-notices-wrapper:first-child' ).html( '<div class="woocommerce-error cpsw-errors">' + result.error.message + '</div>' ).show();
|
332 |
window.scrollTo( { top: 0, behavior: 'smooth' } );
|
|
|
333 |
}
|
334 |
} );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
335 |
break;
|
336 |
case 'cpsw_p24':
|
337 |
stripe.confirmP24Payment(
|
@@ -344,12 +465,50 @@
|
|
344 |
},
|
345 |
);
|
346 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
347 |
default:
|
348 |
break;
|
349 |
}
|
350 |
}
|
351 |
|
352 |
function getBillingDetails() {
|
|
|
|
|
|
|
|
|
353 |
const billingFirstName = document.getElementById( 'billing_first_name' );
|
354 |
const billingLastName = document.getElementById( 'billing_last_name' );
|
355 |
const billingEmail = document.getElementById( 'billing_email' );
|
@@ -408,14 +567,26 @@
|
|
408 |
}
|
409 |
|
410 |
function selectedGateway() {
|
|
|
|
|
411 |
if ( 0 < $( '.wc_payment_method' ).length ) {
|
412 |
const selectedPaymentMethod = $( '.wc_payment_method input[name="payment_method"]:checked' ).val();
|
413 |
-
if ( -1 === $.inArray( selectedPaymentMethod,
|
414 |
return false;
|
415 |
}
|
416 |
return selectedGatewayId = selectedPaymentMethod;
|
417 |
} else if ( 0 < $( '#payment_method_cpsw_stripe' ).length && $( '#payment_method_cpsw_stripe' ).is( ':checked' ) && 'cpsw_stripe' === $( '#payment_method_cpsw_stripe' ).val() ) {
|
418 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
419 |
}
|
420 |
return false;
|
421 |
}
|
@@ -438,12 +609,21 @@
|
|
438 |
}
|
439 |
}
|
440 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
441 |
function onHashChange() {
|
442 |
if ( ! selectedGateway() ) {
|
443 |
return;
|
444 |
}
|
445 |
const partials = window.location.hash.match(
|
446 |
-
/^#?confirm-(pi|si)-([^:]+):(.+)$/,
|
447 |
);
|
448 |
|
449 |
if ( ! partials || 4 > partials.length ) {
|
@@ -498,10 +678,22 @@
|
|
498 |
}
|
499 |
|
500 |
const processingSubmit = function( e ) {
|
501 |
-
if ( 'cpsw_stripe' === selectedGateway() && ! savedCard && '' === paymentMethod ) {
|
502 |
if ( false === isAllowedCard ) {
|
503 |
return false;
|
504 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
505 |
e.preventDefault();
|
506 |
createStripePaymentMethod();
|
507 |
|
@@ -530,6 +722,23 @@
|
|
530 |
}
|
531 |
} );
|
532 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
533 |
$( 'form.woocommerce-checkout' ).on( 'submit checkout_place_order_cpsw_p24', function() {
|
534 |
// check for P24.
|
535 |
if ( 'cpsw_p24' === selectedGateway() ) {
|
@@ -573,11 +782,44 @@
|
|
573 |
} );
|
574 |
} );
|
575 |
|
|
|
|
|
|
|
|
|
576 |
$( 'input[type=radio][name="wc-cpsw_stripe-payment-token"]' ).change( function() {
|
577 |
hideShowElements();
|
578 |
} );
|
579 |
$( '.cpsw-stripe-elements-form' ).hide();
|
580 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
581 |
window.addEventListener( 'hashchange', onHashChange );
|
582 |
mountGateways();
|
|
|
|
|
|
|
|
|
|
|
583 |
}( jQuery ) );
|
26 |
let selectedGatewayId = '';
|
27 |
let selectedIdealBank = '';
|
28 |
let selectedP24Bank = '';
|
29 |
+
let sepaIBAN = false;
|
30 |
+
let emptySepaIBANMessage = cpsw_global_settings.empty_sepa_iban_message;
|
31 |
+
const currentUserBilling = cpsw_global_settings.current_user_billing;
|
32 |
|
33 |
const style = {
|
34 |
base: {
|
36 |
},
|
37 |
};
|
38 |
|
39 |
+
// Create an instance of the iban Element
|
40 |
+
const sepaOptions = Object.keys( cpsw_global_settings.sepa_options ).length ? cpsw_global_settings.sepa_options : {};
|
41 |
+
const sepa = elements.create( 'iban', sepaOptions );
|
42 |
+
|
43 |
+
/**
|
44 |
+
* display error messages for sepa
|
45 |
+
*/
|
46 |
+
sepa.on( 'change', ( { error } ) => {
|
47 |
+
if ( isSepaSaveCardChosen() ) {
|
48 |
+
return true;
|
49 |
+
}
|
50 |
+
|
51 |
+
if ( error ) {
|
52 |
+
sepaIBAN = false;
|
53 |
+
emptySepaIBANMessage = error.message;
|
54 |
+
$( '.cpsw_stripe_sepa_error' ).html( error.message );
|
55 |
+
} else {
|
56 |
+
sepaIBAN = true;
|
57 |
+
$( '.cpsw_stripe_sepa_error' ).html( '' );
|
58 |
+
}
|
59 |
+
} );
|
60 |
+
|
61 |
if ( 'yes' === inlineCC ) {
|
62 |
card = elements.create( 'card', {
|
63 |
style,
|
167 |
$( '.cpsw_stripe_ideal_error' ).html( '' );
|
168 |
} );
|
169 |
|
170 |
+
function isSepaSaveCardChosen() {
|
171 |
+
return (
|
172 |
+
$( '#payment_method_cpsw_sepa' ).is( ':checked' ) &&
|
173 |
+
$( 'input[name="wc-cpsw_sepa-payment-token"]' ).is( ':checked' ) &&
|
174 |
+
'new' !== $( 'input[name="wc-cpsw_sepa-payment-token"]:checked' ).val()
|
175 |
+
);
|
176 |
+
}
|
177 |
+
|
178 |
p24.on( 'change', function( event ) {
|
179 |
selectedP24Bank = event.value;
|
180 |
$( '.cpsw_stripe_p24_error' ).html( '' );
|
199 |
}
|
200 |
}
|
201 |
|
202 |
+
function mountSepa() {
|
203 |
+
if ( 0 === $( '.payment_method_cpsw_sepa' ).length ) {
|
204 |
+
return false;
|
205 |
+
}
|
206 |
+
|
207 |
+
sepa.mount( '.cpsw_stripe_sepa_iban_element_field' );
|
208 |
+
$( '.cpsw_stripe_sepa_payment_form .cpsw_stripe_sepa_iban_element_field' ).css( { backgroundColor: '#fff', borderRadius: '3px' } );
|
209 |
+
}
|
210 |
+
|
211 |
function mountIdeal() {
|
212 |
$( '.cpsw_stripe_ideal_form' ).show();
|
213 |
if ( 0 === $( '.cpsw_stripe_ideal_form' ).length ) {
|
232 |
mountCard();
|
233 |
mountIdeal();
|
234 |
mountP24();
|
235 |
+
mountSepa();
|
236 |
}
|
237 |
|
238 |
function createStripePaymentMethod() {
|
246 |
type: 'card',
|
247 |
card,
|
248 |
};
|
249 |
+
stripe.createPaymentMethod( paymentObject )
|
250 |
+
.then( function( result ) {
|
251 |
+
// Handle result.error or result.paymentMethod
|
252 |
+
if ( result.paymentMethod ) {
|
253 |
+
paymentMethod = result.paymentMethod.id;
|
254 |
+
const brand = result.paymentMethod.card.brand;
|
255 |
+
$( '.cpsw_payment_method' ).remove();
|
256 |
+
$( '.cpsw_card_brand' ).remove();
|
257 |
+
paymentForm.append(
|
258 |
+
"<input type='hidden' class='cpsw_payment_method' name='payment_method_created' value='" +
|
259 |
+
paymentMethod +
|
260 |
+
"'/><input type='hidden' class='cpsw_card_brand' name='card_brand' value='" +
|
261 |
+
brand +
|
262 |
+
"'/>",
|
263 |
+
);
|
264 |
+
if ( $( 'form#order_review' ).length && cpsw_global_settings.changing_payment_method ) {
|
265 |
+
confirmCardSetup( paymentMethod );
|
266 |
+
} else if ( $( 'form#add_payment_method' ).length ) {
|
267 |
+
confirmCardSetup( paymentMethod );
|
268 |
+
} else {
|
269 |
+
paymentForm.trigger( 'submit' );
|
270 |
+
}
|
271 |
+
} else if ( result.error ) {
|
272 |
+
$( '.woocommerce-error' ).remove();
|
273 |
+
$( 'form.woocommerce-checkout' ).unblock();
|
274 |
+
$( 'form#order_review' ).unblock();
|
275 |
+
$( 'form#add_payment_method' ).unblock();
|
276 |
+
logError( result.error );
|
277 |
+
$( '.woocommerce-notices-wrapper:first-child' ).html( '<div class="woocommerce-error cpsw-errors">' + result.error.message + '</div>' ).show();
|
278 |
+
window.scrollTo( { top: 0, behavior: 'smooth' } );
|
279 |
+
return false;
|
280 |
+
}
|
281 |
+
} );
|
282 |
break;
|
283 |
+
case 'cpsw_sepa':
|
284 |
+
if ( $( 'form.woocommerce-checkout' ).length ) {
|
285 |
+
return true;
|
286 |
+
}
|
287 |
|
288 |
+
stripe.createPaymentMethod( {
|
289 |
+
type: 'sepa_debit',
|
290 |
+
sepa_debit: sepa,
|
291 |
+
billing_details: currentUserBilling,
|
292 |
+
} ).then( function( result ) {
|
|
|
|
|
293 |
// Handle result.error or result.paymentMethod
|
294 |
if ( result.paymentMethod ) {
|
295 |
paymentMethod = result.paymentMethod.id;
|
|
|
|
|
|
|
296 |
paymentForm.append(
|
297 |
"<input type='hidden' class='cpsw_payment_method' name='payment_method_created' value='" +
|
298 |
paymentMethod +
|
|
|
|
|
299 |
"'/>",
|
300 |
);
|
301 |
+
paymentForm.trigger( 'submit' );
|
|
|
|
|
|
|
|
|
|
|
|
|
302 |
} else if ( result.error ) {
|
303 |
$( '.woocommerce-error' ).remove();
|
304 |
$( 'form.woocommerce-checkout' ).unblock();
|
305 |
logError( result.error );
|
306 |
$( '.woocommerce-notices-wrapper:first-child' ).html( '<div class="woocommerce-error cpsw-errors">' + result.error.message + '</div>' ).show();
|
307 |
window.scrollTo( { top: 0, behavior: 'smooth' } );
|
308 |
+
$( 'form#order_review' ).unblock();
|
309 |
+
$( 'form#add_payment_method' ).unblock();
|
310 |
return false;
|
311 |
}
|
312 |
} );
|
313 |
+
break;
|
314 |
+
|
315 |
+
default:
|
316 |
+
break;
|
317 |
}
|
318 |
return true;
|
319 |
}
|
320 |
|
321 |
+
function confirmStripePayment( clientSecret, redirectURL, authenticationAlready = false ) {
|
322 |
+
const wcCheckoutForm = $( 'form.woocommerce-checkout' );
|
323 |
+
|
324 |
switch ( selectedGatewayId ) {
|
325 |
case 'cpsw_stripe':
|
326 |
stripe.confirmCardPayment( clientSecret, {} ).then( function( result ) {
|
327 |
if ( result.error ) {
|
328 |
// Show error to your customer (e.g., insufficient funds)
|
329 |
$( '.woocommerce-error' ).remove();
|
330 |
+
wcCheckoutForm.unblock();
|
331 |
logError( result.error );
|
332 |
$( '.woocommerce-notices-wrapper:first-child' ).html( '<div class="woocommerce-error cpsw-errors">' + result.error.message + '</div>' ).show();
|
333 |
window.scrollTo( { top: 0, behavior: 'smooth' } );
|
350 |
if ( result.error ) {
|
351 |
// Show error to your customer (e.g., insufficient funds)
|
352 |
$( '.woocommerce-error' ).remove();
|
353 |
+
wcCheckoutForm.unblock();
|
354 |
logError( result.error );
|
355 |
$( '.woocommerce-notices-wrapper:first-child' ).html( '<div class="woocommerce-error cpsw-errors">' + result.error.message + '</div>' ).show();
|
356 |
window.scrollTo( { top: 0, behavior: 'smooth' } );
|
367 |
if ( result.error ) {
|
368 |
// Show error to your customer (e.g., insufficient funds)
|
369 |
$( '.woocommerce-error' ).remove();
|
370 |
+
wcCheckoutForm.unblock();
|
371 |
logError( result.error );
|
372 |
$( '.woocommerce-notices-wrapper:first-child' ).html( '<div class="woocommerce-error cpsw-errors">' + result.error.message + '</div>' ).show();
|
373 |
window.scrollTo( { top: 0, behavior: 'smooth' } );
|
374 |
+
wcCheckoutForm.removeClass( 'processing' );
|
375 |
}
|
376 |
} );
|
377 |
break;
|
385 |
if ( result.error ) {
|
386 |
// Show error to your customer (e.g., insufficient funds)
|
387 |
$( '.woocommerce-error' ).remove();
|
388 |
+
wcCheckoutForm.unblock();
|
389 |
logError( result.error );
|
390 |
$( '.woocommerce-notices-wrapper:first-child' ).html( '<div class="woocommerce-error cpsw-errors">' + result.error.message + '</div>' ).show();
|
391 |
window.scrollTo( { top: 0, behavior: 'smooth' } );
|
392 |
+
wcCheckoutForm.removeClass( 'processing' );
|
393 |
}
|
394 |
} );
|
395 |
break;
|
403 |
if ( result.error ) {
|
404 |
// Show error to your customer (e.g., insufficient funds)
|
405 |
$( '.woocommerce-error' ).remove();
|
406 |
+
wcCheckoutForm.unblock();
|
407 |
logError( result.error );
|
408 |
$( '.woocommerce-notices-wrapper:first-child' ).html( '<div class="woocommerce-error cpsw-errors">' + result.error.message + '</div>' ).show();
|
409 |
window.scrollTo( { top: 0, behavior: 'smooth' } );
|
410 |
+
wcCheckoutForm.removeClass( 'processing' );
|
411 |
}
|
412 |
} );
|
413 |
+
break;
|
414 |
+
case 'cpsw_sepa':
|
415 |
+
if ( isSepaSaveCardChosen() || authenticationAlready ) {
|
416 |
+
stripe.confirmSepaDebitPayment( clientSecret, {} ).then( function( result ) {
|
417 |
+
if ( result.error ) {
|
418 |
+
// Show error to your customer (e.g., insufficient funds)
|
419 |
+
$( '.woocommerce-error' ).remove();
|
420 |
+
$( 'form.woocommerce-checkout' ).unblock();
|
421 |
+
logError( result.error );
|
422 |
+
$( '.woocommerce-notices-wrapper:first-child' ).html( '<div class="woocommerce-error cpsw-errors">' + result.error.message + '</div>' ).show();
|
423 |
+
window.scrollTo( { top: 0, behavior: 'smooth' } );
|
424 |
+
} else {
|
425 |
+
// The payment has been processed!
|
426 |
+
if ( result.paymentIntent.status === 'succeeded' || result.paymentIntent.status === 'processing' ) {
|
427 |
+
$( '.woocommerce-error' ).remove();
|
428 |
+
window.location = redirectURL;
|
429 |
+
}
|
430 |
+
}
|
431 |
+
} );
|
432 |
+
} else {
|
433 |
+
stripe.confirmSepaDebitPayment( clientSecret, {
|
434 |
+
payment_method: {
|
435 |
+
sepa_debit: sepa,
|
436 |
+
billing_details: getBillingDetails(),
|
437 |
+
},
|
438 |
+
} ).then( function( result ) {
|
439 |
+
if ( result.error ) {
|
440 |
+
// Show error to your customer (e.g., insufficient funds)
|
441 |
+
$( '.woocommerce-error' ).remove();
|
442 |
+
$( 'form.woocommerce-checkout' ).unblock();
|
443 |
+
logError( result.error );
|
444 |
+
$( '.woocommerce-notices-wrapper:first-child' ).html( '<div class="woocommerce-error cpsw-errors">' + result.error.message + '</div>' ).show();
|
445 |
+
window.scrollTo( { top: 0, behavior: 'smooth' } );
|
446 |
+
} else {
|
447 |
+
// The payment has been processed!
|
448 |
+
if ( result.paymentIntent.status === 'succeeded' || result.paymentIntent.status === 'processing' ) {
|
449 |
+
$( '.woocommerce-error' ).remove();
|
450 |
+
window.location = redirectURL;
|
451 |
+
}
|
452 |
+
}
|
453 |
+
} );
|
454 |
+
}
|
455 |
+
|
456 |
break;
|
457 |
case 'cpsw_p24':
|
458 |
stripe.confirmP24Payment(
|
465 |
},
|
466 |
);
|
467 |
break;
|
468 |
+
case 'cpsw_wechat':
|
469 |
+
stripe.confirmWechatPayPayment( clientSecret, {
|
470 |
+
payment_method_options: {
|
471 |
+
wechat_pay: {
|
472 |
+
client: 'web',
|
473 |
+
},
|
474 |
+
},
|
475 |
+
} ).then( function( result ) {
|
476 |
+
if ( result.error ) {
|
477 |
+
// Show error to your customer (e.g., insufficient funds)
|
478 |
+
$( '.woocommerce-error' ).remove();
|
479 |
+
wcCheckoutForm.unblock();
|
480 |
+
logError( result.error );
|
481 |
+
$( '.woocommerce-notices-wrapper:first-child' ).html( '<div class="woocommerce-error cpsw-errors">' + result.error.message + '</div>' ).show();
|
482 |
+
window.scrollTo( { top: 0, behavior: 'smooth' } );
|
483 |
+
} else {
|
484 |
+
// The payment has been processed!
|
485 |
+
if ( result.paymentIntent.status === 'succeeded' ) {
|
486 |
+
window.location = redirectURL;
|
487 |
+
} else if ( result.paymentIntent.status === 'requires_payment_method' ) {
|
488 |
+
// Show error when requires payment method or some how failed.
|
489 |
+
$( '.woocommerce-error' ).remove();
|
490 |
+
wcCheckoutForm.unblock();
|
491 |
+
logError( result.paymentIntent.last_payment_error );
|
492 |
+
$( '.woocommerce-notices-wrapper:first-child' ).html( '<div class="woocommerce-error cpsw-errors">' + result.paymentIntent.last_payment_error.message + '</div>' ).show();
|
493 |
+
window.scrollTo( { top: 0, behavior: 'smooth' } );
|
494 |
+
wcCheckoutForm.removeClass( 'processing' );
|
495 |
+
} else {
|
496 |
+
wcCheckoutForm.removeClass( 'processing' );
|
497 |
+
wcCheckoutForm.unblock();
|
498 |
+
}
|
499 |
+
}
|
500 |
+
} );
|
501 |
+
break;
|
502 |
default:
|
503 |
break;
|
504 |
}
|
505 |
}
|
506 |
|
507 |
function getBillingDetails() {
|
508 |
+
if ( ! $( 'form.woocommerce-checkout' ).length ) {
|
509 |
+
return currentUserBilling;
|
510 |
+
}
|
511 |
+
|
512 |
const billingFirstName = document.getElementById( 'billing_first_name' );
|
513 |
const billingLastName = document.getElementById( 'billing_last_name' );
|
514 |
const billingEmail = document.getElementById( 'billing_email' );
|
567 |
}
|
568 |
|
569 |
function selectedGateway() {
|
570 |
+
const allPaymentMethods = [ 'cpsw_stripe', 'cpsw_alipay', 'cpsw_ideal', 'cpsw_klarna', 'cpsw_p24', 'cpsw_bancontact', 'cpsw_wechat', 'cpsw_sepa' ];
|
571 |
+
|
572 |
if ( 0 < $( '.wc_payment_method' ).length ) {
|
573 |
const selectedPaymentMethod = $( '.wc_payment_method input[name="payment_method"]:checked' ).val();
|
574 |
+
if ( -1 === $.inArray( selectedPaymentMethod, allPaymentMethods ) ) {
|
575 |
return false;
|
576 |
}
|
577 |
return selectedGatewayId = selectedPaymentMethod;
|
578 |
} else if ( 0 < $( '#payment_method_cpsw_stripe' ).length && $( '#payment_method_cpsw_stripe' ).is( ':checked' ) && 'cpsw_stripe' === $( '#payment_method_cpsw_stripe' ).val() ) {
|
579 |
+
const selectedPaymentMethod = $( '.payment_methods input[name="payment_method"]:checked' ).val();
|
580 |
+
if ( -1 === $.inArray( selectedPaymentMethod, allPaymentMethods ) ) {
|
581 |
+
return false;
|
582 |
+
}
|
583 |
+
return selectedGatewayId = selectedPaymentMethod;
|
584 |
+
} else if ( 0 < $( '#payment_method_cpsw_sepa' ).length && $( '#payment_method_cpsw_sepa' ).is( ':checked' ) && 'cpsw_sepa' === $( '#payment_method_cpsw_sepa' ).val() ) {
|
585 |
+
const selectedPaymentMethod = $( '.payment_methods input[name="payment_method"]:checked' ).val();
|
586 |
+
if ( -1 === $.inArray( selectedPaymentMethod, allPaymentMethods ) ) {
|
587 |
+
return false;
|
588 |
+
}
|
589 |
+
return selectedGatewayId = selectedPaymentMethod;
|
590 |
}
|
591 |
return false;
|
592 |
}
|
609 |
}
|
610 |
}
|
611 |
|
612 |
+
function hideShowSepaIBAN() {
|
613 |
+
const isSavedSepaIBAN = ( 'new' === $( "input[name='wc-cpsw_sepa-payment-token']:checked" ).val() ) ? false : true;
|
614 |
+
if ( ! isSavedSepaIBAN ) {
|
615 |
+
$( '.cpsw_stripe_sepa_payment_form' ).fadeIn();
|
616 |
+
} else {
|
617 |
+
$( '.cpsw_stripe_sepa_payment_form' ).fadeOut();
|
618 |
+
}
|
619 |
+
}
|
620 |
+
|
621 |
function onHashChange() {
|
622 |
if ( ! selectedGateway() ) {
|
623 |
return;
|
624 |
}
|
625 |
const partials = window.location.hash.match(
|
626 |
+
/^#?confirm-(pi|si)-([^:]+):(.+):(.+)$/,
|
627 |
);
|
628 |
|
629 |
if ( ! partials || 4 > partials.length ) {
|
678 |
}
|
679 |
|
680 |
const processingSubmit = function( e ) {
|
681 |
+
if ( ( 'cpsw_stripe' === selectedGateway() || 'cpsw_sepa' === selectedGateway() ) && ! savedCard && '' === paymentMethod ) {
|
682 |
if ( false === isAllowedCard ) {
|
683 |
return false;
|
684 |
}
|
685 |
+
|
686 |
+
if ( 'cpsw_sepa' === selectedGateway() && isSepaSaveCardChosen() ) {
|
687 |
+
return true;
|
688 |
+
}
|
689 |
+
|
690 |
+
e.preventDefault();
|
691 |
+
createStripePaymentMethod();
|
692 |
+
|
693 |
+
return false;
|
694 |
+
}
|
695 |
+
|
696 |
+
if ( 'cpsw_sepa' === selectedGateway() && ! isSepaSaveCardChosen() && $( 'form#order_review' ).length && '' === paymentMethod ) {
|
697 |
e.preventDefault();
|
698 |
createStripePaymentMethod();
|
699 |
|
722 |
}
|
723 |
} );
|
724 |
|
725 |
+
$( 'form.woocommerce-checkout' ).on( 'submit checkout_place_order_cpsw_sepa', function() {
|
726 |
+
if ( isSepaSaveCardChosen() ) {
|
727 |
+
$( '.cpsw_stripe_sepa_error' ).html( '' );
|
728 |
+
return true;
|
729 |
+
}
|
730 |
+
|
731 |
+
// check for SEPA.
|
732 |
+
if ( ! sepaIBAN && 'cpsw_sepa' === selectedGateway() ) {
|
733 |
+
$( '.woocommerce-error' ).remove();
|
734 |
+
$( '.woocommerce-notices-wrapper:first-child' ).html( '<div class="woocommerce-error cpsw-errors">' + emptySepaIBANMessage + '</div>' ).show();
|
735 |
+
window.scrollTo( { top: 0, behavior: 'smooth' } );
|
736 |
+
$( '.cpsw_stripe_sepa_error' ).html( emptySepaIBANMessage );
|
737 |
+
return false;
|
738 |
+
}
|
739 |
+
$( '.cpsw_stripe_sepa_error' ).html( '' );
|
740 |
+
} );
|
741 |
+
|
742 |
$( 'form.woocommerce-checkout' ).on( 'submit checkout_place_order_cpsw_p24', function() {
|
743 |
// check for P24.
|
744 |
if ( 'cpsw_p24' === selectedGateway() ) {
|
782 |
} );
|
783 |
} );
|
784 |
|
785 |
+
$( "input[name='wc-cpsw_sepa-payment-token']" ).click( function() {
|
786 |
+
hideShowSepaIBAN();
|
787 |
+
} );
|
788 |
+
|
789 |
$( 'input[type=radio][name="wc-cpsw_stripe-payment-token"]' ).change( function() {
|
790 |
hideShowElements();
|
791 |
} );
|
792 |
$( '.cpsw-stripe-elements-form' ).hide();
|
793 |
|
794 |
+
if ( $( 'form#order_review' ).length && window.location.hash && typeof window.location.hash === 'string' ) {
|
795 |
+
const partials = window.location.hash.match(
|
796 |
+
/^#?confirm-(pi|si)-([^:]+):(.+):(.+)$/,
|
797 |
+
);
|
798 |
+
|
799 |
+
if ( partials ) {
|
800 |
+
try {
|
801 |
+
if ( ! partials || 4 > partials.length ) {
|
802 |
+
return;
|
803 |
+
}
|
804 |
+
|
805 |
+
selectedGatewayId = partials[ 4 ];
|
806 |
+
const intentClientSecret = partials[ 2 ];
|
807 |
+
const redirectURL = decodeURIComponent( partials[ 3 ] );
|
808 |
+
|
809 |
+
// Cleanup the URL
|
810 |
+
history.pushState( {}, '', window.location.pathname + window.location.search );
|
811 |
+
confirmStripePayment( intentClientSecret, redirectURL, true );
|
812 |
+
} catch ( err ) {
|
813 |
+
|
814 |
+
}
|
815 |
+
}
|
816 |
+
}
|
817 |
+
|
818 |
window.addEventListener( 'hashchange', onHashChange );
|
819 |
mountGateways();
|
820 |
+
if ( $( 'form#order_review' ).length ) {
|
821 |
+
hideShowCard();
|
822 |
+
hideShowSepaIBAN();
|
823 |
+
hideShowElements();
|
824 |
+
}
|
825 |
}( jQuery ) );
|
autoloader.php
CHANGED
@@ -9,12 +9,14 @@
|
|
9 |
namespace CPSW;
|
10 |
|
11 |
use CPSW\Gateway\Stripe\Card_Payments;
|
|
|
12 |
use CPSW\Gateway\Stripe\Alipay;
|
13 |
use CPSW\Gateway\Stripe\Klarna;
|
14 |
use CPSW\Gateway\Stripe\Payment_Request_Api;
|
15 |
use CPSW\Gateway\Stripe\Ideal;
|
16 |
use CPSW\Gateway\Stripe\Bancontact;
|
17 |
use CPSW\Gateway\Stripe\P24;
|
|
|
18 |
use CPSW\Compatibility\Apple_Pay;
|
19 |
use CPSW\Admin\Admin_Controller;
|
20 |
use CPSW\Gateway\Stripe\Webhook;
|
@@ -158,6 +160,8 @@ class CPSW_Loader {
|
|
158 |
}
|
159 |
// Initializing Gateways.
|
160 |
|
|
|
|
|
161 |
Bancontact::get_instance();
|
162 |
P24::get_instance();
|
163 |
Klarna::get_instance();
|
9 |
namespace CPSW;
|
10 |
|
11 |
use CPSW\Gateway\Stripe\Card_Payments;
|
12 |
+
use CPSW\Gateway\Stripe\Sepa;
|
13 |
use CPSW\Gateway\Stripe\Alipay;
|
14 |
use CPSW\Gateway\Stripe\Klarna;
|
15 |
use CPSW\Gateway\Stripe\Payment_Request_Api;
|
16 |
use CPSW\Gateway\Stripe\Ideal;
|
17 |
use CPSW\Gateway\Stripe\Bancontact;
|
18 |
use CPSW\Gateway\Stripe\P24;
|
19 |
+
use CPSW\Gateway\Stripe\Wechat;
|
20 |
use CPSW\Compatibility\Apple_Pay;
|
21 |
use CPSW\Admin\Admin_Controller;
|
22 |
use CPSW\Gateway\Stripe\Webhook;
|
160 |
}
|
161 |
// Initializing Gateways.
|
162 |
|
163 |
+
Sepa::get_instance();
|
164 |
+
Wechat::get_instance();
|
165 |
Bancontact::get_instance();
|
166 |
P24::get_instance();
|
167 |
Klarna::get_instance();
|
checkout-plugins-stripe-woo.php
CHANGED
@@ -3,9 +3,9 @@
|
|
3 |
* Plugin Name: Checkout Plugins - Stripe for WooCommerce
|
4 |
* Plugin URI: https://www.checkoutplugins.com/
|
5 |
* Description: Stripe for WooCommerce delivers a simple, secure way to accept credit card payments in your WooCommerce store. Reduce payment friction and boost conversions using this free plugin!
|
6 |
-
* Version: 1.
|
7 |
-
* Author:
|
8 |
-
* Author URI: https://
|
9 |
* License: GPLv2 or later
|
10 |
* Text Domain: checkout-plugins-stripe-woo
|
11 |
*
|
@@ -20,6 +20,6 @@ define( 'CPSW_FILE', __FILE__ );
|
|
20 |
define( 'CPSW_BASE', plugin_basename( CPSW_FILE ) );
|
21 |
define( 'CPSW_DIR', plugin_dir_path( CPSW_FILE ) );
|
22 |
define( 'CPSW_URL', plugins_url( '/', CPSW_FILE ) );
|
23 |
-
define( 'CPSW_VERSION', '1.
|
24 |
|
25 |
require_once 'autoloader.php';
|
3 |
* Plugin Name: Checkout Plugins - Stripe for WooCommerce
|
4 |
* Plugin URI: https://www.checkoutplugins.com/
|
5 |
* Description: Stripe for WooCommerce delivers a simple, secure way to accept credit card payments in your WooCommerce store. Reduce payment friction and boost conversions using this free plugin!
|
6 |
+
* Version: 1.4.0
|
7 |
+
* Author: Checkout Plugins
|
8 |
+
* Author URI: https://checkoutplugins.com/
|
9 |
* License: GPLv2 or later
|
10 |
* Text Domain: checkout-plugins-stripe-woo
|
11 |
*
|
20 |
define( 'CPSW_BASE', plugin_basename( CPSW_FILE ) );
|
21 |
define( 'CPSW_DIR', plugin_dir_path( CPSW_FILE ) );
|
22 |
define( 'CPSW_URL', plugins_url( '/', CPSW_FILE ) );
|
23 |
+
define( 'CPSW_VERSION', '1.4.0' );
|
24 |
|
25 |
require_once 'autoloader.php';
|
gateway/abstract-payment-gateway.php
CHANGED
@@ -12,7 +12,9 @@ use WC_Payment_Gateway;
|
|
12 |
use CPSW\Inc\Helper;
|
13 |
use CPSW\Inc\Logger;
|
14 |
use CPSW\Gateway\Stripe\Stripe_Api;
|
|
|
15 |
use WP_Error;
|
|
|
16 |
use Exception;
|
17 |
|
18 |
/**
|
@@ -22,6 +24,8 @@ use Exception;
|
|
22 |
*/
|
23 |
abstract class Abstract_Payment_Gateway extends WC_Payment_Gateway {
|
24 |
|
|
|
|
|
25 |
/**
|
26 |
* Url of assets directory
|
27 |
*
|
@@ -90,12 +94,12 @@ abstract class Abstract_Payment_Gateway extends WC_Payment_Gateway {
|
|
90 |
* @return string $billing_country
|
91 |
*/
|
92 |
public function get_billing_country() {
|
|
|
|
|
93 |
if ( isset( $wp->query_vars['order-pay'] ) ) {
|
94 |
$order = wc_get_order( absint( $wp->query_vars['order-pay'] ) );
|
95 |
$billing_country = $order->get_billing_country();
|
96 |
-
$currency = $order->get_currency();
|
97 |
} else {
|
98 |
-
$currency = get_woocommerce_currency();
|
99 |
$customer = WC()->customer;
|
100 |
$billing_country = $customer ? $customer->get_billing_country() : null;
|
101 |
|
@@ -115,6 +119,8 @@ abstract class Abstract_Payment_Gateway extends WC_Payment_Gateway {
|
|
115 |
* @return string
|
116 |
*/
|
117 |
public function get_currency() {
|
|
|
|
|
118 |
if ( isset( $wp->query_vars['order-pay'] ) ) {
|
119 |
$order = wc_get_order( absint( $wp->query_vars['order-pay'] ) );
|
120 |
|
@@ -227,7 +233,7 @@ abstract class Abstract_Payment_Gateway extends WC_Payment_Gateway {
|
|
227 |
return false;
|
228 |
}
|
229 |
|
230 |
-
return $response;
|
231 |
}
|
232 |
|
233 |
/**
|
@@ -244,11 +250,9 @@ abstract class Abstract_Payment_Gateway extends WC_Payment_Gateway {
|
|
244 |
}
|
245 |
|
246 |
try {
|
247 |
-
$order
|
248 |
-
$intent_secret
|
249 |
-
|
250 |
-
$response = $this->create_refund_request( $order, $amount, $reason, $intent_secret['id'] );
|
251 |
-
|
252 |
$refund_response = $response['success'] ? $response['data'] : false;
|
253 |
|
254 |
if ( $refund_response ) {
|
@@ -259,9 +263,14 @@ abstract class Abstract_Payment_Gateway extends WC_Payment_Gateway {
|
|
259 |
|
260 |
$refund_time = gmdate( 'Y-m-d H:i:s', time() );
|
261 |
$order->update_meta_data( '_cpsw_refund_id', $refund_response->id );
|
262 |
-
$order->add_order_note( __( 'Reason : ', 'checkout-plugins-stripe-woo' ) . $reason . '.<br>' . __( 'Amount : ', 'checkout-plugins-stripe-woo' ) . get_woocommerce_currency_symbol() . $amount . '.<br>' . __( 'Status : ', 'checkout-plugins-stripe-woo' ) . (
|
263 |
-
Logger::info( __( 'Refund initiated: ', 'checkout-plugins-stripe-woo' ) . __( 'Reason : ', 'checkout-plugins-stripe-woo' ) . $reason . __( 'Amount : ', 'checkout-plugins-stripe-woo' ) . get_woocommerce_currency_symbol() . $amount . __( 'Status : ', 'checkout-plugins-stripe-woo' ) . (
|
264 |
-
|
|
|
|
|
|
|
|
|
|
|
265 |
} else {
|
266 |
$order->add_order_note( __( 'Reason : ', 'checkout-plugins-stripe-woo' ) . $reason . '.<br>' . __( 'Amount : ', 'checkout-plugins-stripe-woo' ) . get_woocommerce_currency_symbol() . $amount . '.<br>' . __( ' Status : Failed ', 'checkout-plugins-stripe-woo' ) );
|
267 |
Logger::error( $response['message'], true );
|
@@ -298,7 +307,7 @@ abstract class Abstract_Payment_Gateway extends WC_Payment_Gateway {
|
|
298 |
* that are asynchronous may take couple days to clear. Webhook will
|
299 |
* take care of the status changes.
|
300 |
*/
|
301 |
-
if ( 'pending' === $response->status ) {
|
302 |
$order_stock_reduced = $order->get_meta( '_order_stock_reduced', true );
|
303 |
|
304 |
if ( ! $order_stock_reduced ) {
|
@@ -306,12 +315,14 @@ abstract class Abstract_Payment_Gateway extends WC_Payment_Gateway {
|
|
306 |
}
|
307 |
|
308 |
$order->set_transaction_id( $response->id );
|
309 |
-
|
310 |
-
|
|
|
|
|
311 |
}
|
312 |
|
313 |
if ( 'succeeded' === $response->status ) {
|
314 |
-
if ( $order->has_status( [ 'pending', 'failed' ] ) ) {
|
315 |
$order->payment_complete( $response->id );
|
316 |
}
|
317 |
|
@@ -329,7 +340,7 @@ abstract class Abstract_Payment_Gateway extends WC_Payment_Gateway {
|
|
329 |
} else {
|
330 |
$order->set_transaction_id( $response->id );
|
331 |
|
332 |
-
if ( $order->has_status( [ 'pending', 'failed' ] ) ) {
|
333 |
wc_reduce_stock_levels( $order_id );
|
334 |
}
|
335 |
|
@@ -505,6 +516,8 @@ abstract class Abstract_Payment_Gateway extends WC_Payment_Gateway {
|
|
505 |
'cpsw_klarna' => '<img src="' . $this->assets_url . 'icon/klarna.svg" class="cpsw-klarna-icon" alt="Klarna" width="60" />',
|
506 |
'cpsw_p24' => '<img src="' . $this->assets_url . 'icon/p24.svg" class="cpsw-p24-icon" alt="Przelewy24" width="60" />',
|
507 |
'cpsw_bancontact' => '<img src="' . $this->assets_url . 'icon/bancontact.svg" class="cpsw-bancontact-icon" alt="Bancontact" width="40" />',
|
|
|
|
|
508 |
];
|
509 |
|
510 |
return apply_filters(
|
@@ -560,7 +573,305 @@ abstract class Abstract_Payment_Gateway extends WC_Payment_Gateway {
|
|
560 |
}
|
561 |
|
562 |
/**
|
563 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
564 |
*
|
565 |
* @param int $order_id WooCommerce order id.
|
566 |
* @return void
|
@@ -744,7 +1055,19 @@ abstract class Abstract_Payment_Gateway extends WC_Payment_Gateway {
|
|
744 |
}
|
745 |
|
746 |
/**
|
747 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
748 |
*
|
749 |
* @param object $order WooCommerce Order.
|
750 |
* @param string $intent_id associated stripe intent id.
|
@@ -766,4 +1089,38 @@ abstract class Abstract_Payment_Gateway extends WC_Payment_Gateway {
|
|
766 |
}
|
767 |
}
|
768 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
769 |
}
|
12 |
use CPSW\Inc\Helper;
|
13 |
use CPSW\Inc\Logger;
|
14 |
use CPSW\Gateway\Stripe\Stripe_Api;
|
15 |
+
use CPSW\Inc\Traits\Subscriptions;
|
16 |
use WP_Error;
|
17 |
+
use WC_Payment_Tokens;
|
18 |
use Exception;
|
19 |
|
20 |
/**
|
24 |
*/
|
25 |
abstract class Abstract_Payment_Gateway extends WC_Payment_Gateway {
|
26 |
|
27 |
+
use Subscriptions;
|
28 |
+
|
29 |
/**
|
30 |
* Url of assets directory
|
31 |
*
|
94 |
* @return string $billing_country
|
95 |
*/
|
96 |
public function get_billing_country() {
|
97 |
+
global $wp;
|
98 |
+
|
99 |
if ( isset( $wp->query_vars['order-pay'] ) ) {
|
100 |
$order = wc_get_order( absint( $wp->query_vars['order-pay'] ) );
|
101 |
$billing_country = $order->get_billing_country();
|
|
|
102 |
} else {
|
|
|
103 |
$customer = WC()->customer;
|
104 |
$billing_country = $customer ? $customer->get_billing_country() : null;
|
105 |
|
119 |
* @return string
|
120 |
*/
|
121 |
public function get_currency() {
|
122 |
+
global $wp;
|
123 |
+
|
124 |
if ( isset( $wp->query_vars['order-pay'] ) ) {
|
125 |
$order = wc_get_order( absint( $wp->query_vars['order-pay'] ) );
|
126 |
|
233 |
return false;
|
234 |
}
|
235 |
|
236 |
+
return apply_filters( 'cpsw_create_stripe_customer_response', $response );
|
237 |
}
|
238 |
|
239 |
/**
|
250 |
}
|
251 |
|
252 |
try {
|
253 |
+
$order = wc_get_order( $order_id );
|
254 |
+
$intent_secret = $order->get_meta( '_cpsw_intent_secret', true );
|
255 |
+
$response = $this->create_refund_request( $order, $amount, $reason, $intent_secret['id'] );
|
|
|
|
|
256 |
$refund_response = $response['success'] ? $response['data'] : false;
|
257 |
|
258 |
if ( $refund_response ) {
|
263 |
|
264 |
$refund_time = gmdate( 'Y-m-d H:i:s', time() );
|
265 |
$order->update_meta_data( '_cpsw_refund_id', $refund_response->id );
|
266 |
+
$order->add_order_note( __( 'Reason : ', 'checkout-plugins-stripe-woo' ) . $reason . '.<br>' . __( 'Amount : ', 'checkout-plugins-stripe-woo' ) . get_woocommerce_currency_symbol() . $amount . '.<br>' . __( 'Status : ', 'checkout-plugins-stripe-woo' ) . ucfirst( $refund_response->status ) . ' [ ' . $refund_time . ' ] ' . ( is_null( $refund_response->id ) ? '' : '<br>' . __( 'Transaction ID : ', 'checkout-plugins-stripe-woo' ) . $refund_response->id ) );
|
267 |
+
Logger::info( __( 'Refund initiated: ', 'checkout-plugins-stripe-woo' ) . __( 'Reason : ', 'checkout-plugins-stripe-woo' ) . $reason . __( 'Amount : ', 'checkout-plugins-stripe-woo' ) . get_woocommerce_currency_symbol() . $amount . __( 'Status : ', 'checkout-plugins-stripe-woo' ) . ucfirst( $refund_response->status ) . ' [ ' . $refund_time . ' ] ' . ( is_null( $refund_response->id ) ? '' : __( 'Transaction ID : ', 'checkout-plugins-stripe-woo' ) . $refund_response->id ), true );
|
268 |
+
|
269 |
+
if ( 'succeeded' === $refund_response->status ) {
|
270 |
+
return true;
|
271 |
+
} else {
|
272 |
+
return new WP_Error( 'error', __( 'Your refund process is ', 'checkout-plugins-stripe-woo' ) . ucfirst( $refund_response->status ) );
|
273 |
+
}
|
274 |
} else {
|
275 |
$order->add_order_note( __( 'Reason : ', 'checkout-plugins-stripe-woo' ) . $reason . '.<br>' . __( 'Amount : ', 'checkout-plugins-stripe-woo' ) . get_woocommerce_currency_symbol() . $amount . '.<br>' . __( ' Status : Failed ', 'checkout-plugins-stripe-woo' ) );
|
276 |
Logger::error( $response['message'], true );
|
307 |
* that are asynchronous may take couple days to clear. Webhook will
|
308 |
* take care of the status changes.
|
309 |
*/
|
310 |
+
if ( 'pending' === $response->status || 'processing' === $response->status ) {
|
311 |
$order_stock_reduced = $order->get_meta( '_order_stock_reduced', true );
|
312 |
|
313 |
if ( ! $order_stock_reduced ) {
|
315 |
}
|
316 |
|
317 |
$order->set_transaction_id( $response->id );
|
318 |
+
$others_info = 'cpsw_sepa' === $this->id ? __( 'Payment will be completed once payment_intent.succeeded webhook received from Stripe.', 'checkout-plugins-stripe-woo' ) : '';
|
319 |
+
|
320 |
+
/* translators: transaction id, other info */
|
321 |
+
$order->update_status( 'on-hold', sprintf( __( 'Stripe charge awaiting payment: %1$s. %2$s', 'checkout-plugins-stripe-woo' ), $response->id, $others_info ) );
|
322 |
}
|
323 |
|
324 |
if ( 'succeeded' === $response->status ) {
|
325 |
+
if ( $order->has_status( [ 'pending', 'failed', 'on-hold' ] ) ) {
|
326 |
$order->payment_complete( $response->id );
|
327 |
}
|
328 |
|
340 |
} else {
|
341 |
$order->set_transaction_id( $response->id );
|
342 |
|
343 |
+
if ( $order->has_status( [ 'pending', 'failed', 'on-hold' ] ) ) {
|
344 |
wc_reduce_stock_levels( $order_id );
|
345 |
}
|
346 |
|
516 |
'cpsw_klarna' => '<img src="' . $this->assets_url . 'icon/klarna.svg" class="cpsw-klarna-icon" alt="Klarna" width="60" />',
|
517 |
'cpsw_p24' => '<img src="' . $this->assets_url . 'icon/p24.svg" class="cpsw-p24-icon" alt="Przelewy24" width="60" />',
|
518 |
'cpsw_bancontact' => '<img src="' . $this->assets_url . 'icon/bancontact.svg" class="cpsw-bancontact-icon" alt="Bancontact" width="40" />',
|
519 |
+
'cpsw_wechat' => '<img src="' . $this->assets_url . 'icon/wechat.svg" class="cpsw-wechat-icon" alt="WeChat" width="80" />',
|
520 |
+
'cpsw_sepa' => '<img src="' . $this->assets_url . 'icon/sepa.svg" class="cpsw-sepa-icon" alt="SEPA" width="50px" />',
|
521 |
];
|
522 |
|
523 |
return apply_filters(
|
573 |
}
|
574 |
|
575 |
/**
|
576 |
+
* Clean/Trim statement descriptor as per stripe requirement.
|
577 |
+
*
|
578 |
+
* @since 1.0.0
|
579 |
+
*
|
580 |
+
* @param string $statement_descriptor User Input.
|
581 |
+
*
|
582 |
+
* @return string optimized statement descriptor.
|
583 |
+
*/
|
584 |
+
public function clean_statement_descriptor( $statement_descriptor = '' ) {
|
585 |
+
$disallowed_characters = [ '<', '>', '\\', '*', '"', "'", '/', '(', ')', '{', '}' ];
|
586 |
+
|
587 |
+
// Strip any tags.
|
588 |
+
$statement_descriptor = wp_strip_all_tags( $statement_descriptor );
|
589 |
+
|
590 |
+
// Strip any HTML entities.
|
591 |
+
// Props https://stackoverflow.com/questions/657643/how-to-remove-html-special-chars .
|
592 |
+
$statement_descriptor = preg_replace( '/&#?[a-z0-9]{2,8};/i', '', $statement_descriptor );
|
593 |
+
|
594 |
+
// Next, remove any remaining disallowed characters.
|
595 |
+
$statement_descriptor = str_replace( $disallowed_characters, '', $statement_descriptor );
|
596 |
+
|
597 |
+
// Trim any whitespace at the ends and limit to 22 characters.
|
598 |
+
$statement_descriptor = substr( trim( $statement_descriptor ), 0, 22 );
|
599 |
+
|
600 |
+
return $statement_descriptor;
|
601 |
+
}
|
602 |
+
|
603 |
+
/**
|
604 |
+
* Process order after stripe payment
|
605 |
+
*
|
606 |
+
* @since 1.0.0
|
607 |
+
*
|
608 |
+
* @param object $response intent response data.
|
609 |
+
* @param string $order_id currnt coocommerce id.
|
610 |
+
*
|
611 |
+
* @return array return data.
|
612 |
+
*/
|
613 |
+
public function process_order( $response, $order_id ) {
|
614 |
+
$order = wc_get_order( $order_id );
|
615 |
+
|
616 |
+
if ( isset( $response->balance_transaction ) ) {
|
617 |
+
$this->update_balance( $order, $response->balance_transaction, true );
|
618 |
+
}
|
619 |
+
|
620 |
+
if ( true === $response->captured ) {
|
621 |
+
$order->payment_complete( $response->id );
|
622 |
+
/* translators: order id */
|
623 |
+
Logger::info( sprintf( __( 'Payment successful Order id - %1s', 'checkout-plugins-stripe-woo' ), $order->get_id() ), true );
|
624 |
+
|
625 |
+
$source_name = 'cpsw_stripe' === $this->id ? ucfirst( $response->payment_method_details->card->brand ) : ucfirst( $response->payment_method_details->type );
|
626 |
+
|
627 |
+
$order->add_order_note( __( 'Payment Status: ', 'checkout-plugins-stripe-woo' ) . ucfirst( $response->status ) . ', ' . __( 'Source: Payment is Completed via ', 'checkout-plugins-stripe-woo' ) . $source_name );
|
628 |
+
} else {
|
629 |
+
/* translators: transaction id */
|
630 |
+
$order->update_status( 'on-hold', sprintf( __( 'Charge authorized (Charge ID: %s). Process order to take payment, or cancel to remove the pre-authorization. Attempting to refund the order in part or in full will release the authorization and cancel the payment.', 'checkout-plugins-stripe-woo' ), $response->id ) );
|
631 |
+
/* translators: transaction id */
|
632 |
+
Logger::info( sprintf( __( 'Charge authorized Order id - %1s', 'checkout-plugins-stripe-woo' ), $order->get_id() ), true );
|
633 |
+
}
|
634 |
+
|
635 |
+
WC()->cart->empty_cart();
|
636 |
+
|
637 |
+
/**
|
638 |
+
* Action when process order.
|
639 |
+
*
|
640 |
+
* @since 1.4.0
|
641 |
+
*
|
642 |
+
* @param obj $response Payment response data.
|
643 |
+
* @param obj $order WooCommerce main order.
|
644 |
+
* @param string $this->id Current payment gateway id.
|
645 |
+
*/
|
646 |
+
do_action( 'cpsw_local_gateways_process_order', $response, $order, $this->id );
|
647 |
+
|
648 |
+
return $this->get_return_url( $order );
|
649 |
+
}
|
650 |
+
|
651 |
+
/**
|
652 |
+
* Save payment method to meta of current order
|
653 |
+
*
|
654 |
+
* @since 1.0.0
|
655 |
+
*
|
656 |
+
* @param object $order current woocommerce order.
|
657 |
+
* @param object $payment_method payment method associated with current order.
|
658 |
+
*
|
659 |
+
* @return void
|
660 |
+
*/
|
661 |
+
public function save_payment_method_to_order( $order, $payment_method ) {
|
662 |
+
if ( $payment_method->customer ) {
|
663 |
+
$order->update_meta_data( '_cpsw_customer_id', $payment_method->customer );
|
664 |
+
}
|
665 |
+
|
666 |
+
$order->update_meta_data( '_cpsw_source_id', $payment_method->source );
|
667 |
+
|
668 |
+
if ( is_callable( [ $order, 'save' ] ) ) {
|
669 |
+
$order->save();
|
670 |
+
}
|
671 |
+
|
672 |
+
$this->maybe_update_source_on_subscription_order( $order, $payment_method );
|
673 |
+
}
|
674 |
+
|
675 |
+
/**
|
676 |
+
* Prepare payment method object
|
677 |
+
*
|
678 |
+
* @since 1.0.0
|
679 |
+
*
|
680 |
+
* @param object $payment_method payment method object from intent.
|
681 |
+
* @param object $token token object used for payment.
|
682 |
+
*
|
683 |
+
* @return object
|
684 |
+
*/
|
685 |
+
public function prepare_payment_method( $payment_method, $token ) {
|
686 |
+
return (object) apply_filters(
|
687 |
+
'cpsw_prepare_payment_method_args',
|
688 |
+
[
|
689 |
+
'token_id' => $token->get_id(),
|
690 |
+
'customer' => $payment_method->customer,
|
691 |
+
'source' => $payment_method->id,
|
692 |
+
'source_object' => $payment_method,
|
693 |
+
'payment_method' => $payment_method->id,
|
694 |
+
'payment_method_object' => $payment_method,
|
695 |
+
]
|
696 |
+
);
|
697 |
+
}
|
698 |
+
|
699 |
+
/**
|
700 |
+
* Checks if using saved payment method or new card
|
701 |
+
*
|
702 |
+
* @since 1.0.0
|
703 |
+
*
|
704 |
+
* @return boolean
|
705 |
+
*/
|
706 |
+
public function is_using_saved_payment_method() {
|
707 |
+
$payment_method = isset( $_POST['payment_method'] ) ? wc_clean( wp_unslash( $_POST['payment_method'] ) ) : $this->id; //phpcs:ignore WordPress.Security.NonceVerification.Missing
|
708 |
+
return ( isset( $_POST[ 'wc-' . $payment_method . '-payment-token' ] ) && 'new' !== $_POST[ 'wc-' . $payment_method . '-payment-token' ] ); //phpcs:ignore WordPress.Security.NonceVerification.Missing
|
709 |
+
}
|
710 |
+
|
711 |
+
/**
|
712 |
+
* This function checks for the conditions whether current card should be saved or not.
|
713 |
+
*
|
714 |
+
* @since 1.0.0
|
715 |
+
*
|
716 |
+
* @param int $order_id WooCommerce order id.
|
717 |
+
*
|
718 |
+
* @return boolean
|
719 |
+
*/
|
720 |
+
public function should_save_card( $order_id ) {
|
721 |
+
$status = false;
|
722 |
+
$status = isset( $_POST[ 'wc-' . $this->id . '-new-payment-method' ] ) || $this->has_subscription( $order_id ); //phpcs:ignore WordPress.Security.NonceVerification.Missing
|
723 |
+
|
724 |
+
return apply_filters( 'cpsw_force_save_card', $status );
|
725 |
+
}
|
726 |
+
|
727 |
+
|
728 |
+
|
729 |
+
/**
|
730 |
+
* Get token object for selected saved card payment
|
731 |
+
*
|
732 |
+
* @since 1.0.0
|
733 |
+
*
|
734 |
+
* @param array $request post request.
|
735 |
+
* @return object
|
736 |
+
*/
|
737 |
+
public function get_token_from_request( array $request ) {
|
738 |
+
$payment_method = ! is_null( $request['payment_method'] ) ? $request['payment_method'] : null;
|
739 |
+
$token_request_key = 'wc-' . $payment_method . '-payment-token';
|
740 |
+
if (
|
741 |
+
! isset( $request[ $token_request_key ] ) ||
|
742 |
+
'new' === $request[ $token_request_key ]
|
743 |
+
) {
|
744 |
+
return null;
|
745 |
+
}
|
746 |
+
|
747 |
+
//phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash
|
748 |
+
$token = WC_Payment_Tokens::get( wc_clean( $request[ $token_request_key ] ) );
|
749 |
+
|
750 |
+
// If the token doesn't belong to this gateway or the current user it's invalid.
|
751 |
+
if ( ! $token || $payment_method !== $token->get_gateway_id() || $token->get_user_id() !== get_current_user_id() ) {
|
752 |
+
return null;
|
753 |
+
}
|
754 |
+
|
755 |
+
return $token;
|
756 |
+
}
|
757 |
+
|
758 |
+
/**
|
759 |
+
* Process payment using saved cards.
|
760 |
+
*
|
761 |
+
* @since 1.0.0
|
762 |
+
*
|
763 |
+
* @param int $order_id woocommerce order id.
|
764 |
+
* @return array
|
765 |
+
*/
|
766 |
+
public function process_payment_with_saved_payment_method( $order_id ) {
|
767 |
+
try {
|
768 |
+
$order = wc_get_order( $order_id );
|
769 |
+
$token = $this->get_token_from_request( $_POST ); //phpcs:ignore WordPress.Security.NonceVerification.Missing
|
770 |
+
$stripe_api = new Stripe_Api();
|
771 |
+
$response = $stripe_api->payment_methods( 'retrieve', [ $token->get_token() ] );
|
772 |
+
$payment_method = $response['success'] ? $response['data'] : false;
|
773 |
+
$prepared_payment_method = $this->prepare_payment_method( $payment_method, $token );
|
774 |
+
|
775 |
+
$this->save_payment_method_to_order( $order, $prepared_payment_method );
|
776 |
+
/* translators: %1$1s order id, %2$2s order total amount */
|
777 |
+
Logger::info( sprintf( __( 'Begin processing payment with saved payment method for order %1$1s for the amount of %2$2s', 'checkout-plugins-stripe-woo' ), $order_id, $order->get_total() ) );
|
778 |
+
|
779 |
+
$request = [
|
780 |
+
'payment_method' => $payment_method->id,
|
781 |
+
'payment_method_types' => [ $this->payment_method_types ],
|
782 |
+
'amount' => $this->get_formatted_amount( $order->get_total() ),
|
783 |
+
'currency' => strtolower( $order->get_currency() ),
|
784 |
+
'description' => $this->get_order_description( $order ),
|
785 |
+
'customer' => $payment_method->customer,
|
786 |
+
'metadata' => $this->get_metadata( $order_id ),
|
787 |
+
];
|
788 |
+
|
789 |
+
if ( 'cpsw_sepa' !== $this->id ) {
|
790 |
+
$request['confirm'] = true;
|
791 |
+
}
|
792 |
+
|
793 |
+
if ( ! empty( $this->capture_method ) ) {
|
794 |
+
$request['capture_method'] = $this->capture_method;
|
795 |
+
}
|
796 |
+
|
797 |
+
if ( ! empty( trim( $this->statement_descriptor ) ) ) {
|
798 |
+
$request['statement_descriptor'] = $this->statement_descriptor;
|
799 |
+
}
|
800 |
+
|
801 |
+
$response = $this->create_payment_for_saved_payment_method( apply_filters( 'cpsw_saved_card_payment_intent_post_data', $request ) );
|
802 |
+
|
803 |
+
if ( $response['success'] ) {
|
804 |
+
$intent = $response['data'];
|
805 |
+
} else {
|
806 |
+
wc_add_notice( $response['message'], 'error' );
|
807 |
+
$intent = false;
|
808 |
+
}
|
809 |
+
|
810 |
+
if ( ! $intent ) {
|
811 |
+
return [
|
812 |
+
'result' => 'fail',
|
813 |
+
'redirect' => '',
|
814 |
+
];
|
815 |
+
}
|
816 |
+
|
817 |
+
$intent_data = [
|
818 |
+
'id' => $intent->id,
|
819 |
+
'client_secret' => $intent->client_secret,
|
820 |
+
];
|
821 |
+
update_post_meta( $order_id, '_cpsw_intent_secret', $intent_data );
|
822 |
+
|
823 |
+
if ( 'requires_action' === $intent->status || 'requires_confirmation' === $intent->status ) {
|
824 |
+
if ( isset( $intent->next_action->type ) && 'redirect_to_url' === $intent->next_action->type && ! empty( $intent->next_action->redirect_to_url->url ) ) {
|
825 |
+
return [
|
826 |
+
'result' => 'success',
|
827 |
+
'redirect' => $intent->next_action->redirect_to_url->url,
|
828 |
+
];
|
829 |
+
} else {
|
830 |
+
return apply_filters(
|
831 |
+
'cpsw_saved_card_payment_return_data',
|
832 |
+
[
|
833 |
+
'result' => 'success',
|
834 |
+
'redirect' => $this->get_return_url( $order ),
|
835 |
+
'payment_method' => $intent_data['id'],
|
836 |
+
'intent_secret' => $intent_data['client_secret'],
|
837 |
+
'save_card' => false,
|
838 |
+
]
|
839 |
+
);
|
840 |
+
}
|
841 |
+
}
|
842 |
+
|
843 |
+
if ( $intent->amount > 0 ) {
|
844 |
+
// Use the last charge within the intent to proceed.
|
845 |
+
$this->process_response( end( $intent->charges->data ), $order );
|
846 |
+
} else {
|
847 |
+
$order->payment_complete();
|
848 |
+
}
|
849 |
+
|
850 |
+
// Remove cart.
|
851 |
+
if ( isset( WC()->cart ) ) {
|
852 |
+
WC()->cart->empty_cart();
|
853 |
+
}
|
854 |
+
|
855 |
+
// Return thank you page redirect.
|
856 |
+
return [
|
857 |
+
'result' => 'success',
|
858 |
+
'redirect' => $this->get_return_url( $order ),
|
859 |
+
];
|
860 |
+
|
861 |
+
} catch ( Exception $e ) {
|
862 |
+
wc_add_notice( $e->getMessage(), 'error' );
|
863 |
+
|
864 |
+
/* translators: error message */
|
865 |
+
$order->update_status( 'failed' );
|
866 |
+
|
867 |
+
return [
|
868 |
+
'result' => 'fail',
|
869 |
+
'redirect' => '',
|
870 |
+
];
|
871 |
+
}
|
872 |
+
}
|
873 |
+
|
874 |
+
/** Get stripe order data
|
875 |
*
|
876 |
* @param int $order_id WooCommerce order id.
|
877 |
* @return void
|
1055 |
}
|
1056 |
|
1057 |
/**
|
1058 |
+
* Create payment for saved payment method, and this function
|
1059 |
+
* usefull for cartflows.
|
1060 |
+
*
|
1061 |
+
* @param array $request_args arguments.
|
1062 |
+
*
|
1063 |
+
* @return array
|
1064 |
+
*/
|
1065 |
+
public function create_payment_for_saved_payment_method( $request_args ) {
|
1066 |
+
$stripe_api = new Stripe_Api();
|
1067 |
+
return $stripe_api->payment_intents( 'create', [ $request_args ] );
|
1068 |
+
}
|
1069 |
+
|
1070 |
+
/** Wrapper function to update stripe balance transaction data in order meta
|
1071 |
*
|
1072 |
* @param object $order WooCommerce Order.
|
1073 |
* @param string $intent_id associated stripe intent id.
|
1089 |
}
|
1090 |
}
|
1091 |
}
|
1092 |
+
|
1093 |
+
/**
|
1094 |
+
* Get stripe default currency.
|
1095 |
+
*
|
1096 |
+
* @since 1.4.0
|
1097 |
+
*
|
1098 |
+
* @return array
|
1099 |
+
*/
|
1100 |
+
public function get_stripe_default_currency() {
|
1101 |
+
if (
|
1102 |
+
empty( Helper::get_setting( 'cpsw_account_id' ) ) ||
|
1103 |
+
! isset( $this->match_stripe_currency )
|
1104 |
+
) {
|
1105 |
+
return false;
|
1106 |
+
}
|
1107 |
+
|
1108 |
+
$account_default_currency = get_transient( 'cpsw_stripe_account_default_currency' );
|
1109 |
+
|
1110 |
+
if ( false === $account_default_currency || ( isset( $_GET['debug'] ) && 1 === absint( sanitize_text_field( $_GET['debug'] ) ) ) ) { //phpcs:ignore
|
1111 |
+
$stripe_api = new Stripe_Api();
|
1112 |
+
$response = $stripe_api->accounts( 'retrieve', [ Helper::get_setting( 'cpsw_account_id' ) ] );
|
1113 |
+
$account_info = $response['success'] ? $response['data'] : false;
|
1114 |
+
|
1115 |
+
if ( ! $account_info ) {
|
1116 |
+
return false;
|
1117 |
+
}
|
1118 |
+
|
1119 |
+
$account_default_currency = strtolower( $account_info->default_currency );
|
1120 |
+
delete_transient( 'cpsw_stripe_account_default_currency' );
|
1121 |
+
set_transient( 'cpsw_stripe_account_default_currency', $account_default_currency, 60 * MINUTE_IN_SECONDS );
|
1122 |
+
}
|
1123 |
+
|
1124 |
+
return array_merge( $this->match_stripe_currency, [ $account_default_currency ] );
|
1125 |
+
}
|
1126 |
}
|
gateway/local-gateway.php
CHANGED
@@ -335,8 +335,11 @@ class Local_Gateway extends Abstract_Payment_Gateway {
|
|
335 |
'no' !== get_option( 'cpsw_show_webhook_secret_notice' ) &&
|
336 |
! Helper::get_webhook_secret()
|
337 |
) {
|
338 |
-
|
339 |
-
$
|
|
|
|
|
|
|
340 |
}
|
341 |
|
342 |
// Add notice if currency not supported.
|
@@ -349,6 +352,17 @@ class Local_Gateway extends Abstract_Payment_Gateway {
|
|
349 |
$notice->add( $this->id . '_currency', 'notice notice-error', sprintf( __( '%1$s is enabled - it requires store currency to be set to %2$s.', 'checkout-plugins-stripe-woo' ), ucfirst( str_replace( 'cpsw_', '', $this->id ) ), implode( ', ', $this->get_supported_currency() ) ), true );
|
350 |
}
|
351 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
352 |
/**
|
353 |
* Action for add more notices for local gateways.
|
354 |
*
|
@@ -369,7 +383,7 @@ class Local_Gateway extends Abstract_Payment_Gateway {
|
|
369 |
*/
|
370 |
public function payment_description() {
|
371 |
$desc = '';
|
372 |
-
if ( $this->get_supported_currency() ) {
|
373 |
// translators: %s: supported currency.
|
374 |
$desc .= sprintf( __( 'This gateway will appear when store currency is <strong>%s</strong>.', 'checkout-plugins-stripe-woo' ), implode( ', ', $this->get_supported_currency() ) );
|
375 |
}
|
@@ -515,7 +529,7 @@ class Local_Gateway extends Abstract_Payment_Gateway {
|
|
515 |
);
|
516 |
|
517 |
// Combine into a hash.
|
518 |
-
$redirect = sprintf( '#confirm-pi-%s:%s', $result['intent_secret'], rawurlencode( $verification_url ) );
|
519 |
|
520 |
/**
|
521 |
* Action modify mayment successful result.
|
@@ -533,52 +547,6 @@ class Local_Gateway extends Abstract_Payment_Gateway {
|
|
533 |
];
|
534 |
}
|
535 |
|
536 |
-
/**
|
537 |
-
* Process order after stripe payment
|
538 |
-
*
|
539 |
-
* @since 1.3.0
|
540 |
-
*
|
541 |
-
* @param object $response intent response data.
|
542 |
-
* @param string $order_id currnt coocommerce id.
|
543 |
-
*
|
544 |
-
* @return array return data.
|
545 |
-
*/
|
546 |
-
public function process_order( $response, $order_id ) {
|
547 |
-
$order = wc_get_order( $order_id );
|
548 |
-
|
549 |
-
if ( isset( $response->balance_transaction ) ) {
|
550 |
-
$this->update_balance( $order, $response->balance_transaction, true );
|
551 |
-
}
|
552 |
-
|
553 |
-
if ( true === $response->captured ) {
|
554 |
-
$order->payment_complete( $response->id );
|
555 |
-
/* translators: order id */
|
556 |
-
Logger::info( sprintf( __( 'Payment successful Order id - %1s', 'checkout-plugins-stripe-woo' ), $order->get_id() ), true );
|
557 |
-
|
558 |
-
$order->add_order_note( __( 'Payment Status: ', 'checkout-plugins-stripe-woo' ) . ucfirst( $response->status ) . ', ' . __( 'Source: Payment is Completed via ', 'checkout-plugins-stripe-woo' ) . ucfirst( $response->payment_method_details->type ) );
|
559 |
-
} else {
|
560 |
-
/* translators: transaction id */
|
561 |
-
$order->update_status( 'on-hold', sprintf( __( 'Charge authorized (Charge ID: %s). Process order to take payment, or cancel to remove the pre-authorization. Attempting to refund the order in part or in full will release the authorization and cancel the payment.', 'checkout-plugins-stripe-woo' ), $response->id ) );
|
562 |
-
/* translators: transaction id */
|
563 |
-
Logger::info( sprintf( __( 'Charge authorized Order id - %1s', 'checkout-plugins-stripe-woo' ), $order->get_id() ), true );
|
564 |
-
}
|
565 |
-
|
566 |
-
WC()->cart->empty_cart();
|
567 |
-
|
568 |
-
/**
|
569 |
-
* Action when process order.
|
570 |
-
*
|
571 |
-
* @since 1.3.0
|
572 |
-
*
|
573 |
-
* @param obj $response Payment response data.
|
574 |
-
* @param obj $order WooCommerce main order.
|
575 |
-
* @param string $this->id Current payment gateway id.
|
576 |
-
*/
|
577 |
-
do_action( 'cpsw_local_gateways_process_order', $response, $order, $this->id );
|
578 |
-
|
579 |
-
return $this->get_return_url( $order );
|
580 |
-
}
|
581 |
-
|
582 |
/**
|
583 |
* Verify intent state and redirect.
|
584 |
*
|
335 |
'no' !== get_option( 'cpsw_show_webhook_secret_notice' ) &&
|
336 |
! Helper::get_webhook_secret()
|
337 |
) {
|
338 |
+
$notice_type = 'cpsw_sepa' === $this->id ? 'notice-error' : 'notice-warning';
|
339 |
+
$dismissible = 'cpsw_sepa' === $this->id ? false : true;
|
340 |
+
$requires = 'cpsw_sepa' === $this->id ? __( 'requires', 'checkout-plugins-stripe-woo' ) : __( 'recommends', 'checkout-plugins-stripe-woo' );
|
341 |
+
/* translators: %1$s requires message, %2$s Webhook secret page link, %4$s Payment method, %5$s Webhook guide page link */
|
342 |
+
$notice->add( 'webhook_secret', 'notice ' . $notice_type, sprintf( __( 'Stripe %1$s using the %2$swebhook%3$s for %4$s. %5$sWebhook Guide%6$s ', 'checkout-plugins-stripe-woo' ), $requires, '<a href="' . admin_url( 'admin.php?page=wc-settings&tab=cpsw_api_settings' ) . '">', '</a>', $this->method_title, '<a href="https://checkoutplugins.com/docs/stripe-card-payments/#webhook" target="_blank">', '</a>' ), $dismissible );
|
343 |
}
|
344 |
|
345 |
// Add notice if currency not supported.
|
352 |
$notice->add( $this->id . '_currency', 'notice notice-error', sprintf( __( '%1$s is enabled - it requires store currency to be set to %2$s.', 'checkout-plugins-stripe-woo' ), ucfirst( str_replace( 'cpsw_', '', $this->id ) ), implode( ', ', $this->get_supported_currency() ) ), true );
|
353 |
}
|
354 |
|
355 |
+
// Add notice if currency not supported.
|
356 |
+
$default_currency = $this->get_stripe_default_currency();
|
357 |
+
if (
|
358 |
+
! empty( $default_currency ) &&
|
359 |
+
! in_array( strtolower( get_woocommerce_currency() ), $default_currency, true ) &&
|
360 |
+
'no' !== get_option( 'cpsw_show_' . $this->id . '_stripe_currency_notice' )
|
361 |
+
) {
|
362 |
+
/* translators: %1$s Payment method, %2$s List of supported currencies */
|
363 |
+
$notice->add( $this->id . '_stripe_currency', 'notice notice-error', sprintf( __( '%1$s is enabled - your store currency %2$s does not match with your stripe account supported currency %3$s.', 'checkout-plugins-stripe-woo' ), ucfirst( str_replace( 'cpsw_', '', $this->id ) ), get_woocommerce_currency(), strtoupper( implode( ', ', $default_currency ) ) ), true );
|
364 |
+
}
|
365 |
+
|
366 |
/**
|
367 |
* Action for add more notices for local gateways.
|
368 |
*
|
383 |
*/
|
384 |
public function payment_description() {
|
385 |
$desc = '';
|
386 |
+
if ( method_exists( $this, 'get_supported_currency' ) && $this->get_supported_currency() ) {
|
387 |
// translators: %s: supported currency.
|
388 |
$desc .= sprintf( __( 'This gateway will appear when store currency is <strong>%s</strong>.', 'checkout-plugins-stripe-woo' ), implode( ', ', $this->get_supported_currency() ) );
|
389 |
}
|
529 |
);
|
530 |
|
531 |
// Combine into a hash.
|
532 |
+
$redirect = sprintf( '#confirm-pi-%s:%s:%s', $result['intent_secret'], rawurlencode( $verification_url ), $this->id );
|
533 |
|
534 |
/**
|
535 |
* Action modify mayment successful result.
|
547 |
];
|
548 |
}
|
549 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
550 |
/**
|
551 |
* Verify intent state and redirect.
|
552 |
*
|
gateway/stripe/card-payments.php
CHANGED
@@ -16,7 +16,6 @@ use CPSW\Gateway\Abstract_Payment_Gateway;
|
|
16 |
use CPSW\Gateway\Stripe\Stripe_Api;
|
17 |
use WC_AJAX;
|
18 |
use WC_HTTPS;
|
19 |
-
use WC_Payment_Tokens;
|
20 |
use WC_Payment_Token_CC;
|
21 |
use Exception;
|
22 |
use WP_Error;
|
@@ -37,6 +36,13 @@ class Card_Payments extends Abstract_Payment_Gateway {
|
|
37 |
*/
|
38 |
public $id = 'cpsw_stripe';
|
39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
/**
|
41 |
* Constructor
|
42 |
*
|
@@ -151,11 +157,11 @@ $ */
|
|
151 |
'desc_tip' => true,
|
152 |
],
|
153 |
'allowed_cards' => [
|
154 |
-
'title'
|
155 |
-
'type'
|
156 |
-
'class'
|
157 |
-
'desc_tip'
|
158 |
-
'options'
|
159 |
'mastercard' => 'MasterCard',
|
160 |
'visa' => 'Visa',
|
161 |
'amex' => 'American Express',
|
@@ -164,7 +170,8 @@ $ */
|
|
164 |
'diners' => 'Diners Club',
|
165 |
'unionpay' => 'UnionPay',
|
166 |
],
|
167 |
-
'default'
|
|
|
168 |
],
|
169 |
'order_status' => [
|
170 |
'type' => 'select',
|
@@ -207,6 +214,10 @@ $ */
|
|
207 |
}
|
208 |
|
209 |
try {
|
|
|
|
|
|
|
|
|
210 |
$order = wc_get_order( $order_id );
|
211 |
$payment_method = sanitize_text_field( $_POST['payment_method_created'] ); //phpcs:ignore WordPress.Security.NonceVerification.Missing
|
212 |
$customer_id = $this->get_customer_id( $order );
|
@@ -216,7 +227,7 @@ $ */
|
|
216 |
'amount' => $this->get_formatted_amount( $order->get_total() ),
|
217 |
'currency' => get_woocommerce_currency(),
|
218 |
'description' => $this->get_order_description( $order ),
|
219 |
-
'payment_method_types' => [
|
220 |
'payment_method' => $payment_method,
|
221 |
'metadata' => $this->get_metadata( $order_id ),
|
222 |
'customer' => $customer_id,
|
@@ -257,139 +268,6 @@ $ */
|
|
257 |
}
|
258 |
}
|
259 |
|
260 |
-
/**
|
261 |
-
* This function checks for the conditions whether current card should be saved or not.
|
262 |
-
*
|
263 |
-
* @param int $order_id WooCommerce order id.
|
264 |
-
* @return boolean
|
265 |
-
*/
|
266 |
-
public function should_save_card( $order_id ) {
|
267 |
-
$status = false;
|
268 |
-
$status = isset( $_POST['enable_saved_card'] ) || $this->has_subscription( $order_id ); //phpcs:ignore WordPress.Security.NonceVerification.Missing
|
269 |
-
|
270 |
-
return apply_filters( 'cpsw_force_save_card', $status );
|
271 |
-
}
|
272 |
-
|
273 |
-
/**
|
274 |
-
* Process payment using saved cards.
|
275 |
-
*
|
276 |
-
* @param int $order_id woocommerce order id.
|
277 |
-
* @return array
|
278 |
-
*/
|
279 |
-
public function process_payment_with_saved_payment_method( $order_id ) {
|
280 |
-
try {
|
281 |
-
$order = wc_get_order( $order_id );
|
282 |
-
$token = $this->get_token_from_request( $_POST ); //phpcs:ignore WordPress.Security.NonceVerification.Missing
|
283 |
-
$stripe_api = new Stripe_Api();
|
284 |
-
$response = $stripe_api->payment_methods( 'retrieve', [ $token->get_token() ] );
|
285 |
-
$payment_method = $response['success'] ? $response['data'] : false;
|
286 |
-
$prepared_payment_method = $this->prepare_payment_method( $payment_method, $token );
|
287 |
-
|
288 |
-
$this->save_payment_method_to_order( $order, $prepared_payment_method );
|
289 |
-
/* translators: %1$1s order id, %2$2s order total amount */
|
290 |
-
Logger::info( sprintf( __( 'Begin processing payment with saved payment method for order %1$1s for the amount of %2$2s', 'checkout-plugins-stripe-woo' ), $order_id, $order->get_total() ) );
|
291 |
-
|
292 |
-
$request = [
|
293 |
-
'payment_method' => $payment_method->id,
|
294 |
-
'payment_method_types' => [ 'card' ],
|
295 |
-
'amount' => $this->get_formatted_amount( $order->get_total() ),
|
296 |
-
'currency' => strtolower( $order->get_currency() ),
|
297 |
-
'description' => $this->get_order_description( $order ),
|
298 |
-
'customer' => $payment_method->customer,
|
299 |
-
'metadata' => $this->get_metadata( $order_id ),
|
300 |
-
'confirm' => true,
|
301 |
-
'capture_method' => $this->capture_method,
|
302 |
-
];
|
303 |
-
|
304 |
-
if ( ! empty( trim( $this->statement_descriptor ) ) ) {
|
305 |
-
$request['statement_descriptor'] = $this->statement_descriptor;
|
306 |
-
}
|
307 |
-
|
308 |
-
$response = $this->create_payment_for_saved_payment_method( apply_filters( 'cpsw_saved_card_payment_intent_post_data', $request ) );
|
309 |
-
|
310 |
-
if ( $response['success'] ) {
|
311 |
-
$intent = $response['data'];
|
312 |
-
} else {
|
313 |
-
wc_add_notice( $response['message'], 'error' );
|
314 |
-
$intent = false;
|
315 |
-
}
|
316 |
-
|
317 |
-
if ( ! $intent ) {
|
318 |
-
return [
|
319 |
-
'result' => 'fail',
|
320 |
-
'redirect' => '',
|
321 |
-
];
|
322 |
-
}
|
323 |
-
|
324 |
-
$intent_data = [
|
325 |
-
'id' => $intent->id,
|
326 |
-
'client_secret' => $intent->client_secret,
|
327 |
-
];
|
328 |
-
update_post_meta( $order_id, '_cpsw_intent_secret', $intent_data );
|
329 |
-
|
330 |
-
if ( 'requires_action' === $intent->status ) {
|
331 |
-
if ( isset( $intent->next_action->type ) && 'redirect_to_url' === $intent->next_action->type && ! empty( $intent->next_action->redirect_to_url->url ) ) {
|
332 |
-
return [
|
333 |
-
'result' => 'success',
|
334 |
-
'redirect' => $intent->next_action->redirect_to_url->url,
|
335 |
-
];
|
336 |
-
} else {
|
337 |
-
return apply_filters(
|
338 |
-
'cpsw_saved_card_payment_return_data',
|
339 |
-
[
|
340 |
-
'result' => 'success',
|
341 |
-
'redirect' => $this->get_return_url( $order ),
|
342 |
-
'payment_method' => $intent_data['id'],
|
343 |
-
'intent_secret' => $intent_data['client_secret'],
|
344 |
-
'save_card' => false,
|
345 |
-
]
|
346 |
-
);
|
347 |
-
}
|
348 |
-
}
|
349 |
-
|
350 |
-
if ( $intent->amount > 0 ) {
|
351 |
-
// Use the last charge within the intent to proceed.
|
352 |
-
$this->process_response( end( $intent->charges->data ), $order );
|
353 |
-
} else {
|
354 |
-
$order->payment_complete();
|
355 |
-
}
|
356 |
-
|
357 |
-
// Remove cart.
|
358 |
-
if ( isset( WC()->cart ) ) {
|
359 |
-
WC()->cart->empty_cart();
|
360 |
-
}
|
361 |
-
|
362 |
-
// Return thank you page redirect.
|
363 |
-
return [
|
364 |
-
'result' => 'success',
|
365 |
-
'redirect' => $this->get_return_url( $order ),
|
366 |
-
];
|
367 |
-
|
368 |
-
} catch ( Exception $e ) {
|
369 |
-
wc_add_notice( $e->getMessage(), 'error' );
|
370 |
-
|
371 |
-
/* translators: error message */
|
372 |
-
$order->update_status( 'failed' );
|
373 |
-
|
374 |
-
return [
|
375 |
-
'result' => 'fail',
|
376 |
-
'redirect' => '',
|
377 |
-
];
|
378 |
-
}
|
379 |
-
}
|
380 |
-
|
381 |
-
/**
|
382 |
-
* Create payment for saved payment method.
|
383 |
-
*
|
384 |
-
* @param array $request_args arguments.
|
385 |
-
*
|
386 |
-
* @return array
|
387 |
-
*/
|
388 |
-
public function create_payment_for_saved_payment_method( $request_args ) {
|
389 |
-
$stripe_api = new Stripe_Api();
|
390 |
-
return $stripe_api->payment_intents( 'create', [ $request_args ] );
|
391 |
-
}
|
392 |
-
|
393 |
/**
|
394 |
* Process payment method functionality
|
395 |
*
|
@@ -447,85 +325,6 @@ $ */
|
|
447 |
];
|
448 |
}
|
449 |
|
450 |
-
/**
|
451 |
-
* Checks if using saved payment method or new card
|
452 |
-
*
|
453 |
-
* @return boolean
|
454 |
-
*/
|
455 |
-
public function is_using_saved_payment_method() {
|
456 |
-
$payment_method = isset( $_POST['payment_method'] ) ? wc_clean( wp_unslash( $_POST['payment_method'] ) ) : $this->id; //phpcs:ignore WordPress.Security.NonceVerification.Missing
|
457 |
-
return ( isset( $_POST[ 'wc-' . $payment_method . '-payment-token' ] ) && 'new' !== $_POST[ 'wc-' . $payment_method . '-payment-token' ] ); //phpcs:ignore WordPress.Security.NonceVerification.Missing
|
458 |
-
}
|
459 |
-
|
460 |
-
/**
|
461 |
-
* Get token object for selected saved card payment
|
462 |
-
*
|
463 |
-
* @param array $request post request.
|
464 |
-
* @return object
|
465 |
-
*/
|
466 |
-
public function get_token_from_request( array $request ) {
|
467 |
-
$payment_method = ! is_null( $request['payment_method'] ) ? $request['payment_method'] : null;
|
468 |
-
$token_request_key = 'wc-' . $payment_method . '-payment-token';
|
469 |
-
if (
|
470 |
-
! isset( $request[ $token_request_key ] ) ||
|
471 |
-
'new' === $request[ $token_request_key ]
|
472 |
-
) {
|
473 |
-
return null;
|
474 |
-
}
|
475 |
-
|
476 |
-
//phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash
|
477 |
-
$token = WC_Payment_Tokens::get( wc_clean( $request[ $token_request_key ] ) );
|
478 |
-
|
479 |
-
// If the token doesn't belong to this gateway or the current user it's invalid.
|
480 |
-
if ( ! $token || $payment_method !== $token->get_gateway_id() || $token->get_user_id() !== get_current_user_id() ) {
|
481 |
-
return null;
|
482 |
-
}
|
483 |
-
|
484 |
-
return $token;
|
485 |
-
}
|
486 |
-
|
487 |
-
/**
|
488 |
-
* Save payment method to meta of current order
|
489 |
-
*
|
490 |
-
* @param object $order current woocommerce order.
|
491 |
-
* @param object $payment_method payment method associated with current order.
|
492 |
-
* @return void
|
493 |
-
*/
|
494 |
-
public function save_payment_method_to_order( $order, $payment_method ) {
|
495 |
-
if ( $payment_method->customer ) {
|
496 |
-
$order->update_meta_data( '_cpsw_customer_id', $payment_method->customer );
|
497 |
-
}
|
498 |
-
|
499 |
-
$order->update_meta_data( '_cpsw_source_id', $payment_method->source );
|
500 |
-
|
501 |
-
if ( is_callable( [ $order, 'save' ] ) ) {
|
502 |
-
$order->save();
|
503 |
-
}
|
504 |
-
|
505 |
-
$this->maybe_update_source_on_subscription_order( $order, $payment_method );
|
506 |
-
}
|
507 |
-
|
508 |
-
/**
|
509 |
-
* Prepare payment method object
|
510 |
-
*
|
511 |
-
* @param object $payment_method payment method object from intent.
|
512 |
-
* @param object $token token object used for payment.
|
513 |
-
* @return object
|
514 |
-
*/
|
515 |
-
public function prepare_payment_method( $payment_method, $token ) {
|
516 |
-
return (object) apply_filters(
|
517 |
-
'cpsw_prepare_payment_method_args',
|
518 |
-
[
|
519 |
-
'token_id' => $token->get_id(),
|
520 |
-
'customer' => $payment_method->customer,
|
521 |
-
'source' => $payment_method->id,
|
522 |
-
'source_object' => $payment_method,
|
523 |
-
'payment_method' => $payment_method->id,
|
524 |
-
'payment_method_object' => $payment_method,
|
525 |
-
]
|
526 |
-
);
|
527 |
-
}
|
528 |
-
|
529 |
/**
|
530 |
* Verify intent state and redirect.
|
531 |
*
|
@@ -591,63 +390,6 @@ $ */
|
|
591 |
return ( $this->supports( 'tokenization' ) && 'yes' === $this->enable_saved_cards && is_user_logged_in() ) ? true : false;
|
592 |
}
|
593 |
|
594 |
-
/**
|
595 |
-
* Clean/Trim statement descriptor as per stripe requirement.
|
596 |
-
*
|
597 |
-
* @param string $statement_descriptor User Input.
|
598 |
-
* @return string optimized statement descriptor.
|
599 |
-
*/
|
600 |
-
public function clean_statement_descriptor( $statement_descriptor = '' ) {
|
601 |
-
$disallowed_characters = [ '<', '>', '\\', '*', '"', "'", '/', '(', ')', '{', '}' ];
|
602 |
-
|
603 |
-
// Strip any tags.
|
604 |
-
$statement_descriptor = wp_strip_all_tags( $statement_descriptor );
|
605 |
-
|
606 |
-
// Strip any HTML entities.
|
607 |
-
// Props https://stackoverflow.com/questions/657643/how-to-remove-html-special-chars .
|
608 |
-
$statement_descriptor = preg_replace( '/&#?[a-z0-9]{2,8};/i', '', $statement_descriptor );
|
609 |
-
|
610 |
-
// Next, remove any remaining disallowed characters.
|
611 |
-
$statement_descriptor = str_replace( $disallowed_characters, '', $statement_descriptor );
|
612 |
-
|
613 |
-
// Trim any whitespace at the ends and limit to 22 characters.
|
614 |
-
$statement_descriptor = substr( trim( $statement_descriptor ), 0, 22 );
|
615 |
-
|
616 |
-
return $statement_descriptor;
|
617 |
-
}
|
618 |
-
|
619 |
-
/**
|
620 |
-
* Process order after stripe payment
|
621 |
-
*
|
622 |
-
* @param object $response intent response data.
|
623 |
-
* @param string $order_id current WooCommerce id.
|
624 |
-
* @return array return data.
|
625 |
-
*/
|
626 |
-
public function process_order( $response, $order_id ) {
|
627 |
-
$order = wc_get_order( $order_id );
|
628 |
-
|
629 |
-
if ( isset( $response->balance_transaction ) ) {
|
630 |
-
$this->update_balance( $order, $response->balance_transaction, true );
|
631 |
-
}
|
632 |
-
|
633 |
-
if ( true === $response->captured ) {
|
634 |
-
$order->payment_complete( $response->id );
|
635 |
-
/* translators: order id */
|
636 |
-
Logger::info( sprintf( __( 'Payment successful Order id - %1s', 'checkout-plugins-stripe-woo' ), $order->get_id() ), true );
|
637 |
-
|
638 |
-
$order->add_order_note( __( 'Payment Status: ', 'checkout-plugins-stripe-woo' ) . ucfirst( $response->status ) . ', ' . __( 'Source: Payment is Completed via ', 'checkout-plugins-stripe-woo' ) . $response->payment_method_details->card->brand );
|
639 |
-
} else {
|
640 |
-
/* translators: transaction id */
|
641 |
-
$order->update_status( 'on-hold', sprintf( __( 'Charge authorized (Charge ID: %s). Process order to take payment, or cancel to remove the pre-authorization. Attempting to refund the order in part or in full will release the authorization and cancel the payment.', 'checkout-plugins-stripe-woo' ), $response->id ) );
|
642 |
-
/* translators: transaction id */
|
643 |
-
Logger::info( sprintf( __( 'Charge authorized Order id - %1s', 'checkout-plugins-stripe-woo' ), $order->get_id() ), true );
|
644 |
-
}
|
645 |
-
|
646 |
-
WC()->cart->empty_cart();
|
647 |
-
|
648 |
-
return $this->get_return_url( $order );
|
649 |
-
}
|
650 |
-
|
651 |
/**
|
652 |
* Modify redirect url
|
653 |
*
|
@@ -661,7 +403,7 @@ $ */
|
|
661 |
}
|
662 |
|
663 |
$order = wc_get_order( $order_id );
|
664 |
-
if (
|
665 |
return $result;
|
666 |
}
|
667 |
|
@@ -681,7 +423,7 @@ $ */
|
|
681 |
);
|
682 |
|
683 |
// Combine into a hash.
|
684 |
-
$redirect = sprintf( '#confirm-pi-%s:%s', $result['intent_secret'], rawurlencode( $verification_url ) );
|
685 |
|
686 |
return [
|
687 |
'result' => 'success',
|
@@ -770,7 +512,7 @@ $ */
|
|
770 |
</span>
|
771 |
<?php
|
772 |
}
|
773 |
-
echo ( apply_filters( 'cpsw_display_save_payment_method_checkbox', $display_tokenization ) && $this->enable_saved_cards() ) ? '<span class="cpsw-save-cards"><label><input type="checkbox" name="
|
774 |
do_action( 'cpsw_payment_fields_' . $this->id, $this->id );
|
775 |
echo '</div>';
|
776 |
if ( 'test' === Helper::get_payment_mode() ) {
|
@@ -800,7 +542,7 @@ $ */
|
|
800 |
public function cpsw_payment_complete_order_status( $order_status, $order_id, $order = null ) {
|
801 |
if ( $order && $order->get_payment_method() ) {
|
802 |
$gateway = $order->get_payment_method();
|
803 |
-
if (
|
804 |
$order_status = $this->get_option( 'order_status' );
|
805 |
}
|
806 |
}
|
16 |
use CPSW\Gateway\Stripe\Stripe_Api;
|
17 |
use WC_AJAX;
|
18 |
use WC_HTTPS;
|
|
|
19 |
use WC_Payment_Token_CC;
|
20 |
use Exception;
|
21 |
use WP_Error;
|
36 |
*/
|
37 |
public $id = 'cpsw_stripe';
|
38 |
|
39 |
+
/**
|
40 |
+
* Payment method types
|
41 |
+
*
|
42 |
+
* @var string
|
43 |
+
*/
|
44 |
+
public $payment_method_types = 'card';
|
45 |
+
|
46 |
/**
|
47 |
* Constructor
|
48 |
*
|
157 |
'desc_tip' => true,
|
158 |
],
|
159 |
'allowed_cards' => [
|
160 |
+
'title' => __( 'Allowed Cards', 'checkout-plugins-stripe-woo' ),
|
161 |
+
'type' => 'multiselect',
|
162 |
+
'class' => 'cpsw_select_woo',
|
163 |
+
'desc_tip' => __( 'Accepts payments using selected cards. If empty all stripe cards are accepted.', 'checkout-plugins-stripe-woo' ),
|
164 |
+
'options' => [
|
165 |
'mastercard' => 'MasterCard',
|
166 |
'visa' => 'Visa',
|
167 |
'amex' => 'American Express',
|
170 |
'diners' => 'Diners Club',
|
171 |
'unionpay' => 'UnionPay',
|
172 |
],
|
173 |
+
'default' => [],
|
174 |
+
'description' => __( 'Select cards for accepts payments. If empty all stripe cards are accepted.', 'checkout-plugins-stripe-woo' ),
|
175 |
],
|
176 |
'order_status' => [
|
177 |
'type' => 'select',
|
214 |
}
|
215 |
|
216 |
try {
|
217 |
+
if ( ! isset( $_POST['payment_method_created'] ) ) { //phpcs:ignore WordPress.Security.NonceVerification.Missing
|
218 |
+
return;
|
219 |
+
}
|
220 |
+
|
221 |
$order = wc_get_order( $order_id );
|
222 |
$payment_method = sanitize_text_field( $_POST['payment_method_created'] ); //phpcs:ignore WordPress.Security.NonceVerification.Missing
|
223 |
$customer_id = $this->get_customer_id( $order );
|
227 |
'amount' => $this->get_formatted_amount( $order->get_total() ),
|
228 |
'currency' => get_woocommerce_currency(),
|
229 |
'description' => $this->get_order_description( $order ),
|
230 |
+
'payment_method_types' => [ $this->payment_method_types ],
|
231 |
'payment_method' => $payment_method,
|
232 |
'metadata' => $this->get_metadata( $order_id ),
|
233 |
'customer' => $customer_id,
|
268 |
}
|
269 |
}
|
270 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
271 |
/**
|
272 |
* Process payment method functionality
|
273 |
*
|
325 |
];
|
326 |
}
|
327 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
328 |
/**
|
329 |
* Verify intent state and redirect.
|
330 |
*
|
390 |
return ( $this->supports( 'tokenization' ) && 'yes' === $this->enable_saved_cards && is_user_logged_in() ) ? true : false;
|
391 |
}
|
392 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
393 |
/**
|
394 |
* Modify redirect url
|
395 |
*
|
403 |
}
|
404 |
|
405 |
$order = wc_get_order( $order_id );
|
406 |
+
if ( $this->id !== $order->get_payment_method() ) {
|
407 |
return $result;
|
408 |
}
|
409 |
|
423 |
);
|
424 |
|
425 |
// Combine into a hash.
|
426 |
+
$redirect = sprintf( '#confirm-pi-%s:%s:%s', $result['intent_secret'], rawurlencode( $verification_url ), $this->id );
|
427 |
|
428 |
return [
|
429 |
'result' => 'success',
|
512 |
</span>
|
513 |
<?php
|
514 |
}
|
515 |
+
echo ( apply_filters( 'cpsw_display_save_payment_method_checkbox', $display_tokenization ) && $this->enable_saved_cards() ) ? '<span class="cpsw-save-cards"><label><input type="checkbox" name="wc-cpsw_stripe-new-payment-method" value="on"/>' . wp_kses_post( apply_filters( 'cpsw_saved_cards_label', __( 'Save Card for Future Payments', 'checkout-plugins-stripe-woo' ) ) ) . '</label></span>' : '';
|
516 |
do_action( 'cpsw_payment_fields_' . $this->id, $this->id );
|
517 |
echo '</div>';
|
518 |
if ( 'test' === Helper::get_payment_mode() ) {
|
542 |
public function cpsw_payment_complete_order_status( $order_status, $order_id, $order = null ) {
|
543 |
if ( $order && $order->get_payment_method() ) {
|
544 |
$gateway = $order->get_payment_method();
|
545 |
+
if ( $this->id === $gateway && ! empty( $this->get_option( 'order_status' ) ) ) {
|
546 |
$order_status = $this->get_option( 'order_status' );
|
547 |
}
|
548 |
}
|
gateway/stripe/frontend-scripts.php
CHANGED
@@ -11,6 +11,7 @@ namespace CPSW\Gateway\Stripe;
|
|
11 |
use CPSW\Inc\Traits\Get_Instance;
|
12 |
use CPSW\Inc\Helper;
|
13 |
use WC_AJAX;
|
|
|
14 |
|
15 |
/**
|
16 |
* Consists frontend scripts for payment gateways
|
@@ -18,6 +19,7 @@ use WC_AJAX;
|
|
18 |
class Frontend_Scripts {
|
19 |
|
20 |
use Get_Instance;
|
|
|
21 |
|
22 |
/**
|
23 |
* Prefix
|
@@ -67,7 +69,9 @@ class Frontend_Scripts {
|
|
67 |
'yes' === Helper::get_setting( 'enabled', 'cpsw_ideal' ) ||
|
68 |
'yes' === Helper::get_setting( 'enabled', 'cpsw_klarna' ) ||
|
69 |
'yes' === Helper::get_setting( 'enabled', 'cpsw_p24' ) ||
|
70 |
-
'yes' === Helper::get_setting( 'enabled', '
|
|
|
|
|
71 |
) {
|
72 |
$this->enqueue_card_payments_scripts( $public_key );
|
73 |
}
|
@@ -93,14 +97,14 @@ class Frontend_Scripts {
|
|
93 |
$this->prefix . 'stripe-elements',
|
94 |
'cpsw_global_settings',
|
95 |
[
|
96 |
-
'public_key'
|
97 |
-
'inline_cc'
|
98 |
-
'is_ssl'
|
99 |
-
'mode'
|
100 |
-
'ajax_url'
|
101 |
-
'js_nonce'
|
102 |
-
'allowed_cards'
|
103 |
-
'default_cards'
|
104 |
'mastercard' => __( 'MasterCard', 'checkout-plugins-stripe-woo' ),
|
105 |
'visa' => __( 'Visa', 'checkout-plugins-stripe-woo' ),
|
106 |
'amex' => __( 'American Express', 'checkout-plugins-stripe-woo' ),
|
@@ -109,9 +113,22 @@ class Frontend_Scripts {
|
|
109 |
'diners' => __( 'Diners Club', 'checkout-plugins-stripe-woo' ),
|
110 |
'unionpay' => __( 'UnionPay', 'checkout-plugins-stripe-woo' ),
|
111 |
],
|
112 |
-
'not_allowed_string'
|
113 |
-
'get_home_url'
|
114 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
]
|
116 |
);
|
117 |
|
@@ -172,4 +189,29 @@ class Frontend_Scripts {
|
|
172 |
);
|
173 |
}
|
174 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
}
|
11 |
use CPSW\Inc\Traits\Get_Instance;
|
12 |
use CPSW\Inc\Helper;
|
13 |
use WC_AJAX;
|
14 |
+
use CPSW\Inc\Traits\Subscription_Helper as SH;
|
15 |
|
16 |
/**
|
17 |
* Consists frontend scripts for payment gateways
|
19 |
class Frontend_Scripts {
|
20 |
|
21 |
use Get_Instance;
|
22 |
+
use SH;
|
23 |
|
24 |
/**
|
25 |
* Prefix
|
69 |
'yes' === Helper::get_setting( 'enabled', 'cpsw_ideal' ) ||
|
70 |
'yes' === Helper::get_setting( 'enabled', 'cpsw_klarna' ) ||
|
71 |
'yes' === Helper::get_setting( 'enabled', 'cpsw_p24' ) ||
|
72 |
+
'yes' === Helper::get_setting( 'enabled', 'cpsw_wechat' ) ||
|
73 |
+
'yes' === Helper::get_setting( 'enabled', 'cpsw_bancontact' ) ||
|
74 |
+
'yes' === Helper::get_setting( 'enabled', 'cpsw_sepa' )
|
75 |
) {
|
76 |
$this->enqueue_card_payments_scripts( $public_key );
|
77 |
}
|
97 |
$this->prefix . 'stripe-elements',
|
98 |
'cpsw_global_settings',
|
99 |
[
|
100 |
+
'public_key' => $public_key,
|
101 |
+
'inline_cc' => Helper::get_setting( 'inline_cc', 'cpsw_stripe' ),
|
102 |
+
'is_ssl' => is_ssl(),
|
103 |
+
'mode' => Helper::get_payment_mode(),
|
104 |
+
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
105 |
+
'js_nonce' => wp_create_nonce( 'cpsw_js_error_nonce' ),
|
106 |
+
'allowed_cards' => Helper::get_setting( 'allowed_cards', 'cpsw_stripe' ),
|
107 |
+
'default_cards' => [
|
108 |
'mastercard' => __( 'MasterCard', 'checkout-plugins-stripe-woo' ),
|
109 |
'visa' => __( 'Visa', 'checkout-plugins-stripe-woo' ),
|
110 |
'amex' => __( 'American Express', 'checkout-plugins-stripe-woo' ),
|
113 |
'diners' => __( 'Diners Club', 'checkout-plugins-stripe-woo' ),
|
114 |
'unionpay' => __( 'UnionPay', 'checkout-plugins-stripe-woo' ),
|
115 |
],
|
116 |
+
'not_allowed_string' => __( 'is not allowed', 'checkout-plugins-stripe-woo' ),
|
117 |
+
'get_home_url' => get_home_url(),
|
118 |
+
'current_user_billing' => $this->get_current_user_billing_details(),
|
119 |
+
'changing_payment_method' => $this->is_changing_payment_method_for_subscription(),
|
120 |
+
'sepa_options' => [
|
121 |
+
'supportedCountries' => [ 'SEPA' ],
|
122 |
+
'placeholderCountry' => WC()->countries->get_base_country(),
|
123 |
+
'style' => [
|
124 |
+
'base' => [
|
125 |
+
'fontSize' => '15px',
|
126 |
+
'color' => '#32325d',
|
127 |
+
],
|
128 |
+
],
|
129 |
+
],
|
130 |
+
'empty_sepa_iban_message' => __( 'Please enter a IBAN number to proceed.', 'checkout-plugins-stripe-woo' ),
|
131 |
+
'empty_bank_message' => __( 'Please select a bank to proceed.', 'checkout-plugins-stripe-woo' ),
|
132 |
]
|
133 |
);
|
134 |
|
189 |
);
|
190 |
}
|
191 |
}
|
192 |
+
|
193 |
+
/**
|
194 |
+
* Get current user billing details
|
195 |
+
*
|
196 |
+
* @since 1.4.0
|
197 |
+
*
|
198 |
+
* @return array
|
199 |
+
*/
|
200 |
+
public function get_current_user_billing_details() {
|
201 |
+
if ( ! is_user_logged_in() ) {
|
202 |
+
return;
|
203 |
+
}
|
204 |
+
|
205 |
+
$user = wp_get_current_user();
|
206 |
+
|
207 |
+
if ( ! empty( $user->display_name ) ) {
|
208 |
+
$details['name'] = $user->display_name;
|
209 |
+
}
|
210 |
+
|
211 |
+
if ( ! empty( $user->user_email ) ) {
|
212 |
+
$details['email'] = $user->user_email;
|
213 |
+
}
|
214 |
+
|
215 |
+
return apply_filters( 'cpsw_current_user_billing_details', $details, get_current_user_id() );
|
216 |
+
}
|
217 |
}
|
gateway/stripe/payment-request-api.php
CHANGED
@@ -14,6 +14,7 @@ use CPSW\Inc\Traits\Get_Instance;
|
|
14 |
use WC_Data_Store;
|
15 |
use WC_Subscriptions_Product;
|
16 |
use WC_Validation;
|
|
|
17 |
|
18 |
/**
|
19 |
* Payment Request Api.
|
14 |
use WC_Data_Store;
|
15 |
use WC_Subscriptions_Product;
|
16 |
use WC_Validation;
|
17 |
+
use Exception;
|
18 |
|
19 |
/**
|
20 |
* Payment Request Api.
|
gateway/stripe/sepa.php
ADDED
@@ -0,0 +1,560 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* SEPA Gateway
|
4 |
+
*
|
5 |
+
* @package checkout-plugins-stripe-woo
|
6 |
+
* @since 1.4.0
|
7 |
+
*/
|
8 |
+
|
9 |
+
namespace CPSW\Gateway\Stripe;
|
10 |
+
|
11 |
+
use CPSW\Inc\Helper;
|
12 |
+
use CPSW\Inc\Logger;
|
13 |
+
use CPSW\Inc\Traits\Get_Instance;
|
14 |
+
use CPSW\Inc\Traits\Subscriptions;
|
15 |
+
use CPSW\Gateway\Local_Gateway;
|
16 |
+
use CPSW\Gateway\Stripe\Stripe_Api;
|
17 |
+
use CPSW\Inc\Token;
|
18 |
+
use Exception;
|
19 |
+
use WP_Error;
|
20 |
+
use WC_AJAX;
|
21 |
+
|
22 |
+
/**
|
23 |
+
* SEPA
|
24 |
+
*
|
25 |
+
* @since 1.4.0
|
26 |
+
*/
|
27 |
+
class Sepa extends Local_Gateway {
|
28 |
+
|
29 |
+
use Get_Instance;
|
30 |
+
use Subscriptions;
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Gateway id
|
34 |
+
*
|
35 |
+
* @var string
|
36 |
+
*/
|
37 |
+
public $id = 'cpsw_sepa';
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Payment method types
|
41 |
+
*
|
42 |
+
* @var string
|
43 |
+
*/
|
44 |
+
public $payment_method_types = 'sepa_debit';
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Constructor
|
48 |
+
*
|
49 |
+
* @since 1.4.0
|
50 |
+
*/
|
51 |
+
public function __construct() {
|
52 |
+
parent::__construct();
|
53 |
+
|
54 |
+
$this->method_title = __( 'SEPA', 'checkout-plugins-stripe-woo' );
|
55 |
+
$this->method_description = $this->method_description();
|
56 |
+
$this->has_fields = true;
|
57 |
+
$this->init_supports();
|
58 |
+
$this->maybe_init_subscriptions();
|
59 |
+
|
60 |
+
$this->init_form_fields();
|
61 |
+
$this->init_settings();
|
62 |
+
// get_option should be called after init_form_fields().
|
63 |
+
$this->title = $this->get_option( 'title' );
|
64 |
+
$this->description = $this->get_option( 'description' );
|
65 |
+
$this->order_button_text = $this->get_option( 'order_button_text' );
|
66 |
+
$this->enable_saved_cards = $this->get_option( 'enable_saved_card' );
|
67 |
+
$this->company_name = $this->get_option( 'company_name' );
|
68 |
+
$this->statement_descriptor = $this->clean_statement_descriptor( $this->get_option( 'statement_descriptor' ) );
|
69 |
+
$this->payment_conform = true;
|
70 |
+
|
71 |
+
add_action( 'wc_ajax_' . $this->id . '_verify_payment_intent', [ $this, 'verify_intent' ] );
|
72 |
+
add_action( 'woocommerce_payment_token_class', [ $this, 'modify_token_class' ], 15, 2 );
|
73 |
+
add_filter( 'woocommerce_payment_methods_list_item', [ $this, 'get_saved_payment_methods_list' ], 10, 2 );
|
74 |
+
add_filter( 'woocommerce_payment_successful_result', [ $this, 'modify_successful_payment_result' ], 999, 2 );
|
75 |
+
}
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Controls the output on the my account page.
|
79 |
+
*
|
80 |
+
* @since 1.4.0
|
81 |
+
*
|
82 |
+
* @param array $item Individual list item from woocommerce_saved_payment_methods_list.
|
83 |
+
* @param WC_Payment_Token $token The payment token associated with this method entry.
|
84 |
+
*
|
85 |
+
* @return array $item
|
86 |
+
*/
|
87 |
+
public function get_saved_payment_methods_list( $item, $token ) {
|
88 |
+
if ( 'cpsw_sepa' === strtolower( $token->get_type() ) ) {
|
89 |
+
$item['method']['last4'] = $token->get_last4();
|
90 |
+
$item['method']['brand'] = esc_html__( 'SEPA IBAN', 'checkout-plugins-stripe-woo' );
|
91 |
+
}
|
92 |
+
|
93 |
+
return $item;
|
94 |
+
}
|
95 |
+
|
96 |
+
/**
|
97 |
+
* Added token class
|
98 |
+
*
|
99 |
+
* @since 1.4.0
|
100 |
+
*
|
101 |
+
* @param string $class token class name.
|
102 |
+
* @param string $type gateway name.
|
103 |
+
*
|
104 |
+
* @return string
|
105 |
+
*/
|
106 |
+
public function modify_token_class( $class, $type ) {
|
107 |
+
if ( 'cpsw_sepa' === $type ) {
|
108 |
+
return 'CPSW\Inc\Token';
|
109 |
+
}
|
110 |
+
|
111 |
+
return $class;
|
112 |
+
}
|
113 |
+
|
114 |
+
/**
|
115 |
+
* Description for SEPA gateway
|
116 |
+
*
|
117 |
+
* @since 1.4.0
|
118 |
+
*
|
119 |
+
* @return string
|
120 |
+
*/
|
121 |
+
public function method_description() {
|
122 |
+
$payment_description = $this->payment_description();
|
123 |
+
|
124 |
+
return sprintf(
|
125 |
+
/* translators: %1$s: Break, %2$s: HTML entities */
|
126 |
+
__( 'Accept payment using SEPA. %1$s %2$s', 'checkout-plugins-stripe-woo' ),
|
127 |
+
'<br/>',
|
128 |
+
$payment_description
|
129 |
+
);
|
130 |
+
}
|
131 |
+
|
132 |
+
/**
|
133 |
+
* Returns all supported currencies for this payment method.
|
134 |
+
*
|
135 |
+
* @since 1.4.0
|
136 |
+
*
|
137 |
+
* @return array
|
138 |
+
*/
|
139 |
+
public function get_supported_currency() {
|
140 |
+
return apply_filters(
|
141 |
+
'cpsw_sepa_supported_currencies',
|
142 |
+
[
|
143 |
+
'EUR',
|
144 |
+
]
|
145 |
+
);
|
146 |
+
}
|
147 |
+
|
148 |
+
/**
|
149 |
+
* Init payment supports.
|
150 |
+
*
|
151 |
+
* @since 1.4.0
|
152 |
+
*
|
153 |
+
* @return void
|
154 |
+
*/
|
155 |
+
public function init_supports() {
|
156 |
+
parent::init_supports();
|
157 |
+
$this->supports[] = 'tokenization';
|
158 |
+
$this->supports[] = 'add_payment_method';
|
159 |
+
$this->supports[] = 'pre-orders';
|
160 |
+
}
|
161 |
+
|
162 |
+
/**
|
163 |
+
* Process payment method functionality
|
164 |
+
*
|
165 |
+
* @return array
|
166 |
+
*/
|
167 |
+
public function add_payment_method() {
|
168 |
+
$source_id = '';
|
169 |
+
if ( empty( $_POST['payment_method_created'] ) && empty( $_POST['stripe_token'] ) || ! is_user_logged_in() ) { //phpcs:ignore WordPress.Security.NonceVerification.Missing
|
170 |
+
$error_msg = __( 'There was a problem adding the payment method.', 'checkout-plugins-stripe-woo' );
|
171 |
+
/* translators: error msg */
|
172 |
+
Logger::error( sprintf( __( 'Add payment method Error: %1$1s', 'checkout-plugins-stripe-woo' ), $error_msg ) );
|
173 |
+
return;
|
174 |
+
}
|
175 |
+
|
176 |
+
$customer_id = $this->get_customer_id();
|
177 |
+
$source = ! empty( $_POST['payment_method_created'] ) ? wc_clean( wp_unslash( $_POST['payment_method_created'] ) ) : ''; //phpcs:ignore WordPress.Security.NonceVerification.Missing
|
178 |
+
$stripe_api = new Stripe_Api();
|
179 |
+
$response = $stripe_api->payment_methods( 'retrieve', [ $source ] );
|
180 |
+
$source_object = $response['success'] ? $response['data'] : false;
|
181 |
+
|
182 |
+
if ( isset( $source_object ) ) {
|
183 |
+
if ( ! empty( $source_object->error ) ) {
|
184 |
+
$error_msg = __( 'Invalid stripe source', 'checkout-plugins-stripe-woo' );
|
185 |
+
wc_add_notice( $error_msg, 'error' );
|
186 |
+
/* translators: error msg */
|
187 |
+
Logger::error( sprintf( __( 'Add payment method Error: %1$1s', 'checkout-plugins-stripe-woo' ), $error_msg ) );
|
188 |
+
return;
|
189 |
+
}
|
190 |
+
|
191 |
+
$source_id = $source_object->id;
|
192 |
+
}
|
193 |
+
$stripe_api = new Stripe_Api();
|
194 |
+
$response = $stripe_api->payment_methods( 'attach', [ $source_id, [ 'customer' => $customer_id ] ] );
|
195 |
+
$response = $response['success'] ? $response['data'] : false;
|
196 |
+
$user = wp_get_current_user();
|
197 |
+
$user_id = ( $user->ID && $user->ID > 0 ) ? $user->ID : false;
|
198 |
+
$this->create_payment_token_for_user( $user_id, $source_object );
|
199 |
+
|
200 |
+
if ( ! $response || is_wp_error( $response ) || ! empty( $response->error ) ) {
|
201 |
+
$error_msg = __( 'Unble to attach payment method to customer', 'checkout-plugins-stripe-woo' );
|
202 |
+
wc_add_notice( $error_msg, 'error' );
|
203 |
+
/* translators: error msg */
|
204 |
+
Logger::error( sprintf( __( 'Add payment method Error: %1$1s', 'checkout-plugins-stripe-woo' ), $error_msg ) );
|
205 |
+
return;
|
206 |
+
}
|
207 |
+
|
208 |
+
do_action( 'cpsw_add_payment_method_' . ( isset( $_POST['payment_method'] ) ? wc_clean( wp_unslash( $_POST['payment_method'] ) ) : '' ) . '_success', $source_id, $source_object ); //phpcs:ignore WordPress.Security.NonceVerification.Missing
|
209 |
+
|
210 |
+
Logger::info( __( 'New payment method added successfully', 'checkout-plugins-stripe-woo' ) );
|
211 |
+
return [
|
212 |
+
'result' => 'success',
|
213 |
+
'redirect' => wc_get_endpoint_url( 'payment-methods' ),
|
214 |
+
];
|
215 |
+
}
|
216 |
+
|
217 |
+
/**
|
218 |
+
* Add more gateway form fields
|
219 |
+
*
|
220 |
+
* @since 1.4.0
|
221 |
+
*
|
222 |
+
* @return array
|
223 |
+
*/
|
224 |
+
public function get_local_payment_settings() {
|
225 |
+
$company_name = [
|
226 |
+
'enable_saved_card' => [
|
227 |
+
'label' => __( 'Enable Payment via Saved IBAN', 'checkout-plugins-stripe-woo' ),
|
228 |
+
'title' => __( 'Saved IBAN', 'checkout-plugins-stripe-woo' ),
|
229 |
+
'type' => 'checkbox',
|
230 |
+
'description' => __( 'Save IBAN details for future orders', 'checkout-plugins-stripe-woo' ),
|
231 |
+
'default' => 'yes',
|
232 |
+
'desc_tip' => true,
|
233 |
+
],
|
234 |
+
'statement_descriptor' => [
|
235 |
+
'title' => __( 'Statement Descriptor', 'checkout-plugins-stripe-woo' ),
|
236 |
+
'type' => 'text',
|
237 |
+
'description' => __( 'Statement descriptors are limited to 22 characters, cannot use the special characters >, <, ", \, *, /, (, ), {, }, and must not consist solely of numbers. This will appear on your customer\'s statement in capital letters.', 'checkout-plugins-stripe-woo' ),
|
238 |
+
'default' => get_bloginfo( 'name' ),
|
239 |
+
'desc_tip' => true,
|
240 |
+
],
|
241 |
+
'company_name' => [
|
242 |
+
'title' => __( 'Company Name', 'checkout-plugins-stripe-woo' ),
|
243 |
+
'type' => 'text',
|
244 |
+
'default' => get_bloginfo( 'name' ),
|
245 |
+
'desc_tip' => true,
|
246 |
+
'description' => __( 'The name of your company that will appear in the SEPA mandate.', 'checkout-plugins-stripe-woo' ),
|
247 |
+
],
|
248 |
+
];
|
249 |
+
|
250 |
+
$local_settings = parent::get_local_payment_settings();
|
251 |
+
|
252 |
+
$local_settings['description']['default'] = __( 'Mandate Information.', 'checkout-plugins-stripe-woo' );
|
253 |
+
|
254 |
+
return array_merge( $local_settings, $company_name );
|
255 |
+
}
|
256 |
+
|
257 |
+
/**
|
258 |
+
* Checks whether this gateway is available.
|
259 |
+
*
|
260 |
+
* @since 1.4.0
|
261 |
+
*
|
262 |
+
* @return boolean
|
263 |
+
*/
|
264 |
+
public function is_available() {
|
265 |
+
if ( ! in_array( $this->get_currency(), $this->get_supported_currency(), true ) ) {
|
266 |
+
return false;
|
267 |
+
}
|
268 |
+
|
269 |
+
if ( ! Helper::get_webhook_secret() ) {
|
270 |
+
return false;
|
271 |
+
}
|
272 |
+
|
273 |
+
return parent::is_available();
|
274 |
+
}
|
275 |
+
|
276 |
+
/**
|
277 |
+
* Renders the Stripe elements form.
|
278 |
+
*
|
279 |
+
* @since 1.4.0
|
280 |
+
*
|
281 |
+
* @return void
|
282 |
+
*/
|
283 |
+
public function payment_form() {
|
284 |
+
// translators: %s: company name.
|
285 |
+
$description = sprintf( __( 'By providing your IBAN and confirming this payment, you are authorizing %s and Stripe, our payment service provider, to send instructions to your bank to debit your account and your bank to debit your account in accordance with those instructions. You are entitled to a refund from your bank under the terms and conditions of your agreement with your bank. A refund must be claimed within 8 weeks starting from the date on which your account was debited.', 'checkout-plugins-stripe-woo' ), $this->get_option( 'company_name' ) );
|
286 |
+
?>
|
287 |
+
<fieldset id="<?php echo esc_attr( $this->id ); ?>-form" class="wc-payment-form cpsw_stripe_sepa_payment_form">
|
288 |
+
<?php echo wpautop( wp_kses_post( $description ) ); //phpcs:ignore ?>
|
289 |
+
<p class="form-row form-row-wide">
|
290 |
+
<label for="cpsw-sepa-stripe-iban-element">
|
291 |
+
<?php esc_html_e( 'IBAN.', 'checkout-plugins-stripe-woo' ); ?> <span class="required">*</span>
|
292 |
+
</label>
|
293 |
+
<div id="cpsw_stripe_sepa_iban_element" class="cpsw_stripe_sepa_iban_element_field">
|
294 |
+
<!-- A Stripe Element will be inserted here. -->
|
295 |
+
</div>
|
296 |
+
</p>
|
297 |
+
|
298 |
+
<!-- Used to display form errors -->
|
299 |
+
<div class="cpsw_stripe_sepa_error" role="alert"></div>
|
300 |
+
<div class="clear"></div>
|
301 |
+
</fieldset>
|
302 |
+
<?php
|
303 |
+
}
|
304 |
+
|
305 |
+
/**
|
306 |
+
* Creates markup for payment form for card payments
|
307 |
+
*
|
308 |
+
* @since 1.4.0
|
309 |
+
*
|
310 |
+
* @return void
|
311 |
+
*/
|
312 |
+
public function payment_fields() {
|
313 |
+
$total = WC()->cart->total;
|
314 |
+
$display_tokenization = $this->supports( 'tokenization' ) && is_checkout() && 'yes' === $this->enable_saved_cards && is_user_logged_in();
|
315 |
+
$description = $this->get_description();
|
316 |
+
$description = ! empty( $description ) ? $description : '';
|
317 |
+
|
318 |
+
// If paying from order, we need to get total from order not cart.
|
319 |
+
if ( isset( $_GET['pay_for_order'] ) && ! empty( $_GET['key'] ) ) { // phpcs:ignore
|
320 |
+
global $wp;
|
321 |
+
|
322 |
+
$order = wc_get_order( wc_clean( $wp->query_vars['order-pay'] ) );
|
323 |
+
$total = $order->get_total();
|
324 |
+
}
|
325 |
+
|
326 |
+
if ( is_add_payment_method_page() ) {
|
327 |
+
$total = '';
|
328 |
+
}
|
329 |
+
|
330 |
+
/**
|
331 |
+
* Action before payment field.
|
332 |
+
*
|
333 |
+
* @since 1.4.0
|
334 |
+
*/
|
335 |
+
do_action( $this->id . '_before_payment_field_checkout' );
|
336 |
+
|
337 |
+
echo '<div
|
338 |
+
id="cpsw-sepa-payment-data"
|
339 |
+
data-amount="' . esc_attr( $this->get_formatted_amount( $total ) ) . '"
|
340 |
+
data-currency="' . esc_attr( strtolower( get_woocommerce_currency() ) ) . '">';
|
341 |
+
|
342 |
+
if ( $display_tokenization ) {
|
343 |
+
$this->tokenization_script();
|
344 |
+
$this->saved_payment_methods();
|
345 |
+
}
|
346 |
+
|
347 |
+
$this->payment_form();
|
348 |
+
|
349 |
+
if ( apply_filters( 'cpsw_sepa_display_save_payment_method_checkbox', $display_tokenization ) && ! $this->is_subscription_item_in_cart() && ! is_add_payment_method_page() && ! isset( $_GET['change_payment_method'] ) ) { // phpcs:ignore
|
350 |
+
$this->save_payment_method_checkbox();
|
351 |
+
}
|
352 |
+
|
353 |
+
if ( 'live' !== Helper::get_payment_mode() ) {
|
354 |
+
echo '<div class="cpsw-test-description">';
|
355 |
+
/* translators: %1$1s - %6$6s: HTML Markup */
|
356 |
+
printf( esc_html__( '%1$1s Test Mode Enabled %2$2s : Use demo IBAN number DE89370400440532013000. %3$3s Check more %4$4sDemo IBAN Number%5$5s', 'checkout-plugins-stripe-woo' ), '<b>', '</b>', '</br>', "<a href='https://stripe.com/docs/testing#sepa-direct-debit' referrer='noopener' target='_blank'>", '</a>' );
|
357 |
+
echo '</div>';
|
358 |
+
}
|
359 |
+
|
360 |
+
echo '</div>';
|
361 |
+
|
362 |
+
/**
|
363 |
+
* Action after payment field.
|
364 |
+
*
|
365 |
+
* @since 1.4.0
|
366 |
+
*/
|
367 |
+
do_action( $this->id . '_after_payment_field_checkout' );
|
368 |
+
}
|
369 |
+
|
370 |
+
/**
|
371 |
+
* Tokenize card payment
|
372 |
+
*
|
373 |
+
* @since 1.4.0
|
374 |
+
*
|
375 |
+
* @param int $user_id id of current user placing .
|
376 |
+
* @param object $payment_method payment method object.
|
377 |
+
*
|
378 |
+
* @return object token object.
|
379 |
+
*/
|
380 |
+
public function create_payment_token_for_user( $user_id, $payment_method ) {
|
381 |
+
$token = new Token();
|
382 |
+
$token->set_last4( $payment_method->sepa_debit->last4 );
|
383 |
+
$token->set_gateway_id( $this->id );
|
384 |
+
$token->set_token( $payment_method->id );
|
385 |
+
$token->set_user_id( $user_id );
|
386 |
+
$token->save();
|
387 |
+
|
388 |
+
return $token;
|
389 |
+
}
|
390 |
+
|
391 |
+
/**
|
392 |
+
* Process woocommerce orders after payment is done
|
393 |
+
*
|
394 |
+
* @since 1.4.0
|
395 |
+
*
|
396 |
+
* @param int $order_id wooCommerce order id.
|
397 |
+
*
|
398 |
+
* @return array data to redirect after payment processing.
|
399 |
+
*/
|
400 |
+
public function process_payment( $order_id ) {
|
401 |
+
if ( $this->maybe_change_subscription_payment_method( $order_id ) ) {
|
402 |
+
return $this->process_change_subscription_payment_method( $order_id );
|
403 |
+
}
|
404 |
+
|
405 |
+
if ( $this->is_using_saved_payment_method() ) {
|
406 |
+
return $this->process_payment_with_saved_payment_method( $order_id );
|
407 |
+
}
|
408 |
+
|
409 |
+
try {
|
410 |
+
$order = wc_get_order( $order_id );
|
411 |
+
$customer_id = $this->get_customer_id( $order );
|
412 |
+
$idempotency_key = $order->get_order_key() . time();
|
413 |
+
|
414 |
+
$data = [
|
415 |
+
'amount' => $this->get_formatted_amount( $order->get_total() ),
|
416 |
+
'currency' => $this->get_currency(),
|
417 |
+
'description' => $this->get_order_description( $order ),
|
418 |
+
'metadata' => $this->get_metadata( $order_id ),
|
419 |
+
'payment_method_types' => [ 'sepa_debit' ],
|
420 |
+
'customer' => $customer_id,
|
421 |
+
];
|
422 |
+
|
423 |
+
if ( ! empty( trim( $this->statement_descriptor ) ) ) {
|
424 |
+
$data['statement_descriptor'] = $this->statement_descriptor;
|
425 |
+
}
|
426 |
+
|
427 |
+
if ( $this->should_save_card( $order_id ) ) {
|
428 |
+
$data['setup_future_usage'] = 'off_session';
|
429 |
+
}
|
430 |
+
|
431 |
+
/* translators: %1$1s order id, %2$2s order total amount */
|
432 |
+
Logger::info( sprintf( __( 'Begin processing payment with SEPA for order %1$1s for the amount of %2$2s', 'checkout-plugins-stripe-woo' ), $order_id, $order->get_total() ) );
|
433 |
+
$intent_data = $this->get_payment_intent( $order_id, $idempotency_key, $data );
|
434 |
+
|
435 |
+
if ( $intent_data ) {
|
436 |
+
return [
|
437 |
+
'result' => 'success',
|
438 |
+
'redirect' => false,
|
439 |
+
'intent_secret' => $intent_data['client_secret'],
|
440 |
+
'save_card' => $this->should_save_card( $order_id ),
|
441 |
+
];
|
442 |
+
} else {
|
443 |
+
return [
|
444 |
+
'result' => 'fail',
|
445 |
+
'redirect' => '',
|
446 |
+
];
|
447 |
+
}
|
448 |
+
} catch ( Exception $e ) {
|
449 |
+
Logger::error( $e->getMessage(), true );
|
450 |
+
return new WP_Error( 'order-error', '<div class="woocommerce-error">' . $e->getMessage() . '</div>', [ 'status' => 200 ] );
|
451 |
+
}
|
452 |
+
}
|
453 |
+
|
454 |
+
/**
|
455 |
+
* Verify intent state and redirect.
|
456 |
+
*
|
457 |
+
* @since 1.4.0
|
458 |
+
*
|
459 |
+
* @return void
|
460 |
+
*/
|
461 |
+
public function verify_intent() {
|
462 |
+
$order_id = isset( $_GET['order'] ) ? sanitize_text_field( $_GET['order'] ) : 0; //phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
463 |
+
$order = wc_get_order( $order_id );
|
464 |
+
|
465 |
+
$intent_secret = get_post_meta( $order_id, '_cpsw_intent_secret', true );
|
466 |
+
$stripe_api = new Stripe_Api();
|
467 |
+
$response = $stripe_api->payment_intents( 'retrieve', [ $intent_secret['id'] ] );
|
468 |
+
$intent = $response['success'] ? $response['data'] : false;
|
469 |
+
|
470 |
+
if ( ! $intent ) {
|
471 |
+
return;
|
472 |
+
}
|
473 |
+
|
474 |
+
if ( isset( $_GET['save_card'] ) && '1' === $_GET['save_card'] ) { //phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
475 |
+
$user = $order->get_id() ? $order->get_user() : wp_get_current_user();
|
476 |
+
$user_id = $user->ID;
|
477 |
+
$payment_method = $intent->payment_method;
|
478 |
+
$response = $stripe_api->payment_methods( 'retrieve', [ $payment_method ] );
|
479 |
+
$payment_method = $response['success'] ? $response['data'] : false;
|
480 |
+
$token = $this->create_payment_token_for_user( $user_id, $payment_method );
|
481 |
+
/* translators: %1$1s order id, %2$2s token id */
|
482 |
+
Logger::info( sprintf( __( 'Payment method tokenized for Order id - %1$1s with token id - %2$2s', 'checkout-plugins-stripe-woo' ), $order_id, $token->get_id() ) );
|
483 |
+
$prepared_payment_method = $this->prepare_payment_method( $payment_method, $token );
|
484 |
+
$this->save_payment_method_to_order( $order, $prepared_payment_method );
|
485 |
+
}
|
486 |
+
|
487 |
+
if ( 'succeeded' === $intent->status ) {
|
488 |
+
$redirect_to = $this->process_order( end( $intent->charges->data ), $order_id );
|
489 |
+
$redirect_url = apply_filters( 'cpsw_redirect_order_url', $redirect_to, $order );
|
490 |
+
wp_safe_redirect( $redirect_url );
|
491 |
+
} elseif ( 'pending' === $intent->status || 'processing' === $intent->status ) {
|
492 |
+
$order_stock_reduced = $order->get_meta( '_order_stock_reduced', true );
|
493 |
+
|
494 |
+
if ( ! $order_stock_reduced ) {
|
495 |
+
wc_reduce_stock_levels( $order_id );
|
496 |
+
}
|
497 |
+
|
498 |
+
$order->set_transaction_id( $intent->id );
|
499 |
+
$others_info = __( 'Payment will be completed once payment_intent.succeeded webhook received from Stripe.', 'checkout-plugins-stripe-woo' );
|
500 |
+
|
501 |
+
/* translators: transaction id, other info */
|
502 |
+
$order->update_status( 'on-hold', sprintf( __( 'Stripe charge awaiting payment: %1$s. %2$s', 'checkout-plugins-stripe-woo' ), $intent->id, $others_info ) );
|
503 |
+
$redirect_to = $this->get_return_url( $order );
|
504 |
+
$redirect_url = apply_filters( 'cpsw_redirect_order_url', $redirect_to, $order );
|
505 |
+
wp_safe_redirect( $redirect_url );
|
506 |
+
} elseif ( isset( $response['data']->last_payment_error ) ) {
|
507 |
+
$message = isset( $response['data']->last_payment_error->message ) ? $response['data']->last_payment_error->message : '';
|
508 |
+
|
509 |
+
// translators: %s: payment fail message.
|
510 |
+
wc_add_notice( sprintf( __( 'Payment failed. %s', 'checkout-plugins-stripe-woo' ), $message ), $notice_type = 'error' );
|
511 |
+
wp_safe_redirect( wc_get_checkout_url() );
|
512 |
+
}
|
513 |
+
exit();
|
514 |
+
}
|
515 |
+
|
516 |
+
/**
|
517 |
+
* Modify redirect url
|
518 |
+
*
|
519 |
+
* @since 1.4.0
|
520 |
+
*
|
521 |
+
* @param array $result redirect url array.
|
522 |
+
* @param int $order_id woocommerce order id.
|
523 |
+
*
|
524 |
+
* @return array modified redirect url array.
|
525 |
+
*/
|
526 |
+
public function modify_successful_payment_result( $result, $order_id ) {
|
527 |
+
if ( empty( $order_id ) ) {
|
528 |
+
return $result;
|
529 |
+
}
|
530 |
+
|
531 |
+
$order = wc_get_order( $order_id );
|
532 |
+
|
533 |
+
if ( $this->id !== $order->get_payment_method() ) {
|
534 |
+
return $result;
|
535 |
+
}
|
536 |
+
|
537 |
+
if ( ! isset( $result['intent_secret'] ) ) {
|
538 |
+
return $result;
|
539 |
+
}
|
540 |
+
|
541 |
+
// Put the final thank you page redirect into the verification URL.
|
542 |
+
$verification_url = add_query_arg(
|
543 |
+
[
|
544 |
+
'order' => $order_id,
|
545 |
+
'confirm_payment_nonce' => wp_create_nonce( 'cpsw_confirm_payment_intent' ),
|
546 |
+
'redirect_to' => rawurlencode( $result['redirect'] ),
|
547 |
+
'save_card' => $result['save_card'],
|
548 |
+
],
|
549 |
+
WC_AJAX::get_endpoint( $this->id . '_verify_payment_intent' )
|
550 |
+
);
|
551 |
+
|
552 |
+
// Combine into a hash.
|
553 |
+
$redirect = sprintf( '#confirm-pi-%s:%s:%s', $result['intent_secret'], rawurlencode( $verification_url ), $this->id );
|
554 |
+
|
555 |
+
return [
|
556 |
+
'result' => 'success',
|
557 |
+
'redirect' => $redirect,
|
558 |
+
];
|
559 |
+
}
|
560 |
+
}
|
gateway/stripe/webhook.php
CHANGED
@@ -175,6 +175,8 @@ class Webhook extends Abstract_Payment_Gateway {
|
|
175 |
exit();
|
176 |
}
|
177 |
|
|
|
|
|
178 |
switch ( $event->type ) {
|
179 |
case 'charge.captured':
|
180 |
$charge = $event->data->object;
|
@@ -339,9 +341,13 @@ class Webhook extends Abstract_Payment_Gateway {
|
|
339 |
if ( isset( $charge->refunds->data[0]->balance_transaction ) ) {
|
340 |
$this->update_balance( $order, $charge->refunds->data[0]->balance_transaction );
|
341 |
}
|
|
|
|
|
|
|
342 |
|
|
|
343 |
$refund_time = gmdate( 'Y-m-d H:i:s', time() );
|
344 |
-
$order->add_order_note( __( 'Reason : ', 'checkout-plugins-stripe-woo' ) . $reason . '.<br>' . __( 'Amount : ', 'checkout-plugins-stripe-woo' ) . $amount . '.<br>' . __( 'Status :
|
345 |
Logger::info( $reason . ' : ' . __( 'Amount : ', 'checkout-plugins-stripe-woo' ) . get_woocommerce_currency_symbol() . str_pad( $raw_amount, 2, 0 ) . __( ' Transaction ID : ', 'checkout-plugins-stripe-woo' ) . $refund_id, true );
|
346 |
}
|
347 |
}
|
@@ -426,7 +432,7 @@ class Webhook extends Abstract_Payment_Gateway {
|
|
426 |
$this->make_charge( $intent, $order );
|
427 |
} else {
|
428 |
if ( ! $order->has_status(
|
429 |
-
[ 'pending', 'failed' ],
|
430 |
$order
|
431 |
) ) {
|
432 |
return;
|
@@ -540,7 +546,7 @@ class Webhook extends Abstract_Payment_Gateway {
|
|
540 |
* @return string
|
541 |
* @since 0.0.1
|
542 |
*/
|
543 |
-
public function time_elapsed_string( $datetime, $full = false ) {
|
544 |
$now = new DateTime();
|
545 |
$ago = new DateTime( $datetime );
|
546 |
$diff = $now->diff( $ago );
|
175 |
exit();
|
176 |
}
|
177 |
|
178 |
+
Logger::info( 'intent type: ' . $event->type );
|
179 |
+
|
180 |
switch ( $event->type ) {
|
181 |
case 'charge.captured':
|
182 |
$charge = $event->data->object;
|
341 |
if ( isset( $charge->refunds->data[0]->balance_transaction ) ) {
|
342 |
$this->update_balance( $order, $charge->refunds->data[0]->balance_transaction );
|
343 |
}
|
344 |
+
if ( 'cpsw_stripe' === $order->get_payment_method() ) {
|
345 |
+
return;
|
346 |
+
}
|
347 |
|
348 |
+
$status = 'cpsw_sepa' === $order->get_payment_method() ? __( 'Pending to Success', 'checkout-plugins-stripe-woo' ) : __( 'Success', 'checkout-plugins-stripe-woo' );
|
349 |
$refund_time = gmdate( 'Y-m-d H:i:s', time() );
|
350 |
+
$order->add_order_note( __( 'Reason : ', 'checkout-plugins-stripe-woo' ) . $reason . '.<br>' . __( 'Amount : ', 'checkout-plugins-stripe-woo' ) . $amount . '.<br>' . __( 'Status : ', 'checkout-plugins-stripe-woo' ) . $status . ' [ ' . $refund_time . ' ] <br>' . __( 'Transaction ID : ', 'checkout-plugins-stripe-woo' ) . $refund_id );
|
351 |
Logger::info( $reason . ' : ' . __( 'Amount : ', 'checkout-plugins-stripe-woo' ) . get_woocommerce_currency_symbol() . str_pad( $raw_amount, 2, 0 ) . __( ' Transaction ID : ', 'checkout-plugins-stripe-woo' ) . $refund_id, true );
|
352 |
}
|
353 |
}
|
432 |
$this->make_charge( $intent, $order );
|
433 |
} else {
|
434 |
if ( ! $order->has_status(
|
435 |
+
[ 'pending', 'failed', 'on-hold' ],
|
436 |
$order
|
437 |
) ) {
|
438 |
return;
|
546 |
* @return string
|
547 |
* @since 0.0.1
|
548 |
*/
|
549 |
+
public static function time_elapsed_string( $datetime, $full = false ) {
|
550 |
$now = new DateTime();
|
551 |
$ago = new DateTime( $datetime );
|
552 |
$diff = $now->diff( $ago );
|
gateway/stripe/wechat.php
ADDED
@@ -0,0 +1,198 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* WeChat Gateway
|
4 |
+
*
|
5 |
+
* @package checkout-plugins-stripe-woo
|
6 |
+
* @since 1.4.0
|
7 |
+
*/
|
8 |
+
|
9 |
+
namespace CPSW\Gateway\Stripe;
|
10 |
+
|
11 |
+
use CPSW\Inc\Helper;
|
12 |
+
use CPSW\Inc\Traits\Get_Instance;
|
13 |
+
use CPSW\Gateway\Local_Gateway;
|
14 |
+
|
15 |
+
/**
|
16 |
+
* WeChat
|
17 |
+
*
|
18 |
+
* @since 1.4.0
|
19 |
+
*/
|
20 |
+
class Wechat extends Local_Gateway {
|
21 |
+
|
22 |
+
use Get_Instance;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Gateway id
|
26 |
+
*
|
27 |
+
* @var string
|
28 |
+
*/
|
29 |
+
public $id = 'cpsw_wechat';
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Payment method types
|
33 |
+
*
|
34 |
+
* @var string
|
35 |
+
*/
|
36 |
+
public $payment_method_types = 'wechat_pay';
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Constructor
|
40 |
+
*
|
41 |
+
* @since 1.4.0
|
42 |
+
*/
|
43 |
+
public function __construct() {
|
44 |
+
parent::__construct();
|
45 |
+
|
46 |
+
$this->method_title = __( 'WeChat', 'checkout-plugins-stripe-woo' );
|
47 |
+
$this->method_description = $this->method_description();
|
48 |
+
$this->has_fields = true;
|
49 |
+
|
50 |
+
$this->match_stripe_currency = [ 'cny' ];
|
51 |
+
$this->init_supports();
|
52 |
+
|
53 |
+
$this->init_form_fields();
|
54 |
+
$this->init_settings();
|
55 |
+
// get_option should be called after init_form_fields().
|
56 |
+
$this->title = $this->get_option( 'title' );
|
57 |
+
$this->description = $this->get_option( 'description' );
|
58 |
+
$this->order_button_text = $this->get_option( 'order_button_text' );
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Description for WeChat gateway
|
63 |
+
*
|
64 |
+
* @since 1.4.0
|
65 |
+
*
|
66 |
+
* @return string
|
67 |
+
*/
|
68 |
+
public function method_description() {
|
69 |
+
$payment_description = $this->payment_description();
|
70 |
+
|
71 |
+
return sprintf(
|
72 |
+
/* translators: %1$s: Break, %2$s: Gateway appear message, %3$s: Break, %4$s: Gateway appear message currency wise, %4$s: HTML entities */
|
73 |
+
__( 'Accept payment using WeChat. %1$s %2$s', 'checkout-plugins-stripe-woo' ),
|
74 |
+
'<br/>',
|
75 |
+
$payment_description,
|
76 |
+
);
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Get test mode description for local gateways
|
81 |
+
*
|
82 |
+
* @return string
|
83 |
+
* @since 1.2.0
|
84 |
+
*/
|
85 |
+
public function get_test_mode_description() {
|
86 |
+
/* translators: HTML Entities. */
|
87 |
+
return apply_filters( 'cpsw_local_gateway_test_description', sprintf( esc_html__( '%1$1s%2$2sTest Mode Enabled%3$3s : A QR code will pop up, scan and pay with WeChat.', 'checkout-plugins-stripe-woo' ), '<br/>', '<strong>', '</strong>' ) );
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Returns all supported currencies for this payment method.
|
92 |
+
*
|
93 |
+
* @since 1.4.0
|
94 |
+
*
|
95 |
+
* @return array
|
96 |
+
*/
|
97 |
+
public function get_supported_currency() {
|
98 |
+
return apply_filters(
|
99 |
+
'cpsw_wechat_supported_currencies',
|
100 |
+
[
|
101 |
+
'AUD',
|
102 |
+
'CAD',
|
103 |
+
'CHE',
|
104 |
+
'CNY',
|
105 |
+
'DKK',
|
106 |
+
'EUR',
|
107 |
+
'GBP',
|
108 |
+
'HKD',
|
109 |
+
'JPY',
|
110 |
+
'NOK',
|
111 |
+
'SEK',
|
112 |
+
'SGD',
|
113 |
+
'USD',
|
114 |
+
]
|
115 |
+
);
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Checks whether this gateway is available.
|
120 |
+
*
|
121 |
+
* @since 1.4.0
|
122 |
+
*
|
123 |
+
* @return boolean
|
124 |
+
*/
|
125 |
+
public function is_available() {
|
126 |
+
if ( ! in_array( $this->get_currency(), $this->get_supported_currency(), true ) ) {
|
127 |
+
return false;
|
128 |
+
}
|
129 |
+
|
130 |
+
$default_currency = $this->get_stripe_default_currency();
|
131 |
+
|
132 |
+
if (
|
133 |
+
! empty( $default_currency ) &&
|
134 |
+
! in_array( strtolower( get_woocommerce_currency() ), $default_currency, true )
|
135 |
+
) {
|
136 |
+
return false;
|
137 |
+
}
|
138 |
+
|
139 |
+
return parent::is_available();
|
140 |
+
}
|
141 |
+
|
142 |
+
/**
|
143 |
+
* Creates markup for payment form for card payments
|
144 |
+
*
|
145 |
+
* @since 1.4.0
|
146 |
+
*
|
147 |
+
* @return void
|
148 |
+
*/
|
149 |
+
public function payment_fields() {
|
150 |
+
global $wp;
|
151 |
+
|
152 |
+
$user = wp_get_current_user();
|
153 |
+
$total = WC()->cart->total;
|
154 |
+
|
155 |
+
// If paying from order, we need to get total from order not cart.
|
156 |
+
if ( isset( $_GET['pay_for_order'] ) && ! empty( $_GET['key'] ) ) { // phpcs:ignore
|
157 |
+
$order = wc_get_order( wc_clean( $wp->query_vars['order-pay'] ) );
|
158 |
+
$total = $order->get_total();
|
159 |
+
}
|
160 |
+
|
161 |
+
if ( is_add_payment_method_page() ) {
|
162 |
+
$pay_button_text = __( 'Add Payment', 'checkout-plugins-stripe-woo' );
|
163 |
+
$total = '';
|
164 |
+
} else {
|
165 |
+
$pay_button_text = '';
|
166 |
+
}
|
167 |
+
|
168 |
+
/**
|
169 |
+
* Action before payment field.
|
170 |
+
*
|
171 |
+
* @since 1.4.0
|
172 |
+
*/
|
173 |
+
do_action( $this->id . '_before_payment_field_checkout' );
|
174 |
+
|
175 |
+
echo '<div
|
176 |
+
id="cpsw-wechat-payment-data"
|
177 |
+
data-amount="' . esc_attr( $total ) . '"
|
178 |
+
data-currency="' . esc_attr( strtolower( $this->get_currency() ) ) . '">';
|
179 |
+
|
180 |
+
if ( $this->description ) {
|
181 |
+
echo wp_kses_post( $this->description );
|
182 |
+
}
|
183 |
+
|
184 |
+
echo '</div>';
|
185 |
+
if ( 'test' === Helper::get_payment_mode() ) {
|
186 |
+
echo '<div class="cpsw_stripe_test_description">';
|
187 |
+
echo wp_kses_post( $this->get_test_mode_description() );
|
188 |
+
echo '</div>';
|
189 |
+
}
|
190 |
+
|
191 |
+
/**
|
192 |
+
* Action after payment field.
|
193 |
+
*
|
194 |
+
* @since 1.4.0
|
195 |
+
*/
|
196 |
+
do_action( $this->id . '_after_payment_field_checkout' );
|
197 |
+
}
|
198 |
+
}
|
inc/helper.php
CHANGED
@@ -44,7 +44,7 @@ class Helper {
|
|
44 |
'express_checkout_button_theme' => 'dark',
|
45 |
'express_checkout_button_height' => '40',
|
46 |
'express_checkout_title' => 'Express Checkout',
|
47 |
-
'express_checkout_tagline' => 'Checkout
|
48 |
'express_checkout_product_page_position' => 'above',
|
49 |
'express_checkout_product_sticky_footer' => 'yes',
|
50 |
'express_checkout_separator_product' => 'OR',
|
44 |
'express_checkout_button_theme' => 'dark',
|
45 |
'express_checkout_button_height' => '40',
|
46 |
'express_checkout_title' => 'Express Checkout',
|
47 |
+
'express_checkout_tagline' => 'Checkout faster with one of our express checkout options.',
|
48 |
'express_checkout_product_page_position' => 'above',
|
49 |
'express_checkout_product_sticky_footer' => 'yes',
|
50 |
'express_checkout_separator_product' => 'OR',
|
inc/token.php
ADDED
@@ -0,0 +1,145 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Token helper.
|
4 |
+
*
|
5 |
+
* @package checkout-plugins-stripe-woo
|
6 |
+
*
|
7 |
+
* @since 1.4.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
namespace CPSW\Inc;
|
11 |
+
|
12 |
+
use WC_Payment_Token;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Stripe Payment Token.
|
16 |
+
*
|
17 |
+
* Representation of a payment token for SEPA.
|
18 |
+
*
|
19 |
+
* @class Token
|
20 |
+
*
|
21 |
+
* @since 1.4.0
|
22 |
+
*/
|
23 |
+
class Token extends WC_Payment_Token {
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Stores payment type.
|
27 |
+
*
|
28 |
+
* @var string
|
29 |
+
*/
|
30 |
+
protected $type = 'cpsw_sepa';
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Stores SEPA payment token data.
|
34 |
+
*
|
35 |
+
* @var array
|
36 |
+
*/
|
37 |
+
protected $extra_data = [
|
38 |
+
'last4' => '',
|
39 |
+
'payment_method_type' => 'sepa_debit',
|
40 |
+
];
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Get type to display to user.
|
44 |
+
*
|
45 |
+
* @since 1.4.0
|
46 |
+
*
|
47 |
+
* @param string $deprecated Deprecated.
|
48 |
+
*
|
49 |
+
* @return string
|
50 |
+
*/
|
51 |
+
public function get_display_name( $deprecated = '' ) {
|
52 |
+
$display = sprintf(
|
53 |
+
/* translators: last 4 digits of IBAN account */
|
54 |
+
__( 'SEPA IBAN ending in %s', 'checkout-plugins-stripe-woo' ),
|
55 |
+
$this->get_last4()
|
56 |
+
);
|
57 |
+
|
58 |
+
return $display;
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Hook prefix
|
63 |
+
*
|
64 |
+
* @since 1.4.0
|
65 |
+
*
|
66 |
+
* @return string
|
67 |
+
*/
|
68 |
+
protected function get_hook_prefix() {
|
69 |
+
return 'cpsw_payment_token_sepa_get_';
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Validate SEPA payment tokens.
|
74 |
+
*
|
75 |
+
* These fields are required by all SEPA payment tokens:
|
76 |
+
* last4 - string Last 4 digits of the iBAN.
|
77 |
+
*
|
78 |
+
* @since 1.4.0
|
79 |
+
*
|
80 |
+
* @return boolean True if the passed data is valid
|
81 |
+
*/
|
82 |
+
public function validate() {
|
83 |
+
if ( false === parent::validate() ) {
|
84 |
+
return false;
|
85 |
+
}
|
86 |
+
|
87 |
+
if ( ! $this->get_last4( 'edit' ) ) {
|
88 |
+
return false;
|
89 |
+
}
|
90 |
+
|
91 |
+
return true;
|
92 |
+
}
|
93 |
+
|
94 |
+
/**
|
95 |
+
* Returns the last four digits.
|
96 |
+
*
|
97 |
+
* @since 1.4.0
|
98 |
+
*
|
99 |
+
* @param string $context What the value is for. Valid values are view and edit.
|
100 |
+
*
|
101 |
+
* @return string Last 4 digits
|
102 |
+
*/
|
103 |
+
public function get_last4( $context = 'view' ) {
|
104 |
+
return $this->get_prop( 'last4', $context );
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Set the last four digits.
|
109 |
+
*
|
110 |
+
* @since 1.4.0
|
111 |
+
*
|
112 |
+
* @param string $last4 Last 4 digits card number.
|
113 |
+
*
|
114 |
+
* @return void
|
115 |
+
*/
|
116 |
+
public function set_last4( $last4 ) {
|
117 |
+
$this->set_prop( 'last4', $last4 );
|
118 |
+
}
|
119 |
+
|
120 |
+
/**
|
121 |
+
* Set Stripe payment method type.
|
122 |
+
*
|
123 |
+
* @since 1.4.0
|
124 |
+
*
|
125 |
+
* @param string $type Payment method type.
|
126 |
+
*
|
127 |
+
* @return void
|
128 |
+
*/
|
129 |
+
public function set_payment_method_type( $type ) {
|
130 |
+
$this->set_prop( 'payment_method_type', $type );
|
131 |
+
}
|
132 |
+
|
133 |
+
/**
|
134 |
+
* Returns Stripe payment method type.
|
135 |
+
*
|
136 |
+
* @since 1.4.0
|
137 |
+
*
|
138 |
+
* @param string $context What the value is for. Valid values are view and edit.
|
139 |
+
*
|
140 |
+
* @return string $payment_method_type
|
141 |
+
*/
|
142 |
+
public function get_payment_method_type( $context = 'view' ) {
|
143 |
+
return $this->get_prop( 'payment_method_type', $context );
|
144 |
+
}
|
145 |
+
}
|
inc/traits/subscriptions.php
CHANGED
@@ -13,6 +13,7 @@ use CPSW\Inc\Logger;
|
|
13 |
use WC_Emails;
|
14 |
use WC_Subscriptions_Change_Payment_Gateway;
|
15 |
use Exception;
|
|
|
16 |
|
17 |
/**
|
18 |
* Trait for Subscriptions utility functions.
|
@@ -266,8 +267,13 @@ trait Subscriptions {
|
|
266 |
// The charge was successfully captured.
|
267 |
do_action( 'cpsw_stripe_process_payment', $response, $renewal_order );
|
268 |
|
|
|
|
|
|
|
|
|
269 |
// Use the last charge within the intent or the full response body in case of SEPA.
|
270 |
-
$this->process_response( isset( $response->charges ) ? end( $response->charges->data ) : $response, $renewal_order );
|
|
|
271 |
}
|
272 |
} catch ( Exception $e ) {
|
273 |
Logger::error( $e->getMessage(), true );
|
@@ -285,7 +291,7 @@ trait Subscriptions {
|
|
285 |
* @param WC_Orde $order current order.
|
286 |
* @param Object $source prepared source to be charged.
|
287 |
* @param string $amount amount of order.
|
288 |
-
* @return
|
289 |
*/
|
290 |
public function create_and_confirm_intent_for_off_session( $order, $source, $amount ) {
|
291 |
$order_id = $order->get_id();
|
@@ -293,21 +299,27 @@ trait Subscriptions {
|
|
293 |
$request = [
|
294 |
'amount' => $amount ? $this->get_formatted_amount( $order->get_total() ) : 0,
|
295 |
'currency' => $order->get_currency(),
|
|
|
296 |
'description' => $this->get_order_description( $order ),
|
297 |
-
'payment_method_types' => [ 'card' ],
|
298 |
-
'off_session' => 'true',
|
299 |
-
'confirm' => 'true',
|
300 |
'confirmation_method' => 'automatic',
|
301 |
'customer' => $source->customer,
|
302 |
'metadata' => $this->get_metadata( $order_id ),
|
303 |
'payment_method' => $source->source,
|
304 |
-
'capture_method' => $this->capture_method,
|
305 |
];
|
306 |
|
|
|
|
|
|
|
|
|
|
|
307 |
if ( ! empty( trim( $this->statement_descriptor ) ) ) {
|
308 |
$request['statement_descriptor'] = $this->statement_descriptor;
|
309 |
}
|
310 |
|
|
|
|
|
|
|
|
|
311 |
Logger::info( "Stripe Payment initiated for order $order_id" );
|
312 |
$stripe_api = new Stripe_Api();
|
313 |
$response = $stripe_api->payment_intents( 'create', [ apply_filters( 'cpsw_create_and_confirm_intent_post_data', $request ) ] );
|
@@ -452,7 +464,7 @@ trait Subscriptions {
|
|
452 |
/**
|
453 |
* Don't transfer Stripe customer/token meta to resubscribe orders.
|
454 |
*
|
455 |
-
* @param
|
456 |
*/
|
457 |
public function delete_resubscribe_meta( $resubscribe_order ) {
|
458 |
delete_post_meta( $resubscribe_order->get_id(), '_cpsw_customer_id' );
|
@@ -736,8 +748,12 @@ trait Subscriptions {
|
|
736 |
$stripe_api = new Stripe_Api();
|
737 |
$response = $stripe_api->payment_methods( 'retrieve', [ $stripe_source ] );
|
738 |
$source_object = $response['success'] ? $response['data'] : false;
|
739 |
-
$source_id = $source_object->id;
|
740 |
|
|
|
|
|
|
|
|
|
|
|
741 |
// This checks to see if customer opted to save the payment method to file.
|
742 |
$maybe_saved_card = isset( $_POST[ 'wc-' . $payment_method . '-new-payment-method' ] ) && ! empty( $_POST[ 'wc-' . $payment_method . '-new-payment-method' ] ); //phpcs:ignore WordPress.Security.NonceVerification.Missing
|
743 |
|
13 |
use WC_Emails;
|
14 |
use WC_Subscriptions_Change_Payment_Gateway;
|
15 |
use Exception;
|
16 |
+
use WC_AJAX;
|
17 |
|
18 |
/**
|
19 |
* Trait for Subscriptions utility functions.
|
267 |
// The charge was successfully captured.
|
268 |
do_action( 'cpsw_stripe_process_payment', $response, $renewal_order );
|
269 |
|
270 |
+
if ( $response && 'cpsw_sepa' === $this->id ) {
|
271 |
+
set_transient( 'cpsw_stripe_sepa_client_secret', $response->client_secret, 1 * MINUTE_IN_SECONDS );
|
272 |
+
}
|
273 |
+
|
274 |
// Use the last charge within the intent or the full response body in case of SEPA.
|
275 |
+
$this->process_response( ( isset( $response->charges ) && ! empty( $response->charges->data ) ) ? end( $response->charges->data ) : $response, $renewal_order );
|
276 |
+
|
277 |
}
|
278 |
} catch ( Exception $e ) {
|
279 |
Logger::error( $e->getMessage(), true );
|
291 |
* @param WC_Orde $order current order.
|
292 |
* @param Object $source prepared source to be charged.
|
293 |
* @param string $amount amount of order.
|
294 |
+
* @return object
|
295 |
*/
|
296 |
public function create_and_confirm_intent_for_off_session( $order, $source, $amount ) {
|
297 |
$order_id = $order->get_id();
|
299 |
$request = [
|
300 |
'amount' => $amount ? $this->get_formatted_amount( $order->get_total() ) : 0,
|
301 |
'currency' => $order->get_currency(),
|
302 |
+
'payment_method_types' => [ $this->payment_method_types ],
|
303 |
'description' => $this->get_order_description( $order ),
|
|
|
|
|
|
|
304 |
'confirmation_method' => 'automatic',
|
305 |
'customer' => $source->customer,
|
306 |
'metadata' => $this->get_metadata( $order_id ),
|
307 |
'payment_method' => $source->source,
|
|
|
308 |
];
|
309 |
|
310 |
+
if ( 'cpsw_sepa' !== $this->id ) {
|
311 |
+
$request['off_session'] = 'true';
|
312 |
+
$request['confirm'] = 'true';
|
313 |
+
}
|
314 |
+
|
315 |
if ( ! empty( trim( $this->statement_descriptor ) ) ) {
|
316 |
$request['statement_descriptor'] = $this->statement_descriptor;
|
317 |
}
|
318 |
|
319 |
+
if ( ! empty( $this->capture_method ) ) {
|
320 |
+
$request['capture_method'] = $this->capture_method;
|
321 |
+
}
|
322 |
+
|
323 |
Logger::info( "Stripe Payment initiated for order $order_id" );
|
324 |
$stripe_api = new Stripe_Api();
|
325 |
$response = $stripe_api->payment_intents( 'create', [ apply_filters( 'cpsw_create_and_confirm_intent_post_data', $request ) ] );
|
464 |
/**
|
465 |
* Don't transfer Stripe customer/token meta to resubscribe orders.
|
466 |
*
|
467 |
+
* @param object $resubscribe_order The order created for the customer to resubscribe to the old expired/cancelled subscription.
|
468 |
*/
|
469 |
public function delete_resubscribe_meta( $resubscribe_order ) {
|
470 |
delete_post_meta( $resubscribe_order->get_id(), '_cpsw_customer_id' );
|
748 |
$stripe_api = new Stripe_Api();
|
749 |
$response = $stripe_api->payment_methods( 'retrieve', [ $stripe_source ] );
|
750 |
$source_object = $response['success'] ? $response['data'] : false;
|
|
|
751 |
|
752 |
+
if ( ! $source_object ) {
|
753 |
+
return;
|
754 |
+
}
|
755 |
+
|
756 |
+
$source_id = $source_object->id;
|
757 |
// This checks to see if customer opted to save the payment method to file.
|
758 |
$maybe_saved_card = isset( $_POST[ 'wc-' . $payment_method . '-new-payment-method' ] ) && ! empty( $_POST[ 'wc-' . $payment_method . '-new-payment-method' ] ); //phpcs:ignore WordPress.Security.NonceVerification.Missing
|
759 |
|
languages/checkout-plugins-stripe-woo.pot
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
-
# Copyright (C) 2022
|
2 |
# This file is distributed under the GPLv2 or later.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Checkout Plugins - Stripe for WooCommerce 1.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/checkout-plugins-stripe-woo\n"
|
7 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
8 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
-
"POT-Creation-Date: 2022-
|
13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
"X-Generator: WP-CLI 2.5.0\n"
|
15 |
"X-Domain: checkout-plugins-stripe-woo\n"
|
@@ -27,15 +27,16 @@ msgid "Stripe for WooCommerce delivers a simple, secure way to accept credit car
|
|
27 |
msgstr ""
|
28 |
|
29 |
#. Author of the plugin
|
30 |
-
|
|
|
31 |
msgstr ""
|
32 |
|
33 |
#. Author URI of the plugin
|
34 |
-
msgid "https://
|
35 |
msgstr ""
|
36 |
|
37 |
#: admin/admin-controller.php:79
|
38 |
-
#: admin/admin-controller.php:
|
39 |
msgid "Stripe API Settings"
|
40 |
msgstr ""
|
41 |
|
@@ -44,8 +45,8 @@ msgid "Credit Cards"
|
|
44 |
msgstr ""
|
45 |
|
46 |
#: admin/admin-controller.php:81
|
47 |
-
#: admin/admin-controller.php:
|
48 |
-
#: wizard/build/app.js:
|
49 |
msgid "Express Checkout"
|
50 |
msgstr ""
|
51 |
|
@@ -65,531 +66,542 @@ msgid "Klarna"
|
|
65 |
msgstr ""
|
66 |
|
67 |
#: admin/admin-controller.php:85
|
|
|
|
|
|
|
|
|
|
|
68 |
#: gateway/stripe/p24.php:45
|
69 |
msgid "Przelewy24"
|
70 |
msgstr ""
|
71 |
|
72 |
-
#: admin/admin-controller.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
msgid "Something went wrong! Please reload the page and try again."
|
74 |
msgstr ""
|
75 |
|
76 |
-
#: admin/admin-controller.php:
|
77 |
-
#: admin/admin-controller.php:
|
78 |
msgid "Connect to Stripe"
|
79 |
msgstr ""
|
80 |
|
81 |
-
#: admin/admin-controller.php:
|
82 |
msgid "Please enter all keys to connect to stripe."
|
83 |
msgstr ""
|
84 |
|
85 |
-
#: admin/admin-controller.php:
|
86 |
msgid "You must enter your API keys or connect the plugin before performing a connection test. Mode:"
|
87 |
msgstr ""
|
88 |
|
89 |
-
#: admin/admin-controller.php:
|
90 |
msgid "Keys Unavailable."
|
91 |
msgstr ""
|
92 |
|
93 |
-
#: admin/admin-controller.php:
|
94 |
msgid "Your Stripe account has been disconnected."
|
95 |
msgstr ""
|
96 |
|
97 |
-
#: admin/admin-controller.php:
|
98 |
msgid "You can connect other Stripe account now."
|
99 |
msgstr ""
|
100 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
#. translators: Html Markup
|
102 |
-
#: admin/admin-controller.php:
|
103 |
msgid "No payment method detected. Either your browser is not supported or you do not have save cards. For more details read %1$1sdocument$2$2s."
|
104 |
msgstr ""
|
105 |
|
|
|
|
|
|
|
|
|
106 |
#. translators: %1$1s HTML Markup
|
107 |
-
#: admin/admin-controller.php:
|
108 |
msgid "You Stripe Publishable and Secret Keys are not set correctly. You can connect to Stripe and correct them from <a href=\"%1$1s\">here.</a>"
|
109 |
msgstr ""
|
110 |
|
111 |
-
#: admin/admin-controller.php:
|
112 |
-
#: admin/admin-controller.php:
|
113 |
msgid "Stripe Connect"
|
114 |
msgstr ""
|
115 |
|
116 |
-
#: admin/admin-controller.php:
|
117 |
-
#: admin/admin-controller.php:
|
118 |
-
#: admin/admin-controller.php:
|
119 |
msgid "Hide API keys"
|
120 |
msgstr ""
|
121 |
|
122 |
-
#: admin/admin-controller.php:
|
123 |
-
#: admin/admin-controller.php:
|
124 |
-
#: admin/admin-controller.php:
|
125 |
-
#: wizard/build/app.js:
|
126 |
msgid "Manage API keys manually"
|
127 |
msgstr ""
|
128 |
|
129 |
#. translators: %1$1s: mode, %2$2s, %3$3s: HTML Markup
|
130 |
-
#: admin/admin-controller.php:
|
131 |
msgid "Stripe Keys for %1$1s mode are not set correctly. Reconnect via %2$2s or %3$3s"
|
132 |
msgstr ""
|
133 |
|
134 |
-
#: admin/admin-controller.php:
|
135 |
msgid "No SSL was detected, Stripe live mode requires SSL."
|
136 |
msgstr ""
|
137 |
|
138 |
-
#: admin/admin-controller.php:
|
139 |
msgid "Your Stripe account has been connected to your WooCommerce store. You may now accept payments in live and test mode."
|
140 |
msgstr ""
|
141 |
|
142 |
-
#: admin/admin-controller.php:
|
143 |
msgid "We were not able to connect your Stripe account. Please try again. "
|
144 |
msgstr ""
|
145 |
|
146 |
-
#: admin/admin-controller.php:
|
147 |
-
#: admin/admin-controller.php:
|
148 |
-
#: admin/admin-controller.php:
|
149 |
msgid "Error: The current user doesn’t have sufficient permissions to perform this action. Please reload the page and try again."
|
150 |
msgstr ""
|
151 |
|
152 |
-
#: admin/admin-controller.php:
|
153 |
-
#: admin/admin-controller.php:
|
154 |
-
#: wizard/build/app.js:
|
155 |
msgid "Connect with Stripe"
|
156 |
msgstr ""
|
157 |
|
158 |
-
#: admin/admin-controller.php:
|
159 |
-
#: admin/admin-controller.php:
|
160 |
-
#: admin/admin-controller.php:
|
161 |
msgid "We make it easy to connect Stripe to your site. Click the Connect button to go through our connect flow."
|
162 |
msgstr ""
|
163 |
|
164 |
#. translators: %1$1s, %2$2s: HTML Markup
|
165 |
-
#: admin/admin-controller.php:
|
166 |
msgid "Have questions about connecting with Stripe? Read %1$s document. %2$s"
|
167 |
msgstr ""
|
168 |
|
169 |
-
#: admin/admin-controller.php:
|
170 |
-
msgid "Although you can add your API keys manually, we recommend using Stripe Connect. Stripe Connect prevents issues that can arise when copying and pasting account details from Stripe into Stripe
|
171 |
msgstr ""
|
172 |
|
173 |
#. translators: %1$1s %2$2s %3$3s: HTML Markup
|
174 |
-
#: admin/admin-controller.php:
|
175 |
msgid "Your manually managed API keys are valid."
|
176 |
msgstr ""
|
177 |
|
178 |
-
#: admin/admin-controller.php:
|
179 |
msgid "It is highly recommended to Connect with Stripe for easier setup and improved security."
|
180 |
msgstr ""
|
181 |
|
182 |
#. translators: $1s Acoount name, $2s html markup, $3s account id, $4s html markup
|
183 |
-
#: admin/admin-controller.php:
|
184 |
msgid "Account (%1$1s) %2$2s %3$3s %4$4s is connected."
|
185 |
msgstr ""
|
186 |
|
187 |
-
#: admin/admin-controller.php:
|
188 |
msgid "Disconnect & connect other account?"
|
189 |
msgstr ""
|
190 |
|
191 |
-
#: admin/admin-controller.php:
|
192 |
msgid "Test Connection"
|
193 |
msgstr ""
|
194 |
|
195 |
-
#: admin/admin-controller.php:
|
196 |
-
msgid "Although you can add your API keys manually, we recommend using Stripe Connect: an easier and more secure way of connecting your Stripe account to your website. Stripe Connect prevents issues that can arise when copying and pasting account details from Stripe into your Stripe
|
197 |
msgstr ""
|
198 |
|
199 |
-
#: admin/admin-controller.php:
|
200 |
msgid "Clear all Stripe account keys"
|
201 |
msgstr ""
|
202 |
|
203 |
-
#: admin/admin-controller.php:
|
204 |
-
#: admin/admin-controller.php:
|
205 |
msgid "Re-Connect to Stripe"
|
206 |
msgstr ""
|
207 |
|
208 |
-
#: admin/admin-controller.php:
|
209 |
-
#: admin/admin-controller.php:
|
210 |
msgid "Your Stripe account has been connected. You can now accept Live and Test payments. You can Re-Connect if you want to recycle your API keys for security."
|
211 |
msgstr ""
|
212 |
|
213 |
-
#: admin/admin-controller.php:
|
214 |
msgid "Connect Manually"
|
215 |
msgstr ""
|
216 |
|
217 |
-
#: admin/admin-controller.php:
|
218 |
msgid "Stripe"
|
219 |
msgstr ""
|
220 |
|
221 |
-
#: admin/admin-controller.php:
|
222 |
msgid "Connection Status"
|
223 |
msgstr ""
|
224 |
|
225 |
-
#: admin/admin-controller.php:
|
226 |
-
#: admin/admin-controller.php:
|
227 |
msgid "This is your Stripe Connect ID and serves as a unique identifier."
|
228 |
msgstr ""
|
229 |
|
230 |
-
#: admin/admin-controller.php:
|
231 |
msgid "Stripe Account Keys"
|
232 |
msgstr ""
|
233 |
|
234 |
-
#: admin/admin-controller.php:
|
235 |
msgid "This will disable any connection to Stripe."
|
236 |
msgstr ""
|
237 |
|
238 |
-
#: admin/admin-controller.php:
|
239 |
msgid "Connect Stripe Account"
|
240 |
msgstr ""
|
241 |
|
242 |
-
#: admin/admin-controller.php:
|
243 |
msgid "Live Publishable Key"
|
244 |
msgstr ""
|
245 |
|
246 |
-
#: admin/admin-controller.php:
|
247 |
-
#: admin/admin-controller.php:
|
248 |
msgid "Your publishable key is used to initialize Stripe assets."
|
249 |
msgstr ""
|
250 |
|
251 |
-
#: admin/admin-controller.php:
|
252 |
msgid "Live Secret Key"
|
253 |
msgstr ""
|
254 |
|
255 |
-
#: admin/admin-controller.php:
|
256 |
msgid "Your secret key is used to authenticate Stripe requests."
|
257 |
msgstr ""
|
258 |
|
259 |
-
#: admin/admin-controller.php:
|
260 |
msgid "Test Publishable Key"
|
261 |
msgstr ""
|
262 |
|
263 |
-
#: admin/admin-controller.php:
|
264 |
msgid "Your test publishable key is used to initialize Stripe assets."
|
265 |
msgstr ""
|
266 |
|
267 |
-
#: admin/admin-controller.php:
|
268 |
msgid "Test Secret Key"
|
269 |
msgstr ""
|
270 |
|
271 |
-
#: admin/admin-controller.php:
|
272 |
msgid "Your test secret key is used to authenticate Stripe requests for testing purposes."
|
273 |
msgstr ""
|
274 |
|
275 |
-
#: admin/admin-controller.php:
|
276 |
msgid "Mode"
|
277 |
msgstr ""
|
278 |
|
279 |
-
#: admin/admin-controller.php:
|
280 |
msgid "No live transactions are processed in test mode. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing."
|
281 |
msgstr ""
|
282 |
|
283 |
-
#: admin/admin-controller.php:
|
284 |
msgid "Webhook URL"
|
285 |
msgstr ""
|
286 |
|
287 |
#. translators: %1$1s - %2$2s HTML markup
|
288 |
-
#: admin/admin-controller.php:
|
289 |
msgid "Important: the webhook URL is called by Stripe when events occur in your account, like a source becomes chargeable. %1$1sWebhook Guide%2$2s"
|
290 |
msgstr ""
|
291 |
|
292 |
-
#: admin/admin-controller.php:
|
293 |
msgid "Live Webhook Secret"
|
294 |
msgstr ""
|
295 |
|
296 |
#. translators: %1$1s Webhook Status
|
297 |
-
#: admin/admin-controller.php:
|
298 |
-
#: admin/admin-controller.php:
|
299 |
msgid "The webhook secret is used to authenticate webhooks sent from Stripe. It ensures nobody else can send you events pretending to be Stripe. %1$1s"
|
300 |
msgstr ""
|
301 |
|
302 |
-
#: admin/admin-controller.php:
|
303 |
msgid "Test Webhook Secret"
|
304 |
msgstr ""
|
305 |
|
306 |
-
#: admin/admin-controller.php:
|
307 |
msgid "Debug Log"
|
308 |
msgstr ""
|
309 |
|
310 |
-
#: admin/admin-controller.php:
|
311 |
msgid "Log debug messages"
|
312 |
msgstr ""
|
313 |
|
314 |
-
#: admin/admin-controller.php:
|
315 |
msgid "Please try again."
|
316 |
msgstr ""
|
317 |
|
318 |
-
#: admin/admin-controller.php:
|
319 |
-
#: admin/admin-controller.php:
|
320 |
msgid "Error: Sorry, the nonce security check didn’t pass. Please reload the page and try again."
|
321 |
msgstr ""
|
322 |
|
323 |
-
#: admin/admin-controller.php:
|
324 |
-
#: admin/admin-controller.php:
|
325 |
msgid "Test Mode:"
|
326 |
msgstr ""
|
327 |
|
328 |
-
#: admin/admin-controller.php:
|
329 |
msgid "Please enter secret key to test."
|
330 |
msgstr ""
|
331 |
|
332 |
-
#: admin/admin-controller.php:
|
333 |
-
#: admin/admin-controller.php:
|
334 |
msgid "Live Mode:"
|
335 |
msgstr ""
|
336 |
|
337 |
-
#: admin/admin-controller.php:
|
338 |
msgid "Please enter secret key to live."
|
339 |
msgstr ""
|
340 |
|
341 |
-
#: admin/admin-controller.php:
|
342 |
msgid "Error: Empty String provided for keys"
|
343 |
msgstr ""
|
344 |
|
345 |
#. translators: %1$1s mode
|
346 |
-
#: admin/admin-controller.php:
|
347 |
msgid "My first %1s customer (created for API docs)"
|
348 |
msgstr ""
|
349 |
|
350 |
-
#: admin/admin-controller.php:
|
351 |
msgid "Connected to Stripe successfully"
|
352 |
msgstr ""
|
353 |
|
354 |
-
#: admin/admin-controller.php:
|
355 |
msgid "Stripe keys are reset successfully."
|
356 |
msgstr ""
|
357 |
|
358 |
-
#: admin/admin-controller.php:
|
359 |
-
#: inc/traits/subscriptions.php:
|
360 |
msgid "Invalid Nonce"
|
361 |
msgstr ""
|
362 |
|
363 |
-
#: admin/admin-controller.php:
|
364 |
msgid "My First Test Customer (created for API docs)"
|
365 |
msgstr ""
|
366 |
|
367 |
-
#: admin/admin-controller.php:
|
368 |
msgid "My First Live Customer (created for API docs)"
|
369 |
msgstr ""
|
370 |
|
371 |
-
#: admin/admin-controller.php:
|
372 |
msgid "Express Checkout is a feature of Card Payments. Enable Card Payments to use Express Checkout"
|
373 |
msgstr ""
|
374 |
|
375 |
#. translators: HTML Markup
|
376 |
-
#: admin/admin-controller.php:
|
377 |
msgid "Accept payment using Apple Pay, Google Pay, Browser Payment Method.%1$1sExpress Checkout uses Payment Request API which is based on client's browser and saved cards.%1$1sPlease check %2$2sprerequisite%3$3s for Apple Pay, Google Pay and Browser Payment Method."
|
378 |
msgstr ""
|
379 |
|
380 |
-
#: admin/admin-controller.php:
|
381 |
-
#: wizard/build/app.js:
|
382 |
msgid "Enable Express Checkout"
|
383 |
msgstr ""
|
384 |
|
385 |
-
#: admin/admin-controller.php:
|
386 |
msgid "Show button on"
|
387 |
msgstr ""
|
388 |
|
389 |
-
#: admin/admin-controller.php:
|
390 |
msgid "Choose page to display Express Checkout buttons."
|
391 |
msgstr ""
|
392 |
|
393 |
-
#: admin/admin-controller.php:
|
394 |
msgid "Product"
|
395 |
msgstr ""
|
396 |
|
397 |
-
#: admin/admin-controller.php:
|
398 |
msgid "Cart"
|
399 |
msgstr ""
|
400 |
|
401 |
-
#: admin/admin-controller.php:
|
402 |
msgid "Checkout"
|
403 |
msgstr ""
|
404 |
|
405 |
-
#: admin/admin-controller.php:
|
406 |
-
msgid "Button
|
407 |
-
msgstr ""
|
408 |
-
|
409 |
-
#: admin/admin-controller.php:1459
|
410 |
-
msgid "Select label for Express Checkout button. Unfortunately, we can't customize the label because of the restrictions from Stripe."
|
411 |
-
msgstr ""
|
412 |
-
|
413 |
-
#: admin/admin-controller.php:1462
|
414 |
-
#: gateway/stripe/card-payments.php:174
|
415 |
-
msgid "Default"
|
416 |
-
msgstr ""
|
417 |
-
|
418 |
-
#: admin/admin-controller.php:1463
|
419 |
-
msgid "Book"
|
420 |
-
msgstr ""
|
421 |
-
|
422 |
-
#: admin/admin-controller.php:1464
|
423 |
-
msgid "Buy"
|
424 |
msgstr ""
|
425 |
|
426 |
-
#: admin/admin-controller.php:
|
427 |
-
msgid "
|
428 |
msgstr ""
|
429 |
|
430 |
-
#: admin/admin-controller.php:
|
431 |
msgid "Button theme"
|
432 |
msgstr ""
|
433 |
|
434 |
-
#: admin/admin-controller.php:
|
435 |
msgid "Select theme for Express Checkout button."
|
436 |
msgstr ""
|
437 |
|
438 |
-
#: admin/admin-controller.php:
|
439 |
msgid "Dark"
|
440 |
msgstr ""
|
441 |
|
442 |
-
#: admin/admin-controller.php:
|
443 |
msgid "Light"
|
444 |
msgstr ""
|
445 |
|
446 |
-
#: admin/admin-controller.php:
|
447 |
msgid "Light Outline"
|
448 |
msgstr ""
|
449 |
|
450 |
-
#: admin/admin-controller.php:
|
451 |
-
msgid "Button height"
|
452 |
-
msgstr ""
|
453 |
-
|
454 |
-
#: admin/admin-controller.php:1486
|
455 |
-
msgid "Select height for Express Checkout button (in px). Button height can be between 35px to 60px. Default height 40px."
|
456 |
-
msgstr ""
|
457 |
-
|
458 |
-
#: admin/admin-controller.php:1491
|
459 |
-
#: admin/admin-controller.php:1621
|
460 |
-
msgid "Separator text"
|
461 |
-
msgstr ""
|
462 |
-
|
463 |
-
#: admin/admin-controller.php:1494
|
464 |
-
msgid "Add separator text for the Express Checkout button. This will help to distinguish between Express Checkout and other buttons."
|
465 |
-
msgstr ""
|
466 |
-
|
467 |
-
#: admin/admin-controller.php:1499
|
468 |
msgid "Button Preview"
|
469 |
msgstr ""
|
470 |
|
471 |
-
#: admin/admin-controller.php:
|
472 |
msgid "Product page options"
|
473 |
msgstr ""
|
474 |
|
475 |
-
#: admin/admin-controller.php:
|
476 |
msgid "Advanced customization options for product page."
|
477 |
msgstr ""
|
478 |
|
479 |
-
#: admin/admin-controller.php:
|
480 |
-
#: admin/admin-controller.php:
|
481 |
-
msgid "Advanced options"
|
482 |
-
msgstr ""
|
483 |
-
|
484 |
-
#: admin/admin-controller.php:1520
|
485 |
-
#: admin/admin-controller.php:1567
|
486 |
msgid "Button position"
|
487 |
msgstr ""
|
488 |
|
489 |
-
#: admin/admin-controller.php:
|
490 |
msgid "Select the position of Express Checkout button. This option will work only for Product page."
|
491 |
msgstr ""
|
492 |
|
493 |
-
#: admin/admin-controller.php:
|
494 |
msgid "Above Add to Cart"
|
495 |
msgstr ""
|
496 |
|
497 |
-
#: admin/admin-controller.php:
|
498 |
msgid "Below Add to Cart"
|
499 |
msgstr ""
|
500 |
|
501 |
-
#: admin/admin-controller.php:
|
502 |
-
|
503 |
-
msgid "Button width"
|
504 |
msgstr ""
|
505 |
|
506 |
-
#: admin/admin-controller.php:
|
507 |
-
#: admin/admin-controller.php:
|
508 |
-
|
|
|
509 |
msgstr ""
|
510 |
|
511 |
-
#: admin/admin-controller.php:
|
|
|
|
|
|
|
|
|
512 |
msgid "Responsive behaviour"
|
513 |
msgstr ""
|
514 |
|
515 |
#. translators: HTML Markup
|
516 |
-
#: admin/admin-controller.php:
|
517 |
msgid "If checked the Express Checkout button will stick%1$1sat bottom of screen on responsive devices."
|
518 |
msgstr ""
|
519 |
|
520 |
-
#: admin/admin-controller.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
521 |
msgid "Checkout page options"
|
522 |
msgstr ""
|
523 |
|
524 |
-
#: admin/admin-controller.php:
|
525 |
msgid "Advanced customization options for Checkout page."
|
526 |
msgstr ""
|
527 |
|
528 |
-
#: admin/admin-controller.php:
|
529 |
msgid "Select the position of Express Checkout button. This option will work only for Checkout page."
|
530 |
msgstr ""
|
531 |
|
532 |
-
#: admin/admin-controller.php:
|
533 |
msgid "Above checkout form"
|
534 |
msgstr ""
|
535 |
|
536 |
-
#: admin/admin-controller.php:
|
537 |
msgid "Above billing details"
|
538 |
msgstr ""
|
539 |
|
540 |
-
#: admin/admin-controller.php:
|
541 |
-
#: gateway/local-gateway.php:
|
542 |
-
#: gateway/stripe/card-payments.php:
|
543 |
msgid "Title"
|
544 |
msgstr ""
|
545 |
|
546 |
-
#: admin/admin-controller.php:
|
547 |
msgid "Add a title above Express Checkout button on Checkout page."
|
548 |
msgstr ""
|
549 |
|
550 |
-
#: admin/admin-controller.php:
|
551 |
msgid "Tagline"
|
552 |
msgstr ""
|
553 |
|
554 |
-
#: admin/admin-controller.php:
|
555 |
msgid "Add a tagline below the title on Checkout page."
|
556 |
msgstr ""
|
557 |
|
558 |
-
#: admin/admin-controller.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
559 |
msgid "Alignment"
|
560 |
msgstr ""
|
561 |
|
562 |
-
#: admin/admin-controller.php:
|
563 |
msgid "This setting will align title, tagline and button based on selection on Checkout page."
|
564 |
msgstr ""
|
565 |
|
566 |
-
#: admin/admin-controller.php:
|
567 |
msgid "Left"
|
568 |
msgstr ""
|
569 |
|
570 |
-
#: admin/admin-controller.php:
|
571 |
msgid "Center"
|
572 |
msgstr ""
|
573 |
|
574 |
-
#: admin/admin-controller.php:
|
575 |
msgid "Right"
|
576 |
msgstr ""
|
577 |
|
578 |
-
#: admin/admin-controller.php:
|
579 |
msgid "Add separator text for Checkout page. If empty will show default separator text."
|
580 |
msgstr ""
|
581 |
|
582 |
-
#: autoloader.php:
|
583 |
msgid "Settings"
|
584 |
msgstr ""
|
585 |
|
586 |
-
#: autoloader.php:
|
587 |
msgid "Documentation"
|
588 |
msgstr ""
|
589 |
|
590 |
#. translators: 1$-2$: opening and closing <strong> tags, 3$-4$: link tags, takes to woocommerce plugin on wp.org, 5$-6$: opening and closing link tags, leads to plugins.php in admin.
|
591 |
-
#: autoloader.php:
|
592 |
-
msgid "%1$
|
593 |
msgstr ""
|
594 |
|
595 |
#. translators: 1 - 4 html entities
|
@@ -618,246 +630,272 @@ msgstr ""
|
|
618 |
msgid "%1$1sApple Pay domain verification failed! %2$2sReason%3$3s: %4$4s"
|
619 |
msgstr ""
|
620 |
|
621 |
-
#: gateway/abstract-payment-gateway.php:
|
622 |
msgid "Order "
|
623 |
msgstr ""
|
624 |
|
625 |
-
#: gateway/abstract-payment-gateway.php:262
|
626 |
-
#: gateway/abstract-payment-gateway.php:263
|
627 |
#: gateway/abstract-payment-gateway.php:266
|
628 |
-
#: gateway/
|
|
|
|
|
629 |
msgid "Reason : "
|
630 |
msgstr ""
|
631 |
|
632 |
-
#: gateway/abstract-payment-gateway.php:262
|
633 |
-
#: gateway/abstract-payment-gateway.php:263
|
634 |
#: gateway/abstract-payment-gateway.php:266
|
635 |
-
#: gateway/
|
636 |
-
#: gateway/
|
|
|
|
|
637 |
msgid "Amount : "
|
638 |
msgstr ""
|
639 |
|
640 |
-
#: gateway/abstract-payment-gateway.php:
|
641 |
-
#: gateway/abstract-payment-gateway.php:
|
|
|
642 |
msgid "Status : "
|
643 |
msgstr ""
|
644 |
|
645 |
-
#: gateway/abstract-payment-gateway.php:
|
646 |
-
#: gateway/abstract-payment-gateway.php:
|
647 |
-
#: gateway/stripe/webhook.php:
|
648 |
msgid "Transaction ID : "
|
649 |
msgstr ""
|
650 |
|
651 |
-
#: gateway/abstract-payment-gateway.php:
|
652 |
msgid "Refund initiated: "
|
653 |
msgstr ""
|
654 |
|
655 |
-
#: gateway/abstract-payment-gateway.php:
|
|
|
|
|
|
|
|
|
656 |
msgid " Status : Failed "
|
657 |
msgstr ""
|
658 |
|
659 |
-
|
660 |
-
#: gateway/
|
661 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
|
|
662 |
msgstr ""
|
663 |
|
664 |
#. translators: transaction id
|
665 |
-
#: gateway/abstract-payment-gateway.php:
|
666 |
-
#: gateway/stripe/webhook.php:
|
667 |
msgid "Stripe charge complete (Charge ID: %s)"
|
668 |
msgstr ""
|
669 |
|
670 |
-
#: gateway/abstract-payment-gateway.php:
|
671 |
msgid "Payment processing failed. Please retry."
|
672 |
msgstr ""
|
673 |
|
674 |
#. translators: transaction id
|
675 |
-
#: gateway/abstract-payment-gateway.php:
|
676 |
msgid "Stripe charge authorized (Charge ID: %s). Process order to take payment, or cancel to remove the pre-authorization. Attempting to refund the order in part or in full will release the authorization and cancel the payment."
|
677 |
msgstr ""
|
678 |
|
679 |
-
#: gateway/abstract-payment-gateway.php:
|
680 |
msgid "An error has occurred internally, due to which you are not redirected to the order received page."
|
681 |
msgstr ""
|
682 |
|
683 |
-
#: gateway/abstract-payment-gateway.php:
|
684 |
-
#: gateway/abstract-payment-gateway.php:
|
685 |
msgid "Uncaptured Amount cannot be refunded"
|
686 |
msgstr ""
|
687 |
|
688 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
689 |
msgid "Fee charged by stripe for this order."
|
690 |
msgstr ""
|
691 |
|
692 |
-
#: gateway/abstract-payment-gateway.php:
|
693 |
msgid "Stripe Fee:"
|
694 |
msgstr ""
|
695 |
|
696 |
-
#: gateway/abstract-payment-gateway.php:
|
697 |
msgid "Net amount that will be credited to your Stripe bank account."
|
698 |
msgstr ""
|
699 |
|
700 |
-
#: gateway/abstract-payment-gateway.php:
|
701 |
msgid "Stripe Payout:"
|
702 |
msgstr ""
|
703 |
|
704 |
-
#: gateway/abstract-payment-gateway.php:
|
705 |
msgid "Unable to update stripe transaction balance"
|
706 |
msgstr ""
|
707 |
|
708 |
#. translators: %s: except countries.
|
709 |
-
#: gateway/local-gateway.php:
|
710 |
msgid " & billing country is not <strong>%s</strong>"
|
711 |
msgstr ""
|
712 |
|
713 |
#. translators: %s: specificcountries.
|
714 |
-
#: gateway/local-gateway.php:
|
715 |
msgid " & billing country is <strong>%s</strong>"
|
716 |
msgstr ""
|
717 |
|
718 |
#. translators: %s: Method title.
|
719 |
-
#: gateway/local-gateway.php:
|
720 |
msgid "Enable %s"
|
721 |
msgstr ""
|
722 |
|
723 |
#. translators: %s: Method title.
|
724 |
-
#: gateway/local-gateway.php:
|
725 |
msgid "Title of the %s gateway."
|
726 |
msgstr ""
|
727 |
|
728 |
-
#: gateway/local-gateway.php:
|
729 |
-
#: gateway/stripe/card-payments.php:
|
730 |
msgid "Description"
|
731 |
msgstr ""
|
732 |
|
733 |
#. translators: gateway title
|
734 |
-
#: gateway/local-gateway.php:
|
735 |
msgid "Description of the %1s gateway."
|
736 |
msgstr ""
|
737 |
|
738 |
-
#: gateway/local-gateway.php:
|
739 |
msgid "Order button label"
|
740 |
msgstr ""
|
741 |
|
742 |
-
#: gateway/local-gateway.php:
|
743 |
msgid "Customize label for order button."
|
744 |
msgstr ""
|
745 |
|
746 |
#. translators: %s: Method title.
|
747 |
-
#: gateway/local-gateway.php:
|
748 |
msgid "Pay with %s"
|
749 |
msgstr ""
|
750 |
|
751 |
-
#: gateway/local-gateway.php:
|
752 |
msgid "Selling location(s)"
|
753 |
msgstr ""
|
754 |
|
755 |
#. translators: gateway title
|
756 |
-
#: gateway/local-gateway.php:
|
757 |
msgid "Choose the countries where you wish to display the %1$s gateway. The gateway will appear when the customer's billing country is in the chosen countries."
|
758 |
msgstr ""
|
759 |
|
760 |
-
#: gateway/local-gateway.php:
|
761 |
msgid "Sell to all countries"
|
762 |
msgstr ""
|
763 |
|
764 |
-
#: gateway/local-gateway.php:
|
765 |
-
#: gateway/local-gateway.php:
|
766 |
msgid "Sell to all countries, except for…"
|
767 |
msgstr ""
|
768 |
|
769 |
-
#: gateway/local-gateway.php:
|
770 |
-
#: gateway/local-gateway.php:
|
771 |
msgid "Sell to specific countries"
|
772 |
msgstr ""
|
773 |
|
774 |
-
#: gateway/local-gateway.php:
|
775 |
msgid "When the billing country matches one of these values, the payment method will be hidden on the Checkout page."
|
776 |
msgstr ""
|
777 |
|
778 |
-
#: gateway/local-gateway.php:
|
779 |
msgid "When the billing country matches one of these values, the payment method will be shown on the Checkout page."
|
780 |
msgstr ""
|
781 |
|
782 |
-
#: gateway/local-gateway.php:
|
783 |
msgid "Choose countries / regions…"
|
784 |
msgstr ""
|
785 |
|
786 |
-
#: gateway/local-gateway.php:
|
787 |
msgid "Country / Region"
|
788 |
msgstr ""
|
789 |
|
790 |
-
#: gateway/local-gateway.php:
|
791 |
msgid "Select all"
|
792 |
msgstr ""
|
793 |
|
794 |
-
#: gateway/local-gateway.php:
|
795 |
msgid "Select none"
|
796 |
msgstr ""
|
797 |
|
798 |
-
|
799 |
-
#:
|
800 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
801 |
msgstr ""
|
802 |
|
803 |
#. translators: %1$s Payment method, %2$s List of supported currencies
|
804 |
-
#: gateway/local-gateway.php:
|
805 |
msgid "%1$s is enabled - it requires store currency to be set to %2$s."
|
806 |
msgstr ""
|
807 |
|
|
|
|
|
|
|
|
|
|
|
808 |
#. translators: %s: supported currency.
|
809 |
-
#: gateway/local-gateway.php:
|
810 |
msgid "This gateway will appear when store currency is <strong>%s</strong>."
|
811 |
msgstr ""
|
812 |
|
813 |
#. translators: HTML Entities.
|
814 |
-
#: gateway/local-gateway.php:
|
815 |
-
msgid "%1$
|
816 |
msgstr ""
|
817 |
|
818 |
#. translators: %1$1s method title, %2$2s order id, %3$3s order total amount
|
819 |
-
#: gateway/local-gateway.php:
|
820 |
msgid "Begin processing payment with %1$1s for order %2$2s for the amount of %3$3s"
|
821 |
msgstr ""
|
822 |
|
823 |
-
#: gateway/local-gateway.php:
|
824 |
msgid "Contact seller. "
|
825 |
msgstr ""
|
826 |
|
827 |
-
#: gateway/local-gateway.php:
|
828 |
msgid "Store currency doesn't match stripe currency. "
|
829 |
msgstr ""
|
830 |
|
831 |
-
#. translators: order id
|
832 |
-
#: gateway/local-gateway.php:552
|
833 |
-
#: gateway/stripe/card-payments.php:637
|
834 |
-
msgid "Payment successful Order id - %1s"
|
835 |
-
msgstr ""
|
836 |
-
|
837 |
-
#. translators: transaction id
|
838 |
-
#: gateway/local-gateway.php:556
|
839 |
-
#: gateway/stripe/card-payments.php:641
|
840 |
-
msgid "Charge authorized (Charge ID: %s). Process order to take payment, or cancel to remove the pre-authorization. Attempting to refund the order in part or in full will release the authorization and cancel the payment."
|
841 |
-
msgstr ""
|
842 |
-
|
843 |
-
#. translators: transaction id
|
844 |
-
#: gateway/local-gateway.php:558
|
845 |
-
#: gateway/stripe/card-payments.php:643
|
846 |
-
msgid "Charge authorized Order id - %1s"
|
847 |
-
msgstr ""
|
848 |
-
|
849 |
-
#: gateway/local-gateway.php:561
|
850 |
-
#: gateway/stripe/card-payments.php:646
|
851 |
-
msgid "Payment Status : "
|
852 |
-
msgstr ""
|
853 |
-
|
854 |
-
#: gateway/local-gateway.php:561
|
855 |
-
#: gateway/stripe/card-payments.php:646
|
856 |
-
msgid " Source : "
|
857 |
-
msgstr ""
|
858 |
-
|
859 |
#. translators: %s: payment fail message.
|
860 |
-
#: gateway/local-gateway.php:
|
|
|
861 |
msgid "Payment failed. %s"
|
862 |
msgstr ""
|
863 |
|
@@ -872,228 +910,252 @@ msgid "Accept payment using Alipay. %1$s %2$s %3$s %4$s"
|
|
872 |
msgstr ""
|
873 |
|
874 |
#: gateway/stripe/alipay.php:146
|
|
|
875 |
#: gateway/stripe/klarna.php:181
|
|
|
876 |
msgid "Add Payment"
|
877 |
msgstr ""
|
878 |
|
879 |
-
|
880 |
-
#:
|
|
|
|
|
|
|
|
|
|
|
881 |
msgid "Stripe Card Processing"
|
882 |
msgstr ""
|
883 |
|
884 |
-
#: gateway/stripe/card-payments.php:
|
885 |
msgid "Accepts payments via Credit/Debit Cards"
|
886 |
msgstr ""
|
887 |
|
888 |
-
#: gateway/stripe/card-payments.php:
|
889 |
msgid "Enable Stripe Gateway"
|
890 |
msgstr ""
|
891 |
|
892 |
-
#: gateway/stripe/card-payments.php:
|
893 |
msgid "Title of Card Element"
|
894 |
msgstr ""
|
895 |
|
896 |
-
#: gateway/stripe/card-payments.php:
|
897 |
msgid "Credit Card (Stripe)"
|
898 |
msgstr ""
|
899 |
|
900 |
-
#: gateway/stripe/card-payments.php:
|
901 |
msgid "Description on Card Elements for Live mode"
|
902 |
msgstr ""
|
903 |
|
904 |
-
#: gateway/stripe/card-payments.php:
|
905 |
msgid "Pay with your credit card via Stripe"
|
906 |
msgstr ""
|
907 |
|
908 |
-
#: gateway/stripe/card-payments.php:
|
|
|
909 |
msgid "Statement Descriptor"
|
910 |
msgstr ""
|
911 |
|
912 |
-
#: gateway/stripe/card-payments.php:
|
|
|
913 |
msgid "Statement descriptors are limited to 22 characters, cannot use the special characters >, <, \", \\, *, /, (, ), {, }, and must not consist solely of numbers. This will appear on your customer's statement in capital letters."
|
914 |
msgstr ""
|
915 |
|
916 |
-
#: gateway/stripe/card-payments.php:
|
917 |
#: gateway/stripe/klarna.php:139
|
918 |
msgid "Charge Type"
|
919 |
msgstr ""
|
920 |
|
921 |
-
#: gateway/stripe/card-payments.php:
|
922 |
#: gateway/stripe/klarna.php:141
|
923 |
msgid "Select how to charge Order"
|
924 |
msgstr ""
|
925 |
|
926 |
-
#: gateway/stripe/card-payments.php:
|
927 |
#: gateway/stripe/klarna.php:144
|
928 |
msgid "Charge"
|
929 |
msgstr ""
|
930 |
|
931 |
-
#: gateway/stripe/card-payments.php:
|
932 |
#: gateway/stripe/klarna.php:145
|
933 |
msgid "Authorize"
|
934 |
msgstr ""
|
935 |
|
936 |
-
#: gateway/stripe/card-payments.php:
|
937 |
msgid "Enable Payment via Saved Cards"
|
938 |
msgstr ""
|
939 |
|
940 |
-
#: gateway/stripe/card-payments.php:
|
941 |
msgid "Saved Cards"
|
942 |
msgstr ""
|
943 |
|
944 |
-
#: gateway/stripe/card-payments.php:
|
945 |
msgid "Save card details for future orders"
|
946 |
msgstr ""
|
947 |
|
948 |
-
#: gateway/stripe/card-payments.php:
|
949 |
msgid "Enable Inline Credit Card Form"
|
950 |
msgstr ""
|
951 |
|
952 |
-
#: gateway/stripe/card-payments.php:
|
953 |
msgid "Inline Credit Card Form"
|
954 |
msgstr ""
|
955 |
|
956 |
-
#: gateway/stripe/card-payments.php:
|
957 |
msgid "Use inline credit card for card payments"
|
958 |
msgstr ""
|
959 |
|
960 |
-
#: gateway/stripe/card-payments.php:
|
961 |
msgid "Allowed Cards"
|
962 |
msgstr ""
|
963 |
|
964 |
-
#: gateway/stripe/card-payments.php:
|
965 |
msgid "Accepts payments using selected cards. If empty all stripe cards are accepted."
|
966 |
msgstr ""
|
967 |
|
968 |
-
#: gateway/stripe/card-payments.php:
|
|
|
|
|
|
|
|
|
969 |
msgid "Order Status"
|
970 |
msgstr ""
|
971 |
|
972 |
-
#: gateway/stripe/card-payments.php:
|
|
|
|
|
|
|
|
|
973 |
msgid "Processing"
|
974 |
msgstr ""
|
975 |
|
976 |
-
#: gateway/stripe/card-payments.php:
|
977 |
msgid "On Hold"
|
978 |
msgstr ""
|
979 |
|
980 |
-
#: gateway/stripe/card-payments.php:
|
981 |
msgid "Completed"
|
982 |
msgstr ""
|
983 |
|
984 |
-
#: gateway/stripe/card-payments.php:
|
985 |
msgid "This is the status of the order once payment is complete. If <b>Default</b> is selected, then WooCommerce will set the order status automatically based on internal logic which states if a product is virtual and downloadable then status is set to complete. Products that require shipping are set to Processing. Default is the recommended setting as it allows standard WooCommerce code to process the order status."
|
986 |
msgstr ""
|
987 |
|
988 |
-
#: gateway/stripe/card-payments.php:
|
989 |
msgid "Order Button Label"
|
990 |
msgstr ""
|
991 |
|
992 |
-
#: gateway/stripe/card-payments.php:
|
993 |
msgid "Customize label for Order button"
|
994 |
msgstr ""
|
995 |
|
996 |
-
#: gateway/stripe/card-payments.php:
|
997 |
msgid "Pay via Stripe"
|
998 |
msgstr ""
|
999 |
|
1000 |
#. translators: %1$1s order id, %2$2s order total amount
|
1001 |
-
#: gateway/stripe/card-payments.php:
|
1002 |
msgid "Begin processing payment with new payment method for order %1$1s for the amount of %2$2s"
|
1003 |
msgstr ""
|
1004 |
|
1005 |
-
|
1006 |
-
#: gateway/stripe/
|
1007 |
-
msgid "Begin processing payment with saved payment method for order %1$1s for the amount of %2$2s"
|
1008 |
-
msgstr ""
|
1009 |
-
|
1010 |
-
#: gateway/stripe/card-payments.php:402
|
1011 |
msgid "There was a problem adding the payment method."
|
1012 |
msgstr ""
|
1013 |
|
1014 |
#. translators: error msg
|
1015 |
-
#: gateway/stripe/card-payments.php:
|
1016 |
-
#: gateway/stripe/card-payments.php:
|
1017 |
-
#: gateway/stripe/card-payments.php:
|
|
|
|
|
|
|
1018 |
msgid "Add payment method Error: %1$1s"
|
1019 |
msgstr ""
|
1020 |
|
1021 |
-
#: gateway/stripe/card-payments.php:
|
|
|
1022 |
msgid "Invalid stripe source"
|
1023 |
msgstr ""
|
1024 |
|
1025 |
-
#: gateway/stripe/card-payments.php:
|
|
|
1026 |
msgid "Unble to attach payment method to customer"
|
1027 |
msgstr ""
|
1028 |
|
1029 |
-
#: gateway/stripe/card-payments.php:
|
|
|
1030 |
msgid "New payment method added successfully"
|
1031 |
msgstr ""
|
1032 |
|
1033 |
#. translators: %1$1s order id, %2$2s token id
|
1034 |
-
#: gateway/stripe/card-payments.php:
|
|
|
1035 |
msgid "Payment method tokenized for Order id - %1$1s with token id - %2$2s"
|
1036 |
msgstr ""
|
1037 |
|
1038 |
#. translators: %1$1s, %2$2s: HTML Markup
|
1039 |
-
#: gateway/stripe/card-payments.php:
|
1040 |
msgid "Live Stripe.js integrations must use HTTPS. %1$1s For more information:%2$2s"
|
1041 |
msgstr ""
|
1042 |
|
1043 |
-
#: gateway/stripe/card-payments.php:
|
1044 |
msgid "Enter Card Details"
|
1045 |
msgstr ""
|
1046 |
|
1047 |
-
#: gateway/stripe/card-payments.php:
|
1048 |
msgid "Expiry Date"
|
1049 |
msgstr ""
|
1050 |
|
1051 |
-
#: gateway/stripe/card-payments.php:
|
1052 |
msgid "CVC"
|
1053 |
msgstr ""
|
1054 |
|
1055 |
-
#: gateway/stripe/card-payments.php:
|
1056 |
msgid "Save Card for Future Payments"
|
1057 |
msgstr ""
|
1058 |
|
1059 |
#. translators: %1$1s - %6$6s: HTML Markup
|
1060 |
-
#: gateway/stripe/card-payments.php:
|
1061 |
-
msgid "%1$1s Test Mode Enabled
|
1062 |
msgstr ""
|
1063 |
|
1064 |
-
#: gateway/stripe/frontend-scripts.php:
|
1065 |
msgid "MasterCard"
|
1066 |
msgstr ""
|
1067 |
|
1068 |
-
#: gateway/stripe/frontend-scripts.php:
|
1069 |
msgid "Visa"
|
1070 |
msgstr ""
|
1071 |
|
1072 |
-
#: gateway/stripe/frontend-scripts.php:
|
1073 |
msgid "American Express"
|
1074 |
msgstr ""
|
1075 |
|
1076 |
-
#: gateway/stripe/frontend-scripts.php:
|
1077 |
msgid "Discover"
|
1078 |
msgstr ""
|
1079 |
|
1080 |
-
#: gateway/stripe/frontend-scripts.php:
|
1081 |
msgid "JCB"
|
1082 |
msgstr ""
|
1083 |
|
1084 |
-
#: gateway/stripe/frontend-scripts.php:
|
1085 |
msgid "Diners Club"
|
1086 |
msgstr ""
|
1087 |
|
1088 |
-
#: gateway/stripe/frontend-scripts.php:
|
1089 |
msgid "UnionPay"
|
1090 |
msgstr ""
|
1091 |
|
1092 |
-
#: gateway/stripe/frontend-scripts.php:
|
1093 |
msgid "is not allowed"
|
1094 |
msgstr ""
|
1095 |
|
1096 |
-
#: gateway/stripe/frontend-scripts.php:
|
|
|
|
|
|
|
|
|
1097 |
msgid "Please select a bank to proceed."
|
1098 |
msgstr ""
|
1099 |
|
@@ -1121,54 +1183,106 @@ msgstr ""
|
|
1121 |
msgid "Accept payment using Przelewy24. %1$s %2$s"
|
1122 |
msgstr ""
|
1123 |
|
1124 |
-
#: gateway/stripe/payment-request-api.php:
|
1125 |
msgid "Empty cart"
|
1126 |
msgstr ""
|
1127 |
|
1128 |
-
#: gateway/stripe/payment-request-api.php:
|
1129 |
msgid "Sign up Fee"
|
1130 |
msgstr ""
|
1131 |
|
1132 |
-
#: gateway/stripe/payment-request-api.php:
|
1133 |
-
#: gateway/stripe/payment-request-api.php:
|
1134 |
-
#: gateway/stripe/payment-request-api.php:
|
1135 |
msgid "Tax"
|
1136 |
msgstr ""
|
1137 |
|
1138 |
-
#: gateway/stripe/payment-request-api.php:
|
1139 |
-
#: gateway/stripe/payment-request-api.php:
|
1140 |
-
#: gateway/stripe/payment-request-api.php:
|
1141 |
msgid "Shipping"
|
1142 |
msgstr ""
|
1143 |
|
1144 |
-
#: gateway/stripe/payment-request-api.php:
|
1145 |
-
#: gateway/stripe/payment-request-api.php:
|
1146 |
msgid "Pending"
|
1147 |
msgstr ""
|
1148 |
|
1149 |
-
#: gateway/stripe/payment-request-api.php:
|
1150 |
msgid "Discount"
|
1151 |
msgstr ""
|
1152 |
|
1153 |
#. translators: %d is the product Id
|
1154 |
-
#: gateway/stripe/payment-request-api.php:
|
1155 |
msgid "Product with the ID (%d) cannot be found."
|
1156 |
msgstr ""
|
1157 |
|
1158 |
#. translators: 1: product name 2: quantity in stock
|
1159 |
-
#: gateway/stripe/payment-request-api.php:
|
1160 |
msgid "You cannot add that amount of \"%1$s\"; to the cart because there is not enough stock (%2$s remaining)."
|
1161 |
msgstr ""
|
1162 |
|
1163 |
-
#: gateway/stripe/payment-request-api.php:
|
1164 |
-
#: gateway/stripe/payment-request-api.php:
|
1165 |
msgid "Unable to find shipping method for address."
|
1166 |
msgstr ""
|
1167 |
|
1168 |
-
#: gateway/stripe/payment-request-api.php:
|
1169 |
msgid "Unable to provide shipping options for Payment Requests."
|
1170 |
msgstr ""
|
1171 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1172 |
#: gateway/stripe/stripe-api.php:61
|
1173 |
msgid "Stripe not initialized"
|
1174 |
msgstr ""
|
@@ -1195,277 +1309,323 @@ msgid "No webhook call since %1s."
|
|
1195 |
msgstr ""
|
1196 |
|
1197 |
#. translators: order id
|
1198 |
-
#: gateway/stripe/webhook.php:
|
1199 |
msgid "Stripe charge partially captured with amount %1$1s Order id - %2$2s"
|
1200 |
msgstr ""
|
1201 |
|
1202 |
#. translators: partial captured amount
|
1203 |
-
#: gateway/stripe/webhook.php:
|
1204 |
msgid "This charge was partially captured via Stripe Dashboard with the amount : %s"
|
1205 |
msgstr ""
|
1206 |
|
1207 |
#. translators: order id
|
1208 |
-
#: gateway/stripe/webhook.php:
|
1209 |
msgid "Stripe charge completely captured Order id - %1s"
|
1210 |
msgstr ""
|
1211 |
|
1212 |
#. translators: amount (including currency symbol)
|
1213 |
-
#: gateway/stripe/webhook.php:
|
1214 |
msgid "Pre-Authorization for %s voided from the Stripe Dashboard."
|
1215 |
msgstr ""
|
1216 |
|
1217 |
-
#: gateway/stripe/webhook.php:
|
1218 |
msgid "Refunded via stripe dashboard"
|
1219 |
msgstr ""
|
1220 |
|
1221 |
-
#: gateway/stripe/webhook.php:
|
1222 |
-
msgid "
|
|
|
|
|
|
|
|
|
1223 |
msgstr ""
|
1224 |
|
1225 |
-
#: gateway/stripe/webhook.php:
|
1226 |
msgid " Transaction ID : "
|
1227 |
msgstr ""
|
1228 |
|
1229 |
-
#: gateway/stripe/webhook.php:
|
1230 |
msgid "This order is under dispute. Please respond via stripe dashboard."
|
1231 |
msgstr ""
|
1232 |
|
1233 |
-
#: gateway/stripe/webhook.php:
|
1234 |
msgid "The disputed order lost or accepted."
|
1235 |
msgstr ""
|
1236 |
|
1237 |
-
#: gateway/stripe/webhook.php:
|
1238 |
msgid "The disputed order resolved in your favour."
|
1239 |
msgstr ""
|
1240 |
|
1241 |
-
#: gateway/stripe/webhook.php:
|
1242 |
msgid "The inquiry or retrieval closed."
|
1243 |
msgstr ""
|
1244 |
|
1245 |
#. translators: transaction id, order id
|
1246 |
-
#: gateway/stripe/webhook.php:
|
1247 |
msgid "Stripe PaymentIntent %1$1s succeeded for order %2$2s"
|
1248 |
msgstr ""
|
1249 |
|
1250 |
#. translators: The error message that was received from Stripe.
|
1251 |
-
#: gateway/stripe/webhook.php:
|
1252 |
msgid "Reason: %s"
|
1253 |
msgstr ""
|
1254 |
|
1255 |
#. translators: The error message that was received from Stripe.
|
1256 |
-
#: gateway/stripe/webhook.php:
|
1257 |
msgid "Stripe SCA authentication failed. %s"
|
1258 |
msgstr ""
|
1259 |
|
1260 |
-
#: gateway/stripe/webhook.php:
|
1261 |
msgid "This order is under review. Please respond via stripe dashboard."
|
1262 |
msgstr ""
|
1263 |
|
1264 |
#. translators: Review reson from stripe
|
1265 |
-
#: gateway/stripe/webhook.php:
|
1266 |
msgid "Review for this order has been resolved. Reason: %s"
|
1267 |
msgstr ""
|
1268 |
|
1269 |
-
|
1270 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1271 |
msgstr ""
|
1272 |
|
1273 |
-
#: inc/traits/subscriptions.php:
|
1274 |
msgid "Customer not found"
|
1275 |
msgstr ""
|
1276 |
|
1277 |
-
#: inc/traits/subscriptions.php:
|
1278 |
msgid "Sorry, we are unable to process your payment at this time. Please retry later."
|
1279 |
msgstr ""
|
1280 |
|
1281 |
-
#: inc/traits/subscriptions.php:
|
1282 |
msgid "This transaction requires authentication."
|
1283 |
msgstr ""
|
1284 |
|
1285 |
#. translators: %s is the charge Id
|
1286 |
#. translators: %s is the stripe charge Id
|
1287 |
-
#: inc/traits/subscriptions.php:
|
1288 |
-
#: inc/traits/subscriptions.php:
|
1289 |
msgid "Stripe charge awaiting authentication by user: %s."
|
1290 |
msgstr ""
|
1291 |
|
1292 |
-
#: inc/traits/subscriptions.php:
|
1293 |
msgid "A \"Stripe Customer ID\" value is required."
|
1294 |
msgstr ""
|
1295 |
|
1296 |
-
#: inc/traits/subscriptions.php:
|
1297 |
msgid "Invalid customer ID. A valid \"Stripe Customer ID\" must begin with \"cus_\"."
|
1298 |
msgstr ""
|
1299 |
|
1300 |
-
#: inc/traits/subscriptions.php:
|
1301 |
msgid "Invalid source ID. A valid source \"Stripe Source ID\" must begin with \"src_\", \"pm_\", or \"card_\"."
|
1302 |
msgstr ""
|
1303 |
|
1304 |
-
#: inc/traits/subscriptions.php:
|
1305 |
msgid "Invalid payment method. Please input a new card number."
|
1306 |
msgstr ""
|
1307 |
|
1308 |
-
#: wizard/
|
1309 |
-
msgid "
|
1310 |
-
msgstr ""
|
1311 |
-
|
1312 |
-
#: wizard/build/app.js:892
|
1313 |
-
msgid "You are almost done."
|
1314 |
-
msgstr ""
|
1315 |
-
|
1316 |
-
#: wizard/build/app.js:895
|
1317 |
-
msgid "Since you have enabled"
|
1318 |
-
msgstr ""
|
1319 |
-
|
1320 |
-
#: wizard/build/app.js:895
|
1321 |
-
msgid " We recommend you to enable"
|
1322 |
msgstr ""
|
1323 |
|
1324 |
-
#: wizard/
|
1325 |
-
msgid "
|
1326 |
msgstr ""
|
1327 |
|
1328 |
-
#: wizard/
|
1329 |
-
msgid "
|
1330 |
msgstr ""
|
1331 |
|
1332 |
-
#: wizard/
|
1333 |
-
|
1334 |
-
msgid "Enabling…"
|
1335 |
msgstr ""
|
1336 |
|
1337 |
-
#: wizard/
|
1338 |
-
msgid "Skip
|
1339 |
msgstr ""
|
1340 |
|
1341 |
-
#: wizard/build/app.js:
|
1342 |
-
msgid "Failed!!"
|
1343 |
-
msgstr ""
|
1344 |
-
|
1345 |
-
#: wizard/build/app.js:940
|
1346 |
-
msgid "Unfortunately Connection to Stripe failed."
|
1347 |
-
msgstr ""
|
1348 |
-
|
1349 |
-
#: wizard/build/app.js:945
|
1350 |
-
msgid "Try Again"
|
1351 |
-
msgstr ""
|
1352 |
-
|
1353 |
-
#: wizard/build/app.js:979
|
1354 |
msgid "Let's Connect"
|
1355 |
msgstr ""
|
1356 |
|
1357 |
-
#: wizard/build/app.js:
|
1358 |
msgid "with Stripe"
|
1359 |
msgstr ""
|
1360 |
|
1361 |
-
#: wizard/build/app.js:
|
1362 |
-
msgid "Checkout Plugins"
|
1363 |
-
msgstr ""
|
1364 |
-
|
1365 |
-
#: wizard/build/app.js:983
|
1366 |
msgid "recommends to connect with"
|
1367 |
msgstr ""
|
1368 |
|
1369 |
-
#: wizard/build/app.js:
|
1370 |
msgid "Stripe connect."
|
1371 |
msgstr ""
|
1372 |
|
1373 |
-
#: wizard/build/app.js:
|
1374 |
msgid "One click onboarding solution provided by"
|
1375 |
msgstr ""
|
1376 |
|
1377 |
-
#: wizard/build/app.js:
|
1378 |
msgid "Stripe."
|
1379 |
msgstr ""
|
1380 |
|
1381 |
-
#: wizard/build/app.js:
|
1382 |
msgid "Connecting…"
|
1383 |
msgstr ""
|
1384 |
|
1385 |
-
#: wizard/build/app.js:
|
1386 |
msgid "Leave onboarding process"
|
1387 |
msgstr ""
|
1388 |
|
1389 |
-
#: wizard/build/app.js:
|
1390 |
msgid "Congratulations!!"
|
1391 |
msgstr ""
|
1392 |
|
1393 |
-
#: wizard/build/app.js:
|
1394 |
msgid "You are connected to Stripe successfully."
|
1395 |
msgstr ""
|
1396 |
|
1397 |
-
#: wizard/build/app.js:
|
1398 |
msgid "Let's enable gateways"
|
1399 |
msgstr ""
|
1400 |
|
1401 |
-
#: wizard/build/app.js:
|
1402 |
msgid "Recommended"
|
1403 |
msgstr ""
|
1404 |
|
1405 |
-
#: wizard/build/app.js:
|
1406 |
msgid "Works with all currencies"
|
1407 |
msgstr ""
|
1408 |
|
1409 |
-
#: wizard/build/app.js:
|
1410 |
msgid "Works with "
|
1411 |
msgstr ""
|
1412 |
|
1413 |
-
#: wizard/build/app.js:
|
|
|
|
|
|
|
|
|
1414 |
msgid "Enable Gateways"
|
1415 |
msgstr ""
|
1416 |
|
1417 |
-
#: wizard/build/app.js:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1418 |
msgid "Great!!"
|
1419 |
msgstr ""
|
1420 |
|
1421 |
-
#: wizard/build/app.js:
|
1422 |
msgid "Your store is all set to accept payment."
|
1423 |
msgstr ""
|
1424 |
|
1425 |
-
#: wizard/build/app.js:
|
1426 |
msgid "We provide lots of customization options to match your needs, don't forget to explore them."
|
1427 |
msgstr ""
|
1428 |
|
1429 |
-
#: wizard/build/app.js:
|
1430 |
msgid "Let's Customize…"
|
1431 |
msgstr ""
|
1432 |
|
1433 |
-
#: wizard/build/app.js:
|
1434 |
msgid "Let's Customize"
|
1435 |
msgstr ""
|
1436 |
|
1437 |
-
#: wizard/build/app.js:
|
1438 |
msgid "Missing"
|
1439 |
msgstr ""
|
1440 |
|
1441 |
-
#: wizard/build/app.js:
|
1442 |
-
msgid "
|
1443 |
msgstr ""
|
1444 |
|
1445 |
-
#: wizard/build/app.js:
|
1446 |
-
msgid "
|
1447 |
msgstr ""
|
1448 |
|
1449 |
-
#: wizard/build/app.js:
|
1450 |
-
msgid "
|
1451 |
msgstr ""
|
1452 |
|
1453 |
-
#: wizard/build/app.js:
|
1454 |
msgid "WooCommerce"
|
1455 |
msgstr ""
|
1456 |
|
1457 |
-
#: wizard/build/app.js:
|
1458 |
msgid "to be active on your store."
|
1459 |
msgstr ""
|
1460 |
|
1461 |
-
#: wizard/build/app.js:
|
1462 |
msgid "Installing…"
|
1463 |
msgstr ""
|
1464 |
|
1465 |
-
#: wizard/build/app.js:
|
1466 |
msgid "Activating…"
|
1467 |
msgstr ""
|
1468 |
|
1469 |
-
#: wizard/build/app.js:
|
1470 |
msgid "Install and continue"
|
1471 |
msgstr ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Copyright (C) 2022 Checkout Plugins
|
2 |
# This file is distributed under the GPLv2 or later.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Checkout Plugins - Stripe for WooCommerce 1.4.0\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/checkout-plugins-stripe-woo\n"
|
7 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
8 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"POT-Creation-Date: 2022-02-22T06:56:54+00:00\n"
|
13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
"X-Generator: WP-CLI 2.5.0\n"
|
15 |
"X-Domain: checkout-plugins-stripe-woo\n"
|
27 |
msgstr ""
|
28 |
|
29 |
#. Author of the plugin
|
30 |
+
#: wizard/build/app.js:1
|
31 |
+
msgid "Checkout Plugins"
|
32 |
msgstr ""
|
33 |
|
34 |
#. Author URI of the plugin
|
35 |
+
msgid "https://checkoutplugins.com/"
|
36 |
msgstr ""
|
37 |
|
38 |
#: admin/admin-controller.php:79
|
39 |
+
#: admin/admin-controller.php:890
|
40 |
msgid "Stripe API Settings"
|
41 |
msgstr ""
|
42 |
|
45 |
msgstr ""
|
46 |
|
47 |
#: admin/admin-controller.php:81
|
48 |
+
#: admin/admin-controller.php:1576
|
49 |
+
#: wizard/build/app.js:1
|
50 |
msgid "Express Checkout"
|
51 |
msgstr ""
|
52 |
|
66 |
msgstr ""
|
67 |
|
68 |
#: admin/admin-controller.php:85
|
69 |
+
#: gateway/stripe/sepa.php:54
|
70 |
+
msgid "SEPA"
|
71 |
+
msgstr ""
|
72 |
+
|
73 |
+
#: admin/admin-controller.php:86
|
74 |
#: gateway/stripe/p24.php:45
|
75 |
msgid "Przelewy24"
|
76 |
msgstr ""
|
77 |
|
78 |
+
#: admin/admin-controller.php:87
|
79 |
+
#: gateway/stripe/wechat.php:46
|
80 |
+
msgid "WeChat"
|
81 |
+
msgstr ""
|
82 |
+
|
83 |
+
#: admin/admin-controller.php:88
|
84 |
+
#: gateway/stripe/bancontact.php:46
|
85 |
+
msgid "Bancontact"
|
86 |
+
msgstr ""
|
87 |
+
|
88 |
+
#: admin/admin-controller.php:264
|
89 |
msgid "Something went wrong! Please reload the page and try again."
|
90 |
msgstr ""
|
91 |
|
92 |
+
#: admin/admin-controller.php:265
|
93 |
+
#: admin/admin-controller.php:759
|
94 |
msgid "Connect to Stripe"
|
95 |
msgstr ""
|
96 |
|
97 |
+
#: admin/admin-controller.php:266
|
98 |
msgid "Please enter all keys to connect to stripe."
|
99 |
msgstr ""
|
100 |
|
101 |
+
#: admin/admin-controller.php:267
|
102 |
msgid "You must enter your API keys or connect the plugin before performing a connection test. Mode:"
|
103 |
msgstr ""
|
104 |
|
105 |
+
#: admin/admin-controller.php:268
|
106 |
msgid "Keys Unavailable."
|
107 |
msgstr ""
|
108 |
|
109 |
+
#: admin/admin-controller.php:269
|
110 |
msgid "Your Stripe account has been disconnected."
|
111 |
msgstr ""
|
112 |
|
113 |
+
#: admin/admin-controller.php:270
|
114 |
msgid "You can connect other Stripe account now."
|
115 |
msgstr ""
|
116 |
|
117 |
+
#: admin/admin-controller.php:291
|
118 |
+
#: admin/admin-controller.php:315
|
119 |
+
#: gateway/stripe/frontend-scripts.php:143
|
120 |
+
#: gateway/stripe/payment-request-api.php:151
|
121 |
+
msgid "Pay now"
|
122 |
+
msgstr ""
|
123 |
+
|
124 |
#. translators: Html Markup
|
125 |
+
#: admin/admin-controller.php:313
|
126 |
msgid "No payment method detected. Either your browser is not supported or you do not have save cards. For more details read %1$1sdocument$2$2s."
|
127 |
msgstr ""
|
128 |
|
129 |
+
#: admin/admin-controller.php:314
|
130 |
+
msgid "NOTE: Title and Tagline appears only on Checkout page."
|
131 |
+
msgstr ""
|
132 |
+
|
133 |
#. translators: %1$1s HTML Markup
|
134 |
+
#: admin/admin-controller.php:334
|
135 |
msgid "You Stripe Publishable and Secret Keys are not set correctly. You can connect to Stripe and correct them from <a href=\"%1$1s\">here.</a>"
|
136 |
msgstr ""
|
137 |
|
138 |
+
#: admin/admin-controller.php:344
|
139 |
+
#: admin/admin-controller.php:895
|
140 |
msgid "Stripe Connect"
|
141 |
msgstr ""
|
142 |
|
143 |
+
#: admin/admin-controller.php:347
|
144 |
+
#: admin/admin-controller.php:548
|
145 |
+
#: admin/admin-controller.php:1525
|
146 |
msgid "Hide API keys"
|
147 |
msgstr ""
|
148 |
|
149 |
+
#: admin/admin-controller.php:349
|
150 |
+
#: admin/admin-controller.php:545
|
151 |
+
#: admin/admin-controller.php:1521
|
152 |
+
#: wizard/build/app.js:1
|
153 |
msgid "Manage API keys manually"
|
154 |
msgstr ""
|
155 |
|
156 |
#. translators: %1$1s: mode, %2$2s, %3$3s: HTML Markup
|
157 |
+
#: admin/admin-controller.php:352
|
158 |
msgid "Stripe Keys for %1$1s mode are not set correctly. Reconnect via %2$2s or %3$3s"
|
159 |
msgstr ""
|
160 |
|
161 |
+
#: admin/admin-controller.php:366
|
162 |
msgid "No SSL was detected, Stripe live mode requires SSL."
|
163 |
msgstr ""
|
164 |
|
165 |
+
#: admin/admin-controller.php:377
|
166 |
msgid "Your Stripe account has been connected to your WooCommerce store. You may now accept payments in live and test mode."
|
167 |
msgstr ""
|
168 |
|
169 |
+
#: admin/admin-controller.php:388
|
170 |
msgid "We were not able to connect your Stripe account. Please try again. "
|
171 |
msgstr ""
|
172 |
|
173 |
+
#: admin/admin-controller.php:399
|
174 |
+
#: admin/admin-controller.php:1078
|
175 |
+
#: admin/admin-controller.php:1180
|
176 |
msgid "Error: The current user doesn’t have sufficient permissions to perform this action. Please reload the page and try again."
|
177 |
msgstr ""
|
178 |
|
179 |
+
#: admin/admin-controller.php:435
|
180 |
+
#: admin/admin-controller.php:520
|
181 |
+
#: wizard/build/app.js:1
|
182 |
msgid "Connect with Stripe"
|
183 |
msgstr ""
|
184 |
|
185 |
+
#: admin/admin-controller.php:436
|
186 |
+
#: admin/admin-controller.php:760
|
187 |
+
#: admin/admin-controller.php:921
|
188 |
msgid "We make it easy to connect Stripe to your site. Click the Connect button to go through our connect flow."
|
189 |
msgstr ""
|
190 |
|
191 |
#. translators: %1$1s, %2$2s: HTML Markup
|
192 |
+
#: admin/admin-controller.php:459
|
193 |
msgid "Have questions about connecting with Stripe? Read %1$s document. %2$s"
|
194 |
msgstr ""
|
195 |
|
196 |
+
#: admin/admin-controller.php:467
|
197 |
+
msgid "Although you can add your API keys manually, we recommend using Stripe Connect. Stripe Connect prevents issues that can arise when copying and pasting account details from Stripe into Checkout Plugins - Stripe for WooCommerce settings."
|
198 |
msgstr ""
|
199 |
|
200 |
#. translators: %1$1s %2$2s %3$3s: HTML Markup
|
201 |
+
#: admin/admin-controller.php:514
|
202 |
msgid "Your manually managed API keys are valid."
|
203 |
msgstr ""
|
204 |
|
205 |
+
#: admin/admin-controller.php:518
|
206 |
msgid "It is highly recommended to Connect with Stripe for easier setup and improved security."
|
207 |
msgstr ""
|
208 |
|
209 |
#. translators: $1s Acoount name, $2s html markup, $3s account id, $4s html markup
|
210 |
+
#: admin/admin-controller.php:528
|
211 |
msgid "Account (%1$1s) %2$2s %3$3s %4$4s is connected."
|
212 |
msgstr ""
|
213 |
|
214 |
+
#: admin/admin-controller.php:538
|
215 |
msgid "Disconnect & connect other account?"
|
216 |
msgstr ""
|
217 |
|
218 |
+
#: admin/admin-controller.php:540
|
219 |
msgid "Test Connection"
|
220 |
msgstr ""
|
221 |
|
222 |
+
#: admin/admin-controller.php:555
|
223 |
+
msgid "Although you can add your API keys manually, we recommend using Stripe Connect: an easier and more secure way of connecting your Stripe account to your website. Stripe Connect prevents issues that can arise when copying and pasting account details from Stripe into your Checkout Plugins - Stripe for WooCommerce payment gateway settings. With Stripe Connect you'll be ready to go with just a few clicks."
|
224 |
msgstr ""
|
225 |
|
226 |
+
#: admin/admin-controller.php:718
|
227 |
msgid "Clear all Stripe account keys"
|
228 |
msgstr ""
|
229 |
|
230 |
+
#: admin/admin-controller.php:751
|
231 |
+
#: admin/admin-controller.php:755
|
232 |
msgid "Re-Connect to Stripe"
|
233 |
msgstr ""
|
234 |
|
235 |
+
#: admin/admin-controller.php:753
|
236 |
+
#: admin/admin-controller.php:757
|
237 |
msgid "Your Stripe account has been connected. You can now accept Live and Test payments. You can Re-Connect if you want to recycle your API keys for security."
|
238 |
msgstr ""
|
239 |
|
240 |
+
#: admin/admin-controller.php:788
|
241 |
msgid "Connect Manually"
|
242 |
msgstr ""
|
243 |
|
244 |
+
#: admin/admin-controller.php:816
|
245 |
msgid "Stripe"
|
246 |
msgstr ""
|
247 |
|
248 |
+
#: admin/admin-controller.php:902
|
249 |
msgid "Connection Status"
|
250 |
msgstr ""
|
251 |
|
252 |
+
#: admin/admin-controller.php:906
|
253 |
+
#: admin/admin-controller.php:907
|
254 |
msgid "This is your Stripe Connect ID and serves as a unique identifier."
|
255 |
msgstr ""
|
256 |
|
257 |
+
#: admin/admin-controller.php:911
|
258 |
msgid "Stripe Account Keys"
|
259 |
msgstr ""
|
260 |
|
261 |
+
#: admin/admin-controller.php:914
|
262 |
msgid "This will disable any connection to Stripe."
|
263 |
msgstr ""
|
264 |
|
265 |
+
#: admin/admin-controller.php:918
|
266 |
msgid "Connect Stripe Account"
|
267 |
msgstr ""
|
268 |
|
269 |
+
#: admin/admin-controller.php:925
|
270 |
msgid "Live Publishable Key"
|
271 |
msgstr ""
|
272 |
|
273 |
+
#: admin/admin-controller.php:927
|
274 |
+
#: admin/admin-controller.php:985
|
275 |
msgid "Your publishable key is used to initialize Stripe assets."
|
276 |
msgstr ""
|
277 |
|
278 |
+
#: admin/admin-controller.php:931
|
279 |
msgid "Live Secret Key"
|
280 |
msgstr ""
|
281 |
|
282 |
+
#: admin/admin-controller.php:933
|
283 |
msgid "Your secret key is used to authenticate Stripe requests."
|
284 |
msgstr ""
|
285 |
|
286 |
+
#: admin/admin-controller.php:937
|
287 |
msgid "Test Publishable Key"
|
288 |
msgstr ""
|
289 |
|
290 |
+
#: admin/admin-controller.php:939
|
291 |
msgid "Your test publishable key is used to initialize Stripe assets."
|
292 |
msgstr ""
|
293 |
|
294 |
+
#: admin/admin-controller.php:943
|
295 |
msgid "Test Secret Key"
|
296 |
msgstr ""
|
297 |
|
298 |
+
#: admin/admin-controller.php:945
|
299 |
msgid "Your test secret key is used to authenticate Stripe requests for testing purposes."
|
300 |
msgstr ""
|
301 |
|
302 |
+
#: admin/admin-controller.php:949
|
303 |
msgid "Mode"
|
304 |
msgstr ""
|
305 |
|
306 |
+
#: admin/admin-controller.php:955
|
307 |
msgid "No live transactions are processed in test mode. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing."
|
308 |
msgstr ""
|
309 |
|
310 |
+
#: admin/admin-controller.php:960
|
311 |
msgid "Webhook URL"
|
312 |
msgstr ""
|
313 |
|
314 |
#. translators: %1$1s - %2$2s HTML markup
|
315 |
+
#: admin/admin-controller.php:964
|
316 |
msgid "Important: the webhook URL is called by Stripe when events occur in your account, like a source becomes chargeable. %1$1sWebhook Guide%2$2s"
|
317 |
msgstr ""
|
318 |
|
319 |
+
#: admin/admin-controller.php:968
|
320 |
msgid "Live Webhook Secret"
|
321 |
msgstr ""
|
322 |
|
323 |
#. translators: %1$1s Webhook Status
|
324 |
+
#: admin/admin-controller.php:971
|
325 |
+
#: admin/admin-controller.php:978
|
326 |
msgid "The webhook secret is used to authenticate webhooks sent from Stripe. It ensures nobody else can send you events pretending to be Stripe. %1$1s"
|
327 |
msgstr ""
|
328 |
|
329 |
+
#: admin/admin-controller.php:975
|
330 |
msgid "Test Webhook Secret"
|
331 |
msgstr ""
|
332 |
|
333 |
+
#: admin/admin-controller.php:982
|
334 |
msgid "Debug Log"
|
335 |
msgstr ""
|
336 |
|
337 |
+
#: admin/admin-controller.php:984
|
338 |
msgid "Log debug messages"
|
339 |
msgstr ""
|
340 |
|
341 |
+
#: admin/admin-controller.php:1025
|
342 |
msgid "Please try again."
|
343 |
msgstr ""
|
344 |
|
345 |
+
#: admin/admin-controller.php:1074
|
346 |
+
#: admin/admin-controller.php:1176
|
347 |
msgid "Error: Sorry, the nonce security check didn’t pass. Please reload the page and try again."
|
348 |
msgstr ""
|
349 |
|
350 |
+
#: admin/admin-controller.php:1087
|
351 |
+
#: admin/admin-controller.php:1152
|
352 |
msgid "Test Mode:"
|
353 |
msgstr ""
|
354 |
|
355 |
+
#: admin/admin-controller.php:1089
|
356 |
msgid "Please enter secret key to test."
|
357 |
msgstr ""
|
358 |
|
359 |
+
#: admin/admin-controller.php:1094
|
360 |
+
#: admin/admin-controller.php:1156
|
361 |
msgid "Live Mode:"
|
362 |
msgstr ""
|
363 |
|
364 |
+
#: admin/admin-controller.php:1096
|
365 |
msgid "Please enter secret key to live."
|
366 |
msgstr ""
|
367 |
|
368 |
+
#: admin/admin-controller.php:1100
|
369 |
msgid "Error: Empty String provided for keys"
|
370 |
msgstr ""
|
371 |
|
372 |
#. translators: %1$1s mode
|
373 |
+
#: admin/admin-controller.php:1112
|
374 |
msgid "My first %1s customer (created for API docs)"
|
375 |
msgstr ""
|
376 |
|
377 |
+
#: admin/admin-controller.php:1117
|
378 |
msgid "Connected to Stripe successfully"
|
379 |
msgstr ""
|
380 |
|
381 |
+
#: admin/admin-controller.php:1186
|
382 |
msgid "Stripe keys are reset successfully."
|
383 |
msgstr ""
|
384 |
|
385 |
+
#: admin/admin-controller.php:1198
|
386 |
+
#: inc/traits/subscriptions.php:346
|
387 |
msgid "Invalid Nonce"
|
388 |
msgstr ""
|
389 |
|
390 |
+
#: admin/admin-controller.php:1328
|
391 |
msgid "My First Test Customer (created for API docs)"
|
392 |
msgstr ""
|
393 |
|
394 |
+
#: admin/admin-controller.php:1377
|
395 |
msgid "My First Live Customer (created for API docs)"
|
396 |
msgstr ""
|
397 |
|
398 |
+
#: admin/admin-controller.php:1569
|
399 |
msgid "Express Checkout is a feature of Card Payments. Enable Card Payments to use Express Checkout"
|
400 |
msgstr ""
|
401 |
|
402 |
#. translators: HTML Markup
|
403 |
+
#: admin/admin-controller.php:1579
|
404 |
msgid "Accept payment using Apple Pay, Google Pay, Browser Payment Method.%1$1sExpress Checkout uses Payment Request API which is based on client's browser and saved cards.%1$1sPlease check %2$2sprerequisite%3$3s for Apple Pay, Google Pay and Browser Payment Method."
|
405 |
msgstr ""
|
406 |
|
407 |
+
#: admin/admin-controller.php:1583
|
408 |
+
#: wizard/build/app.js:1
|
409 |
msgid "Enable Express Checkout"
|
410 |
msgstr ""
|
411 |
|
412 |
+
#: admin/admin-controller.php:1589
|
413 |
msgid "Show button on"
|
414 |
msgstr ""
|
415 |
|
416 |
+
#: admin/admin-controller.php:1593
|
417 |
msgid "Choose page to display Express Checkout buttons."
|
418 |
msgstr ""
|
419 |
|
420 |
+
#: admin/admin-controller.php:1595
|
421 |
msgid "Product"
|
422 |
msgstr ""
|
423 |
|
424 |
+
#: admin/admin-controller.php:1596
|
425 |
msgid "Cart"
|
426 |
msgstr ""
|
427 |
|
428 |
+
#: admin/admin-controller.php:1597
|
429 |
msgid "Checkout"
|
430 |
msgstr ""
|
431 |
|
432 |
+
#: admin/admin-controller.php:1602
|
433 |
+
msgid "Button text"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
434 |
msgstr ""
|
435 |
|
436 |
+
#: admin/admin-controller.php:1605
|
437 |
+
msgid "Add label text for the Express Checkout button."
|
438 |
msgstr ""
|
439 |
|
440 |
+
#: admin/admin-controller.php:1610
|
441 |
msgid "Button theme"
|
442 |
msgstr ""
|
443 |
|
444 |
+
#: admin/admin-controller.php:1613
|
445 |
msgid "Select theme for Express Checkout button."
|
446 |
msgstr ""
|
447 |
|
448 |
+
#: admin/admin-controller.php:1616
|
449 |
msgid "Dark"
|
450 |
msgstr ""
|
451 |
|
452 |
+
#: admin/admin-controller.php:1617
|
453 |
msgid "Light"
|
454 |
msgstr ""
|
455 |
|
456 |
+
#: admin/admin-controller.php:1618
|
457 |
msgid "Light Outline"
|
458 |
msgstr ""
|
459 |
|
460 |
+
#: admin/admin-controller.php:1623
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
461 |
msgid "Button Preview"
|
462 |
msgstr ""
|
463 |
|
464 |
+
#: admin/admin-controller.php:1632
|
465 |
msgid "Product page options"
|
466 |
msgstr ""
|
467 |
|
468 |
+
#: admin/admin-controller.php:1634
|
469 |
msgid "Advanced customization options for product page."
|
470 |
msgstr ""
|
471 |
|
472 |
+
#: admin/admin-controller.php:1638
|
473 |
+
#: admin/admin-controller.php:1701
|
|
|
|
|
|
|
|
|
|
|
474 |
msgid "Button position"
|
475 |
msgstr ""
|
476 |
|
477 |
+
#: admin/admin-controller.php:1642
|
478 |
msgid "Select the position of Express Checkout button. This option will work only for Product page."
|
479 |
msgstr ""
|
480 |
|
481 |
+
#: admin/admin-controller.php:1645
|
482 |
msgid "Above Add to Cart"
|
483 |
msgstr ""
|
484 |
|
485 |
+
#: admin/admin-controller.php:1646
|
486 |
msgid "Below Add to Cart"
|
487 |
msgstr ""
|
488 |
|
489 |
+
#: admin/admin-controller.php:1647
|
490 |
+
msgid "Inline Button"
|
|
|
491 |
msgstr ""
|
492 |
|
493 |
+
#: admin/admin-controller.php:1652
|
494 |
+
#: admin/admin-controller.php:1681
|
495 |
+
#: admin/admin-controller.php:1755
|
496 |
+
msgid "Separator text"
|
497 |
msgstr ""
|
498 |
|
499 |
+
#: admin/admin-controller.php:1655
|
500 |
+
msgid "Add separator text for the Express Checkout button. This will help to distinguish between Express Checkout and other buttons."
|
501 |
+
msgstr ""
|
502 |
+
|
503 |
+
#: admin/admin-controller.php:1661
|
504 |
msgid "Responsive behaviour"
|
505 |
msgstr ""
|
506 |
|
507 |
#. translators: HTML Markup
|
508 |
+
#: admin/admin-controller.php:1663
|
509 |
msgid "If checked the Express Checkout button will stick%1$1sat bottom of screen on responsive devices."
|
510 |
msgstr ""
|
511 |
|
512 |
+
#: admin/admin-controller.php:1674
|
513 |
+
msgid "Cart page options"
|
514 |
+
msgstr ""
|
515 |
+
|
516 |
+
#: admin/admin-controller.php:1676
|
517 |
+
msgid "Advanced customization options for Cart page."
|
518 |
+
msgstr ""
|
519 |
+
|
520 |
+
#: admin/admin-controller.php:1685
|
521 |
+
msgid "Add separator text for Cart page. If empty will show default separator text."
|
522 |
+
msgstr ""
|
523 |
+
|
524 |
+
#: admin/admin-controller.php:1694
|
525 |
msgid "Checkout page options"
|
526 |
msgstr ""
|
527 |
|
528 |
+
#: admin/admin-controller.php:1696
|
529 |
msgid "Advanced customization options for Checkout page."
|
530 |
msgstr ""
|
531 |
|
532 |
+
#: admin/admin-controller.php:1705
|
533 |
msgid "Select the position of Express Checkout button. This option will work only for Checkout page."
|
534 |
msgstr ""
|
535 |
|
536 |
+
#: admin/admin-controller.php:1708
|
537 |
msgid "Above checkout form"
|
538 |
msgstr ""
|
539 |
|
540 |
+
#: admin/admin-controller.php:1709
|
541 |
msgid "Above billing details"
|
542 |
msgstr ""
|
543 |
|
544 |
+
#: admin/admin-controller.php:1714
|
545 |
+
#: gateway/local-gateway.php:125
|
546 |
+
#: gateway/stripe/card-payments.php:111
|
547 |
msgid "Title"
|
548 |
msgstr ""
|
549 |
|
550 |
+
#: admin/admin-controller.php:1718
|
551 |
msgid "Add a title above Express Checkout button on Checkout page."
|
552 |
msgstr ""
|
553 |
|
554 |
+
#: admin/admin-controller.php:1723
|
555 |
msgid "Tagline"
|
556 |
msgstr ""
|
557 |
|
558 |
+
#: admin/admin-controller.php:1727
|
559 |
msgid "Add a tagline below the title on Checkout page."
|
560 |
msgstr ""
|
561 |
|
562 |
+
#: admin/admin-controller.php:1732
|
563 |
+
msgid "Button width"
|
564 |
+
msgstr ""
|
565 |
+
|
566 |
+
#: admin/admin-controller.php:1736
|
567 |
+
msgid "Select width for button (in px). Default width 100%"
|
568 |
+
msgstr ""
|
569 |
+
|
570 |
+
#: admin/admin-controller.php:1741
|
571 |
msgid "Alignment"
|
572 |
msgstr ""
|
573 |
|
574 |
+
#: admin/admin-controller.php:1745
|
575 |
msgid "This setting will align title, tagline and button based on selection on Checkout page."
|
576 |
msgstr ""
|
577 |
|
578 |
+
#: admin/admin-controller.php:1748
|
579 |
msgid "Left"
|
580 |
msgstr ""
|
581 |
|
582 |
+
#: admin/admin-controller.php:1749
|
583 |
msgid "Center"
|
584 |
msgstr ""
|
585 |
|
586 |
+
#: admin/admin-controller.php:1750
|
587 |
msgid "Right"
|
588 |
msgstr ""
|
589 |
|
590 |
+
#: admin/admin-controller.php:1759
|
591 |
msgid "Add separator text for Checkout page. If empty will show default separator text."
|
592 |
msgstr ""
|
593 |
|
594 |
+
#: autoloader.php:140
|
595 |
msgid "Settings"
|
596 |
msgstr ""
|
597 |
|
598 |
+
#: autoloader.php:141
|
599 |
msgid "Documentation"
|
600 |
msgstr ""
|
601 |
|
602 |
#. translators: 1$-2$: opening and closing <strong> tags, 3$-4$: link tags, takes to woocommerce plugin on wp.org, 5$-6$: opening and closing link tags, leads to plugins.php in admin.
|
603 |
+
#: autoloader.php:194
|
604 |
+
msgid "%1$sCheckout Plugins - Stripe for WooCommerce is inactive.%2$s The %3$sWooCommerce plugin%4$s must be active for Checkout Plugins - Stripe for WooCommerce to work. Please %5$sinstall & activate WooCommerce »%6$s"
|
605 |
msgstr ""
|
606 |
|
607 |
#. translators: 1 - 4 html entities
|
630 |
msgid "%1$1sApple Pay domain verification failed! %2$2sReason%3$3s: %4$4s"
|
631 |
msgstr ""
|
632 |
|
633 |
+
#: gateway/abstract-payment-gateway.php:75
|
634 |
msgid "Order "
|
635 |
msgstr ""
|
636 |
|
|
|
|
|
637 |
#: gateway/abstract-payment-gateway.php:266
|
638 |
+
#: gateway/abstract-payment-gateway.php:267
|
639 |
+
#: gateway/abstract-payment-gateway.php:275
|
640 |
+
#: gateway/stripe/webhook.php:350
|
641 |
msgid "Reason : "
|
642 |
msgstr ""
|
643 |
|
|
|
|
|
644 |
#: gateway/abstract-payment-gateway.php:266
|
645 |
+
#: gateway/abstract-payment-gateway.php:267
|
646 |
+
#: gateway/abstract-payment-gateway.php:275
|
647 |
+
#: gateway/stripe/webhook.php:350
|
648 |
+
#: gateway/stripe/webhook.php:351
|
649 |
msgid "Amount : "
|
650 |
msgstr ""
|
651 |
|
652 |
+
#: gateway/abstract-payment-gateway.php:266
|
653 |
+
#: gateway/abstract-payment-gateway.php:267
|
654 |
+
#: gateway/stripe/webhook.php:350
|
655 |
msgid "Status : "
|
656 |
msgstr ""
|
657 |
|
658 |
+
#: gateway/abstract-payment-gateway.php:266
|
659 |
+
#: gateway/abstract-payment-gateway.php:267
|
660 |
+
#: gateway/stripe/webhook.php:350
|
661 |
msgid "Transaction ID : "
|
662 |
msgstr ""
|
663 |
|
664 |
+
#: gateway/abstract-payment-gateway.php:267
|
665 |
msgid "Refund initiated: "
|
666 |
msgstr ""
|
667 |
|
668 |
+
#: gateway/abstract-payment-gateway.php:272
|
669 |
+
msgid "Your refund process is "
|
670 |
+
msgstr ""
|
671 |
+
|
672 |
+
#: gateway/abstract-payment-gateway.php:275
|
673 |
msgid " Status : Failed "
|
674 |
msgstr ""
|
675 |
|
676 |
+
#: gateway/abstract-payment-gateway.php:318
|
677 |
+
#: gateway/stripe/sepa.php:499
|
678 |
+
msgid "Payment will be completed once payment_intent.succeeded webhook received from Stripe."
|
679 |
+
msgstr ""
|
680 |
+
|
681 |
+
#. translators: transaction id, other info
|
682 |
+
#: gateway/abstract-payment-gateway.php:321
|
683 |
+
#: gateway/stripe/sepa.php:502
|
684 |
+
msgid "Stripe charge awaiting payment: %1$s. %2$s"
|
685 |
msgstr ""
|
686 |
|
687 |
#. translators: transaction id
|
688 |
+
#: gateway/abstract-payment-gateway.php:330
|
689 |
+
#: gateway/stripe/webhook.php:266
|
690 |
msgid "Stripe charge complete (Charge ID: %s)"
|
691 |
msgstr ""
|
692 |
|
693 |
+
#: gateway/abstract-payment-gateway.php:336
|
694 |
msgid "Payment processing failed. Please retry."
|
695 |
msgstr ""
|
696 |
|
697 |
#. translators: transaction id
|
698 |
+
#: gateway/abstract-payment-gateway.php:348
|
699 |
msgid "Stripe charge authorized (Charge ID: %s). Process order to take payment, or cancel to remove the pre-authorization. Attempting to refund the order in part or in full will release the authorization and cancel the payment."
|
700 |
msgstr ""
|
701 |
|
702 |
+
#: gateway/abstract-payment-gateway.php:400
|
703 |
msgid "An error has occurred internally, due to which you are not redirected to the order received page."
|
704 |
msgstr ""
|
705 |
|
706 |
+
#: gateway/abstract-payment-gateway.php:548
|
707 |
+
#: gateway/abstract-payment-gateway.php:549
|
708 |
msgid "Uncaptured Amount cannot be refunded"
|
709 |
msgstr ""
|
710 |
|
711 |
+
#. translators: order id
|
712 |
+
#: gateway/abstract-payment-gateway.php:623
|
713 |
+
msgid "Payment successful Order id - %1s"
|
714 |
+
msgstr ""
|
715 |
+
|
716 |
+
#: gateway/abstract-payment-gateway.php:627
|
717 |
+
msgid "Payment Status: "
|
718 |
+
msgstr ""
|
719 |
+
|
720 |
+
#: gateway/abstract-payment-gateway.php:627
|
721 |
+
msgid "Source: Payment is Completed via "
|
722 |
+
msgstr ""
|
723 |
+
|
724 |
+
#. translators: transaction id
|
725 |
+
#: gateway/abstract-payment-gateway.php:630
|
726 |
+
msgid "Charge authorized (Charge ID: %s). Process order to take payment, or cancel to remove the pre-authorization. Attempting to refund the order in part or in full will release the authorization and cancel the payment."
|
727 |
+
msgstr ""
|
728 |
+
|
729 |
+
#. translators: transaction id
|
730 |
+
#: gateway/abstract-payment-gateway.php:632
|
731 |
+
msgid "Charge authorized Order id - %1s"
|
732 |
+
msgstr ""
|
733 |
+
|
734 |
+
#. translators: %1$1s order id, %2$2s order total amount
|
735 |
+
#: gateway/abstract-payment-gateway.php:777
|
736 |
+
msgid "Begin processing payment with saved payment method for order %1$1s for the amount of %2$2s"
|
737 |
+
msgstr ""
|
738 |
+
|
739 |
+
#: gateway/abstract-payment-gateway.php:903
|
740 |
msgid "Fee charged by stripe for this order."
|
741 |
msgstr ""
|
742 |
|
743 |
+
#: gateway/abstract-payment-gateway.php:904
|
744 |
msgid "Stripe Fee:"
|
745 |
msgstr ""
|
746 |
|
747 |
+
#: gateway/abstract-payment-gateway.php:913
|
748 |
msgid "Net amount that will be credited to your Stripe bank account."
|
749 |
msgstr ""
|
750 |
|
751 |
+
#: gateway/abstract-payment-gateway.php:914
|
752 |
msgid "Stripe Payout:"
|
753 |
msgstr ""
|
754 |
|
755 |
+
#: gateway/abstract-payment-gateway.php:993
|
756 |
msgid "Unable to update stripe transaction balance"
|
757 |
msgstr ""
|
758 |
|
759 |
#. translators: %s: except countries.
|
760 |
+
#: gateway/local-gateway.php:97
|
761 |
msgid " & billing country is not <strong>%s</strong>"
|
762 |
msgstr ""
|
763 |
|
764 |
#. translators: %s: specificcountries.
|
765 |
+
#: gateway/local-gateway.php:100
|
766 |
msgid " & billing country is <strong>%s</strong>"
|
767 |
msgstr ""
|
768 |
|
769 |
#. translators: %s: Method title.
|
770 |
+
#: gateway/local-gateway.php:121
|
771 |
msgid "Enable %s"
|
772 |
msgstr ""
|
773 |
|
774 |
#. translators: %s: Method title.
|
775 |
+
#: gateway/local-gateway.php:128
|
776 |
msgid "Title of the %s gateway."
|
777 |
msgstr ""
|
778 |
|
779 |
+
#: gateway/local-gateway.php:133
|
780 |
+
#: gateway/stripe/card-payments.php:118
|
781 |
msgid "Description"
|
782 |
msgstr ""
|
783 |
|
784 |
#. translators: gateway title
|
785 |
+
#: gateway/local-gateway.php:137
|
786 |
msgid "Description of the %1s gateway."
|
787 |
msgstr ""
|
788 |
|
789 |
+
#: gateway/local-gateway.php:141
|
790 |
msgid "Order button label"
|
791 |
msgstr ""
|
792 |
|
793 |
+
#: gateway/local-gateway.php:143
|
794 |
msgid "Customize label for order button."
|
795 |
msgstr ""
|
796 |
|
797 |
#. translators: %s: Method title.
|
798 |
+
#: gateway/local-gateway.php:145
|
799 |
msgid "Pay with %s"
|
800 |
msgstr ""
|
801 |
|
802 |
+
#: gateway/local-gateway.php:149
|
803 |
msgid "Selling location(s)"
|
804 |
msgstr ""
|
805 |
|
806 |
#. translators: gateway title
|
807 |
+
#: gateway/local-gateway.php:156
|
808 |
msgid "Choose the countries where you wish to display the %1$s gateway. The gateway will appear when the customer's billing country is in the chosen countries."
|
809 |
msgstr ""
|
810 |
|
811 |
+
#: gateway/local-gateway.php:158
|
812 |
msgid "Sell to all countries"
|
813 |
msgstr ""
|
814 |
|
815 |
+
#: gateway/local-gateway.php:159
|
816 |
+
#: gateway/local-gateway.php:164
|
817 |
msgid "Sell to all countries, except for…"
|
818 |
msgstr ""
|
819 |
|
820 |
+
#: gateway/local-gateway.php:160
|
821 |
+
#: gateway/local-gateway.php:177
|
822 |
msgid "Sell to specific countries"
|
823 |
msgstr ""
|
824 |
|
825 |
+
#: gateway/local-gateway.php:170
|
826 |
msgid "When the billing country matches one of these values, the payment method will be hidden on the Checkout page."
|
827 |
msgstr ""
|
828 |
|
829 |
+
#: gateway/local-gateway.php:183
|
830 |
msgid "When the billing country matches one of these values, the payment method will be shown on the Checkout page."
|
831 |
msgstr ""
|
832 |
|
833 |
+
#: gateway/local-gateway.php:236
|
834 |
msgid "Choose countries / regions…"
|
835 |
msgstr ""
|
836 |
|
837 |
+
#: gateway/local-gateway.php:237
|
838 |
msgid "Country / Region"
|
839 |
msgstr ""
|
840 |
|
841 |
+
#: gateway/local-gateway.php:249
|
842 |
msgid "Select all"
|
843 |
msgstr ""
|
844 |
|
845 |
+
#: gateway/local-gateway.php:250
|
846 |
msgid "Select none"
|
847 |
msgstr ""
|
848 |
|
849 |
+
#: gateway/local-gateway.php:340
|
850 |
+
#: wizard/build/app.js:1
|
851 |
+
msgid "requires"
|
852 |
+
msgstr ""
|
853 |
+
|
854 |
+
#: gateway/local-gateway.php:340
|
855 |
+
msgid "recommends"
|
856 |
+
msgstr ""
|
857 |
+
|
858 |
+
#. translators: %1$s requires message, %2$s Webhook secret page link, %4$s Payment method, %5$s Webhook guide page link
|
859 |
+
#: gateway/local-gateway.php:342
|
860 |
+
msgid "Stripe %1$s using the %2$swebhook%3$s for %4$s. %5$sWebhook Guide%6$s "
|
861 |
msgstr ""
|
862 |
|
863 |
#. translators: %1$s Payment method, %2$s List of supported currencies
|
864 |
+
#: gateway/local-gateway.php:352
|
865 |
msgid "%1$s is enabled - it requires store currency to be set to %2$s."
|
866 |
msgstr ""
|
867 |
|
868 |
+
#. translators: %1$s Payment method, %2$s List of supported currencies
|
869 |
+
#: gateway/local-gateway.php:363
|
870 |
+
msgid "%1$s is enabled - your store currency %2$s does not match with your stripe account supported currency %3$s."
|
871 |
+
msgstr ""
|
872 |
+
|
873 |
#. translators: %s: supported currency.
|
874 |
+
#: gateway/local-gateway.php:388
|
875 |
msgid "This gateway will appear when store currency is <strong>%s</strong>."
|
876 |
msgstr ""
|
877 |
|
878 |
#. translators: HTML Entities.
|
879 |
+
#: gateway/local-gateway.php:402
|
880 |
+
msgid "%1$1sTest Mode Enabled :%2$2s You will be redirected to an authorization page hosted by Stripe."
|
881 |
msgstr ""
|
882 |
|
883 |
#. translators: %1$1s method title, %2$2s order id, %3$3s order total amount
|
884 |
+
#: gateway/local-gateway.php:447
|
885 |
msgid "Begin processing payment with %1$1s for order %2$2s for the amount of %3$3s"
|
886 |
msgstr ""
|
887 |
|
888 |
+
#: gateway/local-gateway.php:464
|
889 |
msgid "Contact seller. "
|
890 |
msgstr ""
|
891 |
|
892 |
+
#: gateway/local-gateway.php:467
|
893 |
msgid "Store currency doesn't match stripe currency. "
|
894 |
msgstr ""
|
895 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
896 |
#. translators: %s: payment fail message.
|
897 |
+
#: gateway/local-gateway.php:585
|
898 |
+
#: gateway/stripe/sepa.php:510
|
899 |
msgid "Payment failed. %s"
|
900 |
msgstr ""
|
901 |
|
910 |
msgstr ""
|
911 |
|
912 |
#: gateway/stripe/alipay.php:146
|
913 |
+
#: gateway/stripe/bancontact.php:144
|
914 |
#: gateway/stripe/klarna.php:181
|
915 |
+
#: gateway/stripe/wechat.php:162
|
916 |
msgid "Add Payment"
|
917 |
msgstr ""
|
918 |
|
919 |
+
#. translators: %1$s: Break, %2$s: Gateway appear message, %3$s: Break, %4$s: Gateway appear message currency wise, %4$s: HTML entities
|
920 |
+
#: gateway/stripe/bancontact.php:71
|
921 |
+
msgid "Accept payment using Bancontact. %1$s %2$s"
|
922 |
+
msgstr ""
|
923 |
+
|
924 |
+
#: gateway/stripe/card-payments.php:54
|
925 |
+
#: wizard/build/app.js:1
|
926 |
msgid "Stripe Card Processing"
|
927 |
msgstr ""
|
928 |
|
929 |
+
#: gateway/stripe/card-payments.php:55
|
930 |
msgid "Accepts payments via Credit/Debit Cards"
|
931 |
msgstr ""
|
932 |
|
933 |
+
#: gateway/stripe/card-payments.php:107
|
934 |
msgid "Enable Stripe Gateway"
|
935 |
msgstr ""
|
936 |
|
937 |
+
#: gateway/stripe/card-payments.php:113
|
938 |
msgid "Title of Card Element"
|
939 |
msgstr ""
|
940 |
|
941 |
+
#: gateway/stripe/card-payments.php:114
|
942 |
msgid "Credit Card (Stripe)"
|
943 |
msgstr ""
|
944 |
|
945 |
+
#: gateway/stripe/card-payments.php:121
|
946 |
msgid "Description on Card Elements for Live mode"
|
947 |
msgstr ""
|
948 |
|
949 |
+
#: gateway/stripe/card-payments.php:122
|
950 |
msgid "Pay with your credit card via Stripe"
|
951 |
msgstr ""
|
952 |
|
953 |
+
#: gateway/stripe/card-payments.php:126
|
954 |
+
#: gateway/stripe/sepa.php:235
|
955 |
msgid "Statement Descriptor"
|
956 |
msgstr ""
|
957 |
|
958 |
+
#: gateway/stripe/card-payments.php:128
|
959 |
+
#: gateway/stripe/sepa.php:237
|
960 |
msgid "Statement descriptors are limited to 22 characters, cannot use the special characters >, <, \", \\, *, /, (, ), {, }, and must not consist solely of numbers. This will appear on your customer's statement in capital letters."
|
961 |
msgstr ""
|
962 |
|
963 |
+
#: gateway/stripe/card-payments.php:133
|
964 |
#: gateway/stripe/klarna.php:139
|
965 |
msgid "Charge Type"
|
966 |
msgstr ""
|
967 |
|
968 |
+
#: gateway/stripe/card-payments.php:135
|
969 |
#: gateway/stripe/klarna.php:141
|
970 |
msgid "Select how to charge Order"
|
971 |
msgstr ""
|
972 |
|
973 |
+
#: gateway/stripe/card-payments.php:138
|
974 |
#: gateway/stripe/klarna.php:144
|
975 |
msgid "Charge"
|
976 |
msgstr ""
|
977 |
|
978 |
+
#: gateway/stripe/card-payments.php:139
|
979 |
#: gateway/stripe/klarna.php:145
|
980 |
msgid "Authorize"
|
981 |
msgstr ""
|
982 |
|
983 |
+
#: gateway/stripe/card-payments.php:144
|
984 |
msgid "Enable Payment via Saved Cards"
|
985 |
msgstr ""
|
986 |
|
987 |
+
#: gateway/stripe/card-payments.php:145
|
988 |
msgid "Saved Cards"
|
989 |
msgstr ""
|
990 |
|
991 |
+
#: gateway/stripe/card-payments.php:147
|
992 |
msgid "Save card details for future orders"
|
993 |
msgstr ""
|
994 |
|
995 |
+
#: gateway/stripe/card-payments.php:152
|
996 |
msgid "Enable Inline Credit Card Form"
|
997 |
msgstr ""
|
998 |
|
999 |
+
#: gateway/stripe/card-payments.php:153
|
1000 |
msgid "Inline Credit Card Form"
|
1001 |
msgstr ""
|
1002 |
|
1003 |
+
#: gateway/stripe/card-payments.php:155
|
1004 |
msgid "Use inline credit card for card payments"
|
1005 |
msgstr ""
|
1006 |
|
1007 |
+
#: gateway/stripe/card-payments.php:160
|
1008 |
msgid "Allowed Cards"
|
1009 |
msgstr ""
|
1010 |
|
1011 |
+
#: gateway/stripe/card-payments.php:163
|
1012 |
msgid "Accepts payments using selected cards. If empty all stripe cards are accepted."
|
1013 |
msgstr ""
|
1014 |
|
1015 |
+
#: gateway/stripe/card-payments.php:174
|
1016 |
+
msgid "Select cards for accepts payments. If empty all stripe cards are accepted."
|
1017 |
+
msgstr ""
|
1018 |
+
|
1019 |
+
#: gateway/stripe/card-payments.php:178
|
1020 |
msgid "Order Status"
|
1021 |
msgstr ""
|
1022 |
|
1023 |
+
#: gateway/stripe/card-payments.php:181
|
1024 |
+
msgid "Default"
|
1025 |
+
msgstr ""
|
1026 |
+
|
1027 |
+
#: gateway/stripe/card-payments.php:182
|
1028 |
msgid "Processing"
|
1029 |
msgstr ""
|
1030 |
|
1031 |
+
#: gateway/stripe/card-payments.php:183
|
1032 |
msgid "On Hold"
|
1033 |
msgstr ""
|
1034 |
|
1035 |
+
#: gateway/stripe/card-payments.php:184
|
1036 |
msgid "Completed"
|
1037 |
msgstr ""
|
1038 |
|
1039 |
+
#: gateway/stripe/card-payments.php:188
|
1040 |
msgid "This is the status of the order once payment is complete. If <b>Default</b> is selected, then WooCommerce will set the order status automatically based on internal logic which states if a product is virtual and downloadable then status is set to complete. Products that require shipping are set to Processing. Default is the recommended setting as it allows standard WooCommerce code to process the order status."
|
1041 |
msgstr ""
|
1042 |
|
1043 |
+
#: gateway/stripe/card-payments.php:191
|
1044 |
msgid "Order Button Label"
|
1045 |
msgstr ""
|
1046 |
|
1047 |
+
#: gateway/stripe/card-payments.php:193
|
1048 |
msgid "Customize label for Order button"
|
1049 |
msgstr ""
|
1050 |
|
1051 |
+
#: gateway/stripe/card-payments.php:194
|
1052 |
msgid "Pay via Stripe"
|
1053 |
msgstr ""
|
1054 |
|
1055 |
#. translators: %1$1s order id, %2$2s order total amount
|
1056 |
+
#: gateway/stripe/card-payments.php:246
|
1057 |
msgid "Begin processing payment with new payment method for order %1$1s for the amount of %2$2s"
|
1058 |
msgstr ""
|
1059 |
|
1060 |
+
#: gateway/stripe/card-payments.php:280
|
1061 |
+
#: gateway/stripe/sepa.php:170
|
|
|
|
|
|
|
|
|
1062 |
msgid "There was a problem adding the payment method."
|
1063 |
msgstr ""
|
1064 |
|
1065 |
#. translators: error msg
|
1066 |
+
#: gateway/stripe/card-payments.php:282
|
1067 |
+
#: gateway/stripe/card-payments.php:298
|
1068 |
+
#: gateway/stripe/card-payments.php:315
|
1069 |
+
#: gateway/stripe/sepa.php:172
|
1070 |
+
#: gateway/stripe/sepa.php:187
|
1071 |
+
#: gateway/stripe/sepa.php:204
|
1072 |
msgid "Add payment method Error: %1$1s"
|
1073 |
msgstr ""
|
1074 |
|
1075 |
+
#: gateway/stripe/card-payments.php:295
|
1076 |
+
#: gateway/stripe/sepa.php:184
|
1077 |
msgid "Invalid stripe source"
|
1078 |
msgstr ""
|
1079 |
|
1080 |
+
#: gateway/stripe/card-payments.php:312
|
1081 |
+
#: gateway/stripe/sepa.php:201
|
1082 |
msgid "Unble to attach payment method to customer"
|
1083 |
msgstr ""
|
1084 |
|
1085 |
+
#: gateway/stripe/card-payments.php:321
|
1086 |
+
#: gateway/stripe/sepa.php:210
|
1087 |
msgid "New payment method added successfully"
|
1088 |
msgstr ""
|
1089 |
|
1090 |
#. translators: %1$1s order id, %2$2s token id
|
1091 |
+
#: gateway/stripe/card-payments.php:352
|
1092 |
+
#: gateway/stripe/sepa.php:482
|
1093 |
msgid "Payment method tokenized for Order id - %1$1s with token id - %2$2s"
|
1094 |
msgstr ""
|
1095 |
|
1096 |
#. translators: %1$1s, %2$2s: HTML Markup
|
1097 |
+
#: gateway/stripe/card-payments.php:473
|
1098 |
msgid "Live Stripe.js integrations must use HTTPS. %1$1s For more information:%2$2s"
|
1099 |
msgstr ""
|
1100 |
|
1101 |
+
#: gateway/stripe/card-payments.php:503
|
1102 |
msgid "Enter Card Details"
|
1103 |
msgstr ""
|
1104 |
|
1105 |
+
#: gateway/stripe/card-payments.php:506
|
1106 |
msgid "Expiry Date"
|
1107 |
msgstr ""
|
1108 |
|
1109 |
+
#: gateway/stripe/card-payments.php:510
|
1110 |
msgid "CVC"
|
1111 |
msgstr ""
|
1112 |
|
1113 |
+
#: gateway/stripe/card-payments.php:515
|
1114 |
msgid "Save Card for Future Payments"
|
1115 |
msgstr ""
|
1116 |
|
1117 |
#. translators: %1$1s - %6$6s: HTML Markup
|
1118 |
+
#: gateway/stripe/card-payments.php:521
|
1119 |
+
msgid "%1$1s Test Mode Enabled:%2$2s Use demo card 4242424242424242 with any future date and CVV. Check more %3$3sdemo cards%4$4s"
|
1120 |
msgstr ""
|
1121 |
|
1122 |
+
#: gateway/stripe/frontend-scripts.php:108
|
1123 |
msgid "MasterCard"
|
1124 |
msgstr ""
|
1125 |
|
1126 |
+
#: gateway/stripe/frontend-scripts.php:109
|
1127 |
msgid "Visa"
|
1128 |
msgstr ""
|
1129 |
|
1130 |
+
#: gateway/stripe/frontend-scripts.php:110
|
1131 |
msgid "American Express"
|
1132 |
msgstr ""
|
1133 |
|
1134 |
+
#: gateway/stripe/frontend-scripts.php:111
|
1135 |
msgid "Discover"
|
1136 |
msgstr ""
|
1137 |
|
1138 |
+
#: gateway/stripe/frontend-scripts.php:112
|
1139 |
msgid "JCB"
|
1140 |
msgstr ""
|
1141 |
|
1142 |
+
#: gateway/stripe/frontend-scripts.php:113
|
1143 |
msgid "Diners Club"
|
1144 |
msgstr ""
|
1145 |
|
1146 |
+
#: gateway/stripe/frontend-scripts.php:114
|
1147 |
msgid "UnionPay"
|
1148 |
msgstr ""
|
1149 |
|
1150 |
+
#: gateway/stripe/frontend-scripts.php:116
|
1151 |
msgid "is not allowed"
|
1152 |
msgstr ""
|
1153 |
|
1154 |
+
#: gateway/stripe/frontend-scripts.php:130
|
1155 |
+
msgid "Please enter a IBAN number to proceed."
|
1156 |
+
msgstr ""
|
1157 |
+
|
1158 |
+
#: gateway/stripe/frontend-scripts.php:131
|
1159 |
msgid "Please select a bank to proceed."
|
1160 |
msgstr ""
|
1161 |
|
1183 |
msgid "Accept payment using Przelewy24. %1$s %2$s"
|
1184 |
msgstr ""
|
1185 |
|
1186 |
+
#: gateway/stripe/payment-request-api.php:283
|
1187 |
msgid "Empty cart"
|
1188 |
msgstr ""
|
1189 |
|
1190 |
+
#: gateway/stripe/payment-request-api.php:378
|
1191 |
msgid "Sign up Fee"
|
1192 |
msgstr ""
|
1193 |
|
1194 |
+
#: gateway/stripe/payment-request-api.php:390
|
1195 |
+
#: gateway/stripe/payment-request-api.php:491
|
1196 |
+
#: gateway/stripe/payment-request-api.php:664
|
1197 |
msgid "Tax"
|
1198 |
msgstr ""
|
1199 |
|
1200 |
+
#: gateway/stripe/payment-request-api.php:398
|
1201 |
+
#: gateway/stripe/payment-request-api.php:498
|
1202 |
+
#: gateway/stripe/payment-request-api.php:672
|
1203 |
msgid "Shipping"
|
1204 |
msgstr ""
|
1205 |
|
1206 |
+
#: gateway/stripe/payment-request-api.php:405
|
1207 |
+
#: gateway/stripe/payment-request-api.php:679
|
1208 |
msgid "Pending"
|
1209 |
msgstr ""
|
1210 |
|
1211 |
+
#: gateway/stripe/payment-request-api.php:505
|
1212 |
msgid "Discount"
|
1213 |
msgstr ""
|
1214 |
|
1215 |
#. translators: %d is the product Id
|
1216 |
+
#: gateway/stripe/payment-request-api.php:626
|
1217 |
msgid "Product with the ID (%d) cannot be found."
|
1218 |
msgstr ""
|
1219 |
|
1220 |
#. translators: 1: product name 2: quantity in stock
|
1221 |
+
#: gateway/stripe/payment-request-api.php:647
|
1222 |
msgid "You cannot add that amount of \"%1$s\"; to the cart because there is not enough stock (%2$s remaining)."
|
1223 |
msgstr ""
|
1224 |
|
1225 |
+
#: gateway/stripe/payment-request-api.php:776
|
1226 |
+
#: gateway/stripe/payment-request-api.php:793
|
1227 |
msgid "Unable to find shipping method for address."
|
1228 |
msgstr ""
|
1229 |
|
1230 |
+
#: gateway/stripe/payment-request-api.php:781
|
1231 |
msgid "Unable to provide shipping options for Payment Requests."
|
1232 |
msgstr ""
|
1233 |
|
1234 |
+
#: gateway/stripe/sepa.php:90
|
1235 |
+
msgid "SEPA IBAN"
|
1236 |
+
msgstr ""
|
1237 |
+
|
1238 |
+
#. translators: %1$s: Break, %2$s: HTML entities
|
1239 |
+
#: gateway/stripe/sepa.php:126
|
1240 |
+
msgid "Accept payment using SEPA. %1$s %2$s"
|
1241 |
+
msgstr ""
|
1242 |
+
|
1243 |
+
#: gateway/stripe/sepa.php:227
|
1244 |
+
msgid "Enable Payment via Saved IBAN"
|
1245 |
+
msgstr ""
|
1246 |
+
|
1247 |
+
#: gateway/stripe/sepa.php:228
|
1248 |
+
msgid "Saved IBAN"
|
1249 |
+
msgstr ""
|
1250 |
+
|
1251 |
+
#: gateway/stripe/sepa.php:230
|
1252 |
+
msgid "Save IBAN details for future orders"
|
1253 |
+
msgstr ""
|
1254 |
+
|
1255 |
+
#: gateway/stripe/sepa.php:242
|
1256 |
+
msgid "Company Name"
|
1257 |
+
msgstr ""
|
1258 |
+
|
1259 |
+
#: gateway/stripe/sepa.php:246
|
1260 |
+
msgid "The name of your company that will appear in the SEPA mandate."
|
1261 |
+
msgstr ""
|
1262 |
+
|
1263 |
+
#: gateway/stripe/sepa.php:252
|
1264 |
+
msgid "Mandate Information."
|
1265 |
+
msgstr ""
|
1266 |
+
|
1267 |
+
#. translators: %s: company name.
|
1268 |
+
#: gateway/stripe/sepa.php:285
|
1269 |
+
msgid "By providing your IBAN and confirming this payment, you are authorizing %s and Stripe, our payment service provider, to send instructions to your bank to debit your account and your bank to debit your account in accordance with those instructions. You are entitled to a refund from your bank under the terms and conditions of your agreement with your bank. A refund must be claimed within 8 weeks starting from the date on which your account was debited."
|
1270 |
+
msgstr ""
|
1271 |
+
|
1272 |
+
#: gateway/stripe/sepa.php:291
|
1273 |
+
msgid "IBAN."
|
1274 |
+
msgstr ""
|
1275 |
+
|
1276 |
+
#. translators: %1$1s - %6$6s: HTML Markup
|
1277 |
+
#: gateway/stripe/sepa.php:356
|
1278 |
+
msgid "%1$1s Test Mode Enabled %2$2s : Use demo IBAN number DE89370400440532013000. %3$3s Check more %4$4sDemo IBAN Number%5$5s"
|
1279 |
+
msgstr ""
|
1280 |
+
|
1281 |
+
#. translators: %1$1s order id, %2$2s order total amount
|
1282 |
+
#: gateway/stripe/sepa.php:432
|
1283 |
+
msgid "Begin processing payment with SEPA for order %1$1s for the amount of %2$2s"
|
1284 |
+
msgstr ""
|
1285 |
+
|
1286 |
#: gateway/stripe/stripe-api.php:61
|
1287 |
msgid "Stripe not initialized"
|
1288 |
msgstr ""
|
1309 |
msgstr ""
|
1310 |
|
1311 |
#. translators: order id
|
1312 |
+
#: gateway/stripe/webhook.php:258
|
1313 |
msgid "Stripe charge partially captured with amount %1$1s Order id - %2$2s"
|
1314 |
msgstr ""
|
1315 |
|
1316 |
#. translators: partial captured amount
|
1317 |
+
#: gateway/stripe/webhook.php:260
|
1318 |
msgid "This charge was partially captured via Stripe Dashboard with the amount : %s"
|
1319 |
msgstr ""
|
1320 |
|
1321 |
#. translators: order id
|
1322 |
+
#: gateway/stripe/webhook.php:264
|
1323 |
msgid "Stripe charge completely captured Order id - %1s"
|
1324 |
msgstr ""
|
1325 |
|
1326 |
#. translators: amount (including currency symbol)
|
1327 |
+
#: gateway/stripe/webhook.php:310
|
1328 |
msgid "Pre-Authorization for %s voided from the Stripe Dashboard."
|
1329 |
msgstr ""
|
1330 |
|
1331 |
+
#: gateway/stripe/webhook.php:323
|
1332 |
msgid "Refunded via stripe dashboard"
|
1333 |
msgstr ""
|
1334 |
|
1335 |
+
#: gateway/stripe/webhook.php:348
|
1336 |
+
msgid "Pending to Success"
|
1337 |
+
msgstr ""
|
1338 |
+
|
1339 |
+
#: gateway/stripe/webhook.php:348
|
1340 |
+
msgid "Success"
|
1341 |
msgstr ""
|
1342 |
|
1343 |
+
#: gateway/stripe/webhook.php:351
|
1344 |
msgid " Transaction ID : "
|
1345 |
msgstr ""
|
1346 |
|
1347 |
+
#: gateway/stripe/webhook.php:372
|
1348 |
msgid "This order is under dispute. Please respond via stripe dashboard."
|
1349 |
msgstr ""
|
1350 |
|
1351 |
+
#: gateway/stripe/webhook.php:396
|
1352 |
msgid "The disputed order lost or accepted."
|
1353 |
msgstr ""
|
1354 |
|
1355 |
+
#: gateway/stripe/webhook.php:400
|
1356 |
msgid "The disputed order resolved in your favour."
|
1357 |
msgstr ""
|
1358 |
|
1359 |
+
#: gateway/stripe/webhook.php:404
|
1360 |
msgid "The inquiry or retrieval closed."
|
1361 |
msgstr ""
|
1362 |
|
1363 |
#. translators: transaction id, order id
|
1364 |
+
#: gateway/stripe/webhook.php:443
|
1365 |
msgid "Stripe PaymentIntent %1$1s succeeded for order %2$2s"
|
1366 |
msgstr ""
|
1367 |
|
1368 |
#. translators: The error message that was received from Stripe.
|
1369 |
+
#: gateway/stripe/webhook.php:465
|
1370 |
msgid "Reason: %s"
|
1371 |
msgstr ""
|
1372 |
|
1373 |
#. translators: The error message that was received from Stripe.
|
1374 |
+
#: gateway/stripe/webhook.php:467
|
1375 |
msgid "Stripe SCA authentication failed. %s"
|
1376 |
msgstr ""
|
1377 |
|
1378 |
+
#: gateway/stripe/webhook.php:489
|
1379 |
msgid "This order is under review. Please respond via stripe dashboard."
|
1380 |
msgstr ""
|
1381 |
|
1382 |
#. translators: Review reson from stripe
|
1383 |
+
#: gateway/stripe/webhook.php:511
|
1384 |
msgid "Review for this order has been resolved. Reason: %s"
|
1385 |
msgstr ""
|
1386 |
|
1387 |
+
#. translators: %1$s: Break, %2$s: Gateway appear message, %3$s: Break, %4$s: Gateway appear message currency wise, %4$s: HTML entities
|
1388 |
+
#: gateway/stripe/wechat.php:73
|
1389 |
+
msgid "Accept payment using WeChat. %1$s %2$s"
|
1390 |
+
msgstr ""
|
1391 |
+
|
1392 |
+
#. translators: HTML Entities.
|
1393 |
+
#: gateway/stripe/wechat.php:87
|
1394 |
+
msgid "%1$1s%2$2sTest Mode Enabled%3$3s : A QR code will pop up, scan and pay with WeChat."
|
1395 |
+
msgstr ""
|
1396 |
+
|
1397 |
+
#. translators: last 4 digits of IBAN account
|
1398 |
+
#: inc/token.php:54
|
1399 |
+
msgid "SEPA IBAN ending in %s"
|
1400 |
+
msgstr ""
|
1401 |
+
|
1402 |
+
#: inc/traits/subscriptions.php:63
|
1403 |
+
msgid "Update the payment method used for all of my active subscriptions."
|
1404 |
msgstr ""
|
1405 |
|
1406 |
+
#: inc/traits/subscriptions.php:210
|
1407 |
msgid "Customer not found"
|
1408 |
msgstr ""
|
1409 |
|
1410 |
+
#: inc/traits/subscriptions.php:234
|
1411 |
msgid "Sorry, we are unable to process your payment at this time. Please retry later."
|
1412 |
msgstr ""
|
1413 |
|
1414 |
+
#: inc/traits/subscriptions.php:253
|
1415 |
msgid "This transaction requires authentication."
|
1416 |
msgstr ""
|
1417 |
|
1418 |
#. translators: %s is the charge Id
|
1419 |
#. translators: %s is the stripe charge Id
|
1420 |
+
#: inc/traits/subscriptions.php:262
|
1421 |
+
#: inc/traits/subscriptions.php:654
|
1422 |
msgid "Stripe charge awaiting authentication by user: %s."
|
1423 |
msgstr ""
|
1424 |
|
1425 |
+
#: inc/traits/subscriptions.php:583
|
1426 |
msgid "A \"Stripe Customer ID\" value is required."
|
1427 |
msgstr ""
|
1428 |
|
1429 |
+
#: inc/traits/subscriptions.php:586
|
1430 |
msgid "Invalid customer ID. A valid \"Stripe Customer ID\" must begin with \"cus_\"."
|
1431 |
msgstr ""
|
1432 |
|
1433 |
+
#: inc/traits/subscriptions.php:596
|
1434 |
msgid "Invalid source ID. A valid source \"Stripe Source ID\" must begin with \"src_\", \"pm_\", or \"card_\"."
|
1435 |
msgstr ""
|
1436 |
|
1437 |
+
#: inc/traits/subscriptions.php:777
|
1438 |
msgid "Invalid payment method. Please input a new card number."
|
1439 |
msgstr ""
|
1440 |
|
1441 |
+
#: wizard/onboarding.php:130
|
1442 |
+
msgid "Stripe for WooCommerce - Onboarding"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1443 |
msgstr ""
|
1444 |
|
1445 |
+
#: wizard/onboarding.php:178
|
1446 |
+
msgid "Thanks for installing Checkout Plugins - Stripe for WooCommerce!"
|
1447 |
msgstr ""
|
1448 |
|
1449 |
+
#: wizard/onboarding.php:179
|
1450 |
+
msgid "Follow Onboarding process to connect your Stripe account"
|
1451 |
msgstr ""
|
1452 |
|
1453 |
+
#: wizard/onboarding.php:181
|
1454 |
+
msgid "Configure Stripe"
|
|
|
1455 |
msgstr ""
|
1456 |
|
1457 |
+
#: wizard/onboarding.php:182
|
1458 |
+
msgid "Skip Setup"
|
1459 |
msgstr ""
|
1460 |
|
1461 |
+
#: wizard/build/app.js:1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1462 |
msgid "Let's Connect"
|
1463 |
msgstr ""
|
1464 |
|
1465 |
+
#: wizard/build/app.js:1
|
1466 |
msgid "with Stripe"
|
1467 |
msgstr ""
|
1468 |
|
1469 |
+
#: wizard/build/app.js:1
|
|
|
|
|
|
|
|
|
1470 |
msgid "recommends to connect with"
|
1471 |
msgstr ""
|
1472 |
|
1473 |
+
#: wizard/build/app.js:1
|
1474 |
msgid "Stripe connect."
|
1475 |
msgstr ""
|
1476 |
|
1477 |
+
#: wizard/build/app.js:1
|
1478 |
msgid "One click onboarding solution provided by"
|
1479 |
msgstr ""
|
1480 |
|
1481 |
+
#: wizard/build/app.js:1
|
1482 |
msgid "Stripe."
|
1483 |
msgstr ""
|
1484 |
|
1485 |
+
#: wizard/build/app.js:1
|
1486 |
msgid "Connecting…"
|
1487 |
msgstr ""
|
1488 |
|
1489 |
+
#: wizard/build/app.js:1
|
1490 |
msgid "Leave onboarding process"
|
1491 |
msgstr ""
|
1492 |
|
1493 |
+
#: wizard/build/app.js:1
|
1494 |
msgid "Congratulations!!"
|
1495 |
msgstr ""
|
1496 |
|
1497 |
+
#: wizard/build/app.js:1
|
1498 |
msgid "You are connected to Stripe successfully."
|
1499 |
msgstr ""
|
1500 |
|
1501 |
+
#: wizard/build/app.js:1
|
1502 |
msgid "Let's enable gateways"
|
1503 |
msgstr ""
|
1504 |
|
1505 |
+
#: wizard/build/app.js:1
|
1506 |
msgid "Recommended"
|
1507 |
msgstr ""
|
1508 |
|
1509 |
+
#: wizard/build/app.js:1
|
1510 |
msgid "Works with all currencies"
|
1511 |
msgstr ""
|
1512 |
|
1513 |
+
#: wizard/build/app.js:1
|
1514 |
msgid "Works with "
|
1515 |
msgstr ""
|
1516 |
|
1517 |
+
#: wizard/build/app.js:1
|
1518 |
+
msgid "Enabling…"
|
1519 |
+
msgstr ""
|
1520 |
+
|
1521 |
+
#: wizard/build/app.js:1
|
1522 |
msgid "Enable Gateways"
|
1523 |
msgstr ""
|
1524 |
|
1525 |
+
#: wizard/build/app.js:1
|
1526 |
+
msgid "Wooho!!"
|
1527 |
+
msgstr ""
|
1528 |
+
|
1529 |
+
#: wizard/build/app.js:1
|
1530 |
+
msgid "You are almost done."
|
1531 |
+
msgstr ""
|
1532 |
+
|
1533 |
+
#: wizard/build/app.js:1
|
1534 |
+
msgid "Since you have enabled"
|
1535 |
+
msgstr ""
|
1536 |
+
|
1537 |
+
#: wizard/build/app.js:1
|
1538 |
+
msgid " We recommend you to enable"
|
1539 |
+
msgstr ""
|
1540 |
+
|
1541 |
+
#: wizard/build/app.js:1
|
1542 |
+
msgid "feature"
|
1543 |
+
msgstr ""
|
1544 |
+
|
1545 |
+
#: wizard/build/app.js:1
|
1546 |
+
msgid "Express Checkout generates more conversions!!"
|
1547 |
+
msgstr ""
|
1548 |
+
|
1549 |
+
#: wizard/build/app.js:1
|
1550 |
+
msgid "Skip Express Checkout"
|
1551 |
+
msgstr ""
|
1552 |
+
|
1553 |
+
#: wizard/build/app.js:1
|
1554 |
+
msgid "Failed!!"
|
1555 |
+
msgstr ""
|
1556 |
+
|
1557 |
+
#: wizard/build/app.js:1
|
1558 |
+
msgid "Unfortunately Connection to Stripe failed."
|
1559 |
+
msgstr ""
|
1560 |
+
|
1561 |
+
#: wizard/build/app.js:1
|
1562 |
+
msgid "Try Again"
|
1563 |
+
msgstr ""
|
1564 |
+
|
1565 |
+
#: wizard/build/app.js:1
|
1566 |
msgid "Great!!"
|
1567 |
msgstr ""
|
1568 |
|
1569 |
+
#: wizard/build/app.js:1
|
1570 |
msgid "Your store is all set to accept payment."
|
1571 |
msgstr ""
|
1572 |
|
1573 |
+
#: wizard/build/app.js:1
|
1574 |
msgid "We provide lots of customization options to match your needs, don't forget to explore them."
|
1575 |
msgstr ""
|
1576 |
|
1577 |
+
#: wizard/build/app.js:1
|
1578 |
msgid "Let's Customize…"
|
1579 |
msgstr ""
|
1580 |
|
1581 |
+
#: wizard/build/app.js:1
|
1582 |
msgid "Let's Customize"
|
1583 |
msgstr ""
|
1584 |
|
1585 |
+
#: wizard/build/app.js:1
|
1586 |
msgid "Missing"
|
1587 |
msgstr ""
|
1588 |
|
1589 |
+
#: wizard/build/app.js:1
|
1590 |
+
msgid "Inactiave"
|
1591 |
msgstr ""
|
1592 |
|
1593 |
+
#: wizard/build/app.js:1
|
1594 |
+
msgid "WooCoomerce"
|
1595 |
msgstr ""
|
1596 |
|
1597 |
+
#: wizard/build/app.js:1
|
1598 |
+
msgid "Checkout Plugins - Stripe for WooCoomerce"
|
1599 |
msgstr ""
|
1600 |
|
1601 |
+
#: wizard/build/app.js:1
|
1602 |
msgid "WooCommerce"
|
1603 |
msgstr ""
|
1604 |
|
1605 |
+
#: wizard/build/app.js:1
|
1606 |
msgid "to be active on your store."
|
1607 |
msgstr ""
|
1608 |
|
1609 |
+
#: wizard/build/app.js:1
|
1610 |
msgid "Installing…"
|
1611 |
msgstr ""
|
1612 |
|
1613 |
+
#: wizard/build/app.js:1
|
1614 |
msgid "Activating…"
|
1615 |
msgstr ""
|
1616 |
|
1617 |
+
#: wizard/build/app.js:1
|
1618 |
msgid "Install and continue"
|
1619 |
msgstr ""
|
1620 |
+
|
1621 |
+
#: wizard/build/app.js:1
|
1622 |
+
msgid "Activate and continue"
|
1623 |
+
msgstr ""
|
1624 |
+
|
1625 |
+
#: wizard/build/app.js:1
|
1626 |
+
msgid "Installing WooCommerce will take time. Please be patient."
|
1627 |
+
msgstr ""
|
1628 |
+
|
1629 |
+
#: wizard/build/app.js:1
|
1630 |
+
msgid "WooCommerce installing failed. Please try again."
|
1631 |
+
msgstr ""
|
postcss.config.js
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
module.exports = {
|
2 |
-
plugins: {
|
3 |
-
tailwindcss: {},
|
4 |
-
autoprefixer: {},
|
5 |
-
},
|
6 |
-
};
|
|
|
|
|
|
|
|
|
|
|
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: brainstormforce
|
|
3 |
Tags: stripe, credit card
|
4 |
Requires at least: 5.4
|
5 |
Tested up to: 5.9
|
6 |
-
Stable tag: 1.
|
7 |
Requires PHP: 5.6
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
@@ -108,6 +108,13 @@ We understand the need for a quality product backed by dedicated support that ca
|
|
108 |
|
109 |
== Changelog ==
|
110 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
= 1.3.1 - TUESDAY, 8TH FEBRUARY 2022 =
|
112 |
* Fix: Klarna payment method was showing on the checkout page when disabled.
|
113 |
|
3 |
Tags: stripe, credit card
|
4 |
Requires at least: 5.4
|
5 |
Tested up to: 5.9
|
6 |
+
Stable tag: 1.4.0
|
7 |
Requires PHP: 5.6
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
108 |
|
109 |
== Changelog ==
|
110 |
|
111 |
+
= 1.4.0 - TUESDAY, 22ND FEBRUARY 2022 =
|
112 |
+
* New: Supports SEPA payment method.
|
113 |
+
* New: Supports WeChat payment method.
|
114 |
+
* Fix: Onboarding menu icon appears even if stripe is connected.
|
115 |
+
* Fix: Critical error with webhook description fixed.
|
116 |
+
* Fix: 3ds cards issue on pay order and change payment methods page.
|
117 |
+
|
118 |
= 1.3.1 - TUESDAY, 8TH FEBRUARY 2022 =
|
119 |
* Fix: Klarna payment method was showing on the checkout page when disabled.
|
120 |
|
tailwind.config.js
DELETED
@@ -1,25 +0,0 @@
|
|
1 |
-
module.exports = {
|
2 |
-
content: [ './wizard/src/**/*.@(js|jsx)' ],
|
3 |
-
theme: {
|
4 |
-
extend: {
|
5 |
-
colors: {
|
6 |
-
stripe: {
|
7 |
-
500: '#635bff',
|
8 |
-
700: '#7A73FF',
|
9 |
-
},
|
10 |
-
cart: {
|
11 |
-
50: '#f3eaff',
|
12 |
-
500: '#673A9E',
|
13 |
-
700: '#7a47b7',
|
14 |
-
},
|
15 |
-
},
|
16 |
-
maxWidth: {
|
17 |
-
80: '80px',
|
18 |
-
},
|
19 |
-
},
|
20 |
-
},
|
21 |
-
variants: {
|
22 |
-
extend: {},
|
23 |
-
},
|
24 |
-
plugins: [],
|
25 |
-
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wizard/build/app.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('react', 'react-dom', 'wp-api-fetch', 'wp-element', 'wp-i18n'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('react', 'react-dom', 'wp-api-fetch', 'wp-element', 'wp-i18n'), 'version' => '0802e5033de80a3525a847d98d66b145');
|
wizard/build/app.css
CHANGED
@@ -1,8 +1,5 @@
|
|
1 |
-
/*!********************************************************************************************************************************************************************************************************************************************!*\
|
2 |
-
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[3]!./wizard/src/App.scss ***!
|
3 |
-
\********************************************************************************************************************************************************************************************************************************************/
|
4 |
/*
|
5 |
-
! tailwindcss v3.0.
|
6 |
*//*
|
7 |
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
|
8 |
2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
|
@@ -426,8 +423,7 @@ Ensure the default browser behavior of the `hidden` attribute.
|
|
426 |
--tw-backdrop-opacity: ;
|
427 |
--tw-backdrop-saturate: ;
|
428 |
--tw-backdrop-sepia: ;
|
429 |
-
}
|
430 |
-
.sr-only {
|
431 |
position: absolute;
|
432 |
width: 1px;
|
433 |
height: 1px;
|
@@ -437,431 +433,295 @@ Ensure the default browser behavior of the `hidden` attribute.
|
|
437 |
clip: rect(0, 0, 0, 0);
|
438 |
white-space: nowrap;
|
439 |
border-width: 0;
|
440 |
-
}
|
441 |
-
.pointer-events-none {
|
442 |
pointer-events: none;
|
443 |
-
}
|
444 |
-
.fixed {
|
445 |
position: fixed;
|
446 |
-
}
|
447 |
-
.relative {
|
448 |
position: relative;
|
449 |
-
}
|
450 |
-
.left-0 {
|
451 |
left: 0px;
|
452 |
-
}
|
453 |
-
.top-0 {
|
454 |
top: 0px;
|
455 |
-
}
|
456 |
-
.right-0 {
|
457 |
right: 0px;
|
458 |
-
}
|
459 |
-
.z-10 {
|
460 |
z-index: 10;
|
461 |
-
}
|
462 |
-
.mx-auto {
|
463 |
margin-left: auto;
|
464 |
margin-right: auto;
|
465 |
-
}
|
466 |
-
.my-0 {
|
467 |
margin-top: 0px;
|
468 |
margin-bottom: 0px;
|
469 |
-
}
|
470 |
-
.mx-6 {
|
471 |
-
margin-left: 1.5rem;
|
472 |
-
margin-right: 1.5rem;
|
473 |
-
}
|
474 |
-
.mx-2 {
|
475 |
-
margin-left: 0.5rem;
|
476 |
-
margin-right: 0.5rem;
|
477 |
-
}
|
478 |
-
.mx-4 {
|
479 |
margin-left: 1rem;
|
480 |
margin-right: 1rem;
|
481 |
-
}
|
482 |
-
.mx-3 {
|
483 |
-
margin-left: 0.75rem;
|
484 |
-
margin-right: 0.75rem;
|
485 |
-
}
|
486 |
-
.mt-12 {
|
487 |
margin-top: 3rem;
|
488 |
-
}
|
489 |
-
.ml-2 {
|
490 |
margin-left: 0.5rem;
|
491 |
-
}
|
492 |
-
.mr-3 {
|
493 |
margin-right: 0.75rem;
|
494 |
-
}
|
495 |
-
.mt-10 {
|
496 |
margin-top: 2.5rem;
|
497 |
-
}
|
498 |
-
.mt-3 {
|
499 |
margin-top: 0.75rem;
|
500 |
-
}
|
501 |
-
.mt-1 {
|
502 |
margin-top: 0.25rem;
|
503 |
-
}
|
504 |
-
.mb-1 {
|
505 |
margin-bottom: 0.25rem;
|
506 |
-
}
|
507 |
-
.ml-6 {
|
508 |
-
margin-left: 1.5rem;
|
509 |
-
}
|
510 |
-
.mt-5 {
|
511 |
margin-top: 1.25rem;
|
512 |
-
}
|
513 |
-
.mt-4 {
|
514 |
margin-top: 1rem;
|
515 |
-
}
|
516 |
-
.mb-4 {
|
517 |
margin-bottom: 1rem;
|
518 |
-
}
|
519 |
-
.mt-6 {
|
520 |
margin-top: 1.5rem;
|
521 |
-
}
|
522 |
-
.block {
|
523 |
display: block;
|
524 |
-
}
|
525 |
-
.inline-block {
|
526 |
display: inline-block;
|
527 |
-
}
|
528 |
-
.inline {
|
529 |
display: inline;
|
530 |
-
}
|
531 |
-
.flex {
|
532 |
display: flex;
|
533 |
-
}
|
534 |
-
.inline-flex {
|
535 |
display: inline-flex;
|
536 |
-
}
|
537 |
-
.h-16 {
|
538 |
height: 4rem;
|
539 |
-
}
|
540 |
-
.h-5 {
|
541 |
height: 1.25rem;
|
542 |
-
}
|
543 |
-
|
544 |
-
|
545 |
-
}
|
546 |
-
.h-12 {
|
547 |
height: 3rem;
|
548 |
-
}
|
549 |
-
.h-6 {
|
550 |
height: 1.5rem;
|
551 |
-
}
|
552 |
-
.h-20 {
|
553 |
-
height: 5rem;
|
554 |
-
}
|
555 |
-
.h-24 {
|
556 |
-
height: 6rem;
|
557 |
-
}
|
558 |
-
.w-10\/12 {
|
559 |
width: 83.333333%;
|
560 |
-
}
|
561 |
-
.w-auto {
|
562 |
width: auto;
|
563 |
-
}
|
564 |
-
.w-full {
|
565 |
width: 100%;
|
566 |
-
}
|
567 |
-
.w-5 {
|
568 |
width: 1.25rem;
|
569 |
-
}
|
570 |
-
.w-32 {
|
571 |
width: 8rem;
|
572 |
-
}
|
573 |
-
.w-11 {
|
574 |
width: 2.75rem;
|
575 |
-
}
|
576 |
-
.min-w-0 {
|
577 |
min-width: 0px;
|
578 |
-
}
|
579 |
-
.max-w-7xl {
|
580 |
max-width: 80rem;
|
581 |
-
}
|
582 |
-
.max-w-screen-md {
|
583 |
max-width: 768px;
|
584 |
-
}
|
585 |
-
.max-w-80 {
|
586 |
max-width: 80px;
|
587 |
-
}
|
588 |
-
.flex-1 {
|
589 |
flex: 1 1 0%;
|
590 |
-
}
|
591 |
-
.flex-shrink-0 {
|
592 |
flex-shrink: 0;
|
593 |
-
}
|
594 |
-
.flex-grow {
|
595 |
flex-grow: 1;
|
596 |
-
}
|
597 |
-
.translate-x-5 {
|
598 |
--tw-translate-x: 1.25rem;
|
599 |
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
600 |
-
}
|
601 |
-
.translate-x-0 {
|
602 |
--tw-translate-x: 0px;
|
603 |
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
604 |
-
}
|
605 |
-
.transform {
|
606 |
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
607 |
-
}
|
608 |
-
@-webkit-keyframes spin {
|
609 |
|
610 |
to {
|
611 |
transform: rotate(360deg);
|
612 |
}
|
613 |
-
}
|
614 |
-
@keyframes spin {
|
615 |
|
616 |
to {
|
617 |
transform: rotate(360deg);
|
618 |
}
|
619 |
-
}
|
620 |
-
.animate-spin {
|
621 |
-webkit-animation: spin 1s linear infinite;
|
622 |
animation: spin 1s linear infinite;
|
623 |
-
}
|
624 |
-
.cursor-wait {
|
625 |
cursor: wait;
|
626 |
-
}
|
627 |
-
.cursor-pointer {
|
628 |
cursor: pointer;
|
629 |
-
}
|
630 |
-
.items-center {
|
631 |
align-items: center;
|
632 |
-
}
|
633 |
-
.justify-center {
|
634 |
justify-content: center;
|
635 |
-
}
|
636 |
-
.divide-y > :not([hidden]) ~ :not([hidden]) {
|
637 |
--tw-divide-y-reverse: 0;
|
638 |
border-top-width: calc(1px * calc(1 - var(--tw-divide-y-reverse)));
|
639 |
border-bottom-width: calc(1px * var(--tw-divide-y-reverse));
|
640 |
-
}
|
641 |
-
.divide-gray-200 > :not([hidden]) ~ :not([hidden]) {
|
642 |
--tw-divide-opacity: 1;
|
643 |
border-color: rgb(229 231 235 / var(--tw-divide-opacity));
|
644 |
-
}
|
645 |
-
.overflow-hidden {
|
646 |
overflow: hidden;
|
647 |
-
}
|
648 |
-
.overflow-x-hidden {
|
649 |
overflow-x: hidden;
|
650 |
-
}
|
651 |
-
.truncate {
|
652 |
overflow: hidden;
|
653 |
text-overflow: ellipsis;
|
654 |
white-space: nowrap;
|
655 |
-
}
|
656 |
-
.rounded-xl {
|
657 |
border-radius: 0.75rem;
|
658 |
-
}
|
659 |
-
.rounded-md {
|
660 |
border-radius: 0.375rem;
|
661 |
-
}
|
662 |
-
.rounded-full {
|
663 |
border-radius: 9999px;
|
664 |
-
}
|
665 |
-
.border {
|
666 |
border-width: 1px;
|
667 |
-
}
|
668 |
-
.border-2 {
|
669 |
border-width: 2px;
|
670 |
-
}
|
671 |
-
.border-transparent {
|
672 |
border-color: transparent;
|
673 |
-
}
|
674 |
-
.bg-white {
|
675 |
--tw-bg-opacity: 1;
|
676 |
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
677 |
-
}
|
678 |
-
.bg-cart-500 {
|
679 |
--tw-bg-opacity: 1;
|
680 |
background-color: rgb(103 58 158 / var(--tw-bg-opacity));
|
681 |
-
}
|
682 |
-
.bg-green-100 {
|
683 |
--tw-bg-opacity: 1;
|
684 |
background-color: rgb(220 252 231 / var(--tw-bg-opacity));
|
685 |
-
}
|
686 |
-
.bg-gray-200 {
|
687 |
--tw-bg-opacity: 1;
|
688 |
background-color: rgb(229 231 235 / var(--tw-bg-opacity));
|
689 |
-
}
|
690 |
-
.bg-cart-50 {
|
691 |
--tw-bg-opacity: 1;
|
692 |
background-color: rgb(243 234 255 / var(--tw-bg-opacity));
|
693 |
-
}
|
694 |
-
.p-4 {
|
695 |
padding: 1rem;
|
696 |
-
}
|
697 |
-
.px-4 {
|
698 |
padding-left: 1rem;
|
699 |
padding-right: 1rem;
|
700 |
-
}
|
701 |
-
.py-5 {
|
702 |
padding-top: 1.25rem;
|
703 |
padding-bottom: 1.25rem;
|
704 |
-
}
|
705 |
-
.px-8 {
|
706 |
padding-left: 2rem;
|
707 |
padding-right: 2rem;
|
708 |
-
}
|
709 |
-
.py-3 {
|
710 |
padding-top: 0.75rem;
|
711 |
padding-bottom: 0.75rem;
|
712 |
-
}
|
713 |
-
.py-4 {
|
714 |
padding-top: 1rem;
|
715 |
padding-bottom: 1rem;
|
716 |
-
}
|
717 |
-
.px-2 {
|
718 |
padding-left: 0.5rem;
|
719 |
padding-right: 0.5rem;
|
720 |
-
}
|
721 |
-
.py-1 {
|
722 |
padding-top: 0.25rem;
|
723 |
padding-bottom: 0.25rem;
|
724 |
-
}
|
725 |
-
.pt-6 {
|
726 |
padding-top: 1.5rem;
|
727 |
-
}
|
728 |
-
.text-left {
|
729 |
text-align: left;
|
730 |
-
}
|
731 |
-
.text-center {
|
732 |
text-align: center;
|
733 |
-
}
|
734 |
-
.text-4xl {
|
735 |
font-size: 2.25rem;
|
736 |
line-height: 2.5rem;
|
737 |
-
}
|
738 |
-
.text-base {
|
739 |
font-size: 1rem;
|
740 |
line-height: 1.5rem;
|
741 |
-
}
|
742 |
-
.text-sm {
|
743 |
font-size: 0.875rem;
|
744 |
line-height: 1.25rem;
|
745 |
-
}
|
746 |
-
.text-xs {
|
747 |
font-size: 0.75rem;
|
748 |
line-height: 1rem;
|
749 |
-
}
|
750 |
-
.font-extrabold {
|
751 |
font-weight: 800;
|
752 |
-
}
|
753 |
-
.font-bold {
|
754 |
font-weight: 700;
|
755 |
-
}
|
756 |
-
.font-medium {
|
757 |
font-weight: 500;
|
758 |
-
}
|
759 |
-
.tracking-tight {
|
760 |
letter-spacing: -0.025em;
|
761 |
-
}
|
762 |
-
.text-white {
|
763 |
--tw-text-opacity: 1;
|
764 |
color: rgb(255 255 255 / var(--tw-text-opacity));
|
765 |
-
}
|
766 |
-
.text-gray-900 {
|
767 |
--tw-text-opacity: 1;
|
768 |
color: rgb(17 24 39 / var(--tw-text-opacity));
|
769 |
-
}
|
770 |
-
.text-cart-500 {
|
771 |
--tw-text-opacity: 1;
|
772 |
color: rgb(103 58 158 / var(--tw-text-opacity));
|
773 |
-
}
|
774 |
-
.text-gray-500 {
|
775 |
--tw-text-opacity: 1;
|
776 |
color: rgb(107 114 128 / var(--tw-text-opacity));
|
777 |
-
}
|
778 |
-
.text-gray-700 {
|
779 |
--tw-text-opacity: 1;
|
780 |
color: rgb(55 65 81 / var(--tw-text-opacity));
|
781 |
-
}
|
782 |
-
.text-slate-300 {
|
783 |
--tw-text-opacity: 1;
|
784 |
color: rgb(203 213 225 / var(--tw-text-opacity));
|
785 |
-
}
|
786 |
-
.text-red-600 {
|
787 |
--tw-text-opacity: 1;
|
788 |
color: rgb(220 38 38 / var(--tw-text-opacity));
|
789 |
-
}
|
790 |
-
.text-green-800 {
|
791 |
--tw-text-opacity: 1;
|
792 |
color: rgb(22 101 52 / var(--tw-text-opacity));
|
793 |
-
}
|
794 |
-
.text-gray-400 {
|
795 |
--tw-text-opacity: 1;
|
796 |
color: rgb(156 163 175 / var(--tw-text-opacity));
|
797 |
-
}
|
798 |
-
.opacity-25 {
|
799 |
opacity: 0.25;
|
800 |
-
}
|
801 |
-
.opacity-75 {
|
802 |
opacity: 0.75;
|
803 |
-
}
|
804 |
-
.shadow {
|
805 |
--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
|
806 |
--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
|
807 |
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
808 |
-
}
|
809 |
-
.ring-0 {
|
810 |
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
811 |
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
812 |
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
813 |
-
}
|
814 |
-
.filter {
|
815 |
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
816 |
-
}
|
817 |
-
.transition-colors {
|
818 |
transition-property: color, background-color, border-color, fill, stroke, -webkit-text-decoration-color;
|
819 |
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
|
820 |
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, -webkit-text-decoration-color;
|
821 |
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
822 |
transition-duration: 150ms;
|
823 |
-
}
|
824 |
-
.transition {
|
825 |
transition-property: color, background-color, border-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-text-decoration-color, -webkit-backdrop-filter;
|
826 |
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
|
827 |
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-text-decoration-color, -webkit-backdrop-filter;
|
828 |
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
829 |
transition-duration: 150ms;
|
830 |
-
}
|
831 |
-
.delay-150 {
|
832 |
transition-delay: 150ms;
|
833 |
-
}
|
834 |
-
.duration-200 {
|
835 |
transition-duration: 200ms;
|
836 |
-
}
|
837 |
-
.ease-in-out {
|
838 |
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
839 |
-
}
|
840 |
-
.hover\:bg-cart-700:hover {
|
841 |
--tw-bg-opacity: 1;
|
842 |
background-color: rgb(122 71 183 / var(--tw-bg-opacity));
|
843 |
-
}
|
844 |
-
.hover\:bg-gray-50:hover {
|
845 |
--tw-bg-opacity: 1;
|
846 |
background-color: rgb(249 250 251 / var(--tw-bg-opacity));
|
847 |
-
}
|
848 |
-
.focus\:outline-none:focus {
|
849 |
outline: 2px solid transparent;
|
850 |
outline-offset: 2px;
|
851 |
-
}
|
852 |
-
.focus\:ring-2:focus {
|
853 |
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
854 |
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
855 |
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
856 |
-
}
|
857 |
-
.focus\:ring-cart-500:focus {
|
858 |
--tw-ring-opacity: 1;
|
859 |
--tw-ring-color: rgb(103 58 158 / var(--tw-ring-opacity));
|
860 |
-
}
|
861 |
-
.focus\:ring-offset-2:focus {
|
862 |
--tw-ring-offset-width: 2px;
|
863 |
-
}
|
864 |
-
@media (min-width: 640px) {
|
865 |
|
866 |
.sm\:mx-auto {
|
867 |
margin-left: auto;
|
@@ -930,8 +790,7 @@ Ensure the default browser behavior of the `hidden` attribute.
|
|
930 |
font-size: 1.125rem;
|
931 |
line-height: 1.75rem;
|
932 |
}
|
933 |
-
}
|
934 |
-
@media (min-width: 768px) {
|
935 |
|
936 |
.md\:mt-16 {
|
937 |
margin-top: 4rem;
|
@@ -977,8 +836,7 @@ Ensure the default browser behavior of the `hidden` attribute.
|
|
977 |
font-size: 1.125rem;
|
978 |
line-height: 1.75rem;
|
979 |
}
|
980 |
-
}
|
981 |
-
@media (min-width: 1024px) {
|
982 |
|
983 |
.lg\:mx-0 {
|
984 |
margin-left: 0px;
|
@@ -1013,8 +871,7 @@ Ensure the default browser behavior of the `hidden` attribute.
|
|
1013 |
padding-left: 2rem;
|
1014 |
padding-right: 2rem;
|
1015 |
}
|
1016 |
-
}
|
1017 |
-
@media (min-width: 1280px) {
|
1018 |
|
1019 |
.xl\:mt-28 {
|
1020 |
margin-top: 7rem;
|
@@ -1028,5 +885,3 @@ Ensure the default browser behavior of the `hidden` attribute.
|
|
1028 |
display: inline;
|
1029 |
}
|
1030 |
}
|
1031 |
-
|
1032 |
-
/*# sourceMappingURL=app.css.map*/
|
|
|
|
|
|
|
1 |
/*
|
2 |
+
! tailwindcss v3.0.19 | MIT License | https://tailwindcss.com
|
3 |
*//*
|
4 |
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
|
5 |
2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
|
423 |
--tw-backdrop-opacity: ;
|
424 |
--tw-backdrop-saturate: ;
|
425 |
--tw-backdrop-sepia: ;
|
426 |
+
}.sr-only {
|
|
|
427 |
position: absolute;
|
428 |
width: 1px;
|
429 |
height: 1px;
|
433 |
clip: rect(0, 0, 0, 0);
|
434 |
white-space: nowrap;
|
435 |
border-width: 0;
|
436 |
+
}.pointer-events-none {
|
|
|
437 |
pointer-events: none;
|
438 |
+
}.fixed {
|
|
|
439 |
position: fixed;
|
440 |
+
}.relative {
|
|
|
441 |
position: relative;
|
442 |
+
}.left-0 {
|
|
|
443 |
left: 0px;
|
444 |
+
}.top-0 {
|
|
|
445 |
top: 0px;
|
446 |
+
}.right-0 {
|
|
|
447 |
right: 0px;
|
448 |
+
}.z-10 {
|
|
|
449 |
z-index: 10;
|
450 |
+
}.mx-auto {
|
|
|
451 |
margin-left: auto;
|
452 |
margin-right: auto;
|
453 |
+
}.my-0 {
|
|
|
454 |
margin-top: 0px;
|
455 |
margin-bottom: 0px;
|
456 |
+
}.mx-4 {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
457 |
margin-left: 1rem;
|
458 |
margin-right: 1rem;
|
459 |
+
}.mt-12 {
|
|
|
|
|
|
|
|
|
|
|
460 |
margin-top: 3rem;
|
461 |
+
}.ml-2 {
|
|
|
462 |
margin-left: 0.5rem;
|
463 |
+
}.mr-3 {
|
|
|
464 |
margin-right: 0.75rem;
|
465 |
+
}.mt-10 {
|
|
|
466 |
margin-top: 2.5rem;
|
467 |
+
}.mt-3 {
|
|
|
468 |
margin-top: 0.75rem;
|
469 |
+
}.mt-1 {
|
|
|
470 |
margin-top: 0.25rem;
|
471 |
+
}.mb-1 {
|
|
|
472 |
margin-bottom: 0.25rem;
|
473 |
+
}.mt-5 {
|
|
|
|
|
|
|
|
|
474 |
margin-top: 1.25rem;
|
475 |
+
}.mt-4 {
|
|
|
476 |
margin-top: 1rem;
|
477 |
+
}.mb-4 {
|
|
|
478 |
margin-bottom: 1rem;
|
479 |
+
}.mt-6 {
|
|
|
480 |
margin-top: 1.5rem;
|
481 |
+
}.block {
|
|
|
482 |
display: block;
|
483 |
+
}.inline-block {
|
|
|
484 |
display: inline-block;
|
485 |
+
}.inline {
|
|
|
486 |
display: inline;
|
487 |
+
}.flex {
|
|
|
488 |
display: flex;
|
489 |
+
}.inline-flex {
|
|
|
490 |
display: inline-flex;
|
491 |
+
}.h-16 {
|
|
|
492 |
height: 4rem;
|
493 |
+
}.h-5 {
|
|
|
494 |
height: 1.25rem;
|
495 |
+
}.h-24 {
|
496 |
+
height: 6rem;
|
497 |
+
}.h-12 {
|
|
|
|
|
498 |
height: 3rem;
|
499 |
+
}.h-6 {
|
|
|
500 |
height: 1.5rem;
|
501 |
+
}.w-10\/12 {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
502 |
width: 83.333333%;
|
503 |
+
}.w-auto {
|
|
|
504 |
width: auto;
|
505 |
+
}.w-full {
|
|
|
506 |
width: 100%;
|
507 |
+
}.w-5 {
|
|
|
508 |
width: 1.25rem;
|
509 |
+
}.w-32 {
|
|
|
510 |
width: 8rem;
|
511 |
+
}.w-11 {
|
|
|
512 |
width: 2.75rem;
|
513 |
+
}.min-w-0 {
|
|
|
514 |
min-width: 0px;
|
515 |
+
}.max-w-7xl {
|
|
|
516 |
max-width: 80rem;
|
517 |
+
}.max-w-screen-md {
|
|
|
518 |
max-width: 768px;
|
519 |
+
}.max-w-80 {
|
|
|
520 |
max-width: 80px;
|
521 |
+
}.flex-1 {
|
|
|
522 |
flex: 1 1 0%;
|
523 |
+
}.flex-shrink-0 {
|
|
|
524 |
flex-shrink: 0;
|
525 |
+
}.flex-grow {
|
|
|
526 |
flex-grow: 1;
|
527 |
+
}.translate-x-5 {
|
|
|
528 |
--tw-translate-x: 1.25rem;
|
529 |
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
530 |
+
}.translate-x-0 {
|
|
|
531 |
--tw-translate-x: 0px;
|
532 |
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
533 |
+
}.transform {
|
|
|
534 |
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
535 |
+
}@-webkit-keyframes spin {
|
|
|
536 |
|
537 |
to {
|
538 |
transform: rotate(360deg);
|
539 |
}
|
540 |
+
}@keyframes spin {
|
|
|
541 |
|
542 |
to {
|
543 |
transform: rotate(360deg);
|
544 |
}
|
545 |
+
}.animate-spin {
|
|
|
546 |
-webkit-animation: spin 1s linear infinite;
|
547 |
animation: spin 1s linear infinite;
|
548 |
+
}.cursor-wait {
|
|
|
549 |
cursor: wait;
|
550 |
+
}.cursor-pointer {
|
|
|
551 |
cursor: pointer;
|
552 |
+
}.items-center {
|
|
|
553 |
align-items: center;
|
554 |
+
}.justify-center {
|
|
|
555 |
justify-content: center;
|
556 |
+
}.divide-y > :not([hidden]) ~ :not([hidden]) {
|
|
|
557 |
--tw-divide-y-reverse: 0;
|
558 |
border-top-width: calc(1px * calc(1 - var(--tw-divide-y-reverse)));
|
559 |
border-bottom-width: calc(1px * var(--tw-divide-y-reverse));
|
560 |
+
}.divide-gray-200 > :not([hidden]) ~ :not([hidden]) {
|
|
|
561 |
--tw-divide-opacity: 1;
|
562 |
border-color: rgb(229 231 235 / var(--tw-divide-opacity));
|
563 |
+
}.overflow-hidden {
|
|
|
564 |
overflow: hidden;
|
565 |
+
}.overflow-x-hidden {
|
|
|
566 |
overflow-x: hidden;
|
567 |
+
}.truncate {
|
|
|
568 |
overflow: hidden;
|
569 |
text-overflow: ellipsis;
|
570 |
white-space: nowrap;
|
571 |
+
}.rounded-xl {
|
|
|
572 |
border-radius: 0.75rem;
|
573 |
+
}.rounded-md {
|
|
|
574 |
border-radius: 0.375rem;
|
575 |
+
}.rounded-full {
|
|
|
576 |
border-radius: 9999px;
|
577 |
+
}.border {
|
|
|
578 |
border-width: 1px;
|
579 |
+
}.border-2 {
|
|
|
580 |
border-width: 2px;
|
581 |
+
}.border-transparent {
|
|
|
582 |
border-color: transparent;
|
583 |
+
}.bg-white {
|
|
|
584 |
--tw-bg-opacity: 1;
|
585 |
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
586 |
+
}.bg-cart-500 {
|
|
|
587 |
--tw-bg-opacity: 1;
|
588 |
background-color: rgb(103 58 158 / var(--tw-bg-opacity));
|
589 |
+
}.bg-green-100 {
|
|
|
590 |
--tw-bg-opacity: 1;
|
591 |
background-color: rgb(220 252 231 / var(--tw-bg-opacity));
|
592 |
+
}.bg-gray-200 {
|
|
|
593 |
--tw-bg-opacity: 1;
|
594 |
background-color: rgb(229 231 235 / var(--tw-bg-opacity));
|
595 |
+
}.bg-cart-50 {
|
|
|
596 |
--tw-bg-opacity: 1;
|
597 |
background-color: rgb(243 234 255 / var(--tw-bg-opacity));
|
598 |
+
}.p-4 {
|
|
|
599 |
padding: 1rem;
|
600 |
+
}.px-4 {
|
|
|
601 |
padding-left: 1rem;
|
602 |
padding-right: 1rem;
|
603 |
+
}.py-5 {
|
|
|
604 |
padding-top: 1.25rem;
|
605 |
padding-bottom: 1.25rem;
|
606 |
+
}.px-8 {
|
|
|
607 |
padding-left: 2rem;
|
608 |
padding-right: 2rem;
|
609 |
+
}.py-3 {
|
|
|
610 |
padding-top: 0.75rem;
|
611 |
padding-bottom: 0.75rem;
|
612 |
+
}.py-4 {
|
|
|
613 |
padding-top: 1rem;
|
614 |
padding-bottom: 1rem;
|
615 |
+
}.px-2 {
|
|
|
616 |
padding-left: 0.5rem;
|
617 |
padding-right: 0.5rem;
|
618 |
+
}.py-1 {
|
|
|
619 |
padding-top: 0.25rem;
|
620 |
padding-bottom: 0.25rem;
|
621 |
+
}.pt-6 {
|
|
|
622 |
padding-top: 1.5rem;
|
623 |
+
}.text-left {
|
|
|
624 |
text-align: left;
|
625 |
+
}.text-center {
|
|
|
626 |
text-align: center;
|
627 |
+
}.text-4xl {
|
|
|
628 |
font-size: 2.25rem;
|
629 |
line-height: 2.5rem;
|
630 |
+
}.text-base {
|
|
|
631 |
font-size: 1rem;
|
632 |
line-height: 1.5rem;
|
633 |
+
}.text-sm {
|
|
|
634 |
font-size: 0.875rem;
|
635 |
line-height: 1.25rem;
|
636 |
+
}.text-xs {
|
|
|
637 |
font-size: 0.75rem;
|
638 |
line-height: 1rem;
|
639 |
+
}.font-extrabold {
|
|
|
640 |
font-weight: 800;
|
641 |
+
}.font-bold {
|
|
|
642 |
font-weight: 700;
|
643 |
+
}.font-medium {
|
|
|
644 |
font-weight: 500;
|
645 |
+
}.tracking-tight {
|
|
|
646 |
letter-spacing: -0.025em;
|
647 |
+
}.text-white {
|
|
|
648 |
--tw-text-opacity: 1;
|
649 |
color: rgb(255 255 255 / var(--tw-text-opacity));
|
650 |
+
}.text-gray-900 {
|
|
|
651 |
--tw-text-opacity: 1;
|
652 |
color: rgb(17 24 39 / var(--tw-text-opacity));
|
653 |
+
}.text-cart-500 {
|
|
|
654 |
--tw-text-opacity: 1;
|
655 |
color: rgb(103 58 158 / var(--tw-text-opacity));
|
656 |
+
}.text-gray-500 {
|
|
|
657 |
--tw-text-opacity: 1;
|
658 |
color: rgb(107 114 128 / var(--tw-text-opacity));
|
659 |
+
}.text-gray-700 {
|
|
|
660 |
--tw-text-opacity: 1;
|
661 |
color: rgb(55 65 81 / var(--tw-text-opacity));
|
662 |
+
}.text-slate-300 {
|
|
|
663 |
--tw-text-opacity: 1;
|
664 |
color: rgb(203 213 225 / var(--tw-text-opacity));
|
665 |
+
}.text-red-600 {
|
|
|
666 |
--tw-text-opacity: 1;
|
667 |
color: rgb(220 38 38 / var(--tw-text-opacity));
|
668 |
+
}.text-green-800 {
|
|
|
669 |
--tw-text-opacity: 1;
|
670 |
color: rgb(22 101 52 / var(--tw-text-opacity));
|
671 |
+
}.text-gray-400 {
|
|
|
672 |
--tw-text-opacity: 1;
|
673 |
color: rgb(156 163 175 / var(--tw-text-opacity));
|
674 |
+
}.opacity-25 {
|
|
|
675 |
opacity: 0.25;
|
676 |
+
}.opacity-75 {
|
|
|
677 |
opacity: 0.75;
|
678 |
+
}.shadow {
|
|
|
679 |
--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
|
680 |
--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
|
681 |
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
682 |
+
}.ring-0 {
|
|
|
683 |
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
684 |
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
685 |
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
686 |
+
}.filter {
|
|
|
687 |
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
688 |
+
}.transition-colors {
|
|
|
689 |
transition-property: color, background-color, border-color, fill, stroke, -webkit-text-decoration-color;
|
690 |
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
|
691 |
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, -webkit-text-decoration-color;
|
692 |
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
693 |
transition-duration: 150ms;
|
694 |
+
}.transition {
|
|
|
695 |
transition-property: color, background-color, border-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-text-decoration-color, -webkit-backdrop-filter;
|
696 |
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
|
697 |
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-text-decoration-color, -webkit-backdrop-filter;
|
698 |
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
699 |
transition-duration: 150ms;
|
700 |
+
}.delay-150 {
|
|
|
701 |
transition-delay: 150ms;
|
702 |
+
}.duration-200 {
|
|
|
703 |
transition-duration: 200ms;
|
704 |
+
}.ease-in-out {
|
|
|
705 |
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
706 |
+
}.hover\:bg-cart-700:hover {
|
|
|
707 |
--tw-bg-opacity: 1;
|
708 |
background-color: rgb(122 71 183 / var(--tw-bg-opacity));
|
709 |
+
}.hover\:bg-gray-50:hover {
|
|
|
710 |
--tw-bg-opacity: 1;
|
711 |
background-color: rgb(249 250 251 / var(--tw-bg-opacity));
|
712 |
+
}.focus\:outline-none:focus {
|
|
|
713 |
outline: 2px solid transparent;
|
714 |
outline-offset: 2px;
|
715 |
+
}.focus\:ring-2:focus {
|
|
|
716 |
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
717 |
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
718 |
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
719 |
+
}.focus\:ring-cart-500:focus {
|
|
|
720 |
--tw-ring-opacity: 1;
|
721 |
--tw-ring-color: rgb(103 58 158 / var(--tw-ring-opacity));
|
722 |
+
}.focus\:ring-offset-2:focus {
|
|
|
723 |
--tw-ring-offset-width: 2px;
|
724 |
+
}@media (min-width: 640px) {
|
|
|
725 |
|
726 |
.sm\:mx-auto {
|
727 |
margin-left: auto;
|
790 |
font-size: 1.125rem;
|
791 |
line-height: 1.75rem;
|
792 |
}
|
793 |
+
}@media (min-width: 768px) {
|
|
|
794 |
|
795 |
.md\:mt-16 {
|
796 |
margin-top: 4rem;
|
836 |
font-size: 1.125rem;
|
837 |
line-height: 1.75rem;
|
838 |
}
|
839 |
+
}@media (min-width: 1024px) {
|
|
|
840 |
|
841 |
.lg\:mx-0 {
|
842 |
margin-left: 0px;
|
871 |
padding-left: 2rem;
|
872 |
padding-right: 2rem;
|
873 |
}
|
874 |
+
}@media (min-width: 1280px) {
|
|
|
875 |
|
876 |
.xl\:mt-28 {
|
877 |
margin-top: 7rem;
|
885 |
display: inline;
|
886 |
}
|
887 |
}
|
|
|
|
wizard/build/app.js
CHANGED
@@ -1,3304 +1 @@
|
|
1 |
-
/******/ (function() { // webpackBootstrap
|
2 |
-
/******/ "use strict";
|
3 |
-
/******/ var __webpack_modules__ = ({
|
4 |
-
|
5 |
-
/***/ "./node_modules/@headlessui/react/dist/_virtual/_rollupPluginBabelHelpers.js":
|
6 |
-
/*!***********************************************************************************!*\
|
7 |
-
!*** ./node_modules/@headlessui/react/dist/_virtual/_rollupPluginBabelHelpers.js ***!
|
8 |
-
\***********************************************************************************/
|
9 |
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
10 |
-
|
11 |
-
__webpack_require__.r(__webpack_exports__);
|
12 |
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
13 |
-
/* harmony export */ "arrayLikeToArray": function() { return /* binding */ _arrayLikeToArray; },
|
14 |
-
/* harmony export */ "createForOfIteratorHelperLoose": function() { return /* binding */ _createForOfIteratorHelperLoose; },
|
15 |
-
/* harmony export */ "extends": function() { return /* binding */ _extends; },
|
16 |
-
/* harmony export */ "objectWithoutPropertiesLoose": function() { return /* binding */ _objectWithoutPropertiesLoose; },
|
17 |
-
/* harmony export */ "unsupportedIterableToArray": function() { return /* binding */ _unsupportedIterableToArray; }
|
18 |
-
/* harmony export */ });
|
19 |
-
function _extends() {
|
20 |
-
_extends = Object.assign || function (target) {
|
21 |
-
for (var i = 1; i < arguments.length; i++) {
|
22 |
-
var source = arguments[i];
|
23 |
-
|
24 |
-
for (var key in source) {
|
25 |
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
26 |
-
target[key] = source[key];
|
27 |
-
}
|
28 |
-
}
|
29 |
-
}
|
30 |
-
|
31 |
-
return target;
|
32 |
-
};
|
33 |
-
|
34 |
-
return _extends.apply(this, arguments);
|
35 |
-
}
|
36 |
-
|
37 |
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
38 |
-
if (source == null) return {};
|
39 |
-
var target = {};
|
40 |
-
var sourceKeys = Object.keys(source);
|
41 |
-
var key, i;
|
42 |
-
|
43 |
-
for (i = 0; i < sourceKeys.length; i++) {
|
44 |
-
key = sourceKeys[i];
|
45 |
-
if (excluded.indexOf(key) >= 0) continue;
|
46 |
-
target[key] = source[key];
|
47 |
-
}
|
48 |
-
|
49 |
-
return target;
|
50 |
-
}
|
51 |
-
|
52 |
-
function _unsupportedIterableToArray(o, minLen) {
|
53 |
-
if (!o) return;
|
54 |
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
55 |
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
56 |
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
57 |
-
if (n === "Map" || n === "Set") return Array.from(o);
|
58 |
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
59 |
-
}
|
60 |
-
|
61 |
-
function _arrayLikeToArray(arr, len) {
|
62 |
-
if (len == null || len > arr.length) len = arr.length;
|
63 |
-
|
64 |
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
65 |
-
|
66 |
-
return arr2;
|
67 |
-
}
|
68 |
-
|
69 |
-
function _createForOfIteratorHelperLoose(o, allowArrayLike) {
|
70 |
-
var it;
|
71 |
-
|
72 |
-
if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
|
73 |
-
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
74 |
-
if (it) o = it;
|
75 |
-
var i = 0;
|
76 |
-
return function () {
|
77 |
-
if (i >= o.length) return {
|
78 |
-
done: true
|
79 |
-
};
|
80 |
-
return {
|
81 |
-
done: false,
|
82 |
-
value: o[i++]
|
83 |
-
};
|
84 |
-
};
|
85 |
-
}
|
86 |
-
|
87 |
-
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
88 |
-
}
|
89 |
-
|
90 |
-
it = o[Symbol.iterator]();
|
91 |
-
return it.next.bind(it);
|
92 |
-
}
|
93 |
-
|
94 |
-
|
95 |
-
//# sourceMappingURL=_rollupPluginBabelHelpers.js.map
|
96 |
-
|
97 |
-
|
98 |
-
/***/ }),
|
99 |
-
|
100 |
-
/***/ "./node_modules/@headlessui/react/dist/components/description/description.esm.js":
|
101 |
-
/*!***************************************************************************************!*\
|
102 |
-
!*** ./node_modules/@headlessui/react/dist/components/description/description.esm.js ***!
|
103 |
-
\***************************************************************************************/
|
104 |
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
105 |
-
|
106 |
-
__webpack_require__.r(__webpack_exports__);
|
107 |
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
108 |
-
/* harmony export */ "Description": function() { return /* binding */ Description; },
|
109 |
-
/* harmony export */ "useDescriptions": function() { return /* binding */ useDescriptions; }
|
110 |
-
/* harmony export */ });
|
111 |
-
/* harmony import */ var _virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../_virtual/_rollupPluginBabelHelpers.js */ "./node_modules/@headlessui/react/dist/_virtual/_rollupPluginBabelHelpers.js");
|
112 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
113 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
114 |
-
/* harmony import */ var _utils_render_esm_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils/render.esm.js */ "./node_modules/@headlessui/react/dist/utils/render.esm.js");
|
115 |
-
/* harmony import */ var _hooks_use_iso_morphic_effect_esm_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../hooks/use-iso-morphic-effect.esm.js */ "./node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.esm.js");
|
116 |
-
/* harmony import */ var _hooks_use_id_esm_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../hooks/use-id.esm.js */ "./node_modules/@headlessui/react/dist/hooks/use-id.esm.js");
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
var DescriptionContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);
|
124 |
-
|
125 |
-
function useDescriptionContext() {
|
126 |
-
var context = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(DescriptionContext);
|
127 |
-
|
128 |
-
if (context === null) {
|
129 |
-
var err = new Error('You used a <Description /> component, but it is not inside a relevant parent.');
|
130 |
-
if (Error.captureStackTrace) Error.captureStackTrace(err, useDescriptionContext);
|
131 |
-
throw err;
|
132 |
-
}
|
133 |
-
|
134 |
-
return context;
|
135 |
-
}
|
136 |
-
|
137 |
-
function useDescriptions() {
|
138 |
-
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),
|
139 |
-
descriptionIds = _useState[0],
|
140 |
-
setDescriptionIds = _useState[1];
|
141 |
-
|
142 |
-
return [// The actual id's as string or undefined
|
143 |
-
descriptionIds.length > 0 ? descriptionIds.join(' ') : undefined, // The provider component
|
144 |
-
(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
|
145 |
-
return function DescriptionProvider(props) {
|
146 |
-
var register = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (value) {
|
147 |
-
setDescriptionIds(function (existing) {
|
148 |
-
return [].concat(existing, [value]);
|
149 |
-
});
|
150 |
-
return function () {
|
151 |
-
return setDescriptionIds(function (existing) {
|
152 |
-
var clone = existing.slice();
|
153 |
-
var idx = clone.indexOf(value);
|
154 |
-
if (idx !== -1) clone.splice(idx, 1);
|
155 |
-
return clone;
|
156 |
-
});
|
157 |
-
};
|
158 |
-
}, []);
|
159 |
-
var contextBag = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
|
160 |
-
return {
|
161 |
-
register: register,
|
162 |
-
slot: props.slot,
|
163 |
-
name: props.name,
|
164 |
-
props: props.props
|
165 |
-
};
|
166 |
-
}, [register, props.slot, props.name, props.props]);
|
167 |
-
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(DescriptionContext.Provider, {
|
168 |
-
value: contextBag
|
169 |
-
}, props.children);
|
170 |
-
};
|
171 |
-
}, [setDescriptionIds])];
|
172 |
-
} // ---
|
173 |
-
|
174 |
-
var DEFAULT_DESCRIPTION_TAG = 'p';
|
175 |
-
function Description(props) {
|
176 |
-
var context = useDescriptionContext();
|
177 |
-
var id = "headlessui-description-" + (0,_hooks_use_id_esm_js__WEBPACK_IMPORTED_MODULE_1__.useId)();
|
178 |
-
(0,_hooks_use_iso_morphic_effect_esm_js__WEBPACK_IMPORTED_MODULE_2__.useIsoMorphicEffect)(function () {
|
179 |
-
return context.register(id);
|
180 |
-
}, [id, context.register]);
|
181 |
-
var passThroughProps = props;
|
182 |
-
|
183 |
-
var propsWeControl = (0,_virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_3__["extends"])({}, context.props, {
|
184 |
-
id: id
|
185 |
-
});
|
186 |
-
|
187 |
-
return (0,_utils_render_esm_js__WEBPACK_IMPORTED_MODULE_4__.render)({
|
188 |
-
props: (0,_virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_3__["extends"])({}, passThroughProps, propsWeControl),
|
189 |
-
slot: context.slot || {},
|
190 |
-
defaultTag: DEFAULT_DESCRIPTION_TAG,
|
191 |
-
name: context.name || 'Description'
|
192 |
-
});
|
193 |
-
}
|
194 |
-
|
195 |
-
|
196 |
-
//# sourceMappingURL=description.esm.js.map
|
197 |
-
|
198 |
-
|
199 |
-
/***/ }),
|
200 |
-
|
201 |
-
/***/ "./node_modules/@headlessui/react/dist/components/keyboard.esm.js":
|
202 |
-
/*!************************************************************************!*\
|
203 |
-
!*** ./node_modules/@headlessui/react/dist/components/keyboard.esm.js ***!
|
204 |
-
\************************************************************************/
|
205 |
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
206 |
-
|
207 |
-
__webpack_require__.r(__webpack_exports__);
|
208 |
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
209 |
-
/* harmony export */ "Keys": function() { return /* binding */ Keys; }
|
210 |
-
/* harmony export */ });
|
211 |
-
// TODO: This must already exist somewhere, right? 🤔
|
212 |
-
// Ref: https://www.w3.org/TR/uievents-key/#named-key-attribute-values
|
213 |
-
var Keys;
|
214 |
-
|
215 |
-
(function (Keys) {
|
216 |
-
Keys["Space"] = " ";
|
217 |
-
Keys["Enter"] = "Enter";
|
218 |
-
Keys["Escape"] = "Escape";
|
219 |
-
Keys["Backspace"] = "Backspace";
|
220 |
-
Keys["ArrowLeft"] = "ArrowLeft";
|
221 |
-
Keys["ArrowUp"] = "ArrowUp";
|
222 |
-
Keys["ArrowRight"] = "ArrowRight";
|
223 |
-
Keys["ArrowDown"] = "ArrowDown";
|
224 |
-
Keys["Home"] = "Home";
|
225 |
-
Keys["End"] = "End";
|
226 |
-
Keys["PageUp"] = "PageUp";
|
227 |
-
Keys["PageDown"] = "PageDown";
|
228 |
-
Keys["Tab"] = "Tab";
|
229 |
-
})(Keys || (Keys = {}));
|
230 |
-
|
231 |
-
|
232 |
-
//# sourceMappingURL=keyboard.esm.js.map
|
233 |
-
|
234 |
-
|
235 |
-
/***/ }),
|
236 |
-
|
237 |
-
/***/ "./node_modules/@headlessui/react/dist/components/label/label.esm.js":
|
238 |
-
/*!***************************************************************************!*\
|
239 |
-
!*** ./node_modules/@headlessui/react/dist/components/label/label.esm.js ***!
|
240 |
-
\***************************************************************************/
|
241 |
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
242 |
-
|
243 |
-
__webpack_require__.r(__webpack_exports__);
|
244 |
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
245 |
-
/* harmony export */ "Label": function() { return /* binding */ Label; },
|
246 |
-
/* harmony export */ "useLabels": function() { return /* binding */ useLabels; }
|
247 |
-
/* harmony export */ });
|
248 |
-
/* harmony import */ var _virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../_virtual/_rollupPluginBabelHelpers.js */ "./node_modules/@headlessui/react/dist/_virtual/_rollupPluginBabelHelpers.js");
|
249 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
250 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
251 |
-
/* harmony import */ var _utils_render_esm_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils/render.esm.js */ "./node_modules/@headlessui/react/dist/utils/render.esm.js");
|
252 |
-
/* harmony import */ var _hooks_use_iso_morphic_effect_esm_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../hooks/use-iso-morphic-effect.esm.js */ "./node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.esm.js");
|
253 |
-
/* harmony import */ var _hooks_use_id_esm_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../hooks/use-id.esm.js */ "./node_modules/@headlessui/react/dist/hooks/use-id.esm.js");
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
var LabelContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);
|
261 |
-
|
262 |
-
function useLabelContext() {
|
263 |
-
var context = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(LabelContext);
|
264 |
-
|
265 |
-
if (context === null) {
|
266 |
-
var err = new Error('You used a <Label /> component, but it is not inside a relevant parent.');
|
267 |
-
if (Error.captureStackTrace) Error.captureStackTrace(err, useLabelContext);
|
268 |
-
throw err;
|
269 |
-
}
|
270 |
-
|
271 |
-
return context;
|
272 |
-
}
|
273 |
-
|
274 |
-
function useLabels() {
|
275 |
-
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),
|
276 |
-
labelIds = _useState[0],
|
277 |
-
setLabelIds = _useState[1];
|
278 |
-
|
279 |
-
return [// The actual id's as string or undefined.
|
280 |
-
labelIds.length > 0 ? labelIds.join(' ') : undefined, // The provider component
|
281 |
-
(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
|
282 |
-
return function LabelProvider(props) {
|
283 |
-
var register = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (value) {
|
284 |
-
setLabelIds(function (existing) {
|
285 |
-
return [].concat(existing, [value]);
|
286 |
-
});
|
287 |
-
return function () {
|
288 |
-
return setLabelIds(function (existing) {
|
289 |
-
var clone = existing.slice();
|
290 |
-
var idx = clone.indexOf(value);
|
291 |
-
if (idx !== -1) clone.splice(idx, 1);
|
292 |
-
return clone;
|
293 |
-
});
|
294 |
-
};
|
295 |
-
}, []);
|
296 |
-
var contextBag = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
|
297 |
-
return {
|
298 |
-
register: register,
|
299 |
-
slot: props.slot,
|
300 |
-
name: props.name,
|
301 |
-
props: props.props
|
302 |
-
};
|
303 |
-
}, [register, props.slot, props.name, props.props]);
|
304 |
-
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(LabelContext.Provider, {
|
305 |
-
value: contextBag
|
306 |
-
}, props.children);
|
307 |
-
};
|
308 |
-
}, [setLabelIds])];
|
309 |
-
} // ---
|
310 |
-
|
311 |
-
var DEFAULT_LABEL_TAG = 'label';
|
312 |
-
function Label(props) {
|
313 |
-
var _props$passive = props.passive,
|
314 |
-
passive = _props$passive === void 0 ? false : _props$passive,
|
315 |
-
passThroughProps = (0,_virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_1__.objectWithoutPropertiesLoose)(props, ["passive"]);
|
316 |
-
|
317 |
-
var context = useLabelContext();
|
318 |
-
var id = "headlessui-label-" + (0,_hooks_use_id_esm_js__WEBPACK_IMPORTED_MODULE_2__.useId)();
|
319 |
-
(0,_hooks_use_iso_morphic_effect_esm_js__WEBPACK_IMPORTED_MODULE_3__.useIsoMorphicEffect)(function () {
|
320 |
-
return context.register(id);
|
321 |
-
}, [id, context.register]);
|
322 |
-
|
323 |
-
var propsWeControl = (0,_virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_1__["extends"])({}, context.props, {
|
324 |
-
id: id
|
325 |
-
});
|
326 |
-
|
327 |
-
var allProps = (0,_virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_1__["extends"])({}, passThroughProps, propsWeControl); // @ts-expect-error props are dynamic via context, some components will
|
328 |
-
// provide an onClick then we can delete it.
|
329 |
-
|
330 |
-
|
331 |
-
if (passive) delete allProps['onClick'];
|
332 |
-
return (0,_utils_render_esm_js__WEBPACK_IMPORTED_MODULE_4__.render)({
|
333 |
-
props: allProps,
|
334 |
-
slot: context.slot || {},
|
335 |
-
defaultTag: DEFAULT_LABEL_TAG,
|
336 |
-
name: context.name || 'Label'
|
337 |
-
});
|
338 |
-
}
|
339 |
-
|
340 |
-
|
341 |
-
//# sourceMappingURL=label.esm.js.map
|
342 |
-
|
343 |
-
|
344 |
-
/***/ }),
|
345 |
-
|
346 |
-
/***/ "./node_modules/@headlessui/react/dist/components/switch/switch.esm.js":
|
347 |
-
/*!*****************************************************************************!*\
|
348 |
-
!*** ./node_modules/@headlessui/react/dist/components/switch/switch.esm.js ***!
|
349 |
-
\*****************************************************************************/
|
350 |
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
351 |
-
|
352 |
-
__webpack_require__.r(__webpack_exports__);
|
353 |
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
354 |
-
/* harmony export */ "Switch": function() { return /* binding */ Switch; }
|
355 |
-
/* harmony export */ });
|
356 |
-
/* harmony import */ var _virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../_virtual/_rollupPluginBabelHelpers.js */ "./node_modules/@headlessui/react/dist/_virtual/_rollupPluginBabelHelpers.js");
|
357 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
358 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
359 |
-
/* harmony import */ var _utils_render_esm_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils/render.esm.js */ "./node_modules/@headlessui/react/dist/utils/render.esm.js");
|
360 |
-
/* harmony import */ var _hooks_use_sync_refs_esm_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../hooks/use-sync-refs.esm.js */ "./node_modules/@headlessui/react/dist/hooks/use-sync-refs.esm.js");
|
361 |
-
/* harmony import */ var _keyboard_esm_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../keyboard.esm.js */ "./node_modules/@headlessui/react/dist/components/keyboard.esm.js");
|
362 |
-
/* harmony import */ var _utils_bugs_esm_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../utils/bugs.esm.js */ "./node_modules/@headlessui/react/dist/utils/bugs.esm.js");
|
363 |
-
/* harmony import */ var _hooks_use_id_esm_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../hooks/use-id.esm.js */ "./node_modules/@headlessui/react/dist/hooks/use-id.esm.js");
|
364 |
-
/* harmony import */ var _description_description_esm_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../description/description.esm.js */ "./node_modules/@headlessui/react/dist/components/description/description.esm.js");
|
365 |
-
/* harmony import */ var _hooks_use_resolve_button_type_esm_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../hooks/use-resolve-button-type.esm.js */ "./node_modules/@headlessui/react/dist/hooks/use-resolve-button-type.esm.js");
|
366 |
-
/* harmony import */ var _label_label_esm_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../label/label.esm.js */ "./node_modules/@headlessui/react/dist/components/label/label.esm.js");
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
var GroupContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);
|
379 |
-
GroupContext.displayName = 'GroupContext'; // ---
|
380 |
-
|
381 |
-
var DEFAULT_GROUP_TAG = react__WEBPACK_IMPORTED_MODULE_0__.Fragment;
|
382 |
-
|
383 |
-
function Group(props) {
|
384 |
-
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
|
385 |
-
switchElement = _useState[0],
|
386 |
-
setSwitchElement = _useState[1];
|
387 |
-
|
388 |
-
var _useLabels = (0,_label_label_esm_js__WEBPACK_IMPORTED_MODULE_1__.useLabels)(),
|
389 |
-
labelledby = _useLabels[0],
|
390 |
-
LabelProvider = _useLabels[1];
|
391 |
-
|
392 |
-
var _useDescriptions = (0,_description_description_esm_js__WEBPACK_IMPORTED_MODULE_2__.useDescriptions)(),
|
393 |
-
describedby = _useDescriptions[0],
|
394 |
-
DescriptionProvider = _useDescriptions[1];
|
395 |
-
|
396 |
-
var context = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
|
397 |
-
return {
|
398 |
-
"switch": switchElement,
|
399 |
-
setSwitch: setSwitchElement,
|
400 |
-
labelledby: labelledby,
|
401 |
-
describedby: describedby
|
402 |
-
};
|
403 |
-
}, [switchElement, setSwitchElement, labelledby, describedby]);
|
404 |
-
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(DescriptionProvider, {
|
405 |
-
name: "Switch.Description"
|
406 |
-
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(LabelProvider, {
|
407 |
-
name: "Switch.Label",
|
408 |
-
props: {
|
409 |
-
onClick: function onClick() {
|
410 |
-
if (!switchElement) return;
|
411 |
-
switchElement.click();
|
412 |
-
switchElement.focus({
|
413 |
-
preventScroll: true
|
414 |
-
});
|
415 |
-
}
|
416 |
-
}
|
417 |
-
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(GroupContext.Provider, {
|
418 |
-
value: context
|
419 |
-
}, (0,_utils_render_esm_js__WEBPACK_IMPORTED_MODULE_3__.render)({
|
420 |
-
props: props,
|
421 |
-
defaultTag: DEFAULT_GROUP_TAG,
|
422 |
-
name: 'Switch.Group'
|
423 |
-
}))));
|
424 |
-
} // ---
|
425 |
-
|
426 |
-
|
427 |
-
var DEFAULT_SWITCH_TAG = 'button';
|
428 |
-
function Switch(props) {
|
429 |
-
var checked = props.checked,
|
430 |
-
onChange = props.onChange,
|
431 |
-
passThroughProps = (0,_virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_4__.objectWithoutPropertiesLoose)(props, ["checked", "onChange"]);
|
432 |
-
|
433 |
-
var id = "headlessui-switch-" + (0,_hooks_use_id_esm_js__WEBPACK_IMPORTED_MODULE_5__.useId)();
|
434 |
-
var groupContext = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(GroupContext);
|
435 |
-
var internalSwitchRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
436 |
-
var switchRef = (0,_hooks_use_sync_refs_esm_js__WEBPACK_IMPORTED_MODULE_6__.useSyncRefs)(internalSwitchRef, groupContext === null ? null : groupContext.setSwitch);
|
437 |
-
var toggle = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
|
438 |
-
return onChange(!checked);
|
439 |
-
}, [onChange, checked]);
|
440 |
-
var handleClick = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (event) {
|
441 |
-
if ((0,_utils_bugs_esm_js__WEBPACK_IMPORTED_MODULE_7__.isDisabledReactIssue7711)(event.currentTarget)) return event.preventDefault();
|
442 |
-
event.preventDefault();
|
443 |
-
toggle();
|
444 |
-
}, [toggle]);
|
445 |
-
var handleKeyUp = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (event) {
|
446 |
-
if (event.key !== _keyboard_esm_js__WEBPACK_IMPORTED_MODULE_8__.Keys.Tab) event.preventDefault();
|
447 |
-
if (event.key === _keyboard_esm_js__WEBPACK_IMPORTED_MODULE_8__.Keys.Space) toggle();
|
448 |
-
}, [toggle]); // This is needed so that we can "cancel" the click event when we use the `Enter` key on a button.
|
449 |
-
|
450 |
-
var handleKeyPress = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (event) {
|
451 |
-
return event.preventDefault();
|
452 |
-
}, []);
|
453 |
-
var slot = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
|
454 |
-
return {
|
455 |
-
checked: checked
|
456 |
-
};
|
457 |
-
}, [checked]);
|
458 |
-
var propsWeControl = {
|
459 |
-
id: id,
|
460 |
-
ref: switchRef,
|
461 |
-
role: 'switch',
|
462 |
-
type: (0,_hooks_use_resolve_button_type_esm_js__WEBPACK_IMPORTED_MODULE_9__.useResolveButtonType)(props, internalSwitchRef),
|
463 |
-
tabIndex: 0,
|
464 |
-
'aria-checked': checked,
|
465 |
-
'aria-labelledby': groupContext == null ? void 0 : groupContext.labelledby,
|
466 |
-
'aria-describedby': groupContext == null ? void 0 : groupContext.describedby,
|
467 |
-
onClick: handleClick,
|
468 |
-
onKeyUp: handleKeyUp,
|
469 |
-
onKeyPress: handleKeyPress
|
470 |
-
};
|
471 |
-
return (0,_utils_render_esm_js__WEBPACK_IMPORTED_MODULE_3__.render)({
|
472 |
-
props: (0,_virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_4__["extends"])({}, passThroughProps, propsWeControl),
|
473 |
-
slot: slot,
|
474 |
-
defaultTag: DEFAULT_SWITCH_TAG,
|
475 |
-
name: 'Switch'
|
476 |
-
});
|
477 |
-
} // ---
|
478 |
-
|
479 |
-
Switch.Group = Group;
|
480 |
-
Switch.Label = _label_label_esm_js__WEBPACK_IMPORTED_MODULE_1__.Label;
|
481 |
-
Switch.Description = _description_description_esm_js__WEBPACK_IMPORTED_MODULE_2__.Description;
|
482 |
-
|
483 |
-
|
484 |
-
//# sourceMappingURL=switch.esm.js.map
|
485 |
-
|
486 |
-
|
487 |
-
/***/ }),
|
488 |
-
|
489 |
-
/***/ "./node_modules/@headlessui/react/dist/hooks/use-id.esm.js":
|
490 |
-
/*!*****************************************************************!*\
|
491 |
-
!*** ./node_modules/@headlessui/react/dist/hooks/use-id.esm.js ***!
|
492 |
-
\*****************************************************************/
|
493 |
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
494 |
-
|
495 |
-
__webpack_require__.r(__webpack_exports__);
|
496 |
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
497 |
-
/* harmony export */ "useId": function() { return /* binding */ useId; }
|
498 |
-
/* harmony export */ });
|
499 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
500 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
501 |
-
/* harmony import */ var _use_iso_morphic_effect_esm_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./use-iso-morphic-effect.esm.js */ "./node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.esm.js");
|
502 |
-
/* harmony import */ var _use_server_handoff_complete_esm_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./use-server-handoff-complete.esm.js */ "./node_modules/@headlessui/react/dist/hooks/use-server-handoff-complete.esm.js");
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
// didn't take care of the Suspense case. To fix this we used the approach the @reach-ui/auto-id
|
508 |
-
// uses.
|
509 |
-
//
|
510 |
-
// Credits: https://github.com/reach/reach-ui/blob/develop/packages/auto-id/src/index.tsx
|
511 |
-
|
512 |
-
var id = 0;
|
513 |
-
|
514 |
-
function generateId() {
|
515 |
-
return ++id;
|
516 |
-
}
|
517 |
-
|
518 |
-
function useId() {
|
519 |
-
var ready = (0,_use_server_handoff_complete_esm_js__WEBPACK_IMPORTED_MODULE_1__.useServerHandoffComplete)();
|
520 |
-
|
521 |
-
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(ready ? generateId : null),
|
522 |
-
id = _useState[0],
|
523 |
-
setId = _useState[1];
|
524 |
-
|
525 |
-
(0,_use_iso_morphic_effect_esm_js__WEBPACK_IMPORTED_MODULE_2__.useIsoMorphicEffect)(function () {
|
526 |
-
if (id === null) setId(generateId());
|
527 |
-
}, [id]);
|
528 |
-
return id != null ? '' + id : undefined;
|
529 |
-
}
|
530 |
-
|
531 |
-
|
532 |
-
//# sourceMappingURL=use-id.esm.js.map
|
533 |
-
|
534 |
-
|
535 |
-
/***/ }),
|
536 |
-
|
537 |
-
/***/ "./node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.esm.js":
|
538 |
-
/*!*********************************************************************************!*\
|
539 |
-
!*** ./node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.esm.js ***!
|
540 |
-
\*********************************************************************************/
|
541 |
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
542 |
-
|
543 |
-
__webpack_require__.r(__webpack_exports__);
|
544 |
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
545 |
-
/* harmony export */ "useIsoMorphicEffect": function() { return /* binding */ useIsoMorphicEffect; }
|
546 |
-
/* harmony export */ });
|
547 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
548 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
549 |
-
|
550 |
-
|
551 |
-
var useIsoMorphicEffect = typeof window !== 'undefined' ? react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect : react__WEBPACK_IMPORTED_MODULE_0__.useEffect;
|
552 |
-
|
553 |
-
|
554 |
-
//# sourceMappingURL=use-iso-morphic-effect.esm.js.map
|
555 |
-
|
556 |
-
|
557 |
-
/***/ }),
|
558 |
-
|
559 |
-
/***/ "./node_modules/@headlessui/react/dist/hooks/use-resolve-button-type.esm.js":
|
560 |
-
/*!**********************************************************************************!*\
|
561 |
-
!*** ./node_modules/@headlessui/react/dist/hooks/use-resolve-button-type.esm.js ***!
|
562 |
-
\**********************************************************************************/
|
563 |
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
564 |
-
|
565 |
-
__webpack_require__.r(__webpack_exports__);
|
566 |
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
567 |
-
/* harmony export */ "useResolveButtonType": function() { return /* binding */ useResolveButtonType; }
|
568 |
-
/* harmony export */ });
|
569 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
570 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
571 |
-
/* harmony import */ var _use_iso_morphic_effect_esm_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./use-iso-morphic-effect.esm.js */ "./node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.esm.js");
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
function resolveType(props) {
|
576 |
-
var _props$as;
|
577 |
-
|
578 |
-
if (props.type) return props.type;
|
579 |
-
var tag = (_props$as = props.as) != null ? _props$as : 'button';
|
580 |
-
if (typeof tag === 'string' && tag.toLowerCase() === 'button') return 'button';
|
581 |
-
return undefined;
|
582 |
-
}
|
583 |
-
|
584 |
-
function useResolveButtonType(props, ref) {
|
585 |
-
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(function () {
|
586 |
-
return resolveType(props);
|
587 |
-
}),
|
588 |
-
type = _useState[0],
|
589 |
-
setType = _useState[1];
|
590 |
-
|
591 |
-
(0,_use_iso_morphic_effect_esm_js__WEBPACK_IMPORTED_MODULE_1__.useIsoMorphicEffect)(function () {
|
592 |
-
setType(resolveType(props));
|
593 |
-
}, [props.type, props.as]);
|
594 |
-
(0,_use_iso_morphic_effect_esm_js__WEBPACK_IMPORTED_MODULE_1__.useIsoMorphicEffect)(function () {
|
595 |
-
if (type) return;
|
596 |
-
if (!ref.current) return;
|
597 |
-
|
598 |
-
if (ref.current instanceof HTMLButtonElement && !ref.current.hasAttribute('type')) {
|
599 |
-
setType('button');
|
600 |
-
}
|
601 |
-
}, [type, ref]);
|
602 |
-
return type;
|
603 |
-
}
|
604 |
-
|
605 |
-
|
606 |
-
//# sourceMappingURL=use-resolve-button-type.esm.js.map
|
607 |
-
|
608 |
-
|
609 |
-
/***/ }),
|
610 |
-
|
611 |
-
/***/ "./node_modules/@headlessui/react/dist/hooks/use-server-handoff-complete.esm.js":
|
612 |
-
/*!**************************************************************************************!*\
|
613 |
-
!*** ./node_modules/@headlessui/react/dist/hooks/use-server-handoff-complete.esm.js ***!
|
614 |
-
\**************************************************************************************/
|
615 |
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
616 |
-
|
617 |
-
__webpack_require__.r(__webpack_exports__);
|
618 |
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
619 |
-
/* harmony export */ "useServerHandoffComplete": function() { return /* binding */ useServerHandoffComplete; }
|
620 |
-
/* harmony export */ });
|
621 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
622 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
623 |
-
|
624 |
-
|
625 |
-
var state = {
|
626 |
-
serverHandoffComplete: false
|
627 |
-
};
|
628 |
-
function useServerHandoffComplete() {
|
629 |
-
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(state.serverHandoffComplete),
|
630 |
-
serverHandoffComplete = _useState[0],
|
631 |
-
setServerHandoffComplete = _useState[1];
|
632 |
-
|
633 |
-
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
634 |
-
if (serverHandoffComplete === true) return;
|
635 |
-
setServerHandoffComplete(true);
|
636 |
-
}, [serverHandoffComplete]);
|
637 |
-
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
638 |
-
if (state.serverHandoffComplete === false) state.serverHandoffComplete = true;
|
639 |
-
}, []);
|
640 |
-
return serverHandoffComplete;
|
641 |
-
}
|
642 |
-
|
643 |
-
|
644 |
-
//# sourceMappingURL=use-server-handoff-complete.esm.js.map
|
645 |
-
|
646 |
-
|
647 |
-
/***/ }),
|
648 |
-
|
649 |
-
/***/ "./node_modules/@headlessui/react/dist/hooks/use-sync-refs.esm.js":
|
650 |
-
/*!************************************************************************!*\
|
651 |
-
!*** ./node_modules/@headlessui/react/dist/hooks/use-sync-refs.esm.js ***!
|
652 |
-
\************************************************************************/
|
653 |
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
654 |
-
|
655 |
-
__webpack_require__.r(__webpack_exports__);
|
656 |
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
657 |
-
/* harmony export */ "useSyncRefs": function() { return /* binding */ useSyncRefs; }
|
658 |
-
/* harmony export */ });
|
659 |
-
/* harmony import */ var _virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../_virtual/_rollupPluginBabelHelpers.js */ "./node_modules/@headlessui/react/dist/_virtual/_rollupPluginBabelHelpers.js");
|
660 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
661 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
function useSyncRefs() {
|
666 |
-
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
|
667 |
-
refs[_key] = arguments[_key];
|
668 |
-
}
|
669 |
-
|
670 |
-
var cache = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(refs);
|
671 |
-
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
672 |
-
cache.current = refs;
|
673 |
-
}, [refs]);
|
674 |
-
return (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (value) {
|
675 |
-
for (var _iterator = (0,_virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_1__.createForOfIteratorHelperLoose)(cache.current), _step; !(_step = _iterator()).done;) {
|
676 |
-
var ref = _step.value;
|
677 |
-
if (ref == null) continue;
|
678 |
-
if (typeof ref === 'function') ref(value);else ref.current = value;
|
679 |
-
}
|
680 |
-
}, [cache]);
|
681 |
-
}
|
682 |
-
|
683 |
-
|
684 |
-
//# sourceMappingURL=use-sync-refs.esm.js.map
|
685 |
-
|
686 |
-
|
687 |
-
/***/ }),
|
688 |
-
|
689 |
-
/***/ "./node_modules/@headlessui/react/dist/utils/bugs.esm.js":
|
690 |
-
/*!***************************************************************!*\
|
691 |
-
!*** ./node_modules/@headlessui/react/dist/utils/bugs.esm.js ***!
|
692 |
-
\***************************************************************/
|
693 |
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
694 |
-
|
695 |
-
__webpack_require__.r(__webpack_exports__);
|
696 |
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
697 |
-
/* harmony export */ "isDisabledReactIssue7711": function() { return /* binding */ isDisabledReactIssue7711; }
|
698 |
-
/* harmony export */ });
|
699 |
-
// See: https://github.com/facebook/react/issues/7711
|
700 |
-
// See: https://github.com/facebook/react/pull/20612
|
701 |
-
// See: https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#concept-fe-disabled (2.)
|
702 |
-
function isDisabledReactIssue7711(element) {
|
703 |
-
var _ref, _parent;
|
704 |
-
|
705 |
-
var parent = element.parentElement;
|
706 |
-
var legend = null;
|
707 |
-
|
708 |
-
while (parent && !(parent instanceof HTMLFieldSetElement)) {
|
709 |
-
if (parent instanceof HTMLLegendElement) legend = parent;
|
710 |
-
parent = parent.parentElement;
|
711 |
-
}
|
712 |
-
|
713 |
-
var isParentDisabled = (_ref = ((_parent = parent) == null ? void 0 : _parent.getAttribute('disabled')) === '') != null ? _ref : false;
|
714 |
-
if (isParentDisabled && isFirstLegend(legend)) return false;
|
715 |
-
return isParentDisabled;
|
716 |
-
}
|
717 |
-
|
718 |
-
function isFirstLegend(element) {
|
719 |
-
if (!element) return false;
|
720 |
-
var previous = element.previousElementSibling;
|
721 |
-
|
722 |
-
while (previous !== null) {
|
723 |
-
if (previous instanceof HTMLLegendElement) return false;
|
724 |
-
previous = previous.previousElementSibling;
|
725 |
-
}
|
726 |
-
|
727 |
-
return true;
|
728 |
-
}
|
729 |
-
|
730 |
-
|
731 |
-
//# sourceMappingURL=bugs.esm.js.map
|
732 |
-
|
733 |
-
|
734 |
-
/***/ }),
|
735 |
-
|
736 |
-
/***/ "./node_modules/@headlessui/react/dist/utils/match.esm.js":
|
737 |
-
/*!****************************************************************!*\
|
738 |
-
!*** ./node_modules/@headlessui/react/dist/utils/match.esm.js ***!
|
739 |
-
\****************************************************************/
|
740 |
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
741 |
-
|
742 |
-
__webpack_require__.r(__webpack_exports__);
|
743 |
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
744 |
-
/* harmony export */ "match": function() { return /* binding */ match; }
|
745 |
-
/* harmony export */ });
|
746 |
-
function match(value, lookup) {
|
747 |
-
if (value in lookup) {
|
748 |
-
var returnValue = lookup[value];
|
749 |
-
|
750 |
-
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
751 |
-
args[_key - 2] = arguments[_key];
|
752 |
-
}
|
753 |
-
|
754 |
-
return typeof returnValue === 'function' ? returnValue.apply(void 0, args) : returnValue;
|
755 |
-
}
|
756 |
-
|
757 |
-
var error = new Error("Tried to handle \"" + value + "\" but there is no handler defined. Only defined handlers are: " + Object.keys(lookup).map(function (key) {
|
758 |
-
return "\"" + key + "\"";
|
759 |
-
}).join(', ') + ".");
|
760 |
-
if (Error.captureStackTrace) Error.captureStackTrace(error, match);
|
761 |
-
throw error;
|
762 |
-
}
|
763 |
-
|
764 |
-
|
765 |
-
//# sourceMappingURL=match.esm.js.map
|
766 |
-
|
767 |
-
|
768 |
-
/***/ }),
|
769 |
-
|
770 |
-
/***/ "./node_modules/@headlessui/react/dist/utils/render.esm.js":
|
771 |
-
/*!*****************************************************************!*\
|
772 |
-
!*** ./node_modules/@headlessui/react/dist/utils/render.esm.js ***!
|
773 |
-
\*****************************************************************/
|
774 |
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
775 |
-
|
776 |
-
__webpack_require__.r(__webpack_exports__);
|
777 |
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
778 |
-
/* harmony export */ "Features": function() { return /* binding */ Features; },
|
779 |
-
/* harmony export */ "RenderStrategy": function() { return /* binding */ RenderStrategy; },
|
780 |
-
/* harmony export */ "forwardRefWithAs": function() { return /* binding */ forwardRefWithAs; },
|
781 |
-
/* harmony export */ "render": function() { return /* binding */ render; }
|
782 |
-
/* harmony export */ });
|
783 |
-
/* harmony import */ var _virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../_virtual/_rollupPluginBabelHelpers.js */ "./node_modules/@headlessui/react/dist/_virtual/_rollupPluginBabelHelpers.js");
|
784 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
785 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
786 |
-
/* harmony import */ var _match_esm_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./match.esm.js */ "./node_modules/@headlessui/react/dist/utils/match.esm.js");
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
var Features;
|
792 |
-
|
793 |
-
(function (Features) {
|
794 |
-
/** No features at all */
|
795 |
-
Features[Features["None"] = 0] = "None";
|
796 |
-
/**
|
797 |
-
* When used, this will allow us to use one of the render strategies.
|
798 |
-
*
|
799 |
-
* **The render strategies are:**
|
800 |
-
* - **Unmount** _(Will unmount the component.)_
|
801 |
-
* - **Hidden** _(Will hide the component using the [hidden] attribute.)_
|
802 |
-
*/
|
803 |
-
|
804 |
-
Features[Features["RenderStrategy"] = 1] = "RenderStrategy";
|
805 |
-
/**
|
806 |
-
* When used, this will allow the user of our component to be in control. This can be used when
|
807 |
-
* you want to transition based on some state.
|
808 |
-
*/
|
809 |
-
|
810 |
-
Features[Features["Static"] = 2] = "Static";
|
811 |
-
})(Features || (Features = {}));
|
812 |
-
|
813 |
-
var RenderStrategy;
|
814 |
-
|
815 |
-
(function (RenderStrategy) {
|
816 |
-
RenderStrategy[RenderStrategy["Unmount"] = 0] = "Unmount";
|
817 |
-
RenderStrategy[RenderStrategy["Hidden"] = 1] = "Hidden";
|
818 |
-
})(RenderStrategy || (RenderStrategy = {}));
|
819 |
-
|
820 |
-
function render(_ref) {
|
821 |
-
var props = _ref.props,
|
822 |
-
slot = _ref.slot,
|
823 |
-
defaultTag = _ref.defaultTag,
|
824 |
-
features = _ref.features,
|
825 |
-
_ref$visible = _ref.visible,
|
826 |
-
visible = _ref$visible === void 0 ? true : _ref$visible,
|
827 |
-
name = _ref.name;
|
828 |
-
// Visible always render
|
829 |
-
if (visible) return _render(props, slot, defaultTag, name);
|
830 |
-
var featureFlags = features != null ? features : Features.None;
|
831 |
-
|
832 |
-
if (featureFlags & Features.Static) {
|
833 |
-
var _props$static = props["static"],
|
834 |
-
isStatic = _props$static === void 0 ? false : _props$static,
|
835 |
-
rest = (0,_virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_1__.objectWithoutPropertiesLoose)(props, ["static"]); // When the `static` prop is passed as `true`, then the user is in control, thus we don't care about anything else
|
836 |
-
|
837 |
-
|
838 |
-
if (isStatic) return _render(rest, slot, defaultTag, name);
|
839 |
-
}
|
840 |
-
|
841 |
-
if (featureFlags & Features.RenderStrategy) {
|
842 |
-
var _match;
|
843 |
-
|
844 |
-
var _props$unmount = props.unmount,
|
845 |
-
unmount = _props$unmount === void 0 ? true : _props$unmount,
|
846 |
-
_rest = (0,_virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_1__.objectWithoutPropertiesLoose)(props, ["unmount"]);
|
847 |
-
|
848 |
-
var strategy = unmount ? RenderStrategy.Unmount : RenderStrategy.Hidden;
|
849 |
-
return (0,_match_esm_js__WEBPACK_IMPORTED_MODULE_2__.match)(strategy, (_match = {}, _match[RenderStrategy.Unmount] = function () {
|
850 |
-
return null;
|
851 |
-
}, _match[RenderStrategy.Hidden] = function () {
|
852 |
-
return _render((0,_virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_1__["extends"])({}, _rest, {
|
853 |
-
hidden: true,
|
854 |
-
style: {
|
855 |
-
display: 'none'
|
856 |
-
}
|
857 |
-
}), slot, defaultTag, name);
|
858 |
-
}, _match));
|
859 |
-
} // No features enabled, just render
|
860 |
-
|
861 |
-
|
862 |
-
return _render(props, slot, defaultTag, name);
|
863 |
-
}
|
864 |
-
|
865 |
-
function _render(props, slot, tag, name) {
|
866 |
-
var _ref2;
|
867 |
-
|
868 |
-
if (slot === void 0) {
|
869 |
-
slot = {};
|
870 |
-
}
|
871 |
-
|
872 |
-
var _omit = omit(props, ['unmount', 'static']),
|
873 |
-
_omit$as = _omit.as,
|
874 |
-
Component = _omit$as === void 0 ? tag : _omit$as,
|
875 |
-
children = _omit.children,
|
876 |
-
_omit$refName = _omit.refName,
|
877 |
-
refName = _omit$refName === void 0 ? 'ref' : _omit$refName,
|
878 |
-
passThroughProps = (0,_virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_1__.objectWithoutPropertiesLoose)(_omit, ["as", "children", "refName"]); // This allows us to use `<HeadlessUIComponent as={MyComponent} refName="innerRef" />`
|
879 |
-
|
880 |
-
|
881 |
-
var refRelatedProps = props.ref !== undefined ? (_ref2 = {}, _ref2[refName] = props.ref, _ref2) : {};
|
882 |
-
var resolvedChildren = typeof children === 'function' ? children(slot) : children; // Allow for className to be a function with the slot as the contents
|
883 |
-
|
884 |
-
if (passThroughProps.className && typeof passThroughProps.className === 'function') {
|
885 |
-
passThroughProps.className = passThroughProps.className(slot);
|
886 |
-
}
|
887 |
-
|
888 |
-
if (Component === react__WEBPACK_IMPORTED_MODULE_0__.Fragment) {
|
889 |
-
if (Object.keys(passThroughProps).length > 0) {
|
890 |
-
if (!(0,react__WEBPACK_IMPORTED_MODULE_0__.isValidElement)(resolvedChildren) || Array.isArray(resolvedChildren) && resolvedChildren.length > 1) {
|
891 |
-
throw new Error(['Passing props on "Fragment"!', '', "The current component <" + name + " /> is rendering a \"Fragment\".", "However we need to passthrough the following props:", Object.keys(passThroughProps).map(function (line) {
|
892 |
-
return " - " + line;
|
893 |
-
}).join('\n'), '', 'You can apply a few solutions:', ['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".', 'Render a single element as the child so that we can forward the props onto that element.'].map(function (line) {
|
894 |
-
return " - " + line;
|
895 |
-
}).join('\n')].join('\n'));
|
896 |
-
}
|
897 |
-
|
898 |
-
return (0,react__WEBPACK_IMPORTED_MODULE_0__.cloneElement)(resolvedChildren, Object.assign({}, // Filter out undefined values so that they don't override the existing values
|
899 |
-
mergeEventFunctions(compact(omit(passThroughProps, ['ref'])), resolvedChildren.props, ['onClick']), refRelatedProps));
|
900 |
-
}
|
901 |
-
}
|
902 |
-
|
903 |
-
return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(Component, Object.assign({}, omit(passThroughProps, ['ref']), Component !== react__WEBPACK_IMPORTED_MODULE_0__.Fragment && refRelatedProps), resolvedChildren);
|
904 |
-
}
|
905 |
-
/**
|
906 |
-
* We can use this function for the following useCase:
|
907 |
-
*
|
908 |
-
* <Menu.Item> <button onClick={console.log} /> </Menu.Item>
|
909 |
-
*
|
910 |
-
* Our `Menu.Item` will have an internal `onClick`, if you passthrough an `onClick` to the actual
|
911 |
-
* `Menu.Item` component we will call it correctly. However, when we have an `onClick` on the actual
|
912 |
-
* first child, that one should _also_ be called (but before this implementation, it was just
|
913 |
-
* overriding the `onClick`). But it is only when we *render* that we have access to the existing
|
914 |
-
* props of this component.
|
915 |
-
*
|
916 |
-
* It's a bit hacky, and not that clean, but it is something internal and we have tests to rely on
|
917 |
-
* so that we can refactor this later (if needed).
|
918 |
-
*/
|
919 |
-
|
920 |
-
|
921 |
-
function mergeEventFunctions(passThroughProps, existingProps, functionsToMerge) {
|
922 |
-
var clone = Object.assign({}, passThroughProps);
|
923 |
-
|
924 |
-
var _loop = function _loop() {
|
925 |
-
var func = _step.value;
|
926 |
-
|
927 |
-
if (passThroughProps[func] !== undefined && existingProps[func] !== undefined) {
|
928 |
-
var _Object$assign;
|
929 |
-
|
930 |
-
Object.assign(clone, (_Object$assign = {}, _Object$assign[func] = function (event) {
|
931 |
-
// Props we control
|
932 |
-
if (!event.defaultPrevented) passThroughProps[func](event); // Existing props on the component
|
933 |
-
|
934 |
-
if (!event.defaultPrevented) existingProps[func](event);
|
935 |
-
}, _Object$assign));
|
936 |
-
}
|
937 |
-
};
|
938 |
-
|
939 |
-
for (var _iterator = (0,_virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_1__.createForOfIteratorHelperLoose)(functionsToMerge), _step; !(_step = _iterator()).done;) {
|
940 |
-
_loop();
|
941 |
-
}
|
942 |
-
|
943 |
-
return clone;
|
944 |
-
}
|
945 |
-
/**
|
946 |
-
* This is a hack, but basically we want to keep the full 'API' of the component, but we do want to
|
947 |
-
* wrap it in a forwardRef so that we _can_ passthrough the ref
|
948 |
-
*/
|
949 |
-
|
950 |
-
|
951 |
-
function forwardRefWithAs(component) {
|
952 |
-
var _component$displayNam;
|
953 |
-
|
954 |
-
return Object.assign((0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(component), {
|
955 |
-
displayName: (_component$displayNam = component.displayName) != null ? _component$displayNam : component.name
|
956 |
-
});
|
957 |
-
}
|
958 |
-
|
959 |
-
function compact(object) {
|
960 |
-
var clone = Object.assign({}, object);
|
961 |
-
|
962 |
-
for (var key in clone) {
|
963 |
-
if (clone[key] === undefined) delete clone[key];
|
964 |
-
}
|
965 |
-
|
966 |
-
return clone;
|
967 |
-
}
|
968 |
-
|
969 |
-
function omit(object, keysToOmit) {
|
970 |
-
if (keysToOmit === void 0) {
|
971 |
-
keysToOmit = [];
|
972 |
-
}
|
973 |
-
|
974 |
-
var clone = Object.assign({}, object);
|
975 |
-
|
976 |
-
for (var _iterator2 = (0,_virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_1__.createForOfIteratorHelperLoose)(keysToOmit), _step2; !(_step2 = _iterator2()).done;) {
|
977 |
-
var key = _step2.value;
|
978 |
-
if (key in clone) delete clone[key];
|
979 |
-
}
|
980 |
-
|
981 |
-
return clone;
|
982 |
-
}
|
983 |
-
|
984 |
-
|
985 |
-
//# sourceMappingURL=render.esm.js.map
|
986 |
-
|
987 |
-
|
988 |
-
/***/ }),
|
989 |
-
|
990 |
-
/***/ "./wizard/src/Settings.js":
|
991 |
-
/*!********************************!*\
|
992 |
-
!*** ./wizard/src/Settings.js ***!
|
993 |
-
\********************************/
|
994 |
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
995 |
-
|
996 |
-
__webpack_require__.r(__webpack_exports__);
|
997 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
|
998 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
999 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
|
1000 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
1001 |
-
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router/index.js");
|
1002 |
-
/* harmony import */ var _Admin_pages_HomePage__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @Admin/pages/HomePage */ "./wizard/src/pages/HomePage.js");
|
1003 |
-
/* harmony import */ var _Admin_pages_Success__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @Admin/pages/Success */ "./wizard/src/pages/Success.js");
|
1004 |
-
/* harmony import */ var _Admin_pages_ExpressCheckout__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @Admin/pages/ExpressCheckout */ "./wizard/src/pages/ExpressCheckout.js");
|
1005 |
-
/* harmony import */ var _Admin_pages_Failed__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @Admin/pages/Failed */ "./wizard/src/pages/Failed.js");
|
1006 |
-
/* harmony import */ var _Admin_pages_ThankYou__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @Admin/pages/ThankYou */ "./wizard/src/pages/ThankYou.js");
|
1007 |
-
/* harmony import */ var _Admin_pages_WooCommerce__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @Admin/pages/WooCommerce */ "./wizard/src/pages/WooCommerce.js");
|
1008 |
-
/* harmony import */ var _Admin_components_Logo__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @Admin/components/Logo */ "./wizard/src/components/Logo.js");
|
1009 |
-
|
1010 |
-
|
1011 |
-
|
1012 |
-
|
1013 |
-
|
1014 |
-
|
1015 |
-
|
1016 |
-
|
1017 |
-
|
1018 |
-
|
1019 |
-
|
1020 |
-
function Settings() {
|
1021 |
-
const query = new URLSearchParams((0,react_router_dom__WEBPACK_IMPORTED_MODULE_9__.useLocation)().search);
|
1022 |
-
const status = query.get('cpsw_call');
|
1023 |
-
let routePage = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null);
|
1024 |
-
|
1025 |
-
switch (status) {
|
1026 |
-
case 'success':
|
1027 |
-
routePage = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Admin_pages_Success__WEBPACK_IMPORTED_MODULE_3__["default"], null);
|
1028 |
-
break;
|
1029 |
-
|
1030 |
-
case 'failed':
|
1031 |
-
routePage = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Admin_pages_Failed__WEBPACK_IMPORTED_MODULE_5__["default"], null);
|
1032 |
-
break;
|
1033 |
-
|
1034 |
-
case 'express-checkout':
|
1035 |
-
routePage = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Admin_pages_ExpressCheckout__WEBPACK_IMPORTED_MODULE_4__["default"], null);
|
1036 |
-
break;
|
1037 |
-
|
1038 |
-
case 'thank-you':
|
1039 |
-
routePage = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Admin_pages_ThankYou__WEBPACK_IMPORTED_MODULE_6__["default"], null);
|
1040 |
-
break;
|
1041 |
-
|
1042 |
-
case 'setup-woocommerce':
|
1043 |
-
routePage = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Admin_pages_WooCommerce__WEBPACK_IMPORTED_MODULE_7__["default"], null);
|
1044 |
-
break;
|
1045 |
-
|
1046 |
-
default:
|
1047 |
-
routePage = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Admin_pages_HomePage__WEBPACK_IMPORTED_MODULE_2__["default"], null);
|
1048 |
-
break;
|
1049 |
-
}
|
1050 |
-
|
1051 |
-
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
1052 |
-
className: "relative bg-white overflow-hidden w-10/12 mx-auto my-0 rounded-xl mt-12"
|
1053 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
1054 |
-
className: "max-w-7xl mx-auto overflow-x-hidden"
|
1055 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
1056 |
-
className: "relative z-10 bg-white lg:w-full"
|
1057 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Admin_components_Logo__WEBPACK_IMPORTED_MODULE_8__["default"], null), routePage)));
|
1058 |
-
}
|
1059 |
-
|
1060 |
-
/* harmony default export */ __webpack_exports__["default"] = (Settings);
|
1061 |
-
|
1062 |
-
/***/ }),
|
1063 |
-
|
1064 |
-
/***/ "./wizard/src/components/Logo.js":
|
1065 |
-
/*!***************************************!*\
|
1066 |
-
!*** ./wizard/src/components/Logo.js ***!
|
1067 |
-
\***************************************/
|
1068 |
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
1069 |
-
|
1070 |
-
__webpack_require__.r(__webpack_exports__);
|
1071 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
|
1072 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
1073 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
|
1074 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
1075 |
-
|
1076 |
-
|
1077 |
-
|
1078 |
-
function Logo() {
|
1079 |
-
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
1080 |
-
className: "relative pt-6 px-4 sm:px-6 lg:px-8"
|
1081 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("nav", {
|
1082 |
-
className: "relative flex items-center justify-center sm:h-10",
|
1083 |
-
"aria-label": "Logo"
|
1084 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
1085 |
-
className: "flex items-center justify-center flex-grow"
|
1086 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
1087 |
-
className: "flex items-center w-auto"
|
1088 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
|
1089 |
-
className: "h-16 w-full",
|
1090 |
-
src: onboarding_vars.assets_url + 'images/cpsw-logo.svg',
|
1091 |
-
alt: "Checkout Plugins - Stripe for WooCommerce"
|
1092 |
-
}))))));
|
1093 |
-
}
|
1094 |
-
|
1095 |
-
/* harmony default export */ __webpack_exports__["default"] = (Logo);
|
1096 |
-
|
1097 |
-
/***/ }),
|
1098 |
-
|
1099 |
-
/***/ "./wizard/src/components/Spinner.js":
|
1100 |
-
/*!******************************************!*\
|
1101 |
-
!*** ./wizard/src/components/Spinner.js ***!
|
1102 |
-
\******************************************/
|
1103 |
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
1104 |
-
|
1105 |
-
__webpack_require__.r(__webpack_exports__);
|
1106 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
|
1107 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
1108 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
|
1109 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
1110 |
-
|
1111 |
-
|
1112 |
-
|
1113 |
-
function Spinner() {
|
1114 |
-
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", {
|
1115 |
-
className: "animate-spin ml-2 mr-3 h-5 w-5 text-white",
|
1116 |
-
xmlns: "http://www.w3.org/2000/svg",
|
1117 |
-
fill: "none",
|
1118 |
-
viewBox: "0 0 24 24"
|
1119 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("circle", {
|
1120 |
-
className: "opacity-25",
|
1121 |
-
cx: "12",
|
1122 |
-
cy: "12",
|
1123 |
-
r: "10",
|
1124 |
-
stroke: "currentColor",
|
1125 |
-
strokeWidth: "4"
|
1126 |
-
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
|
1127 |
-
className: "opacity-75",
|
1128 |
-
fill: "currentColor",
|
1129 |
-
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
1130 |
-
}));
|
1131 |
-
}
|
1132 |
-
|
1133 |
-
/* harmony default export */ __webpack_exports__["default"] = (Spinner);
|
1134 |
-
|
1135 |
-
/***/ }),
|
1136 |
-
|
1137 |
-
/***/ "./wizard/src/pages/ExpressCheckout.js":
|
1138 |
-
/*!*********************************************!*\
|
1139 |
-
!*** ./wizard/src/pages/ExpressCheckout.js ***!
|
1140 |
-
\*********************************************/
|
1141 |
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
1142 |
-
|
1143 |
-
__webpack_require__.r(__webpack_exports__);
|
1144 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
|
1145 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
1146 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
|
1147 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
1148 |
-
/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch");
|
1149 |
-
/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2__);
|
1150 |
-
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
|
1151 |
-
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
|
1152 |
-
/* harmony import */ var _Admin_components_Spinner__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @Admin/components/Spinner */ "./wizard/src/components/Spinner.js");
|
1153 |
-
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router/index.js");
|
1154 |
-
|
1155 |
-
|
1156 |
-
|
1157 |
-
|
1158 |
-
|
1159 |
-
|
1160 |
-
|
1161 |
-
function ExpressCheckout() {
|
1162 |
-
const [clicked, setClicked] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
|
1163 |
-
const navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_5__.useNavigate)();
|
1164 |
-
|
1165 |
-
function enableExpressCheckout() {
|
1166 |
-
setClicked(true);
|
1167 |
-
const formData = new window.FormData();
|
1168 |
-
formData.append('action', 'cpsw_onboarding_enable_express_checkout');
|
1169 |
-
formData.append('security', onboarding_vars.cpsw_onboarding_enable_express_checkout);
|
1170 |
-
_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2___default()({
|
1171 |
-
url: onboarding_vars.ajax_url,
|
1172 |
-
method: 'POST',
|
1173 |
-
body: formData
|
1174 |
-
}).then(res => {
|
1175 |
-
if (res.success) {
|
1176 |
-
navigate(onboarding_vars.navigator_base + `&cpsw_call=thank-you`);
|
1177 |
-
}
|
1178 |
-
});
|
1179 |
-
}
|
1180 |
-
|
1181 |
-
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("main", {
|
1182 |
-
className: "mt-10 mx-auto w-auto max-w-7xl px-4 sm:mt-12 sm:px-6 md:mt-16 lg:mt-20 lg:px-8 xl:mt-28"
|
1183 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
1184 |
-
className: "text-center"
|
1185 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("h1", {
|
1186 |
-
className: "text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:text-6xl"
|
1187 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
|
1188 |
-
className: "block xl"
|
1189 |
-
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Wooho!!', 'checkout-plugins-stripe-woo')), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
|
1190 |
-
className: "block text-cart-500 xl:inline"
|
1191 |
-
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('You are almost done.', 'checkout-plugins-stripe-woo'))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
|
1192 |
-
className: "mt-3 text-base text-gray-500 sm:mt-5 sm:text-lg sm:mx-auto md:mt-5 md:text-xl lg:mx-0"
|
1193 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
|
1194 |
-
className: "block"
|
1195 |
-
}, " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Since you have enabled', 'checkout-plugins-stripe-woo'), " ", (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
|
1196 |
-
className: "block text-gray-700 xl:inline font-bold"
|
1197 |
-
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Stripe Card Processing', 'checkout-plugins-stripe-woo'), ","), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)(' We recommend you to enable', 'checkout-plugins-stripe-woo'), " ", (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
|
1198 |
-
className: "block text-gray-700 xl:inline font-bold"
|
1199 |
-
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Express Checkout', 'checkout-plugins-stripe-woo')), " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('feature', 'checkout-plugins-stripe-woo'), "."), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Express Checkout generates more conversions!!', 'checkout-plugins-stripe-woo'))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
1200 |
-
className: "block mx-auto mt-1 mb-1"
|
1201 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
|
1202 |
-
className: "inline mx-4 py-5 h-24",
|
1203 |
-
src: onboarding_vars.assets_url + 'images/apple-pay.svg',
|
1204 |
-
alt: "Express Checkout"
|
1205 |
-
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
|
1206 |
-
className: "inline mx-4 py-5 h-24",
|
1207 |
-
src: onboarding_vars.assets_url + 'images/gpay.svg',
|
1208 |
-
alt: "Express Checkout"
|
1209 |
-
})), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
1210 |
-
className: "sm:inline-block lg:inline-block sm:justify-center lg:justify-center"
|
1211 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
1212 |
-
className: "rounded-md shadow"
|
1213 |
-
}, clicked ? (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
|
1214 |
-
className: "disabled w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-wait"
|
1215 |
-
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Enabling…', 'checkout-plugins-stripe-woo'), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Admin_components_Spinner__WEBPACK_IMPORTED_MODULE_4__["default"], null)) : (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
|
1216 |
-
onClick: enableExpressCheckout,
|
1217 |
-
className: "w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-pointer"
|
1218 |
-
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Enable Express Checkout', 'checkout-plugins-stripe-woo'))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
1219 |
-
className: "mt-3 sm:mt-0 sm:ml-3"
|
1220 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("a", {
|
1221 |
-
href: onboarding_vars.base_url + `&cpsw_call=thank-you`,
|
1222 |
-
className: "w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-slate-300 md:py-4 md:text-lg md:px-10"
|
1223 |
-
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Skip Express Checkout', 'checkout-plugins-stripe-woo'))))));
|
1224 |
-
}
|
1225 |
-
|
1226 |
-
/* harmony default export */ __webpack_exports__["default"] = (ExpressCheckout);
|
1227 |
-
|
1228 |
-
/***/ }),
|
1229 |
-
|
1230 |
-
/***/ "./wizard/src/pages/Failed.js":
|
1231 |
-
/*!************************************!*\
|
1232 |
-
!*** ./wizard/src/pages/Failed.js ***!
|
1233 |
-
\************************************/
|
1234 |
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
1235 |
-
|
1236 |
-
__webpack_require__.r(__webpack_exports__);
|
1237 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
|
1238 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
1239 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
|
1240 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
1241 |
-
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
|
1242 |
-
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
|
1243 |
-
|
1244 |
-
|
1245 |
-
|
1246 |
-
|
1247 |
-
function Failed() {
|
1248 |
-
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("main", {
|
1249 |
-
className: "mt-10 mx-auto w-auto max-w-7xl px-4 sm:mt-12 sm:px-6 md:mt-14 lg:mt-16 lg:px-8 xl:mt-18"
|
1250 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
1251 |
-
className: "text-center"
|
1252 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("h1", {
|
1253 |
-
className: "text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:text-6xl"
|
1254 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
|
1255 |
-
className: "block text-red-600 xl:inline"
|
1256 |
-
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Failed!!', 'checkout-plugins-stripe-woo'))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
|
1257 |
-
className: "mt-3 text-base text-gray-500 sm:mt-5 sm:text-lg sm:mx-auto md:mt-5 md:text-xl lg:mx-0"
|
1258 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
|
1259 |
-
className: "block"
|
1260 |
-
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Unfortunately Connection to Stripe failed.', 'checkout-plugins-stripe-woo'))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
1261 |
-
className: "mt-5 sm:mt-8 sm:inline-block lg:inline-block sm:justify-center lg:justify-center"
|
1262 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
1263 |
-
className: "rounded-md shadow"
|
1264 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("a", {
|
1265 |
-
href: onboarding_vars.authorization_url,
|
1266 |
-
className: "w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10"
|
1267 |
-
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Try Again', 'checkout-plugins-stripe-woo'))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
1268 |
-
className: "mt-3 sm:mt-0 sm:ml-3"
|
1269 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("a", {
|
1270 |
-
href: onboarding_vars.manual_connect_url,
|
1271 |
-
className: "w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-slate-300 md:py-4 md:text-lg md:px-10"
|
1272 |
-
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Manage API keys manually', 'checkout-plugins-stripe-woo'))))));
|
1273 |
-
}
|
1274 |
-
|
1275 |
-
/* harmony default export */ __webpack_exports__["default"] = (Failed);
|
1276 |
-
|
1277 |
-
/***/ }),
|
1278 |
-
|
1279 |
-
/***/ "./wizard/src/pages/HomePage.js":
|
1280 |
-
/*!**************************************!*\
|
1281 |
-
!*** ./wizard/src/pages/HomePage.js ***!
|
1282 |
-
\**************************************/
|
1283 |
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
1284 |
-
|
1285 |
-
__webpack_require__.r(__webpack_exports__);
|
1286 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
|
1287 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
1288 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
|
1289 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
1290 |
-
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
|
1291 |
-
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
|
1292 |
-
/* harmony import */ var _Admin_components_Spinner__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @Admin/components/Spinner */ "./wizard/src/components/Spinner.js");
|
1293 |
-
|
1294 |
-
|
1295 |
-
|
1296 |
-
|
1297 |
-
|
1298 |
-
function HomePage() {
|
1299 |
-
const [clicked, setClicked] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
|
1300 |
-
|
1301 |
-
function connectWithStripe() {
|
1302 |
-
setClicked(true);
|
1303 |
-
window.location.replace(onboarding_vars.authorization_url);
|
1304 |
-
}
|
1305 |
-
|
1306 |
-
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("main", {
|
1307 |
-
className: "mt-10 mx-auto w-auto max-w-7xl px-4 sm:mt-12 sm:px-6 md:mt-16 lg:mt-20 lg:px-8 xl:mt-28"
|
1308 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
1309 |
-
className: "text-center"
|
1310 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("h1", {
|
1311 |
-
className: "text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:text-6xl"
|
1312 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
|
1313 |
-
className: "block xl"
|
1314 |
-
}, " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Let\'s Connect', 'checkout-plugins-stripe-woo')), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
|
1315 |
-
className: "block text-cart-500 xl:inline"
|
1316 |
-
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('with Stripe', 'checkout-plugins-stripe-woo'))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
|
1317 |
-
className: "mt-3 text-base text-gray-500 sm:mt-5 sm:text-lg sm:mx-auto md:mt-5 md:text-xl lg:mx-0"
|
1318 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
|
1319 |
-
className: "block"
|
1320 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
|
1321 |
-
className: "block text-gray-700 inline font-bold"
|
1322 |
-
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Checkout Plugins', 'checkout-plugins-stripe-woo')), " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('recommends to connect with', 'checkout-plugins-stripe-woo'), " ", (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
|
1323 |
-
className: "block text-gray-700 xl:inline font-bold"
|
1324 |
-
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Stripe connect.', 'checkout-plugins-stripe-woo'))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('One click onboarding solution provided by', 'checkout-plugins-stripe-woo'), " ", (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
|
1325 |
-
className: "block text-gray-700 xl:inline font-bold"
|
1326 |
-
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Stripe.', 'checkout-plugins-stripe-woo')))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
1327 |
-
className: "mt-5 sm:mt-8 sm:inline-block lg:inline-block sm:justify-center lg:justify-center"
|
1328 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
1329 |
-
className: "rounded-md shadow"
|
1330 |
-
}, clicked ? (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
|
1331 |
-
className: "disabled w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-wait"
|
1332 |
-
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Connecting…', 'checkout-plugins-stripe-woo'), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Admin_components_Spinner__WEBPACK_IMPORTED_MODULE_3__["default"], null)) : (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
|
1333 |
-
onClick: connectWithStripe,
|
1334 |
-
className: "w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-pointer"
|
1335 |
-
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Connect with Stripe', 'checkout-plugins-stripe-woo'))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
1336 |
-
className: "mt-3 sm:mt-0 sm:ml-3"
|
1337 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("a", {
|
1338 |
-
href: onboarding_vars.settings_url,
|
1339 |
-
className: "w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-slate-300 md:py-4 md:text-lg md:px-10"
|
1340 |
-
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Leave onboarding process', 'checkout-plugins-stripe-woo'))))));
|
1341 |
-
}
|
1342 |
-
|
1343 |
-
/* harmony default export */ __webpack_exports__["default"] = (HomePage);
|
1344 |
-
|
1345 |
-
/***/ }),
|
1346 |
-
|
1347 |
-
/***/ "./wizard/src/pages/Success.js":
|
1348 |
-
/*!*************************************!*\
|
1349 |
-
!*** ./wizard/src/pages/Success.js ***!
|
1350 |
-
\*************************************/
|
1351 |
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
1352 |
-
|
1353 |
-
__webpack_require__.r(__webpack_exports__);
|
1354 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
|
1355 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
1356 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
|
1357 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
1358 |
-
/* harmony import */ var _headlessui_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @headlessui/react */ "./node_modules/@headlessui/react/dist/components/switch/switch.esm.js");
|
1359 |
-
/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch");
|
1360 |
-
/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2__);
|
1361 |
-
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
|
1362 |
-
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
|
1363 |
-
/* harmony import */ var _Admin_components_Spinner__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @Admin/components/Spinner */ "./wizard/src/components/Spinner.js");
|
1364 |
-
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router/index.js");
|
1365 |
-
|
1366 |
-
|
1367 |
-
|
1368 |
-
|
1369 |
-
|
1370 |
-
|
1371 |
-
|
1372 |
-
|
1373 |
-
function classNames() {
|
1374 |
-
for (var _len = arguments.length, classes = new Array(_len), _key = 0; _key < _len; _key++) {
|
1375 |
-
classes[_key] = arguments[_key];
|
1376 |
-
}
|
1377 |
-
|
1378 |
-
return classes.filter(Boolean).join(' ');
|
1379 |
-
}
|
1380 |
-
|
1381 |
-
function Success() {
|
1382 |
-
const [clicked, setClicked] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
|
1383 |
-
const [gateways, setGateways] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(onboarding_vars.available_gateways);
|
1384 |
-
const navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_5__.useNavigate)();
|
1385 |
-
|
1386 |
-
function enableGateways(e) {
|
1387 |
-
e.preventDefault();
|
1388 |
-
setClicked(true);
|
1389 |
-
const formData = new window.FormData();
|
1390 |
-
const object = {};
|
1391 |
-
gateways.forEach(function (value) {
|
1392 |
-
object[value.id] = document.getElementsByName(value.id)[0].value;
|
1393 |
-
});
|
1394 |
-
const json = JSON.stringify(object);
|
1395 |
-
formData.append('formdata', json);
|
1396 |
-
formData.append('action', 'cpsw_onboarding_enable_gateway');
|
1397 |
-
formData.append('security', onboarding_vars.cpsw_onboarding_enable_gateway);
|
1398 |
-
_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2___default()({
|
1399 |
-
url: onboarding_vars.ajax_url,
|
1400 |
-
method: 'POST',
|
1401 |
-
body: formData
|
1402 |
-
}).then(res => {
|
1403 |
-
if (res.success) {
|
1404 |
-
if (true === res.data.activated_gateways.cpsw_stripe) {
|
1405 |
-
navigate(onboarding_vars.navigator_base + `&cpsw_call=express-checkout`);
|
1406 |
-
} else {
|
1407 |
-
navigate(onboarding_vars.navigator_base + `&cpsw_call=thank-you`);
|
1408 |
-
}
|
1409 |
-
}
|
1410 |
-
});
|
1411 |
-
}
|
1412 |
-
|
1413 |
-
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("main", {
|
1414 |
-
className: "mt-4 mb-4 mx-auto w-auto max-w-7xl px-4 sm:mt-6 sm:px-6 md:mt-8 lg:mt-10 lg:px-8 xl:mt-16"
|
1415 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
1416 |
-
className: "text-center"
|
1417 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
|
1418 |
-
className: "mt-3 text-base text-gray-500 sm:mt-5 sm:text-lg sm:mx-auto md:mt-5 md:text-xl lg:mx-0"
|
1419 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
|
1420 |
-
className: "block"
|
1421 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
|
1422 |
-
className: "text-gray-700 inline font-bold"
|
1423 |
-
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Congratulations!!', 'checkout-plugins-stripe-woo'), " "), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('You are connected to Stripe successfully.', 'checkout-plugins-stripe-woo')), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
|
1424 |
-
className: "block"
|
1425 |
-
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Let\'s enable gateways', 'checkout-plugins-stripe-woo'))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("ul", {
|
1426 |
-
role: "list",
|
1427 |
-
className: "divide-y divide-gray-200 bg-white overflow-hidden sm:rounded-md mt-10 max-w-screen-md mx-auto"
|
1428 |
-
}, gateways.map(gateway => (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("li", {
|
1429 |
-
key: gateway.id
|
1430 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
|
1431 |
-
href: "#",
|
1432 |
-
className: "block hover:bg-gray-50"
|
1433 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
1434 |
-
className: "flex items-center px-4 py-4 sm:px-6"
|
1435 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
1436 |
-
className: "min-w-0 flex-1 flex items-center"
|
1437 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
1438 |
-
className: "flex-shrink-0"
|
1439 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
|
1440 |
-
className: "h-12 w-32 max-w-80",
|
1441 |
-
src: gateway.icon,
|
1442 |
-
alt: gateway.name
|
1443 |
-
})), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
1444 |
-
className: "min-w-0 flex-1 px-4 md:gap-4"
|
1445 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
|
1446 |
-
className: "text-sm font-medium text-cart-500 flex truncate"
|
1447 |
-
}, gateway.name, " ", gateway.recommended ? (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
|
1448 |
-
className: "ml-2 px-2 py-1 text-green-800 text-xs font-medium bg-green-100 rounded-full"
|
1449 |
-
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Recommended', 'checkout-plugins-stripe-woo')) : ''), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
|
1450 |
-
className: "text-sm font-medium text-gray-400 flex"
|
1451 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
|
1452 |
-
className: "text-left text-sm"
|
1453 |
-
}, 'all' === gateway.currencies ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Works with all currencies', 'checkout-plugins-stripe-woo') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Works with ', 'checkout-plugins-stripe-woo') + gateway.currencies))))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.Switch, {
|
1454 |
-
checked: gateway.enabled,
|
1455 |
-
value: gateway.enabled,
|
1456 |
-
name: gateway.id,
|
1457 |
-
onChange: () => {
|
1458 |
-
gateway.enabled = !gateway.enabled;
|
1459 |
-
setGateways([...gateways]);
|
1460 |
-
},
|
1461 |
-
className: classNames(gateway.enabled ? 'bg-cart-500 ' : 'bg-gray-200', 'relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-cart-500')
|
1462 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
|
1463 |
-
className: "sr-only"
|
1464 |
-
}, gateway.id), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
|
1465 |
-
"aria-hidden": "true",
|
1466 |
-
className: classNames(gateway.enabled ? 'translate-x-5' : 'translate-x-0', 'pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition ease-in-out duration-200')
|
1467 |
-
})))))))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
1468 |
-
className: "mt-5 sm:mt-8 sm:inline-block lg:inline-block sm:justify-center lg:justify-center"
|
1469 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
1470 |
-
className: "rounded-md shadow"
|
1471 |
-
}, clicked ? (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
|
1472 |
-
className: "disabled w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-wait"
|
1473 |
-
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Enabling…', 'checkout-plugins-stripe-woo'), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Admin_components_Spinner__WEBPACK_IMPORTED_MODULE_4__["default"], null)) : (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
|
1474 |
-
onClick: enableGateways,
|
1475 |
-
className: "w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-pointer"
|
1476 |
-
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Enable Gateways', 'checkout-plugins-stripe-woo'))))));
|
1477 |
-
}
|
1478 |
-
|
1479 |
-
/* harmony default export */ __webpack_exports__["default"] = (Success);
|
1480 |
-
|
1481 |
-
/***/ }),
|
1482 |
-
|
1483 |
-
/***/ "./wizard/src/pages/ThankYou.js":
|
1484 |
-
/*!**************************************!*\
|
1485 |
-
!*** ./wizard/src/pages/ThankYou.js ***!
|
1486 |
-
\**************************************/
|
1487 |
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
1488 |
-
|
1489 |
-
__webpack_require__.r(__webpack_exports__);
|
1490 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
|
1491 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
1492 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
|
1493 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
1494 |
-
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
|
1495 |
-
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
|
1496 |
-
/* harmony import */ var _Admin_components_Spinner__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @Admin/components/Spinner */ "./wizard/src/components/Spinner.js");
|
1497 |
-
|
1498 |
-
|
1499 |
-
|
1500 |
-
|
1501 |
-
|
1502 |
-
function ThankYou() {
|
1503 |
-
const [clicked, setClicked] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
|
1504 |
-
|
1505 |
-
function letsCustomize() {
|
1506 |
-
setClicked(true);
|
1507 |
-
window.location.replace(onboarding_vars.gateways_url);
|
1508 |
-
}
|
1509 |
-
|
1510 |
-
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("main", {
|
1511 |
-
className: "mt-10 mx-auto w-auto max-w-7xl px-4 sm:mt-12 sm:px-6 md:mt-14 lg:mt-16 lg:px-8 xl:mt-18"
|
1512 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
1513 |
-
className: "text-center"
|
1514 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("h1", {
|
1515 |
-
className: "text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:text-6xl"
|
1516 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
|
1517 |
-
className: "block text-cart-500 xl:inline"
|
1518 |
-
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Great!!', 'checkout-plugins-stripe-woo'))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
|
1519 |
-
className: "mt-3 text-base text-gray-500 sm:mt-5 sm:text-lg sm:mx-auto md:mt-5 md:text-xl lg:mx-0"
|
1520 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
|
1521 |
-
className: "block"
|
1522 |
-
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Your store is all set to accept payment.', 'checkout-plugins-stripe-woo')), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('We provide lots of customization options to match your needs, don\'t forget to explore them.', 'checkout-plugins-stripe-woo'))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
1523 |
-
className: "mt-5 sm:mt-8 sm:inline-block lg:inline-block sm:justify-center lg:justify-center"
|
1524 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
1525 |
-
className: "rounded-md shadow"
|
1526 |
-
}, clicked ? (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
|
1527 |
-
className: "disabled w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-wait"
|
1528 |
-
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Let\'s Customize…', 'checkout-plugins-stripe-woo'), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Admin_components_Spinner__WEBPACK_IMPORTED_MODULE_3__["default"], null)) : (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
|
1529 |
-
onClick: letsCustomize,
|
1530 |
-
className: "w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-pointer"
|
1531 |
-
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Let\'s Customize', 'checkout-plugins-stripe-woo'))))));
|
1532 |
-
}
|
1533 |
-
|
1534 |
-
/* harmony default export */ __webpack_exports__["default"] = (ThankYou);
|
1535 |
-
|
1536 |
-
/***/ }),
|
1537 |
-
|
1538 |
-
/***/ "./wizard/src/pages/WooCommerce.js":
|
1539 |
-
/*!*****************************************!*\
|
1540 |
-
!*** ./wizard/src/pages/WooCommerce.js ***!
|
1541 |
-
\*****************************************/
|
1542 |
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
1543 |
-
|
1544 |
-
__webpack_require__.r(__webpack_exports__);
|
1545 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
|
1546 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
1547 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
|
1548 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
1549 |
-
/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch");
|
1550 |
-
/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2__);
|
1551 |
-
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
|
1552 |
-
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
|
1553 |
-
/* harmony import */ var _Admin_components_Spinner__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @Admin/components/Spinner */ "./wizard/src/components/Spinner.js");
|
1554 |
-
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router/index.js");
|
1555 |
-
|
1556 |
-
|
1557 |
-
|
1558 |
-
|
1559 |
-
|
1560 |
-
|
1561 |
-
|
1562 |
-
function WooCommerce() {
|
1563 |
-
const [state, setState] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('');
|
1564 |
-
const [notification, setNotification] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
|
1565 |
-
const navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_5__.useNavigate)();
|
1566 |
-
|
1567 |
-
function installWooCommerce() {
|
1568 |
-
if ('' === onboarding_vars.woocommerce_installed) {
|
1569 |
-
setState('installing');
|
1570 |
-
setTimeout(() => {
|
1571 |
-
setNotification(true);
|
1572 |
-
}, 10000);
|
1573 |
-
wp.updates.queue.push({
|
1574 |
-
action: 'install-plugin',
|
1575 |
-
// Required action.
|
1576 |
-
data: {
|
1577 |
-
slug: 'woocommerce'
|
1578 |
-
}
|
1579 |
-
}); // Required to set queue.
|
1580 |
-
|
1581 |
-
wp.updates.queueChecker();
|
1582 |
-
} else {
|
1583 |
-
setState('activating');
|
1584 |
-
const formData = new window.FormData();
|
1585 |
-
formData.append('action', 'cpsw_onboarding_install_woocommerce');
|
1586 |
-
formData.append('security', onboarding_vars.cpsw_onboarding_install_woocommerce);
|
1587 |
-
_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2___default()({
|
1588 |
-
url: onboarding_vars.ajax_url,
|
1589 |
-
method: 'POST',
|
1590 |
-
body: formData
|
1591 |
-
}).then(res => {
|
1592 |
-
if (res.success) {
|
1593 |
-
navigate(onboarding_vars.navigator_base);
|
1594 |
-
}
|
1595 |
-
});
|
1596 |
-
}
|
1597 |
-
}
|
1598 |
-
|
1599 |
-
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("main", {
|
1600 |
-
className: "mt-10 mx-auto max-w-7xl px-4 sm:mt-12 sm:px-6 md:mt-16 lg:mt-20 lg:px-8 xl:mt-28"
|
1601 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
1602 |
-
className: "text-center"
|
1603 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("h1", {
|
1604 |
-
className: "text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:text-6xl"
|
1605 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
|
1606 |
-
className: "block xl"
|
1607 |
-
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Missing', 'checkout-plugins-stripe-woo')), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
|
1608 |
-
className: "block text-cart-500 xl:inline"
|
1609 |
-
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('WooCoomerce', 'checkout-plugins-stripe-woo'))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
|
1610 |
-
className: "mt-6 text-base justify-center text-gray-500 sm:mt-5 sm:text-lg sm:w-full sm:mx-auto md:mt-5 md:text-xl lg:mx-0"
|
1611 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
|
1612 |
-
className: "block text-gray-700 xl:inline font-bold"
|
1613 |
-
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Checkout Plugins - Stripe for WooCoomerce', 'checkout-plugins-stripe-woo')), " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('requires', 'checkout-plugins-stripe-woo'), " ", (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
|
1614 |
-
className: "block text-gray-700 xl:inline font-bold"
|
1615 |
-
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('WooCommerce', 'checkout-plugins-stripe-woo')), " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('to be active on your store.', 'checkout-plugins-stripe-woo')), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
1616 |
-
className: "mt-5 sm:mt-8 sm:flex justify-center"
|
1617 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
1618 |
-
className: "rounded-md shadow"
|
1619 |
-
}, (() => {
|
1620 |
-
if ('installing' === state) {
|
1621 |
-
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
|
1622 |
-
className: "disabled w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-wait"
|
1623 |
-
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Installing…', 'checkout-plugins-stripe-woo'), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Admin_components_Spinner__WEBPACK_IMPORTED_MODULE_4__["default"], null));
|
1624 |
-
} else if ('activating' === state) {
|
1625 |
-
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
|
1626 |
-
className: "disabled w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-wait"
|
1627 |
-
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Activating…', 'checkout-plugins-stripe-woo'), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Admin_components_Spinner__WEBPACK_IMPORTED_MODULE_4__["default"], null));
|
1628 |
-
}
|
1629 |
-
|
1630 |
-
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
|
1631 |
-
onClick: installWooCommerce,
|
1632 |
-
className: "install-dependency w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-pointer"
|
1633 |
-
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Install and continue', 'checkout-plugins-stripe-woo'));
|
1634 |
-
})()))), notification ? (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
1635 |
-
className: "bg-cart-50 p-4 fixed left-0 top-0 right-0 transition ease-in-out delay-150"
|
1636 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
1637 |
-
className: "block"
|
1638 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
1639 |
-
className: "text-center justify-center"
|
1640 |
-
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
|
1641 |
-
className: "text-sm mx-auto w-full text-cart-500 text-center"
|
1642 |
-
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Installing WooCommerce will take time. Please be patient.'))))) : '');
|
1643 |
-
}
|
1644 |
-
|
1645 |
-
/* harmony default export */ __webpack_exports__["default"] = (WooCommerce);
|
1646 |
-
|
1647 |
-
/***/ }),
|
1648 |
-
|
1649 |
-
/***/ "./node_modules/history/index.js":
|
1650 |
-
/*!***************************************!*\
|
1651 |
-
!*** ./node_modules/history/index.js ***!
|
1652 |
-
\***************************************/
|
1653 |
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
1654 |
-
|
1655 |
-
__webpack_require__.r(__webpack_exports__);
|
1656 |
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
1657 |
-
/* harmony export */ "Action": function() { return /* binding */ r; },
|
1658 |
-
/* harmony export */ "createBrowserHistory": function() { return /* binding */ createBrowserHistory; },
|
1659 |
-
/* harmony export */ "createHashHistory": function() { return /* binding */ createHashHistory; },
|
1660 |
-
/* harmony export */ "createMemoryHistory": function() { return /* binding */ createMemoryHistory; },
|
1661 |
-
/* harmony export */ "createPath": function() { return /* binding */ I; },
|
1662 |
-
/* harmony export */ "parsePath": function() { return /* binding */ J; }
|
1663 |
-
/* harmony export */ });
|
1664 |
-
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
|
1665 |
-
var r,B=r||(r={});B.Pop="POP";B.Push="PUSH";B.Replace="REPLACE";var C= true?function(b){return Object.freeze(b)}:0;function D(b,h){if(!b){"undefined"!==typeof console&&console.warn(h);try{throw Error(h);}catch(e){}}}function E(b){b.preventDefault();b.returnValue=""}
|
1666 |
-
function F(){var b=[];return{get length(){return b.length},push:function(h){b.push(h);return function(){b=b.filter(function(e){return e!==h})}},call:function(h){b.forEach(function(e){return e&&e(h)})}}}function H(){return Math.random().toString(36).substr(2,8)}function I(b){var h=b.pathname;h=void 0===h?"/":h;var e=b.search;e=void 0===e?"":e;b=b.hash;b=void 0===b?"":b;e&&"?"!==e&&(h+="?"===e.charAt(0)?e:"?"+e);b&&"#"!==b&&(h+="#"===b.charAt(0)?b:"#"+b);return h}
|
1667 |
-
function J(b){var h={};if(b){var e=b.indexOf("#");0<=e&&(h.hash=b.substr(e),b=b.substr(0,e));e=b.indexOf("?");0<=e&&(h.search=b.substr(e),b=b.substr(0,e));b&&(h.pathname=b)}return h}
|
1668 |
-
function createBrowserHistory(b){function h(){var c=p.location,a=m.state||{};return[a.idx,C({pathname:c.pathname,search:c.search,hash:c.hash,state:a.usr||null,key:a.key||"default"})]}function e(c){return"string"===typeof c?c:I(c)}function x(c,a){void 0===a&&(a=null);return C((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({pathname:q.pathname,hash:"",search:""},"string"===typeof c?J(c):c,{state:a,key:H()}))}function z(c){t=c;c=h();v=c[0];q=c[1];d.call({action:t,location:q})}function A(c,a){function f(){A(c,a)}var l=r.Push,k=x(c,
|
1669 |
-
a);if(!g.length||(g.call({action:l,location:k,retry:f}),!1)){var n=[{usr:k.state,key:k.key,idx:v+1},e(k)];k=n[0];n=n[1];try{m.pushState(k,"",n)}catch(G){p.location.assign(n)}z(l)}}function y(c,a){function f(){y(c,a)}var l=r.Replace,k=x(c,a);g.length&&(g.call({action:l,location:k,retry:f}),1)||(k=[{usr:k.state,key:k.key,idx:v},e(k)],m.replaceState(k[0],"",k[1]),z(l))}function w(c){m.go(c)}void 0===b&&(b={});b=b.window;var p=void 0===b?document.defaultView:b,m=p.history,u=null;p.addEventListener("popstate",
|
1670 |
-
function(){if(u)g.call(u),u=null;else{var c=r.Pop,a=h(),f=a[0];a=a[1];if(g.length)if(null!=f){var l=v-f;l&&(u={action:c,location:a,retry:function(){w(-1*l)}},w(l))}else true?D(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."):
|
1671 |
-
0;else z(c)}});var t=r.Pop;b=h();var v=b[0],q=b[1],d=F(),g=F();null==v&&(v=0,m.replaceState((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({},m.state,{idx:v}),""));return{get action(){return t},get location(){return q},createHref:e,push:A,replace:y,go:w,back:function(){w(-1)},forward:function(){w(1)},listen:function(c){return d.push(c)},block:function(c){var a=g.push(c);1===g.length&&p.addEventListener("beforeunload",E);return function(){a();g.length||p.removeEventListener("beforeunload",E)}}}};
|
1672 |
-
function createHashHistory(b){function h(){var a=J(m.location.hash.substr(1)),f=a.pathname,l=a.search;a=a.hash;var k=u.state||{};return[k.idx,C({pathname:void 0===f?"/":f,search:void 0===l?"":l,hash:void 0===a?"":a,state:k.usr||null,key:k.key||"default"})]}function e(){if(t)c.call(t),t=null;else{var a=r.Pop,f=h(),l=f[0];f=f[1];if(c.length)if(null!=l){var k=q-l;k&&(t={action:a,location:f,retry:function(){p(-1*k)}},p(k))}else true?D(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."):
|
1673 |
-
0;else A(a)}}function x(a){var f=document.querySelector("base"),l="";f&&f.getAttribute("href")&&(f=m.location.href,l=f.indexOf("#"),l=-1===l?f:f.slice(0,l));return l+"#"+("string"===typeof a?a:I(a))}function z(a,f){void 0===f&&(f=null);return C((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({pathname:d.pathname,hash:"",search:""},"string"===typeof a?J(a):a,{state:f,key:H()}))}function A(a){v=a;a=h();q=a[0];d=a[1];g.call({action:v,location:d})}function y(a,f){function l(){y(a,f)}var k=r.Push,n=z(a,f); true?
|
1674 |
-
D("/"===n.pathname.charAt(0),"Relative pathnames are not supported in hash history.push("+JSON.stringify(a)+")"):0;if(!c.length||(c.call({action:k,location:n,retry:l}),!1)){var G=[{usr:n.state,key:n.key,idx:q+1},x(n)];n=G[0];G=G[1];try{u.pushState(n,"",G)}catch(K){m.location.assign(G)}A(k)}}function w(a,f){function l(){w(a,f)}var k=r.Replace,n=z(a,f); true?D("/"===n.pathname.charAt(0),"Relative pathnames are not supported in hash history.replace("+JSON.stringify(a)+
|
1675 |
-
")"):0;c.length&&(c.call({action:k,location:n,retry:l}),1)||(n=[{usr:n.state,key:n.key,idx:q},x(n)],u.replaceState(n[0],"",n[1]),A(k))}function p(a){u.go(a)}void 0===b&&(b={});b=b.window;var m=void 0===b?document.defaultView:b,u=m.history,t=null;m.addEventListener("popstate",e);m.addEventListener("hashchange",function(){var a=h()[1];I(a)!==I(d)&&e()});var v=r.Pop;b=h();var q=b[0],d=b[1],g=F(),c=F();null==q&&(q=0,u.replaceState((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({},u.state,{idx:q}),""));return{get action(){return v},get location(){return d},
|
1676 |
-
createHref:x,push:y,replace:w,go:p,back:function(){p(-1)},forward:function(){p(1)},listen:function(a){return g.push(a)},block:function(a){var f=c.push(a);1===c.length&&m.addEventListener("beforeunload",E);return function(){f();c.length||m.removeEventListener("beforeunload",E)}}}};
|
1677 |
-
function createMemoryHistory(b){function h(d,g){void 0===g&&(g=null);return C((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({pathname:t.pathname,search:"",hash:""},"string"===typeof d?J(d):d,{state:g,key:H()}))}function e(d,g,c){return!q.length||(q.call({action:d,location:g,retry:c}),!1)}function x(d,g){u=d;t=g;v.call({action:u,location:t})}function z(d,g){var c=r.Push,a=h(d,g); true?D("/"===t.pathname.charAt(0),"Relative pathnames are not supported in memory history.push("+JSON.stringify(d)+")"):
|
1678 |
-
0;e(c,a,function(){z(d,g)})&&(m+=1,p.splice(m,p.length,a),x(c,a))}function A(d,g){var c=r.Replace,a=h(d,g); true?D("/"===t.pathname.charAt(0),"Relative pathnames are not supported in memory history.replace("+JSON.stringify(d)+")"):0;e(c,a,function(){A(d,g)})&&(p[m]=a,x(c,a))}function y(d){var g=Math.min(Math.max(m+d,0),p.length-1),c=r.Pop,a=p[g];e(c,a,function(){y(d)})&&(m=g,x(c,a))}void 0===b&&(b={});var w=b;b=w.initialEntries;w=w.initialIndex;var p=(void 0===
|
1679 |
-
b?["/"]:b).map(function(d){var g=C((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({pathname:"/",search:"",hash:"",state:null,key:H()},"string"===typeof d?J(d):d)); true?D("/"===g.pathname.charAt(0),"Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: "+JSON.stringify(d)+")"):0;return g}),m=Math.min(Math.max(null==w?p.length-1:w,0),p.length-1),u=r.Pop,t=p[m],v=F(),q=F();return{get index(){return m},get action(){return u},get location(){return t},createHref:function(d){return"string"===
|
1680 |
-
typeof d?d:I(d)},push:z,replace:A,go:y,back:function(){y(-1)},forward:function(){y(1)},listen:function(d){return v.push(d)},block:function(d){return q.push(d)}}};
|
1681 |
-
//# sourceMappingURL=index.js.map
|
1682 |
-
|
1683 |
-
|
1684 |
-
/***/ }),
|
1685 |
-
|
1686 |
-
/***/ "./wizard/src/App.scss":
|
1687 |
-
/*!*****************************!*\
|
1688 |
-
!*** ./wizard/src/App.scss ***!
|
1689 |
-
\*****************************/
|
1690 |
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
1691 |
-
|
1692 |
-
__webpack_require__.r(__webpack_exports__);
|
1693 |
-
// extracted by mini-css-extract-plugin
|
1694 |
-
|
1695 |
-
|
1696 |
-
/***/ }),
|
1697 |
-
|
1698 |
-
/***/ "./node_modules/react-router-dom/index.js":
|
1699 |
-
/*!************************************************!*\
|
1700 |
-
!*** ./node_modules/react-router-dom/index.js ***!
|
1701 |
-
\************************************************/
|
1702 |
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
1703 |
-
|
1704 |
-
__webpack_require__.r(__webpack_exports__);
|
1705 |
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
1706 |
-
/* harmony export */ "MemoryRouter": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.MemoryRouter; },
|
1707 |
-
/* harmony export */ "Navigate": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.Navigate; },
|
1708 |
-
/* harmony export */ "Outlet": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.Outlet; },
|
1709 |
-
/* harmony export */ "Route": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.Route; },
|
1710 |
-
/* harmony export */ "Router": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.Router; },
|
1711 |
-
/* harmony export */ "Routes": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.Routes; },
|
1712 |
-
/* harmony export */ "UNSAFE_LocationContext": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_LocationContext; },
|
1713 |
-
/* harmony export */ "UNSAFE_NavigationContext": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_NavigationContext; },
|
1714 |
-
/* harmony export */ "UNSAFE_RouteContext": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_RouteContext; },
|
1715 |
-
/* harmony export */ "createRoutesFromChildren": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.createRoutesFromChildren; },
|
1716 |
-
/* harmony export */ "generatePath": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.generatePath; },
|
1717 |
-
/* harmony export */ "matchPath": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.matchPath; },
|
1718 |
-
/* harmony export */ "matchRoutes": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.matchRoutes; },
|
1719 |
-
/* harmony export */ "renderMatches": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.renderMatches; },
|
1720 |
-
/* harmony export */ "resolvePath": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.resolvePath; },
|
1721 |
-
/* harmony export */ "useHref": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.useHref; },
|
1722 |
-
/* harmony export */ "useInRouterContext": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.useInRouterContext; },
|
1723 |
-
/* harmony export */ "useLocation": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.useLocation; },
|
1724 |
-
/* harmony export */ "useMatch": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.useMatch; },
|
1725 |
-
/* harmony export */ "useNavigate": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.useNavigate; },
|
1726 |
-
/* harmony export */ "useNavigationType": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.useNavigationType; },
|
1727 |
-
/* harmony export */ "useOutlet": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.useOutlet; },
|
1728 |
-
/* harmony export */ "useOutletContext": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.useOutletContext; },
|
1729 |
-
/* harmony export */ "useParams": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.useParams; },
|
1730 |
-
/* harmony export */ "useResolvedPath": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.useResolvedPath; },
|
1731 |
-
/* harmony export */ "useRoutes": function() { return /* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_1__.useRoutes; },
|
1732 |
-
/* harmony export */ "BrowserRouter": function() { return /* binding */ BrowserRouter; },
|
1733 |
-
/* harmony export */ "HashRouter": function() { return /* binding */ HashRouter; },
|
1734 |
-
/* harmony export */ "Link": function() { return /* binding */ Link; },
|
1735 |
-
/* harmony export */ "NavLink": function() { return /* binding */ NavLink; },
|
1736 |
-
/* harmony export */ "createSearchParams": function() { return /* binding */ createSearchParams; },
|
1737 |
-
/* harmony export */ "unstable_HistoryRouter": function() { return /* binding */ HistoryRouter; },
|
1738 |
-
/* harmony export */ "useLinkClickHandler": function() { return /* binding */ useLinkClickHandler; },
|
1739 |
-
/* harmony export */ "useSearchParams": function() { return /* binding */ useSearchParams; }
|
1740 |
-
/* harmony export */ });
|
1741 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
1742 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
1743 |
-
/* harmony import */ var history__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! history */ "./node_modules/history/index.js");
|
1744 |
-
/* harmony import */ var react_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-router */ "./node_modules/react-router/index.js");
|
1745 |
-
/**
|
1746 |
-
* React Router DOM v6.2.1
|
1747 |
-
*
|
1748 |
-
* Copyright (c) Remix Software Inc.
|
1749 |
-
*
|
1750 |
-
* This source code is licensed under the MIT license found in the
|
1751 |
-
* LICENSE.md file in the root directory of this source tree.
|
1752 |
-
*
|
1753 |
-
* @license MIT
|
1754 |
-
*/
|
1755 |
-
|
1756 |
-
|
1757 |
-
|
1758 |
-
|
1759 |
-
|
1760 |
-
function _extends() {
|
1761 |
-
_extends = Object.assign || function (target) {
|
1762 |
-
for (var i = 1; i < arguments.length; i++) {
|
1763 |
-
var source = arguments[i];
|
1764 |
-
|
1765 |
-
for (var key in source) {
|
1766 |
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
1767 |
-
target[key] = source[key];
|
1768 |
-
}
|
1769 |
-
}
|
1770 |
-
}
|
1771 |
-
|
1772 |
-
return target;
|
1773 |
-
};
|
1774 |
-
|
1775 |
-
return _extends.apply(this, arguments);
|
1776 |
-
}
|
1777 |
-
|
1778 |
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
1779 |
-
if (source == null) return {};
|
1780 |
-
var target = {};
|
1781 |
-
var sourceKeys = Object.keys(source);
|
1782 |
-
var key, i;
|
1783 |
-
|
1784 |
-
for (i = 0; i < sourceKeys.length; i++) {
|
1785 |
-
key = sourceKeys[i];
|
1786 |
-
if (excluded.indexOf(key) >= 0) continue;
|
1787 |
-
target[key] = source[key];
|
1788 |
-
}
|
1789 |
-
|
1790 |
-
return target;
|
1791 |
-
}
|
1792 |
-
|
1793 |
-
const _excluded = ["onClick", "reloadDocument", "replace", "state", "target", "to"],
|
1794 |
-
_excluded2 = ["aria-current", "caseSensitive", "className", "end", "style", "to", "children"];
|
1795 |
-
|
1796 |
-
function warning(cond, message) {
|
1797 |
-
if (!cond) {
|
1798 |
-
// eslint-disable-next-line no-console
|
1799 |
-
if (typeof console !== "undefined") console.warn(message);
|
1800 |
-
|
1801 |
-
try {
|
1802 |
-
// Welcome to debugging React Router!
|
1803 |
-
//
|
1804 |
-
// This error is thrown as a convenience so you can more easily
|
1805 |
-
// find the source for a warning that appears in the console by
|
1806 |
-
// enabling "pause on exceptions" in your JavaScript debugger.
|
1807 |
-
throw new Error(message); // eslint-disable-next-line no-empty
|
1808 |
-
} catch (e) {}
|
1809 |
-
}
|
1810 |
-
} ////////////////////////////////////////////////////////////////////////////////
|
1811 |
-
// COMPONENTS
|
1812 |
-
////////////////////////////////////////////////////////////////////////////////
|
1813 |
-
|
1814 |
-
/**
|
1815 |
-
* A `<Router>` for use in web browsers. Provides the cleanest URLs.
|
1816 |
-
*/
|
1817 |
-
function BrowserRouter(_ref) {
|
1818 |
-
let {
|
1819 |
-
basename,
|
1820 |
-
children,
|
1821 |
-
window
|
1822 |
-
} = _ref;
|
1823 |
-
let historyRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
|
1824 |
-
|
1825 |
-
if (historyRef.current == null) {
|
1826 |
-
historyRef.current = (0,history__WEBPACK_IMPORTED_MODULE_2__.createBrowserHistory)({
|
1827 |
-
window
|
1828 |
-
});
|
1829 |
-
}
|
1830 |
-
|
1831 |
-
let history = historyRef.current;
|
1832 |
-
let [state, setState] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({
|
1833 |
-
action: history.action,
|
1834 |
-
location: history.location
|
1835 |
-
});
|
1836 |
-
(0,react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect)(() => history.listen(setState), [history]);
|
1837 |
-
return /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react_router__WEBPACK_IMPORTED_MODULE_1__.Router, {
|
1838 |
-
basename: basename,
|
1839 |
-
children: children,
|
1840 |
-
location: state.location,
|
1841 |
-
navigationType: state.action,
|
1842 |
-
navigator: history
|
1843 |
-
});
|
1844 |
-
}
|
1845 |
-
|
1846 |
-
/**
|
1847 |
-
* A `<Router>` for use in web browsers. Stores the location in the hash
|
1848 |
-
* portion of the URL so it is not sent to the server.
|
1849 |
-
*/
|
1850 |
-
function HashRouter(_ref2) {
|
1851 |
-
let {
|
1852 |
-
basename,
|
1853 |
-
children,
|
1854 |
-
window
|
1855 |
-
} = _ref2;
|
1856 |
-
let historyRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
|
1857 |
-
|
1858 |
-
if (historyRef.current == null) {
|
1859 |
-
historyRef.current = (0,history__WEBPACK_IMPORTED_MODULE_2__.createHashHistory)({
|
1860 |
-
window
|
1861 |
-
});
|
1862 |
-
}
|
1863 |
-
|
1864 |
-
let history = historyRef.current;
|
1865 |
-
let [state, setState] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({
|
1866 |
-
action: history.action,
|
1867 |
-
location: history.location
|
1868 |
-
});
|
1869 |
-
(0,react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect)(() => history.listen(setState), [history]);
|
1870 |
-
return /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react_router__WEBPACK_IMPORTED_MODULE_1__.Router, {
|
1871 |
-
basename: basename,
|
1872 |
-
children: children,
|
1873 |
-
location: state.location,
|
1874 |
-
navigationType: state.action,
|
1875 |
-
navigator: history
|
1876 |
-
});
|
1877 |
-
}
|
1878 |
-
|
1879 |
-
/**
|
1880 |
-
* A `<Router>` that accepts a pre-instantiated history object. It's important
|
1881 |
-
* to note that using your own history object is highly discouraged and may add
|
1882 |
-
* two versions of the history library to your bundles unless you use the same
|
1883 |
-
* version of the history library that React Router uses internally.
|
1884 |
-
*/
|
1885 |
-
function HistoryRouter(_ref3) {
|
1886 |
-
let {
|
1887 |
-
basename,
|
1888 |
-
children,
|
1889 |
-
history
|
1890 |
-
} = _ref3;
|
1891 |
-
const [state, setState] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({
|
1892 |
-
action: history.action,
|
1893 |
-
location: history.location
|
1894 |
-
});
|
1895 |
-
(0,react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect)(() => history.listen(setState), [history]);
|
1896 |
-
return /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react_router__WEBPACK_IMPORTED_MODULE_1__.Router, {
|
1897 |
-
basename: basename,
|
1898 |
-
children: children,
|
1899 |
-
location: state.location,
|
1900 |
-
navigationType: state.action,
|
1901 |
-
navigator: history
|
1902 |
-
});
|
1903 |
-
}
|
1904 |
-
|
1905 |
-
if (true) {
|
1906 |
-
HistoryRouter.displayName = "unstable_HistoryRouter";
|
1907 |
-
}
|
1908 |
-
|
1909 |
-
function isModifiedEvent(event) {
|
1910 |
-
return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
|
1911 |
-
}
|
1912 |
-
|
1913 |
-
/**
|
1914 |
-
* The public API for rendering a history-aware <a>.
|
1915 |
-
*/
|
1916 |
-
const Link = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function LinkWithRef(_ref4, ref) {
|
1917 |
-
let {
|
1918 |
-
onClick,
|
1919 |
-
reloadDocument,
|
1920 |
-
replace = false,
|
1921 |
-
state,
|
1922 |
-
target,
|
1923 |
-
to
|
1924 |
-
} = _ref4,
|
1925 |
-
rest = _objectWithoutPropertiesLoose(_ref4, _excluded);
|
1926 |
-
|
1927 |
-
let href = (0,react_router__WEBPACK_IMPORTED_MODULE_1__.useHref)(to);
|
1928 |
-
let internalOnClick = useLinkClickHandler(to, {
|
1929 |
-
replace,
|
1930 |
-
state,
|
1931 |
-
target
|
1932 |
-
});
|
1933 |
-
|
1934 |
-
function handleClick(event) {
|
1935 |
-
if (onClick) onClick(event);
|
1936 |
-
|
1937 |
-
if (!event.defaultPrevented && !reloadDocument) {
|
1938 |
-
internalOnClick(event);
|
1939 |
-
}
|
1940 |
-
}
|
1941 |
-
|
1942 |
-
return (
|
1943 |
-
/*#__PURE__*/
|
1944 |
-
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
1945 |
-
(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("a", _extends({}, rest, {
|
1946 |
-
href: href,
|
1947 |
-
onClick: handleClick,
|
1948 |
-
ref: ref,
|
1949 |
-
target: target
|
1950 |
-
}))
|
1951 |
-
);
|
1952 |
-
});
|
1953 |
-
|
1954 |
-
if (true) {
|
1955 |
-
Link.displayName = "Link";
|
1956 |
-
}
|
1957 |
-
|
1958 |
-
/**
|
1959 |
-
* A <Link> wrapper that knows if it's "active" or not.
|
1960 |
-
*/
|
1961 |
-
const NavLink = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function NavLinkWithRef(_ref5, ref) {
|
1962 |
-
let {
|
1963 |
-
"aria-current": ariaCurrentProp = "page",
|
1964 |
-
caseSensitive = false,
|
1965 |
-
className: classNameProp = "",
|
1966 |
-
end = false,
|
1967 |
-
style: styleProp,
|
1968 |
-
to,
|
1969 |
-
children
|
1970 |
-
} = _ref5,
|
1971 |
-
rest = _objectWithoutPropertiesLoose(_ref5, _excluded2);
|
1972 |
-
|
1973 |
-
let location = (0,react_router__WEBPACK_IMPORTED_MODULE_1__.useLocation)();
|
1974 |
-
let path = (0,react_router__WEBPACK_IMPORTED_MODULE_1__.useResolvedPath)(to);
|
1975 |
-
let locationPathname = location.pathname;
|
1976 |
-
let toPathname = path.pathname;
|
1977 |
-
|
1978 |
-
if (!caseSensitive) {
|
1979 |
-
locationPathname = locationPathname.toLowerCase();
|
1980 |
-
toPathname = toPathname.toLowerCase();
|
1981 |
-
}
|
1982 |
-
|
1983 |
-
let isActive = locationPathname === toPathname || !end && locationPathname.startsWith(toPathname) && locationPathname.charAt(toPathname.length) === "/";
|
1984 |
-
let ariaCurrent = isActive ? ariaCurrentProp : undefined;
|
1985 |
-
let className;
|
1986 |
-
|
1987 |
-
if (typeof classNameProp === "function") {
|
1988 |
-
className = classNameProp({
|
1989 |
-
isActive
|
1990 |
-
});
|
1991 |
-
} else {
|
1992 |
-
// If the className prop is not a function, we use a default `active`
|
1993 |
-
// class for <NavLink />s that are active. In v5 `active` was the default
|
1994 |
-
// value for `activeClassName`, but we are removing that API and can still
|
1995 |
-
// use the old default behavior for a cleaner upgrade path and keep the
|
1996 |
-
// simple styling rules working as they currently do.
|
1997 |
-
className = [classNameProp, isActive ? "active" : null].filter(Boolean).join(" ");
|
1998 |
-
}
|
1999 |
-
|
2000 |
-
let style = typeof styleProp === "function" ? styleProp({
|
2001 |
-
isActive
|
2002 |
-
}) : styleProp;
|
2003 |
-
return /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(Link, _extends({}, rest, {
|
2004 |
-
"aria-current": ariaCurrent,
|
2005 |
-
className: className,
|
2006 |
-
ref: ref,
|
2007 |
-
style: style,
|
2008 |
-
to: to
|
2009 |
-
}), typeof children === "function" ? children({
|
2010 |
-
isActive
|
2011 |
-
}) : children);
|
2012 |
-
});
|
2013 |
-
|
2014 |
-
if (true) {
|
2015 |
-
NavLink.displayName = "NavLink";
|
2016 |
-
} ////////////////////////////////////////////////////////////////////////////////
|
2017 |
-
// HOOKS
|
2018 |
-
////////////////////////////////////////////////////////////////////////////////
|
2019 |
-
|
2020 |
-
/**
|
2021 |
-
* Handles the click behavior for router `<Link>` components. This is useful if
|
2022 |
-
* you need to create custom `<Link>` components with the same click behavior we
|
2023 |
-
* use in our exported `<Link>`.
|
2024 |
-
*/
|
2025 |
-
|
2026 |
-
|
2027 |
-
function useLinkClickHandler(to, _temp) {
|
2028 |
-
let {
|
2029 |
-
target,
|
2030 |
-
replace: replaceProp,
|
2031 |
-
state
|
2032 |
-
} = _temp === void 0 ? {} : _temp;
|
2033 |
-
let navigate = (0,react_router__WEBPACK_IMPORTED_MODULE_1__.useNavigate)();
|
2034 |
-
let location = (0,react_router__WEBPACK_IMPORTED_MODULE_1__.useLocation)();
|
2035 |
-
let path = (0,react_router__WEBPACK_IMPORTED_MODULE_1__.useResolvedPath)(to);
|
2036 |
-
return (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(event => {
|
2037 |
-
if (event.button === 0 && ( // Ignore everything but left clicks
|
2038 |
-
!target || target === "_self") && // Let browser handle "target=_blank" etc.
|
2039 |
-
!isModifiedEvent(event) // Ignore clicks with modifier keys
|
2040 |
-
) {
|
2041 |
-
event.preventDefault(); // If the URL hasn't changed, a regular <a> will do a replace instead of
|
2042 |
-
// a push, so do the same here.
|
2043 |
-
|
2044 |
-
let replace = !!replaceProp || (0,history__WEBPACK_IMPORTED_MODULE_2__.createPath)(location) === (0,history__WEBPACK_IMPORTED_MODULE_2__.createPath)(path);
|
2045 |
-
navigate(to, {
|
2046 |
-
replace,
|
2047 |
-
state
|
2048 |
-
});
|
2049 |
-
}
|
2050 |
-
}, [location, navigate, path, replaceProp, state, target, to]);
|
2051 |
-
}
|
2052 |
-
/**
|
2053 |
-
* A convenient wrapper for reading and writing search parameters via the
|
2054 |
-
* URLSearchParams interface.
|
2055 |
-
*/
|
2056 |
-
|
2057 |
-
function useSearchParams(defaultInit) {
|
2058 |
-
true ? warning(typeof URLSearchParams !== "undefined", "You cannot use the `useSearchParams` hook in a browser that does not " + "support the URLSearchParams API. If you need to support Internet " + "Explorer 11, we recommend you load a polyfill such as " + "https://github.com/ungap/url-search-params\n\n" + "If you're unsure how to load polyfills, we recommend you check out " + "https://polyfill.io/v3/ which provides some recommendations about how " + "to load polyfills only for users that need them, instead of for every " + "user.") : 0;
|
2059 |
-
let defaultSearchParamsRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(createSearchParams(defaultInit));
|
2060 |
-
let location = (0,react_router__WEBPACK_IMPORTED_MODULE_1__.useLocation)();
|
2061 |
-
let searchParams = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
|
2062 |
-
let searchParams = createSearchParams(location.search);
|
2063 |
-
|
2064 |
-
for (let key of defaultSearchParamsRef.current.keys()) {
|
2065 |
-
if (!searchParams.has(key)) {
|
2066 |
-
defaultSearchParamsRef.current.getAll(key).forEach(value => {
|
2067 |
-
searchParams.append(key, value);
|
2068 |
-
});
|
2069 |
-
}
|
2070 |
-
}
|
2071 |
-
|
2072 |
-
return searchParams;
|
2073 |
-
}, [location.search]);
|
2074 |
-
let navigate = (0,react_router__WEBPACK_IMPORTED_MODULE_1__.useNavigate)();
|
2075 |
-
let setSearchParams = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((nextInit, navigateOptions) => {
|
2076 |
-
navigate("?" + createSearchParams(nextInit), navigateOptions);
|
2077 |
-
}, [navigate]);
|
2078 |
-
return [searchParams, setSearchParams];
|
2079 |
-
}
|
2080 |
-
|
2081 |
-
/**
|
2082 |
-
* Creates a URLSearchParams object using the given initializer.
|
2083 |
-
*
|
2084 |
-
* This is identical to `new URLSearchParams(init)` except it also
|
2085 |
-
* supports arrays as values in the object form of the initializer
|
2086 |
-
* instead of just strings. This is convenient when you need multiple
|
2087 |
-
* values for a given key, but don't want to use an array initializer.
|
2088 |
-
*
|
2089 |
-
* For example, instead of:
|
2090 |
-
*
|
2091 |
-
* let searchParams = new URLSearchParams([
|
2092 |
-
* ['sort', 'name'],
|
2093 |
-
* ['sort', 'price']
|
2094 |
-
* ]);
|
2095 |
-
*
|
2096 |
-
* you can do:
|
2097 |
-
*
|
2098 |
-
* let searchParams = createSearchParams({
|
2099 |
-
* sort: ['name', 'price']
|
2100 |
-
* });
|
2101 |
-
*/
|
2102 |
-
function createSearchParams(init) {
|
2103 |
-
if (init === void 0) {
|
2104 |
-
init = "";
|
2105 |
-
}
|
2106 |
-
|
2107 |
-
return new URLSearchParams(typeof init === "string" || Array.isArray(init) || init instanceof URLSearchParams ? init : Object.keys(init).reduce((memo, key) => {
|
2108 |
-
let value = init[key];
|
2109 |
-
return memo.concat(Array.isArray(value) ? value.map(v => [key, v]) : [[key, value]]);
|
2110 |
-
}, []));
|
2111 |
-
}
|
2112 |
-
|
2113 |
-
|
2114 |
-
//# sourceMappingURL=index.js.map
|
2115 |
-
|
2116 |
-
|
2117 |
-
/***/ }),
|
2118 |
-
|
2119 |
-
/***/ "./node_modules/react-router/index.js":
|
2120 |
-
/*!********************************************!*\
|
2121 |
-
!*** ./node_modules/react-router/index.js ***!
|
2122 |
-
\********************************************/
|
2123 |
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
2124 |
-
|
2125 |
-
__webpack_require__.r(__webpack_exports__);
|
2126 |
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
2127 |
-
/* harmony export */ "MemoryRouter": function() { return /* binding */ MemoryRouter; },
|
2128 |
-
/* harmony export */ "Navigate": function() { return /* binding */ Navigate; },
|
2129 |
-
/* harmony export */ "Outlet": function() { return /* binding */ Outlet; },
|
2130 |
-
/* harmony export */ "Route": function() { return /* binding */ Route; },
|
2131 |
-
/* harmony export */ "Router": function() { return /* binding */ Router; },
|
2132 |
-
/* harmony export */ "Routes": function() { return /* binding */ Routes; },
|
2133 |
-
/* harmony export */ "UNSAFE_LocationContext": function() { return /* binding */ LocationContext; },
|
2134 |
-
/* harmony export */ "UNSAFE_NavigationContext": function() { return /* binding */ NavigationContext; },
|
2135 |
-
/* harmony export */ "UNSAFE_RouteContext": function() { return /* binding */ RouteContext; },
|
2136 |
-
/* harmony export */ "createRoutesFromChildren": function() { return /* binding */ createRoutesFromChildren; },
|
2137 |
-
/* harmony export */ "generatePath": function() { return /* binding */ generatePath; },
|
2138 |
-
/* harmony export */ "matchPath": function() { return /* binding */ matchPath; },
|
2139 |
-
/* harmony export */ "matchRoutes": function() { return /* binding */ matchRoutes; },
|
2140 |
-
/* harmony export */ "renderMatches": function() { return /* binding */ renderMatches; },
|
2141 |
-
/* harmony export */ "resolvePath": function() { return /* binding */ resolvePath; },
|
2142 |
-
/* harmony export */ "useHref": function() { return /* binding */ useHref; },
|
2143 |
-
/* harmony export */ "useInRouterContext": function() { return /* binding */ useInRouterContext; },
|
2144 |
-
/* harmony export */ "useLocation": function() { return /* binding */ useLocation; },
|
2145 |
-
/* harmony export */ "useMatch": function() { return /* binding */ useMatch; },
|
2146 |
-
/* harmony export */ "useNavigate": function() { return /* binding */ useNavigate; },
|
2147 |
-
/* harmony export */ "useNavigationType": function() { return /* binding */ useNavigationType; },
|
2148 |
-
/* harmony export */ "useOutlet": function() { return /* binding */ useOutlet; },
|
2149 |
-
/* harmony export */ "useOutletContext": function() { return /* binding */ useOutletContext; },
|
2150 |
-
/* harmony export */ "useParams": function() { return /* binding */ useParams; },
|
2151 |
-
/* harmony export */ "useResolvedPath": function() { return /* binding */ useResolvedPath; },
|
2152 |
-
/* harmony export */ "useRoutes": function() { return /* binding */ useRoutes; }
|
2153 |
-
/* harmony export */ });
|
2154 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
2155 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
2156 |
-
/* harmony import */ var history__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! history */ "./node_modules/history/index.js");
|
2157 |
-
/**
|
2158 |
-
* React Router v6.2.1
|
2159 |
-
*
|
2160 |
-
* Copyright (c) Remix Software Inc.
|
2161 |
-
*
|
2162 |
-
* This source code is licensed under the MIT license found in the
|
2163 |
-
* LICENSE.md file in the root directory of this source tree.
|
2164 |
-
*
|
2165 |
-
* @license MIT
|
2166 |
-
*/
|
2167 |
-
|
2168 |
-
|
2169 |
-
|
2170 |
-
function invariant(cond, message) {
|
2171 |
-
if (!cond) throw new Error(message);
|
2172 |
-
}
|
2173 |
-
|
2174 |
-
function warning(cond, message) {
|
2175 |
-
if (!cond) {
|
2176 |
-
// eslint-disable-next-line no-console
|
2177 |
-
if (typeof console !== "undefined") console.warn(message);
|
2178 |
-
|
2179 |
-
try {
|
2180 |
-
// Welcome to debugging React Router!
|
2181 |
-
//
|
2182 |
-
// This error is thrown as a convenience so you can more easily
|
2183 |
-
// find the source for a warning that appears in the console by
|
2184 |
-
// enabling "pause on exceptions" in your JavaScript debugger.
|
2185 |
-
throw new Error(message); // eslint-disable-next-line no-empty
|
2186 |
-
} catch (e) {}
|
2187 |
-
}
|
2188 |
-
}
|
2189 |
-
|
2190 |
-
const alreadyWarned = {};
|
2191 |
-
|
2192 |
-
function warningOnce(key, cond, message) {
|
2193 |
-
if (!cond && !alreadyWarned[key]) {
|
2194 |
-
alreadyWarned[key] = true;
|
2195 |
-
true ? warning(false, message) : 0;
|
2196 |
-
}
|
2197 |
-
} ///////////////////////////////////////////////////////////////////////////////
|
2198 |
-
// CONTEXT
|
2199 |
-
///////////////////////////////////////////////////////////////////////////////
|
2200 |
-
|
2201 |
-
/**
|
2202 |
-
* A Navigator is a "location changer"; it's how you get to different locations.
|
2203 |
-
*
|
2204 |
-
* Every history instance conforms to the Navigator interface, but the
|
2205 |
-
* distinction is useful primarily when it comes to the low-level <Router> API
|
2206 |
-
* where both the location and a navigator must be provided separately in order
|
2207 |
-
* to avoid "tearing" that may occur in a suspense-enabled app if the action
|
2208 |
-
* and/or location were to be read directly from the history instance.
|
2209 |
-
*/
|
2210 |
-
|
2211 |
-
|
2212 |
-
const NavigationContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);
|
2213 |
-
|
2214 |
-
if (true) {
|
2215 |
-
NavigationContext.displayName = "Navigation";
|
2216 |
-
}
|
2217 |
-
|
2218 |
-
const LocationContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);
|
2219 |
-
|
2220 |
-
if (true) {
|
2221 |
-
LocationContext.displayName = "Location";
|
2222 |
-
}
|
2223 |
-
|
2224 |
-
const RouteContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)({
|
2225 |
-
outlet: null,
|
2226 |
-
matches: []
|
2227 |
-
});
|
2228 |
-
|
2229 |
-
if (true) {
|
2230 |
-
RouteContext.displayName = "Route";
|
2231 |
-
} ///////////////////////////////////////////////////////////////////////////////
|
2232 |
-
// COMPONENTS
|
2233 |
-
///////////////////////////////////////////////////////////////////////////////
|
2234 |
-
|
2235 |
-
|
2236 |
-
/**
|
2237 |
-
* A <Router> that stores all entries in memory.
|
2238 |
-
*
|
2239 |
-
* @see https://reactrouter.com/docs/en/v6/api#memoryrouter
|
2240 |
-
*/
|
2241 |
-
function MemoryRouter(_ref) {
|
2242 |
-
let {
|
2243 |
-
basename,
|
2244 |
-
children,
|
2245 |
-
initialEntries,
|
2246 |
-
initialIndex
|
2247 |
-
} = _ref;
|
2248 |
-
let historyRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
|
2249 |
-
|
2250 |
-
if (historyRef.current == null) {
|
2251 |
-
historyRef.current = (0,history__WEBPACK_IMPORTED_MODULE_1__.createMemoryHistory)({
|
2252 |
-
initialEntries,
|
2253 |
-
initialIndex
|
2254 |
-
});
|
2255 |
-
}
|
2256 |
-
|
2257 |
-
let history = historyRef.current;
|
2258 |
-
let [state, setState] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({
|
2259 |
-
action: history.action,
|
2260 |
-
location: history.location
|
2261 |
-
});
|
2262 |
-
(0,react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect)(() => history.listen(setState), [history]);
|
2263 |
-
return /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(Router, {
|
2264 |
-
basename: basename,
|
2265 |
-
children: children,
|
2266 |
-
location: state.location,
|
2267 |
-
navigationType: state.action,
|
2268 |
-
navigator: history
|
2269 |
-
});
|
2270 |
-
}
|
2271 |
-
|
2272 |
-
/**
|
2273 |
-
* Changes the current location.
|
2274 |
-
*
|
2275 |
-
* Note: This API is mostly useful in React.Component subclasses that are not
|
2276 |
-
* able to use hooks. In functional components, we recommend you use the
|
2277 |
-
* `useNavigate` hook instead.
|
2278 |
-
*
|
2279 |
-
* @see https://reactrouter.com/docs/en/v6/api#navigate
|
2280 |
-
*/
|
2281 |
-
function Navigate(_ref2) {
|
2282 |
-
let {
|
2283 |
-
to,
|
2284 |
-
replace,
|
2285 |
-
state
|
2286 |
-
} = _ref2;
|
2287 |
-
!useInRouterContext() ? true ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of
|
2288 |
-
// the router loaded. We can help them understand how to avoid that.
|
2289 |
-
"<Navigate> may be used only in the context of a <Router> component.") : 0 : void 0;
|
2290 |
-
true ? warning(!(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(NavigationContext).static, "<Navigate> must not be used on the initial render in a <StaticRouter>. " + "This is a no-op, but you should modify your code so the <Navigate> is " + "only ever rendered in response to some user interaction or state change.") : 0;
|
2291 |
-
let navigate = useNavigate();
|
2292 |
-
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
2293 |
-
navigate(to, {
|
2294 |
-
replace,
|
2295 |
-
state
|
2296 |
-
});
|
2297 |
-
});
|
2298 |
-
return null;
|
2299 |
-
}
|
2300 |
-
|
2301 |
-
/**
|
2302 |
-
* Renders the child route's element, if there is one.
|
2303 |
-
*
|
2304 |
-
* @see https://reactrouter.com/docs/en/v6/api#outlet
|
2305 |
-
*/
|
2306 |
-
function Outlet(props) {
|
2307 |
-
return useOutlet(props.context);
|
2308 |
-
}
|
2309 |
-
|
2310 |
-
/**
|
2311 |
-
* Declares an element that should be rendered at a certain URL path.
|
2312 |
-
*
|
2313 |
-
* @see https://reactrouter.com/docs/en/v6/api#route
|
2314 |
-
*/
|
2315 |
-
function Route(_props) {
|
2316 |
-
true ? invariant(false, "A <Route> is only ever to be used as the child of <Routes> element, " + "never rendered directly. Please wrap your <Route> in a <Routes>.") : 0 ;
|
2317 |
-
}
|
2318 |
-
|
2319 |
-
/**
|
2320 |
-
* Provides location context for the rest of the app.
|
2321 |
-
*
|
2322 |
-
* Note: You usually won't render a <Router> directly. Instead, you'll render a
|
2323 |
-
* router that is more specific to your environment such as a <BrowserRouter>
|
2324 |
-
* in web browsers or a <StaticRouter> for server rendering.
|
2325 |
-
*
|
2326 |
-
* @see https://reactrouter.com/docs/en/v6/api#router
|
2327 |
-
*/
|
2328 |
-
function Router(_ref3) {
|
2329 |
-
let {
|
2330 |
-
basename: basenameProp = "/",
|
2331 |
-
children = null,
|
2332 |
-
location: locationProp,
|
2333 |
-
navigationType = history__WEBPACK_IMPORTED_MODULE_1__.Action.Pop,
|
2334 |
-
navigator,
|
2335 |
-
static: staticProp = false
|
2336 |
-
} = _ref3;
|
2337 |
-
!!useInRouterContext() ? true ? invariant(false, "You cannot render a <Router> inside another <Router>." + " You should never have more than one in your app.") : 0 : void 0;
|
2338 |
-
let basename = normalizePathname(basenameProp);
|
2339 |
-
let navigationContext = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({
|
2340 |
-
basename,
|
2341 |
-
navigator,
|
2342 |
-
static: staticProp
|
2343 |
-
}), [basename, navigator, staticProp]);
|
2344 |
-
|
2345 |
-
if (typeof locationProp === "string") {
|
2346 |
-
locationProp = (0,history__WEBPACK_IMPORTED_MODULE_1__.parsePath)(locationProp);
|
2347 |
-
}
|
2348 |
-
|
2349 |
-
let {
|
2350 |
-
pathname = "/",
|
2351 |
-
search = "",
|
2352 |
-
hash = "",
|
2353 |
-
state = null,
|
2354 |
-
key = "default"
|
2355 |
-
} = locationProp;
|
2356 |
-
let location = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
|
2357 |
-
let trailingPathname = stripBasename(pathname, basename);
|
2358 |
-
|
2359 |
-
if (trailingPathname == null) {
|
2360 |
-
return null;
|
2361 |
-
}
|
2362 |
-
|
2363 |
-
return {
|
2364 |
-
pathname: trailingPathname,
|
2365 |
-
search,
|
2366 |
-
hash,
|
2367 |
-
state,
|
2368 |
-
key
|
2369 |
-
};
|
2370 |
-
}, [basename, pathname, search, hash, state, key]);
|
2371 |
-
true ? warning(location != null, "<Router basename=\"" + basename + "\"> is not able to match the URL " + ("\"" + pathname + search + hash + "\" because it does not start with the ") + "basename, so the <Router> won't render anything.") : 0;
|
2372 |
-
|
2373 |
-
if (location == null) {
|
2374 |
-
return null;
|
2375 |
-
}
|
2376 |
-
|
2377 |
-
return /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(NavigationContext.Provider, {
|
2378 |
-
value: navigationContext
|
2379 |
-
}, /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(LocationContext.Provider, {
|
2380 |
-
children: children,
|
2381 |
-
value: {
|
2382 |
-
location,
|
2383 |
-
navigationType
|
2384 |
-
}
|
2385 |
-
}));
|
2386 |
-
}
|
2387 |
-
|
2388 |
-
/**
|
2389 |
-
* A container for a nested tree of <Route> elements that renders the branch
|
2390 |
-
* that best matches the current location.
|
2391 |
-
*
|
2392 |
-
* @see https://reactrouter.com/docs/en/v6/api#routes
|
2393 |
-
*/
|
2394 |
-
function Routes(_ref4) {
|
2395 |
-
let {
|
2396 |
-
children,
|
2397 |
-
location
|
2398 |
-
} = _ref4;
|
2399 |
-
return useRoutes(createRoutesFromChildren(children), location);
|
2400 |
-
} ///////////////////////////////////////////////////////////////////////////////
|
2401 |
-
// HOOKS
|
2402 |
-
///////////////////////////////////////////////////////////////////////////////
|
2403 |
-
|
2404 |
-
/**
|
2405 |
-
* Returns the full href for the given "to" value. This is useful for building
|
2406 |
-
* custom links that are also accessible and preserve right-click behavior.
|
2407 |
-
*
|
2408 |
-
* @see https://reactrouter.com/docs/en/v6/api#usehref
|
2409 |
-
*/
|
2410 |
-
|
2411 |
-
function useHref(to) {
|
2412 |
-
!useInRouterContext() ? true ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of the
|
2413 |
-
// router loaded. We can help them understand how to avoid that.
|
2414 |
-
"useHref() may be used only in the context of a <Router> component.") : 0 : void 0;
|
2415 |
-
let {
|
2416 |
-
basename,
|
2417 |
-
navigator
|
2418 |
-
} = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(NavigationContext);
|
2419 |
-
let {
|
2420 |
-
hash,
|
2421 |
-
pathname,
|
2422 |
-
search
|
2423 |
-
} = useResolvedPath(to);
|
2424 |
-
let joinedPathname = pathname;
|
2425 |
-
|
2426 |
-
if (basename !== "/") {
|
2427 |
-
let toPathname = getToPathname(to);
|
2428 |
-
let endsWithSlash = toPathname != null && toPathname.endsWith("/");
|
2429 |
-
joinedPathname = pathname === "/" ? basename + (endsWithSlash ? "/" : "") : joinPaths([basename, pathname]);
|
2430 |
-
}
|
2431 |
-
|
2432 |
-
return navigator.createHref({
|
2433 |
-
pathname: joinedPathname,
|
2434 |
-
search,
|
2435 |
-
hash
|
2436 |
-
});
|
2437 |
-
}
|
2438 |
-
/**
|
2439 |
-
* Returns true if this component is a descendant of a <Router>.
|
2440 |
-
*
|
2441 |
-
* @see https://reactrouter.com/docs/en/v6/api#useinroutercontext
|
2442 |
-
*/
|
2443 |
-
|
2444 |
-
function useInRouterContext() {
|
2445 |
-
return (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(LocationContext) != null;
|
2446 |
-
}
|
2447 |
-
/**
|
2448 |
-
* Returns the current location object, which represents the current URL in web
|
2449 |
-
* browsers.
|
2450 |
-
*
|
2451 |
-
* Note: If you're using this it may mean you're doing some of your own
|
2452 |
-
* "routing" in your app, and we'd like to know what your use case is. We may
|
2453 |
-
* be able to provide something higher-level to better suit your needs.
|
2454 |
-
*
|
2455 |
-
* @see https://reactrouter.com/docs/en/v6/api#uselocation
|
2456 |
-
*/
|
2457 |
-
|
2458 |
-
function useLocation() {
|
2459 |
-
!useInRouterContext() ? true ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of the
|
2460 |
-
// router loaded. We can help them understand how to avoid that.
|
2461 |
-
"useLocation() may be used only in the context of a <Router> component.") : 0 : void 0;
|
2462 |
-
return (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(LocationContext).location;
|
2463 |
-
}
|
2464 |
-
|
2465 |
-
/**
|
2466 |
-
* Returns the current navigation action which describes how the router came to
|
2467 |
-
* the current location, either by a pop, push, or replace on the history stack.
|
2468 |
-
*
|
2469 |
-
* @see https://reactrouter.com/docs/en/v6/api#usenavigationtype
|
2470 |
-
*/
|
2471 |
-
function useNavigationType() {
|
2472 |
-
return (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(LocationContext).navigationType;
|
2473 |
-
}
|
2474 |
-
/**
|
2475 |
-
* Returns true if the URL for the given "to" value matches the current URL.
|
2476 |
-
* This is useful for components that need to know "active" state, e.g.
|
2477 |
-
* <NavLink>.
|
2478 |
-
*
|
2479 |
-
* @see https://reactrouter.com/docs/en/v6/api#usematch
|
2480 |
-
*/
|
2481 |
-
|
2482 |
-
function useMatch(pattern) {
|
2483 |
-
!useInRouterContext() ? true ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of the
|
2484 |
-
// router loaded. We can help them understand how to avoid that.
|
2485 |
-
"useMatch() may be used only in the context of a <Router> component.") : 0 : void 0;
|
2486 |
-
let {
|
2487 |
-
pathname
|
2488 |
-
} = useLocation();
|
2489 |
-
return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => matchPath(pattern, pathname), [pathname, pattern]);
|
2490 |
-
}
|
2491 |
-
/**
|
2492 |
-
* The interface for the navigate() function returned from useNavigate().
|
2493 |
-
*/
|
2494 |
-
|
2495 |
-
/**
|
2496 |
-
* Returns an imperative method for changing the location. Used by <Link>s, but
|
2497 |
-
* may also be used by other elements to change the location.
|
2498 |
-
*
|
2499 |
-
* @see https://reactrouter.com/docs/en/v6/api#usenavigate
|
2500 |
-
*/
|
2501 |
-
function useNavigate() {
|
2502 |
-
!useInRouterContext() ? true ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of the
|
2503 |
-
// router loaded. We can help them understand how to avoid that.
|
2504 |
-
"useNavigate() may be used only in the context of a <Router> component.") : 0 : void 0;
|
2505 |
-
let {
|
2506 |
-
basename,
|
2507 |
-
navigator
|
2508 |
-
} = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(NavigationContext);
|
2509 |
-
let {
|
2510 |
-
matches
|
2511 |
-
} = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(RouteContext);
|
2512 |
-
let {
|
2513 |
-
pathname: locationPathname
|
2514 |
-
} = useLocation();
|
2515 |
-
let routePathnamesJson = JSON.stringify(matches.map(match => match.pathnameBase));
|
2516 |
-
let activeRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(false);
|
2517 |
-
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
2518 |
-
activeRef.current = true;
|
2519 |
-
});
|
2520 |
-
let navigate = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (to, options) {
|
2521 |
-
if (options === void 0) {
|
2522 |
-
options = {};
|
2523 |
-
}
|
2524 |
-
|
2525 |
-
true ? warning(activeRef.current, "You should call navigate() in a React.useEffect(), not when " + "your component is first rendered.") : 0;
|
2526 |
-
if (!activeRef.current) return;
|
2527 |
-
|
2528 |
-
if (typeof to === "number") {
|
2529 |
-
navigator.go(to);
|
2530 |
-
return;
|
2531 |
-
}
|
2532 |
-
|
2533 |
-
let path = resolveTo(to, JSON.parse(routePathnamesJson), locationPathname);
|
2534 |
-
|
2535 |
-
if (basename !== "/") {
|
2536 |
-
path.pathname = joinPaths([basename, path.pathname]);
|
2537 |
-
}
|
2538 |
-
|
2539 |
-
(!!options.replace ? navigator.replace : navigator.push)(path, options.state);
|
2540 |
-
}, [basename, navigator, routePathnamesJson, locationPathname]);
|
2541 |
-
return navigate;
|
2542 |
-
}
|
2543 |
-
const OutletContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);
|
2544 |
-
/**
|
2545 |
-
* Returns the context (if provided) for the child route at this level of the route
|
2546 |
-
* hierarchy.
|
2547 |
-
* @see https://reactrouter.com/docs/en/v6/api#useoutletcontext
|
2548 |
-
*/
|
2549 |
-
|
2550 |
-
function useOutletContext() {
|
2551 |
-
return (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(OutletContext);
|
2552 |
-
}
|
2553 |
-
/**
|
2554 |
-
* Returns the element for the child route at this level of the route
|
2555 |
-
* hierarchy. Used internally by <Outlet> to render child routes.
|
2556 |
-
*
|
2557 |
-
* @see https://reactrouter.com/docs/en/v6/api#useoutlet
|
2558 |
-
*/
|
2559 |
-
|
2560 |
-
function useOutlet(context) {
|
2561 |
-
let outlet = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(RouteContext).outlet;
|
2562 |
-
|
2563 |
-
if (outlet) {
|
2564 |
-
return /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(OutletContext.Provider, {
|
2565 |
-
value: context
|
2566 |
-
}, outlet);
|
2567 |
-
}
|
2568 |
-
|
2569 |
-
return outlet;
|
2570 |
-
}
|
2571 |
-
/**
|
2572 |
-
* Returns an object of key/value pairs of the dynamic params from the current
|
2573 |
-
* URL that were matched by the route path.
|
2574 |
-
*
|
2575 |
-
* @see https://reactrouter.com/docs/en/v6/api#useparams
|
2576 |
-
*/
|
2577 |
-
|
2578 |
-
function useParams() {
|
2579 |
-
let {
|
2580 |
-
matches
|
2581 |
-
} = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(RouteContext);
|
2582 |
-
let routeMatch = matches[matches.length - 1];
|
2583 |
-
return routeMatch ? routeMatch.params : {};
|
2584 |
-
}
|
2585 |
-
/**
|
2586 |
-
* Resolves the pathname of the given `to` value against the current location.
|
2587 |
-
*
|
2588 |
-
* @see https://reactrouter.com/docs/en/v6/api#useresolvedpath
|
2589 |
-
*/
|
2590 |
-
|
2591 |
-
function useResolvedPath(to) {
|
2592 |
-
let {
|
2593 |
-
matches
|
2594 |
-
} = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(RouteContext);
|
2595 |
-
let {
|
2596 |
-
pathname: locationPathname
|
2597 |
-
} = useLocation();
|
2598 |
-
let routePathnamesJson = JSON.stringify(matches.map(match => match.pathnameBase));
|
2599 |
-
return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => resolveTo(to, JSON.parse(routePathnamesJson), locationPathname), [to, routePathnamesJson, locationPathname]);
|
2600 |
-
}
|
2601 |
-
/**
|
2602 |
-
* Returns the element of the route that matched the current location, prepared
|
2603 |
-
* with the correct context to render the remainder of the route tree. Route
|
2604 |
-
* elements in the tree must render an <Outlet> to render their child route's
|
2605 |
-
* element.
|
2606 |
-
*
|
2607 |
-
* @see https://reactrouter.com/docs/en/v6/api#useroutes
|
2608 |
-
*/
|
2609 |
-
|
2610 |
-
function useRoutes(routes, locationArg) {
|
2611 |
-
!useInRouterContext() ? true ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of the
|
2612 |
-
// router loaded. We can help them understand how to avoid that.
|
2613 |
-
"useRoutes() may be used only in the context of a <Router> component.") : 0 : void 0;
|
2614 |
-
let {
|
2615 |
-
matches: parentMatches
|
2616 |
-
} = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(RouteContext);
|
2617 |
-
let routeMatch = parentMatches[parentMatches.length - 1];
|
2618 |
-
let parentParams = routeMatch ? routeMatch.params : {};
|
2619 |
-
let parentPathname = routeMatch ? routeMatch.pathname : "/";
|
2620 |
-
let parentPathnameBase = routeMatch ? routeMatch.pathnameBase : "/";
|
2621 |
-
let parentRoute = routeMatch && routeMatch.route;
|
2622 |
-
|
2623 |
-
if (true) {
|
2624 |
-
// You won't get a warning about 2 different <Routes> under a <Route>
|
2625 |
-
// without a trailing *, but this is a best-effort warning anyway since we
|
2626 |
-
// cannot even give the warning unless they land at the parent route.
|
2627 |
-
//
|
2628 |
-
// Example:
|
2629 |
-
//
|
2630 |
-
// <Routes>
|
2631 |
-
// {/* This route path MUST end with /* because otherwise
|
2632 |
-
// it will never match /blog/post/123 */}
|
2633 |
-
// <Route path="blog" element={<Blog />} />
|
2634 |
-
// <Route path="blog/feed" element={<BlogFeed />} />
|
2635 |
-
// </Routes>
|
2636 |
-
//
|
2637 |
-
// function Blog() {
|
2638 |
-
// return (
|
2639 |
-
// <Routes>
|
2640 |
-
// <Route path="post/:id" element={<Post />} />
|
2641 |
-
// </Routes>
|
2642 |
-
// );
|
2643 |
-
// }
|
2644 |
-
let parentPath = parentRoute && parentRoute.path || "";
|
2645 |
-
warningOnce(parentPathname, !parentRoute || parentPath.endsWith("*"), "You rendered descendant <Routes> (or called `useRoutes()`) at " + ("\"" + parentPathname + "\" (under <Route path=\"" + parentPath + "\">) but the ") + "parent route path has no trailing \"*\". This means if you navigate " + "deeper, the parent won't match anymore and therefore the child " + "routes will never render.\n\n" + ("Please change the parent <Route path=\"" + parentPath + "\"> to <Route ") + ("path=\"" + (parentPath === "/" ? "*" : parentPath + "/*") + "\">."));
|
2646 |
-
}
|
2647 |
-
|
2648 |
-
let locationFromContext = useLocation();
|
2649 |
-
let location;
|
2650 |
-
|
2651 |
-
if (locationArg) {
|
2652 |
-
var _parsedLocationArg$pa;
|
2653 |
-
|
2654 |
-
let parsedLocationArg = typeof locationArg === "string" ? (0,history__WEBPACK_IMPORTED_MODULE_1__.parsePath)(locationArg) : locationArg;
|
2655 |
-
!(parentPathnameBase === "/" || ((_parsedLocationArg$pa = parsedLocationArg.pathname) == null ? void 0 : _parsedLocationArg$pa.startsWith(parentPathnameBase))) ? true ? invariant(false, "When overriding the location using `<Routes location>` or `useRoutes(routes, location)`, " + "the location pathname must begin with the portion of the URL pathname that was " + ("matched by all parent routes. The current pathname base is \"" + parentPathnameBase + "\" ") + ("but pathname \"" + parsedLocationArg.pathname + "\" was given in the `location` prop.")) : 0 : void 0;
|
2656 |
-
location = parsedLocationArg;
|
2657 |
-
} else {
|
2658 |
-
location = locationFromContext;
|
2659 |
-
}
|
2660 |
-
|
2661 |
-
let pathname = location.pathname || "/";
|
2662 |
-
let remainingPathname = parentPathnameBase === "/" ? pathname : pathname.slice(parentPathnameBase.length) || "/";
|
2663 |
-
let matches = matchRoutes(routes, {
|
2664 |
-
pathname: remainingPathname
|
2665 |
-
});
|
2666 |
-
|
2667 |
-
if (true) {
|
2668 |
-
true ? warning(parentRoute || matches != null, "No routes matched location \"" + location.pathname + location.search + location.hash + "\" ") : 0;
|
2669 |
-
true ? warning(matches == null || matches[matches.length - 1].route.element !== undefined, "Matched leaf route at location \"" + location.pathname + location.search + location.hash + "\" does not have an element. " + "This means it will render an <Outlet /> with a null value by default resulting in an \"empty\" page.") : 0;
|
2670 |
-
}
|
2671 |
-
|
2672 |
-
return _renderMatches(matches && matches.map(match => Object.assign({}, match, {
|
2673 |
-
params: Object.assign({}, parentParams, match.params),
|
2674 |
-
pathname: joinPaths([parentPathnameBase, match.pathname]),
|
2675 |
-
pathnameBase: match.pathnameBase === "/" ? parentPathnameBase : joinPaths([parentPathnameBase, match.pathnameBase])
|
2676 |
-
})), parentMatches);
|
2677 |
-
} ///////////////////////////////////////////////////////////////////////////////
|
2678 |
-
// UTILS
|
2679 |
-
///////////////////////////////////////////////////////////////////////////////
|
2680 |
-
|
2681 |
-
/**
|
2682 |
-
* Creates a route config from a React "children" object, which is usually
|
2683 |
-
* either a `<Route>` element or an array of them. Used internally by
|
2684 |
-
* `<Routes>` to create a route config from its children.
|
2685 |
-
*
|
2686 |
-
* @see https://reactrouter.com/docs/en/v6/api#createroutesfromchildren
|
2687 |
-
*/
|
2688 |
-
|
2689 |
-
function createRoutesFromChildren(children) {
|
2690 |
-
let routes = [];
|
2691 |
-
react__WEBPACK_IMPORTED_MODULE_0__.Children.forEach(children, element => {
|
2692 |
-
if (! /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.isValidElement)(element)) {
|
2693 |
-
// Ignore non-elements. This allows people to more easily inline
|
2694 |
-
// conditionals in their route config.
|
2695 |
-
return;
|
2696 |
-
}
|
2697 |
-
|
2698 |
-
if (element.type === react__WEBPACK_IMPORTED_MODULE_0__.Fragment) {
|
2699 |
-
// Transparently support React.Fragment and its children.
|
2700 |
-
routes.push.apply(routes, createRoutesFromChildren(element.props.children));
|
2701 |
-
return;
|
2702 |
-
}
|
2703 |
-
|
2704 |
-
!(element.type === Route) ? true ? invariant(false, "[" + (typeof element.type === "string" ? element.type : element.type.name) + "] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>") : 0 : void 0;
|
2705 |
-
let route = {
|
2706 |
-
caseSensitive: element.props.caseSensitive,
|
2707 |
-
element: element.props.element,
|
2708 |
-
index: element.props.index,
|
2709 |
-
path: element.props.path
|
2710 |
-
};
|
2711 |
-
|
2712 |
-
if (element.props.children) {
|
2713 |
-
route.children = createRoutesFromChildren(element.props.children);
|
2714 |
-
}
|
2715 |
-
|
2716 |
-
routes.push(route);
|
2717 |
-
});
|
2718 |
-
return routes;
|
2719 |
-
}
|
2720 |
-
/**
|
2721 |
-
* The parameters that were parsed from the URL path.
|
2722 |
-
*/
|
2723 |
-
|
2724 |
-
/**
|
2725 |
-
* Returns a path with params interpolated.
|
2726 |
-
*
|
2727 |
-
* @see https://reactrouter.com/docs/en/v6/api#generatepath
|
2728 |
-
*/
|
2729 |
-
function generatePath(path, params) {
|
2730 |
-
if (params === void 0) {
|
2731 |
-
params = {};
|
2732 |
-
}
|
2733 |
-
|
2734 |
-
return path.replace(/:(\w+)/g, (_, key) => {
|
2735 |
-
!(params[key] != null) ? true ? invariant(false, "Missing \":" + key + "\" param") : 0 : void 0;
|
2736 |
-
return params[key];
|
2737 |
-
}).replace(/\/*\*$/, _ => params["*"] == null ? "" : params["*"].replace(/^\/*/, "/"));
|
2738 |
-
}
|
2739 |
-
/**
|
2740 |
-
* A RouteMatch contains info about how a route matched a URL.
|
2741 |
-
*/
|
2742 |
-
|
2743 |
-
/**
|
2744 |
-
* Matches the given routes to a location and returns the match data.
|
2745 |
-
*
|
2746 |
-
* @see https://reactrouter.com/docs/en/v6/api#matchroutes
|
2747 |
-
*/
|
2748 |
-
function matchRoutes(routes, locationArg, basename) {
|
2749 |
-
if (basename === void 0) {
|
2750 |
-
basename = "/";
|
2751 |
-
}
|
2752 |
-
|
2753 |
-
let location = typeof locationArg === "string" ? (0,history__WEBPACK_IMPORTED_MODULE_1__.parsePath)(locationArg) : locationArg;
|
2754 |
-
let pathname = stripBasename(location.pathname || "/", basename);
|
2755 |
-
|
2756 |
-
if (pathname == null) {
|
2757 |
-
return null;
|
2758 |
-
}
|
2759 |
-
|
2760 |
-
let branches = flattenRoutes(routes);
|
2761 |
-
rankRouteBranches(branches);
|
2762 |
-
let matches = null;
|
2763 |
-
|
2764 |
-
for (let i = 0; matches == null && i < branches.length; ++i) {
|
2765 |
-
matches = matchRouteBranch(branches[i], pathname);
|
2766 |
-
}
|
2767 |
-
|
2768 |
-
return matches;
|
2769 |
-
}
|
2770 |
-
|
2771 |
-
function flattenRoutes(routes, branches, parentsMeta, parentPath) {
|
2772 |
-
if (branches === void 0) {
|
2773 |
-
branches = [];
|
2774 |
-
}
|
2775 |
-
|
2776 |
-
if (parentsMeta === void 0) {
|
2777 |
-
parentsMeta = [];
|
2778 |
-
}
|
2779 |
-
|
2780 |
-
if (parentPath === void 0) {
|
2781 |
-
parentPath = "";
|
2782 |
-
}
|
2783 |
-
|
2784 |
-
routes.forEach((route, index) => {
|
2785 |
-
let meta = {
|
2786 |
-
relativePath: route.path || "",
|
2787 |
-
caseSensitive: route.caseSensitive === true,
|
2788 |
-
childrenIndex: index,
|
2789 |
-
route
|
2790 |
-
};
|
2791 |
-
|
2792 |
-
if (meta.relativePath.startsWith("/")) {
|
2793 |
-
!meta.relativePath.startsWith(parentPath) ? true ? invariant(false, "Absolute route path \"" + meta.relativePath + "\" nested under path " + ("\"" + parentPath + "\" is not valid. An absolute child route path ") + "must start with the combined path of all its parent routes.") : 0 : void 0;
|
2794 |
-
meta.relativePath = meta.relativePath.slice(parentPath.length);
|
2795 |
-
}
|
2796 |
-
|
2797 |
-
let path = joinPaths([parentPath, meta.relativePath]);
|
2798 |
-
let routesMeta = parentsMeta.concat(meta); // Add the children before adding this route to the array so we traverse the
|
2799 |
-
// route tree depth-first and child routes appear before their parents in
|
2800 |
-
// the "flattened" version.
|
2801 |
-
|
2802 |
-
if (route.children && route.children.length > 0) {
|
2803 |
-
!(route.index !== true) ? true ? invariant(false, "Index routes must not have child routes. Please remove " + ("all child routes from route path \"" + path + "\".")) : 0 : void 0;
|
2804 |
-
flattenRoutes(route.children, branches, routesMeta, path);
|
2805 |
-
} // Routes without a path shouldn't ever match by themselves unless they are
|
2806 |
-
// index routes, so don't add them to the list of possible branches.
|
2807 |
-
|
2808 |
-
|
2809 |
-
if (route.path == null && !route.index) {
|
2810 |
-
return;
|
2811 |
-
}
|
2812 |
-
|
2813 |
-
branches.push({
|
2814 |
-
path,
|
2815 |
-
score: computeScore(path, route.index),
|
2816 |
-
routesMeta
|
2817 |
-
});
|
2818 |
-
});
|
2819 |
-
return branches;
|
2820 |
-
}
|
2821 |
-
|
2822 |
-
function rankRouteBranches(branches) {
|
2823 |
-
branches.sort((a, b) => a.score !== b.score ? b.score - a.score // Higher score first
|
2824 |
-
: compareIndexes(a.routesMeta.map(meta => meta.childrenIndex), b.routesMeta.map(meta => meta.childrenIndex)));
|
2825 |
-
}
|
2826 |
-
|
2827 |
-
const paramRe = /^:\w+$/;
|
2828 |
-
const dynamicSegmentValue = 3;
|
2829 |
-
const indexRouteValue = 2;
|
2830 |
-
const emptySegmentValue = 1;
|
2831 |
-
const staticSegmentValue = 10;
|
2832 |
-
const splatPenalty = -2;
|
2833 |
-
|
2834 |
-
const isSplat = s => s === "*";
|
2835 |
-
|
2836 |
-
function computeScore(path, index) {
|
2837 |
-
let segments = path.split("/");
|
2838 |
-
let initialScore = segments.length;
|
2839 |
-
|
2840 |
-
if (segments.some(isSplat)) {
|
2841 |
-
initialScore += splatPenalty;
|
2842 |
-
}
|
2843 |
-
|
2844 |
-
if (index) {
|
2845 |
-
initialScore += indexRouteValue;
|
2846 |
-
}
|
2847 |
-
|
2848 |
-
return segments.filter(s => !isSplat(s)).reduce((score, segment) => score + (paramRe.test(segment) ? dynamicSegmentValue : segment === "" ? emptySegmentValue : staticSegmentValue), initialScore);
|
2849 |
-
}
|
2850 |
-
|
2851 |
-
function compareIndexes(a, b) {
|
2852 |
-
let siblings = a.length === b.length && a.slice(0, -1).every((n, i) => n === b[i]);
|
2853 |
-
return siblings ? // If two routes are siblings, we should try to match the earlier sibling
|
2854 |
-
// first. This allows people to have fine-grained control over the matching
|
2855 |
-
// behavior by simply putting routes with identical paths in the order they
|
2856 |
-
// want them tried.
|
2857 |
-
a[a.length - 1] - b[b.length - 1] : // Otherwise, it doesn't really make sense to rank non-siblings by index,
|
2858 |
-
// so they sort equally.
|
2859 |
-
0;
|
2860 |
-
}
|
2861 |
-
|
2862 |
-
function matchRouteBranch(branch, pathname) {
|
2863 |
-
let {
|
2864 |
-
routesMeta
|
2865 |
-
} = branch;
|
2866 |
-
let matchedParams = {};
|
2867 |
-
let matchedPathname = "/";
|
2868 |
-
let matches = [];
|
2869 |
-
|
2870 |
-
for (let i = 0; i < routesMeta.length; ++i) {
|
2871 |
-
let meta = routesMeta[i];
|
2872 |
-
let end = i === routesMeta.length - 1;
|
2873 |
-
let remainingPathname = matchedPathname === "/" ? pathname : pathname.slice(matchedPathname.length) || "/";
|
2874 |
-
let match = matchPath({
|
2875 |
-
path: meta.relativePath,
|
2876 |
-
caseSensitive: meta.caseSensitive,
|
2877 |
-
end
|
2878 |
-
}, remainingPathname);
|
2879 |
-
if (!match) return null;
|
2880 |
-
Object.assign(matchedParams, match.params);
|
2881 |
-
let route = meta.route;
|
2882 |
-
matches.push({
|
2883 |
-
params: matchedParams,
|
2884 |
-
pathname: joinPaths([matchedPathname, match.pathname]),
|
2885 |
-
pathnameBase: joinPaths([matchedPathname, match.pathnameBase]),
|
2886 |
-
route
|
2887 |
-
});
|
2888 |
-
|
2889 |
-
if (match.pathnameBase !== "/") {
|
2890 |
-
matchedPathname = joinPaths([matchedPathname, match.pathnameBase]);
|
2891 |
-
}
|
2892 |
-
}
|
2893 |
-
|
2894 |
-
return matches;
|
2895 |
-
}
|
2896 |
-
/**
|
2897 |
-
* Renders the result of `matchRoutes()` into a React element.
|
2898 |
-
*/
|
2899 |
-
|
2900 |
-
|
2901 |
-
function renderMatches(matches) {
|
2902 |
-
return _renderMatches(matches);
|
2903 |
-
}
|
2904 |
-
|
2905 |
-
function _renderMatches(matches, parentMatches) {
|
2906 |
-
if (parentMatches === void 0) {
|
2907 |
-
parentMatches = [];
|
2908 |
-
}
|
2909 |
-
|
2910 |
-
if (matches == null) return null;
|
2911 |
-
return matches.reduceRight((outlet, match, index) => {
|
2912 |
-
return /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(RouteContext.Provider, {
|
2913 |
-
children: match.route.element !== undefined ? match.route.element : /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(Outlet, null),
|
2914 |
-
value: {
|
2915 |
-
outlet,
|
2916 |
-
matches: parentMatches.concat(matches.slice(0, index + 1))
|
2917 |
-
}
|
2918 |
-
});
|
2919 |
-
}, null);
|
2920 |
-
}
|
2921 |
-
/**
|
2922 |
-
* A PathPattern is used to match on some portion of a URL pathname.
|
2923 |
-
*/
|
2924 |
-
|
2925 |
-
|
2926 |
-
/**
|
2927 |
-
* Performs pattern matching on a URL pathname and returns information about
|
2928 |
-
* the match.
|
2929 |
-
*
|
2930 |
-
* @see https://reactrouter.com/docs/en/v6/api#matchpath
|
2931 |
-
*/
|
2932 |
-
function matchPath(pattern, pathname) {
|
2933 |
-
if (typeof pattern === "string") {
|
2934 |
-
pattern = {
|
2935 |
-
path: pattern,
|
2936 |
-
caseSensitive: false,
|
2937 |
-
end: true
|
2938 |
-
};
|
2939 |
-
}
|
2940 |
-
|
2941 |
-
let [matcher, paramNames] = compilePath(pattern.path, pattern.caseSensitive, pattern.end);
|
2942 |
-
let match = pathname.match(matcher);
|
2943 |
-
if (!match) return null;
|
2944 |
-
let matchedPathname = match[0];
|
2945 |
-
let pathnameBase = matchedPathname.replace(/(.)\/+$/, "$1");
|
2946 |
-
let captureGroups = match.slice(1);
|
2947 |
-
let params = paramNames.reduce((memo, paramName, index) => {
|
2948 |
-
// We need to compute the pathnameBase here using the raw splat value
|
2949 |
-
// instead of using params["*"] later because it will be decoded then
|
2950 |
-
if (paramName === "*") {
|
2951 |
-
let splatValue = captureGroups[index] || "";
|
2952 |
-
pathnameBase = matchedPathname.slice(0, matchedPathname.length - splatValue.length).replace(/(.)\/+$/, "$1");
|
2953 |
-
}
|
2954 |
-
|
2955 |
-
memo[paramName] = safelyDecodeURIComponent(captureGroups[index] || "", paramName);
|
2956 |
-
return memo;
|
2957 |
-
}, {});
|
2958 |
-
return {
|
2959 |
-
params,
|
2960 |
-
pathname: matchedPathname,
|
2961 |
-
pathnameBase,
|
2962 |
-
pattern
|
2963 |
-
};
|
2964 |
-
}
|
2965 |
-
|
2966 |
-
function compilePath(path, caseSensitive, end) {
|
2967 |
-
if (caseSensitive === void 0) {
|
2968 |
-
caseSensitive = false;
|
2969 |
-
}
|
2970 |
-
|
2971 |
-
if (end === void 0) {
|
2972 |
-
end = true;
|
2973 |
-
}
|
2974 |
-
|
2975 |
-
true ? warning(path === "*" || !path.endsWith("*") || path.endsWith("/*"), "Route path \"" + path + "\" will be treated as if it were " + ("\"" + path.replace(/\*$/, "/*") + "\" because the `*` character must ") + "always follow a `/` in the pattern. To get rid of this warning, " + ("please change the route path to \"" + path.replace(/\*$/, "/*") + "\".")) : 0;
|
2976 |
-
let paramNames = [];
|
2977 |
-
let regexpSource = "^" + path.replace(/\/*\*?$/, "") // Ignore trailing / and /*, we'll handle it below
|
2978 |
-
.replace(/^\/*/, "/") // Make sure it has a leading /
|
2979 |
-
.replace(/[\\.*+^$?{}|()[\]]/g, "\\$&") // Escape special regex chars
|
2980 |
-
.replace(/:(\w+)/g, (_, paramName) => {
|
2981 |
-
paramNames.push(paramName);
|
2982 |
-
return "([^\\/]+)";
|
2983 |
-
});
|
2984 |
-
|
2985 |
-
if (path.endsWith("*")) {
|
2986 |
-
paramNames.push("*");
|
2987 |
-
regexpSource += path === "*" || path === "/*" ? "(.*)$" // Already matched the initial /, just match the rest
|
2988 |
-
: "(?:\\/(.+)|\\/*)$"; // Don't include the / in params["*"]
|
2989 |
-
} else {
|
2990 |
-
regexpSource += end ? "\\/*$" // When matching to the end, ignore trailing slashes
|
2991 |
-
: // Otherwise, match a word boundary or a proceeding /. The word boundary restricts
|
2992 |
-
// parent routes to matching only their own words and nothing more, e.g. parent
|
2993 |
-
// route "/home" should not match "/home2".
|
2994 |
-
"(?:\\b|\\/|$)";
|
2995 |
-
}
|
2996 |
-
|
2997 |
-
let matcher = new RegExp(regexpSource, caseSensitive ? undefined : "i");
|
2998 |
-
return [matcher, paramNames];
|
2999 |
-
}
|
3000 |
-
|
3001 |
-
function safelyDecodeURIComponent(value, paramName) {
|
3002 |
-
try {
|
3003 |
-
return decodeURIComponent(value);
|
3004 |
-
} catch (error) {
|
3005 |
-
true ? warning(false, "The value for the URL param \"" + paramName + "\" will not be decoded because" + (" the string \"" + value + "\" is a malformed URL segment. This is probably") + (" due to a bad percent encoding (" + error + ").")) : 0;
|
3006 |
-
return value;
|
3007 |
-
}
|
3008 |
-
}
|
3009 |
-
/**
|
3010 |
-
* Returns a resolved path object relative to the given pathname.
|
3011 |
-
*
|
3012 |
-
* @see https://reactrouter.com/docs/en/v6/api#resolvepath
|
3013 |
-
*/
|
3014 |
-
|
3015 |
-
|
3016 |
-
function resolvePath(to, fromPathname) {
|
3017 |
-
if (fromPathname === void 0) {
|
3018 |
-
fromPathname = "/";
|
3019 |
-
}
|
3020 |
-
|
3021 |
-
let {
|
3022 |
-
pathname: toPathname,
|
3023 |
-
search = "",
|
3024 |
-
hash = ""
|
3025 |
-
} = typeof to === "string" ? (0,history__WEBPACK_IMPORTED_MODULE_1__.parsePath)(to) : to;
|
3026 |
-
let pathname = toPathname ? toPathname.startsWith("/") ? toPathname : resolvePathname(toPathname, fromPathname) : fromPathname;
|
3027 |
-
return {
|
3028 |
-
pathname,
|
3029 |
-
search: normalizeSearch(search),
|
3030 |
-
hash: normalizeHash(hash)
|
3031 |
-
};
|
3032 |
-
}
|
3033 |
-
|
3034 |
-
function resolvePathname(relativePath, fromPathname) {
|
3035 |
-
let segments = fromPathname.replace(/\/+$/, "").split("/");
|
3036 |
-
let relativeSegments = relativePath.split("/");
|
3037 |
-
relativeSegments.forEach(segment => {
|
3038 |
-
if (segment === "..") {
|
3039 |
-
// Keep the root "" segment so the pathname starts at /
|
3040 |
-
if (segments.length > 1) segments.pop();
|
3041 |
-
} else if (segment !== ".") {
|
3042 |
-
segments.push(segment);
|
3043 |
-
}
|
3044 |
-
});
|
3045 |
-
return segments.length > 1 ? segments.join("/") : "/";
|
3046 |
-
}
|
3047 |
-
|
3048 |
-
function resolveTo(toArg, routePathnames, locationPathname) {
|
3049 |
-
let to = typeof toArg === "string" ? (0,history__WEBPACK_IMPORTED_MODULE_1__.parsePath)(toArg) : toArg;
|
3050 |
-
let toPathname = toArg === "" || to.pathname === "" ? "/" : to.pathname; // If a pathname is explicitly provided in `to`, it should be relative to the
|
3051 |
-
// route context. This is explained in `Note on `<Link to>` values` in our
|
3052 |
-
// migration guide from v5 as a means of disambiguation between `to` values
|
3053 |
-
// that begin with `/` and those that do not. However, this is problematic for
|
3054 |
-
// `to` values that do not provide a pathname. `to` can simply be a search or
|
3055 |
-
// hash string, in which case we should assume that the navigation is relative
|
3056 |
-
// to the current location's pathname and *not* the route pathname.
|
3057 |
-
|
3058 |
-
let from;
|
3059 |
-
|
3060 |
-
if (toPathname == null) {
|
3061 |
-
from = locationPathname;
|
3062 |
-
} else {
|
3063 |
-
let routePathnameIndex = routePathnames.length - 1;
|
3064 |
-
|
3065 |
-
if (toPathname.startsWith("..")) {
|
3066 |
-
let toSegments = toPathname.split("/"); // Each leading .. segment means "go up one route" instead of "go up one
|
3067 |
-
// URL segment". This is a key difference from how <a href> works and a
|
3068 |
-
// major reason we call this a "to" value instead of a "href".
|
3069 |
-
|
3070 |
-
while (toSegments[0] === "..") {
|
3071 |
-
toSegments.shift();
|
3072 |
-
routePathnameIndex -= 1;
|
3073 |
-
}
|
3074 |
-
|
3075 |
-
to.pathname = toSegments.join("/");
|
3076 |
-
} // If there are more ".." segments than parent routes, resolve relative to
|
3077 |
-
// the root / URL.
|
3078 |
-
|
3079 |
-
|
3080 |
-
from = routePathnameIndex >= 0 ? routePathnames[routePathnameIndex] : "/";
|
3081 |
-
}
|
3082 |
-
|
3083 |
-
let path = resolvePath(to, from); // Ensure the pathname has a trailing slash if the original to value had one.
|
3084 |
-
|
3085 |
-
if (toPathname && toPathname !== "/" && toPathname.endsWith("/") && !path.pathname.endsWith("/")) {
|
3086 |
-
path.pathname += "/";
|
3087 |
-
}
|
3088 |
-
|
3089 |
-
return path;
|
3090 |
-
}
|
3091 |
-
|
3092 |
-
function getToPathname(to) {
|
3093 |
-
// Empty strings should be treated the same as / paths
|
3094 |
-
return to === "" || to.pathname === "" ? "/" : typeof to === "string" ? (0,history__WEBPACK_IMPORTED_MODULE_1__.parsePath)(to).pathname : to.pathname;
|
3095 |
-
}
|
3096 |
-
|
3097 |
-
function stripBasename(pathname, basename) {
|
3098 |
-
if (basename === "/") return pathname;
|
3099 |
-
|
3100 |
-
if (!pathname.toLowerCase().startsWith(basename.toLowerCase())) {
|
3101 |
-
return null;
|
3102 |
-
}
|
3103 |
-
|
3104 |
-
let nextChar = pathname.charAt(basename.length);
|
3105 |
-
|
3106 |
-
if (nextChar && nextChar !== "/") {
|
3107 |
-
// pathname does not start with basename/
|
3108 |
-
return null;
|
3109 |
-
}
|
3110 |
-
|
3111 |
-
return pathname.slice(basename.length) || "/";
|
3112 |
-
}
|
3113 |
-
|
3114 |
-
const joinPaths = paths => paths.join("/").replace(/\/\/+/g, "/");
|
3115 |
-
|
3116 |
-
const normalizePathname = pathname => pathname.replace(/\/+$/, "").replace(/^\/*/, "/");
|
3117 |
-
|
3118 |
-
const normalizeSearch = search => !search || search === "?" ? "" : search.startsWith("?") ? search : "?" + search;
|
3119 |
-
|
3120 |
-
const normalizeHash = hash => !hash || hash === "#" ? "" : hash.startsWith("#") ? hash : "#" + hash; ///////////////////////////////////////////////////////////////////////////////
|
3121 |
-
|
3122 |
-
|
3123 |
-
//# sourceMappingURL=index.js.map
|
3124 |
-
|
3125 |
-
|
3126 |
-
/***/ }),
|
3127 |
-
|
3128 |
-
/***/ "react":
|
3129 |
-
/*!************************!*\
|
3130 |
-
!*** external "React" ***!
|
3131 |
-
\************************/
|
3132 |
-
/***/ (function(module) {
|
3133 |
-
|
3134 |
-
module.exports = window["React"];
|
3135 |
-
|
3136 |
-
/***/ }),
|
3137 |
-
|
3138 |
-
/***/ "react-dom":
|
3139 |
-
/*!***************************!*\
|
3140 |
-
!*** external "ReactDOM" ***!
|
3141 |
-
\***************************/
|
3142 |
-
/***/ (function(module) {
|
3143 |
-
|
3144 |
-
module.exports = window["ReactDOM"];
|
3145 |
-
|
3146 |
-
/***/ }),
|
3147 |
-
|
3148 |
-
/***/ "@wordpress/api-fetch":
|
3149 |
-
/*!**********************************!*\
|
3150 |
-
!*** external ["wp","apiFetch"] ***!
|
3151 |
-
\**********************************/
|
3152 |
-
/***/ (function(module) {
|
3153 |
-
|
3154 |
-
module.exports = window["wp"]["apiFetch"];
|
3155 |
-
|
3156 |
-
/***/ }),
|
3157 |
-
|
3158 |
-
/***/ "@wordpress/element":
|
3159 |
-
/*!*********************************!*\
|
3160 |
-
!*** external ["wp","element"] ***!
|
3161 |
-
\*********************************/
|
3162 |
-
/***/ (function(module) {
|
3163 |
-
|
3164 |
-
module.exports = window["wp"]["element"];
|
3165 |
-
|
3166 |
-
/***/ }),
|
3167 |
-
|
3168 |
-
/***/ "@wordpress/i18n":
|
3169 |
-
/*!******************************!*\
|
3170 |
-
!*** external ["wp","i18n"] ***!
|
3171 |
-
\******************************/
|
3172 |
-
/***/ (function(module) {
|
3173 |
-
|
3174 |
-
module.exports = window["wp"]["i18n"];
|
3175 |
-
|
3176 |
-
/***/ }),
|
3177 |
-
|
3178 |
-
/***/ "./node_modules/@babel/runtime/helpers/esm/extends.js":
|
3179 |
-
/*!************************************************************!*\
|
3180 |
-
!*** ./node_modules/@babel/runtime/helpers/esm/extends.js ***!
|
3181 |
-
\************************************************************/
|
3182 |
-
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
3183 |
-
|
3184 |
-
__webpack_require__.r(__webpack_exports__);
|
3185 |
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
3186 |
-
/* harmony export */ "default": function() { return /* binding */ _extends; }
|
3187 |
-
/* harmony export */ });
|
3188 |
-
function _extends() {
|
3189 |
-
_extends = Object.assign || function (target) {
|
3190 |
-
for (var i = 1; i < arguments.length; i++) {
|
3191 |
-
var source = arguments[i];
|
3192 |
-
|
3193 |
-
for (var key in source) {
|
3194 |
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
3195 |
-
target[key] = source[key];
|
3196 |
-
}
|
3197 |
-
}
|
3198 |
-
}
|
3199 |
-
|
3200 |
-
return target;
|
3201 |
-
};
|
3202 |
-
|
3203 |
-
return _extends.apply(this, arguments);
|
3204 |
-
}
|
3205 |
-
|
3206 |
-
/***/ })
|
3207 |
-
|
3208 |
-
/******/ });
|
3209 |
-
/************************************************************************/
|
3210 |
-
/******/ // The module cache
|
3211 |
-
/******/ var __webpack_module_cache__ = {};
|
3212 |
-
/******/
|
3213 |
-
/******/ // The require function
|
3214 |
-
/******/ function __webpack_require__(moduleId) {
|
3215 |
-
/******/ // Check if module is in cache
|
3216 |
-
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
3217 |
-
/******/ if (cachedModule !== undefined) {
|
3218 |
-
/******/ return cachedModule.exports;
|
3219 |
-
/******/ }
|
3220 |
-
/******/ // Create a new module (and put it into the cache)
|
3221 |
-
/******/ var module = __webpack_module_cache__[moduleId] = {
|
3222 |
-
/******/ // no module.id needed
|
3223 |
-
/******/ // no module.loaded needed
|
3224 |
-
/******/ exports: {}
|
3225 |
-
/******/ };
|
3226 |
-
/******/
|
3227 |
-
/******/ // Execute the module function
|
3228 |
-
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
3229 |
-
/******/
|
3230 |
-
/******/ // Return the exports of the module
|
3231 |
-
/******/ return module.exports;
|
3232 |
-
/******/ }
|
3233 |
-
/******/
|
3234 |
-
/************************************************************************/
|
3235 |
-
/******/ /* webpack/runtime/compat get default export */
|
3236 |
-
/******/ !function() {
|
3237 |
-
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
3238 |
-
/******/ __webpack_require__.n = function(module) {
|
3239 |
-
/******/ var getter = module && module.__esModule ?
|
3240 |
-
/******/ function() { return module['default']; } :
|
3241 |
-
/******/ function() { return module; };
|
3242 |
-
/******/ __webpack_require__.d(getter, { a: getter });
|
3243 |
-
/******/ return getter;
|
3244 |
-
/******/ };
|
3245 |
-
/******/ }();
|
3246 |
-
/******/
|
3247 |
-
/******/ /* webpack/runtime/define property getters */
|
3248 |
-
/******/ !function() {
|
3249 |
-
/******/ // define getter functions for harmony exports
|
3250 |
-
/******/ __webpack_require__.d = function(exports, definition) {
|
3251 |
-
/******/ for(var key in definition) {
|
3252 |
-
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
3253 |
-
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
3254 |
-
/******/ }
|
3255 |
-
/******/ }
|
3256 |
-
/******/ };
|
3257 |
-
/******/ }();
|
3258 |
-
/******/
|
3259 |
-
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
3260 |
-
/******/ !function() {
|
3261 |
-
/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
|
3262 |
-
/******/ }();
|
3263 |
-
/******/
|
3264 |
-
/******/ /* webpack/runtime/make namespace object */
|
3265 |
-
/******/ !function() {
|
3266 |
-
/******/ // define __esModule on exports
|
3267 |
-
/******/ __webpack_require__.r = function(exports) {
|
3268 |
-
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
3269 |
-
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
3270 |
-
/******/ }
|
3271 |
-
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
3272 |
-
/******/ };
|
3273 |
-
/******/ }();
|
3274 |
-
/******/
|
3275 |
-
/************************************************************************/
|
3276 |
-
var __webpack_exports__ = {};
|
3277 |
-
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
3278 |
-
!function() {
|
3279 |
-
/*!***************************!*\
|
3280 |
-
!*** ./wizard/src/App.js ***!
|
3281 |
-
\***************************/
|
3282 |
-
__webpack_require__.r(__webpack_exports__);
|
3283 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
|
3284 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
3285 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
|
3286 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
3287 |
-
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-dom */ "react-dom");
|
3288 |
-
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_2__);
|
3289 |
-
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router-dom/index.js");
|
3290 |
-
/* harmony import */ var _Admin_App_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @Admin/App.scss */ "./wizard/src/App.scss");
|
3291 |
-
/* harmony import */ var _Admin_Settings__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @Admin/Settings */ "./wizard/src/Settings.js");
|
3292 |
-
|
3293 |
-
|
3294 |
-
|
3295 |
-
|
3296 |
-
/* Main Compnent */
|
3297 |
-
|
3298 |
-
|
3299 |
-
|
3300 |
-
react_dom__WEBPACK_IMPORTED_MODULE_2___default().render((0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(react_router_dom__WEBPACK_IMPORTED_MODULE_5__.BrowserRouter, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Admin_Settings__WEBPACK_IMPORTED_MODULE_4__["default"], null)), document.getElementById('cpsw-onboarding-content'));
|
3301 |
-
}();
|
3302 |
-
/******/ })()
|
3303 |
-
;
|
3304 |
-
//# sourceMappingURL=app.js.map
|
1 |
+
!function(){"use strict";var e={n:function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,{a:n}),n},d:function(t,n){for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t=window.wp.element,n=window.React,r=e.n(n),a=window.ReactDOM,o=e.n(a);function l(){return l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l.apply(this,arguments)}var s,c=s||(s={});c.Pop="POP",c.Push="PUSH",c.Replace="REPLACE";function i(e){e.preventDefault(),e.returnValue=""}function u(){var e=[];return{get length(){return e.length},push:function(t){return e.push(t),function(){e=e.filter((function(e){return e!==t}))}},call:function(t){e.forEach((function(e){return e&&e(t)}))}}}function m(e){var t={};if(e){var n=e.indexOf("#");0<=n&&(t.hash=e.substr(n),e=e.substr(0,n)),0<=(n=e.indexOf("?"))&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function d(e,t){if(!e)throw new Error(t)}const p=(0,n.createContext)(null),f=(0,n.createContext)(null),g=(0,n.createContext)({outlet:null,matches:[]});function x(e){let{basename:t="/",children:r=null,location:a,navigationType:o=s.Pop,navigator:l,static:c=!1}=e;h()&&d(!1);let i=y(t),u=(0,n.useMemo)((()=>({basename:i,navigator:l,static:c})),[i,l,c]);"string"==typeof a&&(a=m(a));let{pathname:g="/",search:x="",hash:b="",state:v=null,key:w="default"}=a,E=(0,n.useMemo)((()=>{let e=function(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=e.charAt(t.length);return n&&"/"!==n?null:e.slice(t.length)||"/"}(g,i);return null==e?null:{pathname:e,search:x,hash:b,state:v,key:w}}),[i,g,x,b,v,w]);return null==E?null:(0,n.createElement)(p.Provider,{value:u},(0,n.createElement)(f.Provider,{children:r,value:{location:E,navigationType:o}}))}function h(){return null!=(0,n.useContext)(f)}function b(){return h()||d(!1),(0,n.useContext)(f).location}function v(){h()||d(!1);let{basename:e,navigator:t}=(0,n.useContext)(p),{matches:r}=(0,n.useContext)(g),{pathname:a}=b(),o=JSON.stringify(r.map((e=>e.pathnameBase))),l=(0,n.useRef)(!1);return(0,n.useEffect)((()=>{l.current=!0})),(0,n.useCallback)((function(n,r){if(void 0===r&&(r={}),!l.current)return;if("number"==typeof n)return void t.go(n);let s=function(e,t,n){let r,a="string"==typeof e?m(e):e,o=""===e||""===a.pathname?"/":a.pathname;if(null==o)r=n;else{let e=t.length-1;if(o.startsWith("..")){let t=o.split("/");for(;".."===t[0];)t.shift(),e-=1;a.pathname=t.join("/")}r=e>=0?t[e]:"/"}let l=function(e,t){void 0===t&&(t="/");let{pathname:n,search:r="",hash:a=""}="string"==typeof e?m(e):e,o=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:o,search:E(r),hash:_(a)}}(a,r);return o&&"/"!==o&&o.endsWith("/")&&!l.pathname.endsWith("/")&&(l.pathname+="/"),l}(n,JSON.parse(o),a);"/"!==e&&(s.pathname=w([e,s.pathname])),(r.replace?t.replace:t.push)(s,r.state)}),[e,t,o,a])}const w=e=>e.join("/").replace(/\/\/+/g,"/"),y=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),E=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",_=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";var k,N,C,S=window.wp.i18n,j=function(){return(0,t.createElement)("svg",{className:"animate-spin ml-2 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},(0,t.createElement)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,t.createElement)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"}))},P=function(){const[e,r]=(0,n.useState)(!1),a=v();return(0,t.createElement)("main",{className:"mt-10 mx-auto w-auto max-w-7xl px-4 sm:mt-12 sm:px-6 md:mt-16 lg:mt-20 lg:px-8 xl:mt-28"},(0,t.createElement)("div",{className:"text-center"},(0,t.createElement)("h1",{className:"text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:text-6xl"},(0,t.createElement)("span",{className:"block xl"}," ",(0,S.__)("Let's Connect","checkout-plugins-stripe-woo")),(0,t.createElement)("span",{className:"block text-cart-500 xl:inline"},(0,S.__)("with Stripe","checkout-plugins-stripe-woo"))),(0,t.createElement)("p",{className:"mt-3 text-base text-gray-500 sm:mt-5 sm:text-lg sm:mx-auto md:mt-5 md:text-xl lg:mx-0"},(0,t.createElement)("span",{className:"block"},(0,t.createElement)("span",{className:"block text-gray-700 inline font-bold"},(0,S.__)("Checkout Plugins","checkout-plugins-stripe-woo"))," ",(0,S.__)("recommends to connect with","checkout-plugins-stripe-woo")," ",(0,t.createElement)("span",{className:"block text-gray-700 xl:inline font-bold"},(0,S.__)("Stripe connect.","checkout-plugins-stripe-woo"))),(0,t.createElement)("span",null,(0,S.__)("One click onboarding solution provided by","checkout-plugins-stripe-woo")," ",(0,t.createElement)("span",{className:"block text-gray-700 xl:inline font-bold"},(0,S.__)("Stripe.","checkout-plugins-stripe-woo")))),(0,t.createElement)("div",{className:"mt-5 sm:mt-8 sm:inline-block lg:inline-block sm:justify-center lg:justify-center"},(0,t.createElement)("div",{className:"rounded-md shadow"},e?(0,t.createElement)("button",{className:"disabled w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-wait"},(0,S.__)("Connecting…","checkout-plugins-stripe-woo"),(0,t.createElement)(j,null)):(0,t.createElement)("button",{onClick:function(){r(!0),""===onboarding_vars.woocommerce_installed||""===onboarding_vars.woocommerce_activated?a(onboarding_vars.navigator_base+"&cpsw_call=setup-woocommerce"):window.location.replace(onboarding_vars.authorization_url)},className:"w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-pointer"},(0,S.__)("Connect with Stripe","checkout-plugins-stripe-woo"))),(0,t.createElement)("div",{className:"mt-3 sm:mt-0 sm:ml-3"},(0,t.createElement)("a",{href:onboarding_vars.settings_url,className:"w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-slate-300 md:py-4 md:text-lg md:px-10"},(0,S.__)("Leave onboarding process","checkout-plugins-stripe-woo"))))))};function O(){return O=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},O.apply(this,arguments)}function A(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function L(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return T(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?T(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}function M(e,t){if(e in t){for(var n=t[e],r=arguments.length,a=new Array(r>2?r-2:0),o=2;o<r;o++)a[o-2]=arguments[o];return"function"==typeof n?n.apply(void 0,a):n}var l=new Error('Tried to handle "'+e+'" but there is no handler defined. Only defined handlers are: '+Object.keys(t).map((function(e){return'"'+e+'"'})).join(", ")+".");throw Error.captureStackTrace&&Error.captureStackTrace(l,M),l}function W(e){var t=e.props,n=e.slot,r=e.defaultTag,a=e.features,o=e.visible,l=void 0===o||o,s=e.name;if(l)return D(t,n,r,s);var c=null!=a?a:k.None;if(c&k.Static){var i=t.static,u=void 0!==i&&i,m=A(t,["static"]);if(u)return D(m,n,r,s)}if(c&k.RenderStrategy){var d,p=t.unmount,f=void 0===p||p,g=A(t,["unmount"]);return M(f?N.Unmount:N.Hidden,((d={})[N.Unmount]=function(){return null},d[N.Hidden]=function(){return D(O({},g,{hidden:!0,style:{display:"none"}}),n,r,s)},d))}return D(t,n,r,s)}function D(e,t,r,a){var o;void 0===t&&(t={});var l=H(e,["unmount","static"]),s=l.as,c=void 0===s?r:s,i=l.children,u=l.refName,m=void 0===u?"ref":u,d=A(l,["as","children","refName"]),p=void 0!==e.ref?((o={})[m]=e.ref,o):{},f="function"==typeof i?i(t):i;if(d.className&&"function"==typeof d.className&&(d.className=d.className(t)),c===n.Fragment&&Object.keys(d).length>0){if(!(0,n.isValidElement)(f)||Array.isArray(f)&&f.length>1)throw new Error(['Passing props on "Fragment"!',"","The current component <"+a+' /> is rendering a "Fragment".',"However we need to passthrough the following props:",Object.keys(d).map((function(e){return" - "+e})).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map((function(e){return" - "+e})).join("\n")].join("\n"));return(0,n.cloneElement)(f,Object.assign({},function(e,t,n){for(var r,a=Object.assign({},e),o=function(){var n,o=r.value;void 0!==e[o]&&void 0!==t[o]&&Object.assign(a,((n={})[o]=function(n){n.defaultPrevented||e[o](n),n.defaultPrevented||t[o](n)},n))},l=L(["onClick"]);!(r=l()).done;)o();return a}(function(e){var t=Object.assign({},e);for(var n in t)void 0===t[n]&&delete t[n];return t}(H(d,["ref"])),f.props),p))}return(0,n.createElement)(c,Object.assign({},H(d,["ref"]),c!==n.Fragment&&p),f)}function H(e,t){void 0===t&&(t=[]);for(var n,r=Object.assign({},e),a=L(t);!(n=a()).done;){var o=n.value;o in r&&delete r[o]}return r}!function(e){e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static"}(k||(k={})),function(e){e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden"}(N||(N={})),function(e){e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab"}(C||(C={}));var R="undefined"!=typeof window?n.useLayoutEffect:n.useEffect,U={serverHandoffComplete:!1},F=0;function I(){return++F}function z(){var e=function(){var e=(0,n.useState)(U.serverHandoffComplete),t=e[0],r=e[1];return(0,n.useEffect)((function(){!0!==t&&r(!0)}),[t]),(0,n.useEffect)((function(){!1===U.serverHandoffComplete&&(U.serverHandoffComplete=!0)}),[]),t}(),t=(0,n.useState)(e?I:null),r=t[0],a=t[1];return R((function(){null===r&&a(I())}),[r]),null!=r?""+r:void 0}var B=(0,n.createContext)(null);function Y(){var e=(0,n.useContext)(B);if(null===e){var t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Y),t}return e}function G(e){var t;if(e.type)return e.type;var n=null!=(t=e.as)?t:"button";return"string"==typeof n&&"button"===n.toLowerCase()?"button":void 0}function V(e,t){var r=(0,n.useState)((function(){return G(e)})),a=r[0],o=r[1];return R((function(){o(G(e))}),[e.type,e.as]),R((function(){a||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&o("button")}),[a,t]),a}var q=(0,n.createContext)(null);function J(){var e=(0,n.useContext)(q);if(null===e){var t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,J),t}return e}var $=(0,n.createContext)(null);$.displayName="GroupContext";var K=n.Fragment;function Q(e){var t=e.checked,r=e.onChange,a=A(e,["checked","onChange"]),o="headlessui-switch-"+z(),l=(0,n.useContext)($),s=(0,n.useRef)(null),c=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var a=(0,n.useRef)(t);return(0,n.useEffect)((function(){a.current=t}),[t]),(0,n.useCallback)((function(e){for(var t,n=L(a.current);!(t=n()).done;){var r=t.value;null!=r&&("function"==typeof r?r(e):r.current=e)}}),[a])}(s,null===l?null:l.setSwitch),i=(0,n.useCallback)((function(){return r(!t)}),[r,t]),u=(0,n.useCallback)((function(e){if(function(e){for(var t,n,r=e.parentElement,a=null;r&&!(r instanceof HTMLFieldSetElement);)r instanceof HTMLLegendElement&&(a=r),r=r.parentElement;var o=null!=(t=""===(null==(n=r)?void 0:n.getAttribute("disabled")))&&t;return(!o||!function(e){if(!e)return!1;for(var t=e.previousElementSibling;null!==t;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}(a))&&o}(e.currentTarget))return e.preventDefault();e.preventDefault(),i()}),[i]),m=(0,n.useCallback)((function(e){e.key!==C.Tab&&e.preventDefault(),e.key===C.Space&&i()}),[i]),d=(0,n.useCallback)((function(e){return e.preventDefault()}),[]),p=(0,n.useMemo)((function(){return{checked:t}}),[t]);return W({props:O({},a,{id:o,ref:c,role:"switch",type:V(e,s),tabIndex:0,"aria-checked":t,"aria-labelledby":null==l?void 0:l.labelledby,"aria-describedby":null==l?void 0:l.describedby,onClick:u,onKeyUp:m,onKeyPress:d}),slot:p,defaultTag:"button",name:"Switch"})}Q.Group=function(e){var t=(0,n.useState)(null),a=t[0],o=t[1],l=function(){var e=(0,n.useState)([]),t=e[0],a=e[1];return[t.length>0?t.join(" "):void 0,(0,n.useMemo)((function(){return function(e){var t=(0,n.useCallback)((function(e){return a((function(t){return[].concat(t,[e])})),function(){return a((function(t){var n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))}}),[]),o=(0,n.useMemo)((function(){return{register:t,slot:e.slot,name:e.name,props:e.props}}),[t,e.slot,e.name,e.props]);return r().createElement(q.Provider,{value:o},e.children)}}),[a])]}(),s=l[0],c=l[1],i=function(){var e=(0,n.useState)([]),t=e[0],a=e[1];return[t.length>0?t.join(" "):void 0,(0,n.useMemo)((function(){return function(e){var t=(0,n.useCallback)((function(e){return a((function(t){return[].concat(t,[e])})),function(){return a((function(t){var n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))}}),[]),o=(0,n.useMemo)((function(){return{register:t,slot:e.slot,name:e.name,props:e.props}}),[t,e.slot,e.name,e.props]);return r().createElement(B.Provider,{value:o},e.children)}}),[a])]}(),u=i[0],m=i[1],d=(0,n.useMemo)((function(){return{switch:a,setSwitch:o,labelledby:s,describedby:u}}),[a,o,s,u]);return r().createElement(m,{name:"Switch.Description"},r().createElement(c,{name:"Switch.Label",props:{onClick:function(){a&&(a.click(),a.focus({preventScroll:!0}))}}},r().createElement($.Provider,{value:d},W({props:e,defaultTag:K,name:"Switch.Group"}))))},Q.Label=function(e){var t=e.passive,n=void 0!==t&&t,r=A(e,["passive"]),a=J(),o="headlessui-label-"+z();R((function(){return a.register(o)}),[o,a.register]);var l=O({},a.props,{id:o}),s=O({},r,l);return n&&delete s.onClick,W({props:s,slot:a.slot||{},defaultTag:"label",name:a.name||"Label"})},Q.Description=function(e){var t=Y(),n="headlessui-description-"+z();R((function(){return t.register(n)}),[n,t.register]);var r=e,a=O({},t.props,{id:n});return W({props:O({},r,a),slot:t.slot||{},defaultTag:"p",name:t.name||"Description"})};var X=window.wp.apiFetch,Z=e.n(X);function ee(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(Boolean).join(" ")}var te=function(){const[e,r]=(0,n.useState)(!1),[a,o]=(0,n.useState)(onboarding_vars.available_gateways),l=v();return(0,t.createElement)("main",{className:"mt-4 mb-4 mx-auto w-auto max-w-7xl px-4 sm:mt-6 sm:px-6 md:mt-8 lg:mt-10 lg:px-8 xl:mt-16"},(0,t.createElement)("div",{className:"text-center"},(0,t.createElement)("p",{className:"mt-3 text-base text-gray-500 sm:mt-5 sm:text-lg sm:mx-auto md:mt-5 md:text-xl lg:mx-0"},(0,t.createElement)("span",{className:"block"},(0,t.createElement)("span",{className:"text-gray-700 inline font-bold"},(0,S.__)("Congratulations!!","checkout-plugins-stripe-woo")," "),(0,S.__)("You are connected to Stripe successfully.","checkout-plugins-stripe-woo")),(0,t.createElement)("span",{className:"block"},(0,S.__)("Let's enable gateways","checkout-plugins-stripe-woo"))),(0,t.createElement)("ul",{role:"list",className:"divide-y divide-gray-200 bg-white overflow-hidden sm:rounded-md mt-10 max-w-screen-md mx-auto"},a.map((e=>(0,t.createElement)("li",{key:e.id},(0,t.createElement)("span",{href:"#",className:"block hover:bg-gray-50"},(0,t.createElement)("div",{className:"flex items-center px-4 py-4 sm:px-6"},(0,t.createElement)("div",{className:"min-w-0 flex-1 flex items-center"},(0,t.createElement)("div",{className:"flex-shrink-0"},(0,t.createElement)("img",{className:"h-12 w-32 max-w-80",src:e.icon,alt:e.name})),(0,t.createElement)("div",{className:"min-w-0 flex-1 px-4 md:gap-4"},(0,t.createElement)("div",null,(0,t.createElement)("p",{className:"text-sm font-medium text-cart-500 flex truncate"},e.name," ",e.recommended?(0,t.createElement)("span",{className:"ml-2 px-2 py-1 text-green-800 text-xs font-medium bg-green-100 rounded-full"},(0,S.__)("Recommended","checkout-plugins-stripe-woo")):""),(0,t.createElement)("p",{className:"text-sm font-medium text-gray-400 flex"},(0,t.createElement)("span",{className:"text-left text-sm"},"all"===e.currencies?(0,S.__)("Works with all currencies","checkout-plugins-stripe-woo"):(0,S.__)("Works with ","checkout-plugins-stripe-woo")+e.currencies))))),(0,t.createElement)("div",null,(0,t.createElement)(Q,{checked:e.enabled,value:e.enabled,name:e.id,onChange:()=>{e.enabled=!e.enabled,o([...a])},className:ee(e.enabled?"bg-cart-500 ":"bg-gray-200","relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-cart-500")},(0,t.createElement)("span",{className:"sr-only"},e.id),(0,t.createElement)("span",{"aria-hidden":"true",className:ee(e.enabled?"translate-x-5":"translate-x-0","pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition ease-in-out duration-200")}))))))))),(0,t.createElement)("div",{className:"mt-5 sm:mt-8 sm:inline-block lg:inline-block sm:justify-center lg:justify-center"},(0,t.createElement)("div",{className:"rounded-md shadow"},e?(0,t.createElement)("button",{className:"disabled w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-wait"},(0,S.__)("Enabling…","checkout-plugins-stripe-woo"),(0,t.createElement)(j,null)):(0,t.createElement)("button",{onClick:function(e){e.preventDefault(),r(!0);const t=new window.FormData,n={};a.forEach((function(e){n[e.id]=document.getElementsByName(e.id)[0].value}));const o=JSON.stringify(n);t.append("formdata",o),t.append("action","cpsw_onboarding_enable_gateway"),t.append("security",onboarding_vars.cpsw_onboarding_enable_gateway),Z()({url:onboarding_vars.ajax_url,method:"POST",body:t}).then((e=>{e.success&&(!0===e.data.activated_gateways.cpsw_stripe?l(onboarding_vars.navigator_base+"&cpsw_call=express-checkout"):l(onboarding_vars.navigator_base+"&cpsw_call=thank-you"))}))},className:"w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-pointer"},(0,S.__)("Enable Gateways","checkout-plugins-stripe-woo"))))))},ne=function(){const[e,r]=(0,n.useState)(!1),a=v();return(0,t.createElement)("main",{className:"mt-10 mx-auto w-auto max-w-7xl px-4 sm:mt-12 sm:px-6 md:mt-16 lg:mt-20 lg:px-8 xl:mt-28"},(0,t.createElement)("div",{className:"text-center"},(0,t.createElement)("h1",{className:"text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:text-6xl"},(0,t.createElement)("span",{className:"block xl"},(0,S.__)("Wooho!!","checkout-plugins-stripe-woo")),(0,t.createElement)("span",{className:"block text-cart-500 xl:inline"},(0,S.__)("You are almost done.","checkout-plugins-stripe-woo"))),(0,t.createElement)("p",{className:"mt-3 text-base text-gray-500 sm:mt-5 sm:text-lg sm:mx-auto md:mt-5 md:text-xl lg:mx-0"},(0,t.createElement)("span",{className:"block"}," ",(0,S.__)("Since you have enabled","checkout-plugins-stripe-woo")," ",(0,t.createElement)("span",{className:"block text-gray-700 xl:inline font-bold"},(0,S.__)("Stripe Card Processing","checkout-plugins-stripe-woo"),","),(0,S.__)(" We recommend you to enable","checkout-plugins-stripe-woo")," ",(0,t.createElement)("span",{className:"block text-gray-700 xl:inline font-bold"},(0,S.__)("Express Checkout","checkout-plugins-stripe-woo"))," ",(0,S.__)("feature","checkout-plugins-stripe-woo"),"."),(0,t.createElement)("span",null,(0,S.__)("Express Checkout generates more conversions!!","checkout-plugins-stripe-woo"))),(0,t.createElement)("div",{className:"block mx-auto mt-1 mb-1"},(0,t.createElement)("img",{className:"inline mx-4 py-5 h-24",src:onboarding_vars.assets_url+"images/apple-pay.svg",alt:"Express Checkout"}),(0,t.createElement)("img",{className:"inline mx-4 py-5 h-24",src:onboarding_vars.assets_url+"images/gpay.svg",alt:"Express Checkout"})),(0,t.createElement)("div",{className:"sm:inline-block lg:inline-block sm:justify-center lg:justify-center"},(0,t.createElement)("div",{className:"rounded-md shadow"},e?(0,t.createElement)("button",{className:"disabled w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-wait"},(0,S.__)("Enabling…","checkout-plugins-stripe-woo"),(0,t.createElement)(j,null)):(0,t.createElement)("button",{onClick:function(){r(!0);const e=new window.FormData;e.append("action","cpsw_onboarding_enable_express_checkout"),e.append("security",onboarding_vars.cpsw_onboarding_enable_express_checkout),Z()({url:onboarding_vars.ajax_url,method:"POST",body:e}).then((e=>{e.success&&a(onboarding_vars.navigator_base+"&cpsw_call=thank-you")}))},className:"w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-pointer"},(0,S.__)("Enable Express Checkout","checkout-plugins-stripe-woo"))),(0,t.createElement)("div",{className:"mt-3 sm:mt-0 sm:ml-3"},(0,t.createElement)("a",{href:onboarding_vars.base_url+"&cpsw_call=thank-you",className:"w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-slate-300 md:py-4 md:text-lg md:px-10"},(0,S.__)("Skip Express Checkout","checkout-plugins-stripe-woo"))))))},re=function(){return(0,t.createElement)("main",{className:"mt-10 mx-auto w-auto max-w-7xl px-4 sm:mt-12 sm:px-6 md:mt-14 lg:mt-16 lg:px-8 xl:mt-18"},(0,t.createElement)("div",{className:"text-center"},(0,t.createElement)("h1",{className:"text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:text-6xl"},(0,t.createElement)("span",{className:"block text-red-600 xl:inline"},(0,S.__)("Failed!!","checkout-plugins-stripe-woo"))),(0,t.createElement)("p",{className:"mt-3 text-base text-gray-500 sm:mt-5 sm:text-lg sm:mx-auto md:mt-5 md:text-xl lg:mx-0"},(0,t.createElement)("span",{className:"block"},(0,S.__)("Unfortunately Connection to Stripe failed.","checkout-plugins-stripe-woo"))),(0,t.createElement)("div",{className:"mt-5 sm:mt-8 sm:inline-block lg:inline-block sm:justify-center lg:justify-center"},(0,t.createElement)("div",{className:"rounded-md shadow"},(0,t.createElement)("a",{href:onboarding_vars.authorization_url,className:"w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10"},(0,S.__)("Try Again","checkout-plugins-stripe-woo"))),(0,t.createElement)("div",{className:"mt-3 sm:mt-0 sm:ml-3"},(0,t.createElement)("a",{href:onboarding_vars.manual_connect_url,className:"w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-slate-300 md:py-4 md:text-lg md:px-10"},(0,S.__)("Manage API keys manually","checkout-plugins-stripe-woo"))))))},ae=function(){const[e,r]=(0,n.useState)(!1);return(0,t.createElement)("main",{className:"mt-10 mx-auto w-auto max-w-7xl px-4 sm:mt-12 sm:px-6 md:mt-14 lg:mt-16 lg:px-8 xl:mt-18"},(0,t.createElement)("div",{className:"text-center"},(0,t.createElement)("h1",{className:"text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:text-6xl"},(0,t.createElement)("span",{className:"block text-cart-500 xl:inline"},(0,S.__)("Great!!","checkout-plugins-stripe-woo"))),(0,t.createElement)("p",{className:"mt-3 text-base text-gray-500 sm:mt-5 sm:text-lg sm:mx-auto md:mt-5 md:text-xl lg:mx-0"},(0,t.createElement)("span",{className:"block"},(0,S.__)("Your store is all set to accept payment.","checkout-plugins-stripe-woo")),(0,t.createElement)("span",null,(0,S.__)("We provide lots of customization options to match your needs, don't forget to explore them.","checkout-plugins-stripe-woo"))),(0,t.createElement)("div",{className:"mt-5 sm:mt-8 sm:inline-block lg:inline-block sm:justify-center lg:justify-center"},(0,t.createElement)("div",{className:"rounded-md shadow"},e?(0,t.createElement)("button",{className:"disabled w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-wait"},(0,S.__)("Let's Customize…","checkout-plugins-stripe-woo"),(0,t.createElement)(j,null)):(0,t.createElement)("button",{onClick:function(){r(!0),window.location.replace(onboarding_vars.gateways_url)},className:"w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-pointer"},(0,S.__)("Let's Customize","checkout-plugins-stripe-woo"))))))},oe=function(){""!==onboarding_vars.woocommerce_installed&&""!==onboarding_vars.woocommerce_activated&&window.location.replace(onboarding_vars.navigator_base);const[e,r]=(0,n.useState)(""),[a,o]=(0,n.useState)(!1),[l,s]=(0,n.useState)(!1);return(0,t.createElement)("main",{className:"mt-10 mx-auto max-w-7xl px-4 sm:mt-12 sm:px-6 md:mt-16 lg:mt-20 lg:px-8 xl:mt-28"},(0,t.createElement)("div",{className:"text-center"},(0,t.createElement)("h1",{className:"text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:text-6xl"},(0,t.createElement)("span",{className:"block xl"},""===onboarding_vars.woocommerce_installed?(0,S.__)("Missing","checkout-plugins-stripe-woo"):(0,S.__)("Inactiave","checkout-plugins-stripe-woo")),(0,t.createElement)("span",{className:"block text-cart-500 xl:inline"},(0,S.__)("WooCoomerce","checkout-plugins-stripe-woo"))),(0,t.createElement)("p",{className:"mt-6 text-base justify-center text-gray-500 sm:mt-5 sm:text-lg sm:w-full sm:mx-auto md:mt-5 md:text-xl lg:mx-0"},(0,t.createElement)("span",{className:"block text-gray-700 xl:inline font-bold"},(0,S.__)("Checkout Plugins - Stripe for WooCoomerce","checkout-plugins-stripe-woo"))," ",(0,S.__)("requires","checkout-plugins-stripe-woo")," ",(0,t.createElement)("span",{className:"block text-gray-700 xl:inline font-bold"},(0,S.__)("WooCommerce","checkout-plugins-stripe-woo"))," ",(0,S.__)("to be active on your store.","checkout-plugins-stripe-woo")),(0,t.createElement)("div",{className:"mt-5 sm:mt-8 sm:flex justify-center"},(0,t.createElement)("div",{className:"rounded-md shadow"},"installing"===e?(0,t.createElement)("button",{className:"disabled w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-wait"},(0,S.__)("Installing…","checkout-plugins-stripe-woo"),(0,t.createElement)(j,null)):"activating"===e?(0,t.createElement)("button",{className:"disabled w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-wait"},(0,S.__)("Activating…","checkout-plugins-stripe-woo"),(0,t.createElement)(j,null)):(0,t.createElement)("button",{onClick:function(){if(""===onboarding_vars.woocommerce_installed)r("installing"),setTimeout((()=>{o(!0)}),1e4),wp.updates.queue.push({action:"install-plugin",data:{slug:"woocommerce"}}),wp.updates.queueChecker();else{r("activating");const e=new window.FormData;e.append("action","cpsw_onboarding_install_woocommerce"),e.append("security",onboarding_vars.cpsw_onboarding_install_woocommerce),Z()({url:onboarding_vars.ajax_url,method:"POST",body:e}).then((e=>{e.success?window.location.replace(onboarding_vars.onboarding_base):s(!0)}))}},className:"install-dependency w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-pointer"},""===onboarding_vars.woocommerce_installed?(0,S.__)("Install and continue","checkout-plugins-stripe-woo"):(0,S.__)("Activate and continue","checkout-plugins-stripe-woo"))))),a?(0,t.createElement)("div",{className:"bg-cart-50 p-4 fixed left-0 top-0 right-0 transition ease-in-out delay-150"},(0,t.createElement)("div",{className:"block"},(0,t.createElement)("div",{className:"text-center justify-center"},(0,t.createElement)("p",{className:"text-sm mx-auto w-full text-cart-500 text-center"},(0,S.__)("Installing WooCommerce will take time. Please be patient.","checkout-plugins-stripe-woo"))))):"",l?(0,t.createElement)("div",{className:"bg-cart-50 p-4 fixed left-0 top-0 right-0 transition ease-in-out delay-150"},(0,t.createElement)("div",{className:"block"},(0,t.createElement)("div",{className:"text-center justify-center"},(0,t.createElement)("p",{className:"text-sm mx-auto w-full text-cart-500 text-center"},(0,S.__)("WooCommerce installing failed. Please try again.","checkout-plugins-stripe-woo"))))):"")},le=function(){return(0,t.createElement)("div",null,(0,t.createElement)("div",{className:"relative pt-6 px-4 sm:px-6 lg:px-8"},(0,t.createElement)("nav",{className:"relative flex items-center justify-center sm:h-10","aria-label":"Logo"},(0,t.createElement)("div",{className:"flex items-center justify-center flex-grow"},(0,t.createElement)("div",{className:"flex items-center w-auto"},(0,t.createElement)("img",{className:"h-16 w-full",src:onboarding_vars.assets_url+"images/cpsw-logo.svg",alt:"Checkout Plugins - Stripe for WooCommerce"}))))))};o().render((0,t.createElement)((function(e){let{basename:t,children:r,window:a}=e,o=(0,n.useRef)();null==o.current&&(o.current=function(e){function t(){var e=c.location,t=d.state||{};return[t.idx,{pathname:e.pathname,search:e.search,hash:e.hash,state:t.usr||null,key:t.key||"default"}]}function n(e){return"string"==typeof e?e:function(e){var t=e.pathname;t=void 0===t?"/":t;var n=e.search;return n=void 0===n?"":n,e=void 0===(e=e.hash)?"":e,n&&"?"!==n&&(t+="?"===n.charAt(0)?n:"?"+n),e&&"#"!==e&&(t+="#"===e.charAt(0)?e:"#"+e),t}(e)}function r(e,t){return void 0===t&&(t=null),l({pathname:x.pathname,hash:"",search:""},"string"==typeof e?m(e):e,{state:t,key:Math.random().toString(36).substr(2,8)})}function a(e){f=e,e=t(),g=e[0],x=e[1],h.call({action:f,location:x})}function o(e){d.go(e)}void 0===e&&(e={});var c=void 0===(e=e.window)?document.defaultView:e,d=c.history,p=null;c.addEventListener("popstate",(function(){if(p)b.call(p),p=null;else{var e=s.Pop,n=t(),r=n[0];if(n=n[1],b.length){if(null!=r){var l=g-r;l&&(p={action:e,location:n,retry:function(){o(-1*l)}},o(l))}}else a(e)}}));var f=s.Pop,g=(e=t())[0],x=e[1],h=u(),b=u();return null==g&&(g=0,d.replaceState(l({},d.state,{idx:g}),"")),{get action(){return f},get location(){return x},createHref:n,push:function e(t,o){var l=s.Push,i=r(t,o);if(!b.length||(b.call({action:l,location:i,retry:function(){e(t,o)}}),0)){var u=[{usr:i.state,key:i.key,idx:g+1},n(i)];i=u[0],u=u[1];try{d.pushState(i,"",u)}catch(e){c.location.assign(u)}a(l)}},replace:function e(t,o){var l=s.Replace,c=r(t,o);b.length&&(b.call({action:l,location:c,retry:function(){e(t,o)}}),1)||(c=[{usr:c.state,key:c.key,idx:g},n(c)],d.replaceState(c[0],"",c[1]),a(l))},go:o,back:function(){o(-1)},forward:function(){o(1)},listen:function(e){return h.push(e)},block:function(e){var t=b.push(e);return 1===b.length&&c.addEventListener("beforeunload",i),function(){t(),b.length||c.removeEventListener("beforeunload",i)}}}}({window:a}));let c=o.current,[d,p]=(0,n.useState)({action:c.action,location:c.location});return(0,n.useLayoutEffect)((()=>c.listen(p)),[c]),(0,n.createElement)(x,{basename:t,children:r,location:d.location,navigationType:d.action,navigator:c})}),null,(0,t.createElement)((function(){const e=new URLSearchParams(b().search).get("cpsw_call");let n=(0,t.createElement)("p",null);switch(e){case"success":n=(0,t.createElement)(te,null);break;case"failed":n=(0,t.createElement)(re,null);break;case"express-checkout":n=(0,t.createElement)(ne,null);break;case"thank-you":n=(0,t.createElement)(ae,null);break;case"setup-woocommerce":n=(0,t.createElement)(oe,null);break;default:n=(0,t.createElement)(P,null)}return(0,t.createElement)("div",{className:"relative bg-white overflow-hidden w-10/12 mx-auto my-0 rounded-xl mt-12"},(0,t.createElement)("div",{className:"max-w-7xl mx-auto overflow-x-hidden"},(0,t.createElement)("div",{className:"relative z-10 bg-white lg:w-full"},(0,t.createElement)(le,null),n)))}),null)),document.getElementById("cpsw-onboarding-content"))}();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wizard/onboarding.php
CHANGED
@@ -37,6 +37,8 @@ class Onboarding {
|
|
37 |
return;
|
38 |
}
|
39 |
|
|
|
|
|
40 |
add_action( 'admin_menu', [ $this, 'admin_menus' ] );
|
41 |
add_action( 'admin_init', [ $this, 'setup_wizard' ] );
|
42 |
add_action( 'admin_notices', [ $this, 'show_onboarding_wizard_notice' ] );
|
@@ -75,6 +77,7 @@ class Onboarding {
|
|
75 |
}
|
76 |
|
77 |
$this->enqueue_scripts_styles();
|
|
|
78 |
|
79 |
ob_start();
|
80 |
$this->setup_wizard_html();
|
@@ -158,7 +161,7 @@ class Onboarding {
|
|
158 |
'plugins',
|
159 |
];
|
160 |
|
161 |
-
if ( ! in_array( $screen_id, $allowed_screens, true ) ) {
|
162 |
return;
|
163 |
}
|
164 |
|
@@ -197,11 +200,12 @@ class Onboarding {
|
|
197 |
/**
|
198 |
* Update onboarding setup status
|
199 |
*
|
|
|
200 |
* @return void
|
201 |
* @since 1.3.0
|
202 |
*/
|
203 |
-
public function update_connect_with_stripe_status() {
|
204 |
-
update_option( 'cpsw_setup_status',
|
205 |
}
|
206 |
|
207 |
/**
|
@@ -211,14 +215,13 @@ class Onboarding {
|
|
211 |
* @since 1.3.0
|
212 |
*/
|
213 |
public function localize_vars() {
|
214 |
-
$admin_controller = Admin_Controller::get_instance();
|
215 |
$redirect_url = admin_url( 'index.php?page=cpsw-onboarding' );
|
216 |
$available_gateways = $this->available_gateways();
|
217 |
return [
|
218 |
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
219 |
'base_url' => $redirect_url,
|
220 |
'assets_url' => CPSW_URL . 'wizard/',
|
221 |
-
'authorization_url' => $admin_controller->get_stripe_connect_url( $redirect_url ),
|
222 |
'settings_url' => admin_url( 'admin.php?page=wc-settings&tab=cpsw_api_settings' ),
|
223 |
'gateways_url' => admin_url( 'admin.php?page=wc-settings&tab=checkout§ion=cpsw_stripe' ),
|
224 |
'manual_connect_url' => admin_url( 'admin.php?page=wc-settings&tab=cpsw_api_settings&connect=manually' ),
|
@@ -228,7 +231,9 @@ class Onboarding {
|
|
228 |
'cpsw_onboarding_enable_express_checkout' => wp_create_nonce( 'cpsw_onboarding_enable_express_checkout' ),
|
229 |
'cpsw_onboarding_install_woocommerce' => wp_create_nonce( 'cpsw_onboarding_install_woocommerce' ),
|
230 |
'woocommerce_installed' => $this->is_woocommerce_installed(),
|
|
|
231 |
'navigator_base' => '/wp-admin/index.php?page=cpsw-onboarding',
|
|
|
232 |
];
|
233 |
}
|
234 |
|
@@ -386,14 +391,7 @@ class Onboarding {
|
|
386 |
$_cpsw_notice_nonce = filter_input( INPUT_GET, '_cpsw_notice_nonce', FILTER_SANITIZE_STRING );
|
387 |
|
388 |
if ( $cpsw_hide_notice && $_cpsw_notice_nonce && wp_verify_nonce( sanitize_text_field( wp_unslash( $_cpsw_notice_nonce ) ), 'cpsw_hide_notices_nonce' ) ) {
|
389 |
-
$this->update_connect_with_stripe_status();
|
390 |
-
|
391 |
-
unset( $_GET['cpsw-hide-notice'] );
|
392 |
-
unset( $_GET['_cpsw_notice_nonce'] );
|
393 |
-
|
394 |
-
$params = array_map( 'sanitize_text_field', $_GET );
|
395 |
-
|
396 |
-
wp_safe_redirect( add_query_arg( $params, admin_url( 'admin.php' ) ) );
|
397 |
}
|
398 |
}
|
399 |
|
@@ -410,11 +408,8 @@ class Onboarding {
|
|
410 |
}
|
411 |
|
412 |
if (
|
413 |
-
|
414 |
-
|
415 |
-
! empty( Helper::get_setting( 'cpsw_test_secret_key' ) ) &&
|
416 |
-
! empty( Helper::get_setting( 'cpsw_pub_key' ) ) &&
|
417 |
-
! empty( Helper::get_setting( 'cpsw_secret_key' ) )
|
418 |
) {
|
419 |
return;
|
420 |
}
|
37 |
return;
|
38 |
}
|
39 |
|
40 |
+
$this->admin_controller = Admin_Controller::get_instance();
|
41 |
+
|
42 |
add_action( 'admin_menu', [ $this, 'admin_menus' ] );
|
43 |
add_action( 'admin_init', [ $this, 'setup_wizard' ] );
|
44 |
add_action( 'admin_notices', [ $this, 'show_onboarding_wizard_notice' ] );
|
77 |
}
|
78 |
|
79 |
$this->enqueue_scripts_styles();
|
80 |
+
delete_transient( '_wc_activation_redirect' );
|
81 |
|
82 |
ob_start();
|
83 |
$this->setup_wizard_html();
|
161 |
'plugins',
|
162 |
];
|
163 |
|
164 |
+
if ( ! in_array( $screen_id, $allowed_screens, true ) || $this->admin_controller->is_stripe_connected() ) {
|
165 |
return;
|
166 |
}
|
167 |
|
200 |
/**
|
201 |
* Update onboarding setup status
|
202 |
*
|
203 |
+
* @param string $status Set status.
|
204 |
* @return void
|
205 |
* @since 1.3.0
|
206 |
*/
|
207 |
+
public function update_connect_with_stripe_status( $status = 'success' ) {
|
208 |
+
update_option( 'cpsw_setup_status', $status );
|
209 |
}
|
210 |
|
211 |
/**
|
215 |
* @since 1.3.0
|
216 |
*/
|
217 |
public function localize_vars() {
|
|
|
218 |
$redirect_url = admin_url( 'index.php?page=cpsw-onboarding' );
|
219 |
$available_gateways = $this->available_gateways();
|
220 |
return [
|
221 |
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
222 |
'base_url' => $redirect_url,
|
223 |
'assets_url' => CPSW_URL . 'wizard/',
|
224 |
+
'authorization_url' => $this->admin_controller->get_stripe_connect_url( $redirect_url ),
|
225 |
'settings_url' => admin_url( 'admin.php?page=wc-settings&tab=cpsw_api_settings' ),
|
226 |
'gateways_url' => admin_url( 'admin.php?page=wc-settings&tab=checkout§ion=cpsw_stripe' ),
|
227 |
'manual_connect_url' => admin_url( 'admin.php?page=wc-settings&tab=cpsw_api_settings&connect=manually' ),
|
231 |
'cpsw_onboarding_enable_express_checkout' => wp_create_nonce( 'cpsw_onboarding_enable_express_checkout' ),
|
232 |
'cpsw_onboarding_install_woocommerce' => wp_create_nonce( 'cpsw_onboarding_install_woocommerce' ),
|
233 |
'woocommerce_installed' => $this->is_woocommerce_installed(),
|
234 |
+
'woocommerce_activated' => class_exists( 'woocommerce' ),
|
235 |
'navigator_base' => '/wp-admin/index.php?page=cpsw-onboarding',
|
236 |
+
'onboarding_base' => admin_url( 'index.php?page=cpsw-onboarding' ),
|
237 |
];
|
238 |
}
|
239 |
|
391 |
$_cpsw_notice_nonce = filter_input( INPUT_GET, '_cpsw_notice_nonce', FILTER_SANITIZE_STRING );
|
392 |
|
393 |
if ( $cpsw_hide_notice && $_cpsw_notice_nonce && wp_verify_nonce( sanitize_text_field( wp_unslash( $_cpsw_notice_nonce ) ), 'cpsw_hide_notices_nonce' ) ) {
|
394 |
+
$this->update_connect_with_stripe_status( 'skipped' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
395 |
}
|
396 |
}
|
397 |
|
408 |
}
|
409 |
|
410 |
if (
|
411 |
+
'skipped' !== get_option( 'cpsw_setup_status', false ) &&
|
412 |
+
$this->admin_controller->is_stripe_connected()
|
|
|
|
|
|
|
413 |
) {
|
414 |
return;
|
415 |
}
|
wizard/src/pages/HomePage.js
CHANGED
@@ -1,14 +1,20 @@
|
|
1 |
import React, { useState } from 'react';
|
2 |
import { __ } from '@wordpress/i18n';
|
3 |
import Spinner from '@Admin/components/Spinner';
|
|
|
4 |
|
5 |
function HomePage() {
|
6 |
const [ clicked, setClicked ] = useState( false );
|
|
|
7 |
function connectWithStripe() {
|
8 |
setClicked( true );
|
9 |
-
|
10 |
-
onboarding_vars.
|
11 |
-
|
|
|
|
|
|
|
|
|
12 |
}
|
13 |
|
14 |
return (
|
1 |
import React, { useState } from 'react';
|
2 |
import { __ } from '@wordpress/i18n';
|
3 |
import Spinner from '@Admin/components/Spinner';
|
4 |
+
import { useNavigate } from 'react-router-dom';
|
5 |
|
6 |
function HomePage() {
|
7 |
const [ clicked, setClicked ] = useState( false );
|
8 |
+
const navigate = useNavigate();
|
9 |
function connectWithStripe() {
|
10 |
setClicked( true );
|
11 |
+
if ( '' === onboarding_vars.woocommerce_installed || '' === onboarding_vars.woocommerce_activated ) {
|
12 |
+
navigate( onboarding_vars.navigator_base + '&cpsw_call=setup-woocommerce' );
|
13 |
+
} else {
|
14 |
+
window.location.replace(
|
15 |
+
onboarding_vars.authorization_url,
|
16 |
+
);
|
17 |
+
}
|
18 |
}
|
19 |
|
20 |
return (
|
wizard/src/pages/WooCommerce.js
CHANGED
@@ -2,12 +2,17 @@ import React, { useState } from 'react';
|
|
2 |
import apiFetch from '@wordpress/api-fetch';
|
3 |
import { __ } from '@wordpress/i18n';
|
4 |
import Spinner from '@Admin/components/Spinner';
|
5 |
-
import { useNavigate } from 'react-router-dom';
|
6 |
|
7 |
function WooCommerce() {
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
const [ state, setState ] = useState( '' );
|
9 |
const [ notification, setNotification ] = useState( false );
|
10 |
-
const
|
11 |
function installWooCommerce() {
|
12 |
if ( '' === onboarding_vars.woocommerce_installed ) {
|
13 |
setState( 'installing' );
|
@@ -42,7 +47,11 @@ function WooCommerce() {
|
|
42 |
body: formData,
|
43 |
} ).then( ( res ) => {
|
44 |
if ( res.success ) {
|
45 |
-
|
|
|
|
|
|
|
|
|
46 |
}
|
47 |
} );
|
48 |
}
|
@@ -52,7 +61,7 @@ function WooCommerce() {
|
|
52 |
<main className="mt-10 mx-auto max-w-7xl px-4 sm:mt-12 sm:px-6 md:mt-16 lg:mt-20 lg:px-8 xl:mt-28">
|
53 |
<div className="text-center">
|
54 |
<h1 className="text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:text-6xl">
|
55 |
-
<span className="block xl">{ __( 'Missing', 'checkout-plugins-stripe-woo' ) }</span>
|
56 |
<span className="block text-cart-500 xl:inline">{ __( 'WooCoomerce', 'checkout-plugins-stripe-woo' ) }</span>
|
57 |
</h1>
|
58 |
<p className="mt-6 text-base justify-center text-gray-500 sm:mt-5 sm:text-lg sm:w-full sm:mx-auto md:mt-5 md:text-xl lg:mx-0">
|
@@ -78,7 +87,7 @@ function WooCommerce() {
|
|
78 |
}
|
79 |
return (
|
80 |
<button onClick={ installWooCommerce } className="install-dependency w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-pointer">
|
81 |
-
{ __( 'Install and continue', 'checkout-plugins-stripe-woo' ) }
|
82 |
</button>
|
83 |
);
|
84 |
} )() }
|
@@ -89,7 +98,17 @@ function WooCommerce() {
|
|
89 |
<div className="bg-cart-50 p-4 fixed left-0 top-0 right-0 transition ease-in-out delay-150">
|
90 |
<div className="block">
|
91 |
<div className="text-center justify-center">
|
92 |
-
<p className="text-sm mx-auto w-full text-cart-500 text-center">{ __( 'Installing WooCommerce will take time. Please be patient.' ) }</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
</div>
|
94 |
</div>
|
95 |
</div>
|
2 |
import apiFetch from '@wordpress/api-fetch';
|
3 |
import { __ } from '@wordpress/i18n';
|
4 |
import Spinner from '@Admin/components/Spinner';
|
|
|
5 |
|
6 |
function WooCommerce() {
|
7 |
+
if ( '' !== onboarding_vars.woocommerce_installed && '' !== onboarding_vars.woocommerce_activated ) {
|
8 |
+
window.location.replace(
|
9 |
+
onboarding_vars.navigator_base,
|
10 |
+
);
|
11 |
+
}
|
12 |
+
|
13 |
const [ state, setState ] = useState( '' );
|
14 |
const [ notification, setNotification ] = useState( false );
|
15 |
+
const [ notificationError, setErrorNotification ] = useState( false );
|
16 |
function installWooCommerce() {
|
17 |
if ( '' === onboarding_vars.woocommerce_installed ) {
|
18 |
setState( 'installing' );
|
47 |
body: formData,
|
48 |
} ).then( ( res ) => {
|
49 |
if ( res.success ) {
|
50 |
+
window.location.replace(
|
51 |
+
onboarding_vars.onboarding_base,
|
52 |
+
);
|
53 |
+
} else {
|
54 |
+
setErrorNotification( true );
|
55 |
}
|
56 |
} );
|
57 |
}
|
61 |
<main className="mt-10 mx-auto max-w-7xl px-4 sm:mt-12 sm:px-6 md:mt-16 lg:mt-20 lg:px-8 xl:mt-28">
|
62 |
<div className="text-center">
|
63 |
<h1 className="text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:text-6xl">
|
64 |
+
<span className="block xl">{ '' === onboarding_vars.woocommerce_installed ? __( 'Missing', 'checkout-plugins-stripe-woo' ) : __( 'Inactiave', 'checkout-plugins-stripe-woo' ) }</span>
|
65 |
<span className="block text-cart-500 xl:inline">{ __( 'WooCoomerce', 'checkout-plugins-stripe-woo' ) }</span>
|
66 |
</h1>
|
67 |
<p className="mt-6 text-base justify-center text-gray-500 sm:mt-5 sm:text-lg sm:w-full sm:mx-auto md:mt-5 md:text-xl lg:mx-0">
|
87 |
}
|
88 |
return (
|
89 |
<button onClick={ installWooCommerce } className="install-dependency w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-pointer">
|
90 |
+
{ '' === onboarding_vars.woocommerce_installed ? __( 'Install and continue', 'checkout-plugins-stripe-woo' ) : __( 'Activate and continue', 'checkout-plugins-stripe-woo' ) }
|
91 |
</button>
|
92 |
);
|
93 |
} )() }
|
98 |
<div className="bg-cart-50 p-4 fixed left-0 top-0 right-0 transition ease-in-out delay-150">
|
99 |
<div className="block">
|
100 |
<div className="text-center justify-center">
|
101 |
+
<p className="text-sm mx-auto w-full text-cart-500 text-center">{ __( 'Installing WooCommerce will take time. Please be patient.', 'checkout-plugins-stripe-woo' ) }</p>
|
102 |
+
</div>
|
103 |
+
</div>
|
104 |
+
</div>
|
105 |
+
) : ( '' ) }
|
106 |
+
|
107 |
+
{ notificationError ? (
|
108 |
+
<div className="bg-cart-50 p-4 fixed left-0 top-0 right-0 transition ease-in-out delay-150">
|
109 |
+
<div className="block">
|
110 |
+
<div className="text-center justify-center">
|
111 |
+
<p className="text-sm mx-auto w-full text-cart-500 text-center">{ __( 'WooCommerce installing failed. Please try again.', 'checkout-plugins-stripe-woo' ) }</p>
|
112 |
</div>
|
113 |
</div>
|
114 |
</div>
|