Shopify / shopify-api-php

MIT License
378 stars 173 forks source link

Can't register consent in the Customer Privacy API #369

Closed consentmo closed 2 hours ago

consentmo commented 2 hours ago

We are having with the our app’s Hydrogen integration is regarding not being able to register consent in the Customer Privacy API. The error message we receive on when running the store in development mode is - POST https://checkout.shoesforuse.myshopify.com/api/unstable/graphql.json net::ERR_CERT_COMMON_NAME_INVALID. When we deploy the changes on the live store we receive an error regarding an extraneous country key being set.

These are the steps to reproduce the issue:

  1. Create a hydrogen storefront.
  2. Add a Custom Variable with key PUBLIC_CHECKOUT_DOMAIN and value checkout.shoesforuse.myshopify.com
  3. Add a Script component to load the Customer Privacy API.
  4. Set the Consent Security Policy’s withPrivacyBanner option to false.
  5. Create the component ThirdPartyConsent from the example provided in the Shopify documentation. After that change the thirdPartyConsentSdkUrl to a url that contain test data that sets all consent categories to true, and then add the url to the Consent Security Policy’s defaultSrc property in order for the script to not be blocked.
  6. Include the ThirdPartyConsent component in the body of the store right bellow the script that loads the Customer Privacy API.
consentmo commented 2 hours ago

Opened in hydrogen repo https://github.com/Shopify/hydrogen/issues/2553