diff --git a/changelog/fix-13-platform-checkout-brand-logo b/changelog/fix-13-platform-checkout-brand-logo new file mode 100644 index 00000000000..7fe89540116 --- /dev/null +++ b/changelog/fix-13-platform-checkout-brand-logo @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Fix platform checkout store logo preview. diff --git a/client/components/file-upload/preview.tsx b/client/components/file-upload/preview.tsx index a537830fe54..8dcb65c7ec7 100644 --- a/client/components/file-upload/preview.tsx +++ b/client/components/file-upload/preview.tsx @@ -4,7 +4,6 @@ * External dependencies */ import * as React from 'react'; -import { addQueryArgs } from '@wordpress/url'; /** * Internal dependencies. @@ -20,9 +19,8 @@ const FileUploadPreview = ( { fileName, showPreview, }: FileUploadProps ): JSX.Element => { - let url = + const url = wcpaySettings.restUrl + NAMESPACE.substring( 1 ) + '/file/' + fileName; - url = addQueryArgs( url, { as_account: 0 } ); return ( <> diff --git a/client/settings/express-checkout-settings/file-upload.tsx b/client/settings/express-checkout-settings/file-upload.tsx index 17e0ad3e58f..4dd8e1dc577 100644 --- a/client/settings/express-checkout-settings/file-upload.tsx +++ b/client/settings/express-checkout-settings/file-upload.tsx @@ -83,8 +83,6 @@ const PlatformCheckoutFileUpload: React.FunctionComponent< PlatformCheckoutFileU const body = new FormData(); body.append( 'file', file ); body.append( 'purpose', purpose ); - // Interpreting as_account as Boolean false in the backend - body.append( 'as_account', '0' ); try { const uploadedFile: unknown = await apiFetch( { diff --git a/client/settings/express-checkout-settings/platform-checkout-preview.js b/client/settings/express-checkout-settings/platform-checkout-preview.js index 85682f7cc0a..c10990f1fa8 100644 --- a/client/settings/express-checkout-settings/platform-checkout-preview.js +++ b/client/settings/express-checkout-settings/platform-checkout-preview.js @@ -3,7 +3,6 @@ * External dependencies */ import React from 'react'; -import { addQueryArgs } from '@wordpress/url'; /** * Internal dependencies. @@ -11,9 +10,8 @@ import { addQueryArgs } from '@wordpress/url'; import { NAMESPACE } from 'wcpay/data/constants'; export default ( { storeName, storeLogo, ...props } ) => { - let storeLogoUrl = + const storeLogoUrl = wcpaySettings.restUrl + NAMESPACE.substring( 1 ) + '/file/' + storeLogo; - storeLogoUrl = addQueryArgs( storeLogoUrl, { as_account: 0 } ); return ( <> diff --git a/includes/class-wc-payments.php b/includes/class-wc-payments.php index 29d5f9de005..f1b61abae11 100644 --- a/includes/class-wc-payments.php +++ b/includes/class-wc-payments.php @@ -1060,7 +1060,7 @@ public static function ajax_init_platform_checkout() { 'session_cookie_value' => wp_unslash( $_COOKIE[ $session_cookie_name ] ?? '' ), // phpcs:ignore WordPress.Security.ValidatedSanitizedInput 'store_data' => [ 'store_name' => get_bloginfo( 'name' ), - 'store_logo' => ! empty( $store_logo ) ? add_query_arg( 'as_account', '0', get_rest_url( null, 'wc/v3/payments/file/' . $store_logo ) ) : '', + 'store_logo' => ! empty( $store_logo ) ? get_rest_url( null, 'wc/v3/payments/file/' . $store_logo ) : '', 'custom_message' => self::get_gateway()->get_option( 'platform_checkout_custom_message' ), 'blog_id' => Jetpack_Options::get_option( 'id' ), 'blog_url' => get_site_url(),