For discussing the development and usage of Checkout UI extensions, post-purchase extensions, web pixels, Customer Accounts UI extensions, and POS UI extensions
I'm creating payment customization app using Javascript. I used reserved prefix for namespace with reference to the following tutrial.
https://shopify.dev/docs/apps/checkout/payment-customizations/ui
By referring to Step2 of the tutorial, I tried the following input.graphql to get metafield value, but I couldn't.
query Input {
paymentCustomization {
metafield(namespace: "$app:payment-customization", key: "function-config") {
value
}
}
}
When I used actual value (SHOPIFY_API_KEY) instead of $app, it worked fine.
query Input {
paymentCustomization {
metafield(namespace: "XXXXXXXXXXXX:payment-customization", key: "function-config") {
value
}
}
}
I must have forgotten some procedure.
How can I set $app value?
Thank you.
Hi could you share what error was returned to you when you used $app:payment-customization.
To learn more visit the Shopify Help Center or the Community Blog.
Hi, thank you for your message.
I'm using of Shopify CLI (3.48.4) and I had no errors in running typegen or deploy the extension. I have made index.js that only displays input values in standard error that we can see in Shopify Partners page.
...
(input) => {
console.error(JSON.stringify(input));
...
}
When I used $app in input.graphql, I got standard error like this.
{
"paymentCustomization": {
"metafield": null
}
}
When I used actual value (SHOPIFY_API_KEY), I got the followings that I set.
{
"paymentCustomization": {
"metafield": {
"value": "{\"methods\":[{\"name\":\"Cash on Delivery (COD)\",\"label\":\"\",\"active\":true,\"rules\":[]}]}"
}
}
}
I have no idea how I should set $app value.
Thank you.