Automattic / woocommerce-payments

Accept payments via credit card. Manage transactions within WordPress.
https://wordpress.org/plugins/woocommerce-payments/
Other
175 stars 69 forks source link

Store name with special characters on express checkout payment sheets displays ascii code #9219

Closed pierorocca closed 2 weeks ago

pierorocca commented 3 months ago

Describe the bug

The store name displayed in the ECE implementation of express checkout displays an ascii code for special characters in the payment sheet.

image

To Reproduce

  1. Shop on my test store proccaatomic.wpcomstaging.com, called Piero's Atomic site
  2. Select Google Pay from the cart of PDP and note the ascii code

Expected behavior

Special characters are not displayed as ascii codes

cesarcosta99 commented 2 weeks ago

@pierorocca I did a quick investigation on this one and this is what I got:

When we're initializing ECE, we don't pass on any business information to the element, see example.

That value comes from the business name on Stripe and they set that on the payment sheet on their own. What's causing that on your site is that the business name text is misconfigured, probably from the moment you onboarded the store the first time. We can see that by looking at the GET https://api.stripe.com/v1/elements/sessions call, which returns, among other data, "business_name": "Piero's Atomic Site".

I went on the Stripe dashboard and manually set my local store's business name to Piero's Atomic and it was displayed correctly in the payment sheet.

Stripe dashboard Payment sheet
Image Image

I'm afraid this may not be an issue, at least on our end 🤔 and I guess this happens because at some point in the KYC flow Stripe takes that information and set the business name automatically without parsing special characters. @pierorocca, I don't know how we handle changes in the business information on our end, but maybe on a per request-basis?

pierorocca commented 2 weeks ago

Thanks for that sleuthing Cesar! Makes sense. Let's close this out please. TY!