Skip to content

Commit

Permalink
Pass appearance data when initiating WooPay via email input (#9310)
Browse files Browse the repository at this point in the history
  • Loading branch information
malithsen committed Aug 23, 2024
1 parent 0d017f6 commit f9fc6a1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions changelog/fix-woopay-themeing-on-email-flow
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Pass appearance data when initiating WooPay via the email input flow
6 changes: 6 additions & 0 deletions client/checkout/woopay/email-input-iframe.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import { getConfig } from 'wcpay/utils/checkout';
import { recordUserEvent, getTracksIdentity } from 'tracks';
import request from '../utils/request';
import { buildAjaxURL } from 'utils/express-checkout';
import { getAppearance } from 'checkout/upe-styles';
import {
getTargetElement,
getAppearanceType,
validateEmail,
appendRedirectionParams,
shouldSkipWooPay,
Expand Down Expand Up @@ -177,6 +179,7 @@ export const handleWooPayEmailInput = async (
iframe.addEventListener( 'load', () => {
// Set the initial value.
iframeHeaderValue = true;
const appearanceType = getAppearanceType();

if ( getConfig( 'isWoopayFirstPartyAuthEnabled' ) ) {
request(
Expand All @@ -186,6 +189,9 @@ export const handleWooPayEmailInput = async (
order_id: getConfig( 'order_id' ),
key: getConfig( 'key' ),
billing_email: getConfig( 'billing_email' ),
appearance: getConfig( 'isWooPayGlobalThemeSupportEnabled' )
? getAppearance( appearanceType )
: null,
}
).then( ( response ) => {
if ( response?.data?.session ) {
Expand Down

0 comments on commit f9fc6a1

Please sign in to comment.