diff --git a/changelog.txt b/changelog.txt index f148a487b8..bfb70bf673 100644 --- a/changelog.txt +++ b/changelog.txt @@ -11,6 +11,7 @@ * Fix - Do not load express payment buttons on switch subscription page. * Fix - Return 'is_live' as true in account summary response when test mode is disabled in gateway settings and charge is enabled in Stripe account. * Fix - Prevents notices being displayed on WordPress 6.7 due to loading translations too early (only shown on stores with WP_DEBUG enabled). +* Tweak - Update links to plugin documentation and Stripe documentation. = 8.9.0 - 2024-11-14 = * Update - Enhance webhook processing to enable retrieving orders using payment_intent metadata. @@ -1359,7 +1360,7 @@ * Add support for changing a subscription's recurring amount = 1.5.0 - 2013-01-18 = -* Supports Stripe Checkout https://stripe.com/docs/checkout +* Supports Stripe Checkout https://docs.stripe.com/payments/checkout = 1.4.0 - 2013-01-18 = * WC 2.0 Compat diff --git a/client/settings/payment-gateway-manager/constants.js b/client/settings/payment-gateway-manager/constants.js index d5b8e7cc69..a00ae62210 100644 --- a/client/settings/payment-gateway-manager/constants.js +++ b/client/settings/payment-gateway-manager/constants.js @@ -92,7 +92,7 @@ export const gatewaysInfo = { 'woocommerce-gateway-stripe' ), guide: - 'https://stripe.com/docs/payments/payment-methods/overview#vouchers', + 'https://docs.stripe.com/payments/payment-methods/overview#vouchers', Fields: () => { const [ gatewayExpiration, diff --git a/client/settings/payment-settings/test-mode-checkbox.js b/client/settings/payment-settings/test-mode-checkbox.js index 724f241a56..f3635e27c3 100644 --- a/client/settings/payment-settings/test-mode-checkbox.js +++ b/client/settings/payment-settings/test-mode-checkbox.js @@ -26,7 +26,7 @@ const TestModeCheckbox = () => { components: { testCardNumbersLink: ( // eslint-disable-next-line jsx-a11y/anchor-has-content - + ), learnMoreLink: ( // eslint-disable-next-line jsx-a11y/anchor-has-content diff --git a/client/settings/payments-and-transactions-section/manual-capture-control.js b/client/settings/payments-and-transactions-section/manual-capture-control.js index 0dd6730ee5..a6393814e0 100644 --- a/client/settings/payments-and-transactions-section/manual-capture-control.js +++ b/client/settings/payments-and-transactions-section/manual-capture-control.js @@ -1,5 +1,6 @@ import { __ } from '@wordpress/i18n'; import styled from '@emotion/styled'; +import interpolateComponents from 'interpolate-components'; import React, { useContext, useState } from 'react'; import { CheckboxControl, Button } from '@wordpress/components'; import { Icon, info } from '@wordpress/icons'; @@ -72,10 +73,18 @@ const ManualCaptureControl = () => { 'Issue an authorization on checkout, and capture later', 'woocommerce-gateway-stripe' ) } - help={ __( - 'Charge must be captured on the order details screen within 7 days of authorization, otherwise the authorization and order will be canceled.', - 'woocommerce-gateway-stripe' - ) } + help={ interpolateComponents( { + mixedString: __( + 'Charge must be captured on the order details screen within 7 days of authorization, otherwise the authorization and order will be canceled. {{learnMoreLink}}Learn more{{/learnMoreLink}}', + 'woocommerce-gateway-stripe' + ), + components: { + learnMoreLink: ( + // eslint-disable-next-line jsx-a11y/anchor-has-content + + ), + }, + } ) } /> { isConfirmationModalOpen && ( { if ( ! isUpeEnabled ) { return [ diff --git a/docs/api/README.md b/docs/api/README.md index 4dc27a58c1..6a252a1f87 100644 --- a/docs/api/README.md +++ b/docs/api/README.md @@ -8,16 +8,18 @@ explains how payment gateways API is used to manage WooCommerce Stripe gateway. Table of Contents ================= -* [Retrieve Stripe Payment Gateway](#retrieve-stripe-payment-gateway) - * [Capability required](#capability-required) - * [Request](#request) - * [Response](#response) - * [Notes](#notes) -* [Update Stripe Payment Gateway](#update-stripe-payment-gateway) - * [Capability required](#capability-required-1) - * [Request](#request-1) - * [Response](#response-1) - * [Notes](#notes-1) +- [REST API](#rest-api) +- [Table of Contents](#table-of-contents) + - [Retrieve Stripe Payment Gateway](#retrieve-stripe-payment-gateway) + - [Capability required](#capability-required) + - [Request](#request) + - [Response](#response) + - [Notes](#notes) + - [Update Stripe Payment Gateway](#update-stripe-payment-gateway) + - [Capability required](#capability-required-1) + - [Request](#request-1) + - [Response](#response-1) + - [Notes](#notes-1) ## Retrieve Stripe Payment Gateway @@ -25,7 +27,7 @@ Table of Contents * `manage_woocommerce` -### Request +### Request ``` GET /wp-json/wc/v2/payment_gateways/stripe @@ -47,7 +49,7 @@ Status: 200 OK { "id": "stripe", "title": "Stripe", - "description": "Pay with your credit card via Stripe. TEST MODE ENABLED. In test mode, you can use the card number 4242424242424242 with any CVC and a valid expiration date or check the documentation \"Testing Stripe\" for more card numbers.", + "description": "Pay with your credit card via Stripe. TEST MODE ENABLED. In test mode, you can use the card number 4242424242424242 with any CVC and a valid expiration date or check the documentation \"Testing Stripe\" for more card numbers.", "order": 4, "enabled": true, "method_title": "Stripe", @@ -216,7 +218,7 @@ Status: 200 OK ### Notes In WooCommerce Stripe 4.0.0, there will be multiple payment methods to support -[Stripe Sources](https://stripe.com/docs/sources). For example, there will be +[Stripe Sources](https://docs.stripe.com/sources). For example, there will be [`stripe_bancontact`](https://github.com/woocommerce/woocommerce-gateway-stripe/blob/3041f46f4b1b5d25b24be25767e0387f0cdf3f96/includes/payment-methods/class-wc-gateway-stripe-bancontact.php#L59) payment method in addition to `stripe` payment method. You can request `stripe_bancontact` with: @@ -266,7 +268,7 @@ curl -u consumer_key:consumer_secret -X PUT \ { "id": "stripe", "title": "Stripe", - "description": "Pay with your credit card via Stripe. TEST MODE ENABLED. In test mode, you can use the card number 4242424242424242 with any CVC and a valid expiration date or check the documentation \"Testing Stripe\" for more card numbers.", + "description": "Pay with your credit card via Stripe. TEST MODE ENABLED. In test mode, you can use the card number 4242424242424242 with any CVC and a valid expiration date or check the documentation \"Testing Stripe\" for more card numbers.", "order": 4, "enabled": true, "method_title": "Stripe", diff --git a/includes/abstracts/abstract-wc-stripe-payment-gateway.php b/includes/abstracts/abstract-wc-stripe-payment-gateway.php index ecf9778a84..6663eb0b23 100644 --- a/includes/abstracts/abstract-wc-stripe-payment-gateway.php +++ b/includes/abstracts/abstract-wc-stripe-payment-gateway.php @@ -1105,7 +1105,7 @@ public function process_refund( $order_id, $amount = null, $reason = '' ) { } if ( $reason ) { - // Trim the refund reason to a max of 500 characters due to Stripe limits: https://stripe.com/docs/api/metadata. + // Trim the refund reason to a max of 500 characters due to Stripe limits: https://docs.stripe.com/api/metadata. if ( strlen( $reason ) > 500 ) { $reason = function_exists( 'mb_substr' ) ? mb_substr( $reason, 0, 450 ) : substr( $reason, 0, 450 ); // Add some explainer text indicating where to find the full refund reason. diff --git a/includes/admin/class-wc-rest-stripe-tokens-controller.php b/includes/admin/class-wc-rest-stripe-tokens-controller.php index 3dabb689c6..1d721873f2 100644 --- a/includes/admin/class-wc-rest-stripe-tokens-controller.php +++ b/includes/admin/class-wc-rest-stripe-tokens-controller.php @@ -22,7 +22,7 @@ public function register_routes() { register_rest_route( $this->namespace, // For more info on Stripe tokens, see the following: - // https://stripe.com/docs/api/tokens/object + // https://docs.stripe.com/api/tokens/object '/' . $this->rest_base . '/(?P[a-z]{3}_[a-zA-Z0-9]{24})', [ 'methods' => WP_REST_Server::READABLE, diff --git a/includes/admin/class-wc-stripe-admin-notices.php b/includes/admin/class-wc-stripe-admin-notices.php index 308355c0bc..5a310d0e17 100644 --- a/includes/admin/class-wc-stripe-admin-notices.php +++ b/includes/admin/class-wc-stripe-admin-notices.php @@ -149,7 +149,7 @@ public function stripe_check_environment() { } if ( empty( $show_3ds_notice ) && $three_d_secure ) { - $url = 'https://stripe.com/docs/payments/3d-secure#three-ds-radar'; + $url = 'https://docs.stripe.com/payments/3d-secure/authentication-flow#three-ds-radar'; $message = sprintf( /* translators: 1) HTML anchor open tag 2) HTML anchor closing tag */ diff --git a/includes/admin/class-wc-stripe-inbox-notes.php b/includes/admin/class-wc-stripe-inbox-notes.php index 8a7676f7d0..d4a19f8e86 100644 --- a/includes/admin/class-wc-stripe-inbox-notes.php +++ b/includes/admin/class-wc-stripe-inbox-notes.php @@ -174,7 +174,7 @@ public static function create_failure_note() { $note->add_action( 'learn-more', __( 'Learn more', 'woocommerce-gateway-stripe' ), - 'https://woocommerce.com/document/stripe/troubleshooting/apple-pay-private-window/' + 'https://woocommerce.com/document/stripe/setup-and-configuration/express-checkouts/#apple-pay-requirements' ); $note->save(); } catch ( Exception $e ) {} // @codingStandardsIgnoreLine. diff --git a/includes/class-wc-gateway-stripe.php b/includes/class-wc-gateway-stripe.php index 3c0cd39d9c..4287335c6f 100644 --- a/includes/class-wc-gateway-stripe.php +++ b/includes/class-wc-gateway-stripe.php @@ -245,7 +245,7 @@ public function payment_fields() { if ( $this->testmode ) { /* translators: link to Stripe testing page */ - $description .= ' ' . sprintf( __( 'TEST MODE ENABLED. In test mode, you can use the card number 4242424242424242 with any CVC and a valid expiration date or check the Testing Stripe documentation for more card numbers.', 'woocommerce-gateway-stripe' ), 'https://stripe.com/docs/testing' ); + $description .= ' ' . sprintf( __( 'TEST MODE ENABLED. In test mode, you can use the card number 4242424242424242 with any CVC and a valid expiration date or check the Testing Stripe documentation for more card numbers.', 'woocommerce-gateway-stripe' ), 'https://docs.stripe.com/testing' ); } $description = trim( $description ); diff --git a/includes/class-wc-stripe-api.php b/includes/class-wc-stripe-api.php index 56934c1379..b166bed83b 100644 --- a/includes/class-wc-stripe-api.php +++ b/includes/class-wc-stripe-api.php @@ -225,7 +225,7 @@ public static function request_with_level3_data( $request, $api, $level3_data, $ // 2. Do not add level3 data if there's a transient indicating that level3 was // not accepted by Stripe in the past for this account. // 3. Do not try to add level3 data if merchant is not based in the US. - // https://stripe.com/docs/level3#level-iii-usage-requirements + // https://docs.stripe.com/level3#level-iii-usage-requirements // (Needs to be authenticated with a level3 gated account to see above docs). if ( empty( $level3_data ) || diff --git a/includes/class-wc-stripe-apple-pay-registration.php b/includes/class-wc-stripe-apple-pay-registration.php index 1b6b4de46f..653a3909fd 100644 --- a/includes/class-wc-stripe-apple-pay-registration.php +++ b/includes/class-wc-stripe-apple-pay-registration.php @@ -436,7 +436,7 @@ private function is_available(): bool { $account_country = $cached_account_data['country'] ?? null; // Stripe Elements doesn’t support Apple Pay for Stripe accounts in India. - // https://stripe.com/docs/stripe-js/elements/payment-request-button?client=html#html-js-testing + // https://docs.stripe.com/stripe-js/elements/payment-request-button?client=html#prerequisites return 'IN' !== $account_country; } } diff --git a/includes/class-wc-stripe-helper.php b/includes/class-wc-stripe-helper.php index 01a374c3a0..651cc8e92a 100644 --- a/includes/class-wc-stripe-helper.php +++ b/includes/class-wc-stripe-helper.php @@ -271,8 +271,8 @@ public static function get_localized_messages() { /** * List of currencies supported by Stripe that has no decimals - * https://stripe.com/docs/currencies#zero-decimal from https://stripe.com/docs/currencies#presentment-currencies - * ugx is an exception and not in this list for being a special cases in Stripe https://stripe.com/docs/currencies#special-cases + * https://docs.stripe.com/currencies#zero-decimal from https://docs.stripe.com/currencies#presentment-currencies + * ugx is an exception and not in this list for being a special cases in Stripe https://docs.stripe.com/currencies#special-cases * * @return array $currencies */ @@ -1088,7 +1088,7 @@ public static function clean_statement_descriptor( $statement_descriptor = '' ) * Converts a WooCommerce locale to the closest supported by Stripe.js. * * Stripe.js supports only a subset of IETF language tags, if a country specific locale is not supported we use - * the default for that language (https://stripe.com/docs/js/appendix/supported_locales). + * the default for that language (https://docs.stripe.com/js/appendix/supported_locales). * If no match is found we return 'auto' so Stripe.js uses the browser locale. * * @param string $wc_locale The locale to convert. @@ -1096,7 +1096,7 @@ public static function clean_statement_descriptor( $statement_descriptor = '' ) * @return string Closest locale supported by Stripe ('auto' if NONE). */ public static function convert_wc_locale_to_stripe_locale( $wc_locale ) { - // List copied from: https://stripe.com/docs/js/appendix/supported_locales. + // List copied from: https://docs.stripe.com/js/appendix/supported_locales. $supported = [ 'ar', // Arabic. 'bg', // Bulgarian (Bulgaria). diff --git a/includes/class-wc-stripe-intent-controller.php b/includes/class-wc-stripe-intent-controller.php index 9ae2ed1b53..262d38a999 100644 --- a/includes/class-wc-stripe-intent-controller.php +++ b/includes/class-wc-stripe-intent-controller.php @@ -937,7 +937,7 @@ private function build_base_payment_intent_request_params( $payment_information * * A mandate must be provided before a deferred intent UPE payment can be processed. * This applies to SEPA, Bancontact, iDeal, Sofort, Cash App and Link payment methods. - * https://stripe.com/docs/payments/finalize-payments-on-the-server + * https://docs.stripe.com/payments/finalize-payments-on-the-server * * @param string $selected_payment_type The name of the selected UPE payment type. * @param bool $is_using_saved_payment_method Option. True if the customer is using a saved payment method, false otherwise. diff --git a/includes/class-wc-stripe-webhook-handler.php b/includes/class-wc-stripe-webhook-handler.php index 619a11826c..fbb3681470 100644 --- a/includes/class-wc-stripe-webhook-handler.php +++ b/includes/class-wc-stripe-webhook-handler.php @@ -119,7 +119,7 @@ public function check_for_webhook() { // A webhook endpoint must return a 2xx HTTP status code to prevent future webhook // delivery failures. - // @see https://stripe.com/docs/webhooks/build#acknowledge-events-immediately + // @see https://docs.stripe.com/webhooks#acknowledge-events-immediately status_header( 204 ); exit; } diff --git a/includes/constants/class-wc-stripe-currency-code.php b/includes/constants/class-wc-stripe-currency-code.php index 3b5bf18120..d807fca963 100644 --- a/includes/constants/class-wc-stripe-currency-code.php +++ b/includes/constants/class-wc-stripe-currency-code.php @@ -2,7 +2,7 @@ class WC_Stripe_Currency_Code { - // Source: https://stripe.com/docs/currencies + // Source: https://docs.stripe.com/currencies const UNITED_STATES_DOLLAR = 'USD'; // United States Dollar. const UNITED_ARAB_EMIRATES_DIRHAM = 'AED'; // United Arab Emirates dirham. const AFGHAN_AFGHANI = 'AFN'; // Afghan afghani. diff --git a/includes/payment-methods/class-wc-stripe-upe-payment-gateway.php b/includes/payment-methods/class-wc-stripe-upe-payment-gateway.php index ea1e03c7a0..2657568cdc 100644 --- a/includes/payment-methods/class-wc-stripe-upe-payment-gateway.php +++ b/includes/payment-methods/class-wc-stripe-upe-payment-gateway.php @@ -539,7 +539,7 @@ public function get_upe_enabled_at_checkout_payment_method_ids( $order_id = null /** * Returns the list of available payment method types for UPE. - * See https://stripe.com/docs/stripe-js/payment-element#web-create-payment-intent for a complete list. + * See https://docs.stripe.com/payments/accept-a-payment?platform=web&ui=elements#web-create-intent for a complete list. * * @return string[] */ @@ -577,7 +577,7 @@ public function payment_fields() { esc_html__( '%1$sTest mode:%2$s use the test VISA card 4242424242424242 with any expiry date and CVC. Other payment methods may redirect to a Stripe test page to authorize payment. More test card numbers are listed %3$shere%4$s.', 'woocommerce-gateway-stripe' ), '', '', - '', + '', '' ); ?> @@ -1847,9 +1847,9 @@ protected function stripe_request( $path, $params = null, $order = null, $method } /** - * Returns an array of address datato be used in a Stripe /payment_intents API request. + * Returns an array of address data to be used in a Stripe /payment_intents API request. * - * Stripe docs: https://stripe.com/docs/api/payment_intents/create#create_payment_intent-shipping + * Stripe docs: https://docs.stripe.com/api/payment_intents/create#create_payment_intent-shipping * * @since 7.7.0 * diff --git a/includes/payment-methods/class-wc-stripe-upe-payment-method-alipay.php b/includes/payment-methods/class-wc-stripe-upe-payment-method-alipay.php index e112c0906b..35de000fe7 100644 --- a/includes/payment-methods/class-wc-stripe-upe-payment-method-alipay.php +++ b/includes/payment-methods/class-wc-stripe-upe-payment-method-alipay.php @@ -42,7 +42,7 @@ public function __construct() { /** * Returns the currencies this UPE method supports for the Stripe account. - * Documentation: https://stripe.com/docs/payments/alipay#supported-currencies. + * Documentation: https://docs.stripe.com/payments/alipay#supported-currencies. * * @return array */ diff --git a/includes/payment-methods/class-wc-stripe-upe-payment-method-cc.php b/includes/payment-methods/class-wc-stripe-upe-payment-method-cc.php index 4fc6099f04..ec95c75da9 100644 --- a/includes/payment-methods/class-wc-stripe-upe-payment-method-cc.php +++ b/includes/payment-methods/class-wc-stripe-upe-payment-method-cc.php @@ -110,7 +110,7 @@ public function get_testing_instructions() { esc_html__( '%1$sTest mode:%2$s use the test VISA card 4242424242424242 with any expiry date and CVC. Other payment methods may redirect to a Stripe test page to authorize payment. More test card numbers are listed %3$shere%4$s.', 'woocommerce-gateway-stripe' ), '', '', - '', + '', '' ); } diff --git a/includes/payment-methods/class-wc-stripe-upe-payment-method-sepa.php b/includes/payment-methods/class-wc-stripe-upe-payment-method-sepa.php index 84ef27c808..2aa4804bc0 100644 --- a/includes/payment-methods/class-wc-stripe-upe-payment-method-sepa.php +++ b/includes/payment-methods/class-wc-stripe-upe-payment-method-sepa.php @@ -57,7 +57,7 @@ public function get_testing_instructions() { esc_html__( '%1$sTest mode:%2$s use the test account number AT611904300234573201. Other payment methods may redirect to a Stripe test page to authorize payment. More test card numbers are listed %3$shere%4$s.', 'woocommerce-gateway-stripe' ), '', '', - '', + '', '' ); } diff --git a/readme.txt b/readme.txt index 64e9c3c915..f646c583ac 100644 --- a/readme.txt +++ b/readme.txt @@ -121,5 +121,6 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o * Fix - Do not load express payment buttons on switch subscription page. * Fix - Return 'is_live' as true in account summary response when test mode is disabled in gateway settings and charge is enabled in Stripe account. * Fix - Prevents notices being displayed on WordPress 6.7 due to loading translations too early (only shown on stores with WP_DEBUG enabled). +* Tweak - Update links to plugin documentation and Stripe documentation. [See changelog for all versions](https://raw.githubusercontent.com/woocommerce/woocommerce-gateway-stripe/trunk/changelog.txt). diff --git a/tests/phpunit/test-class-wc-stripe-upe-payment-method.php b/tests/phpunit/test-class-wc-stripe-upe-payment-method.php index cc29dfb251..9416204cc0 100644 --- a/tests/phpunit/test-class-wc-stripe-upe-payment-method.php +++ b/tests/phpunit/test-class-wc-stripe-upe-payment-method.php @@ -251,7 +251,7 @@ public function test_payment_methods_show_correct_default_outputs() { $this->assertTrue( $card_method->is_reusable() ); $this->assertEquals( WC_Stripe_Payment_Methods::CARD, $card_method->get_retrievable_type() ); $this->assertEquals( - 'Test mode: use the test VISA card 4242424242424242 with any expiry date and CVC. Other payment methods may redirect to a Stripe test page to authorize payment. More test card numbers are listed here.', + 'Test mode: use the test VISA card 4242424242424242 with any expiry date and CVC. Other payment methods may redirect to a Stripe test page to authorize payment. More test card numbers are listed here.', $card_method->get_testing_instructions() ); @@ -285,7 +285,7 @@ public function test_payment_methods_show_correct_default_outputs() { $this->assertTrue( $sepa_method->is_reusable() ); $this->assertEquals( WC_Stripe_Payment_Methods::SEPA_DEBIT, $sepa_method->get_retrievable_type() ); $this->assertEquals( - 'Test mode: use the test account number AT611904300234573201. Other payment methods may redirect to a Stripe test page to authorize payment. More test card numbers are listed here.', + 'Test mode: use the test account number AT611904300234573201. Other payment methods may redirect to a Stripe test page to authorize payment. More test card numbers are listed here.', $sepa_method->get_testing_instructions() ); diff --git a/tests/phpunit/test-wc-stripe-webhook-state.php b/tests/phpunit/test-wc-stripe-webhook-state.php index ea56ee3b5d..06d76ff94f 100644 --- a/tests/phpunit/test-wc-stripe-webhook-state.php +++ b/tests/phpunit/test-wc-stripe-webhook-state.php @@ -97,7 +97,7 @@ private function set_valid_request_data( $overwrite_timestamp = null ) { // Headers $this->request_headers = [ - 'USER-AGENT' => 'Stripe/1.0 (+https://stripe.com/docs/webhooks)', + 'USER-AGENT' => 'Stripe/1.0 (+https://docs.stripe.com/webhooks)', 'CONTENT-TYPE' => 'application/json; charset=utf-8', 'STRIPE-SIGNATURE' => 't=' . $timestamp . ',v1=' . $signature, ];