For discussing the development and usage of Checkout UI extensions, post-purchase extensions, web pixels, Customer Accounts UI extensions, and POS UI extensions
I've created a Payment Method customization for a Merchant that hides or shows the specified payment method based on metafields for the customer.
When the customers account has the appropriate metafields with the appropriate values then the manual payment method will be shown. I have tested it successfully on a development shop and installed it today on the Merchants Plus shop, set up the function for the desired payment method and the required metafields.. but the function always hides they payment method (default if any of the metafields are not set or contain "invalid" values)
In the devshop I can see the output of the function but in the installed shop I can't see whats going on, what metafields values are getting read or what my debug output is.
Ive double and triple checked the metafield definitions to make sure that I didnt' have any stupid typos and they all pan out. It just doesn't seem to be working.
Anyone run into similar issues? Or have any pointers for me to dug this. I've been sitting here for hours trying to figure this out so far.
Cheers,
Gary
Solved! Go to the solution
This is an accepted solution.
Well this is embarrassing :).
I figured it out. Although I checked the spelling very carefully of the metafields, apparently I had mistakenly set one of the metafields from single_line_text_field to list.single_line_text_field without realizing. Obviously that value was not being correctly checked within my function as the graphql query was returning an array instead of a single value.
This is an accepted solution.
Well this is embarrassing :).
I figured it out. Although I checked the spelling very carefully of the metafields, apparently I had mistakenly set one of the metafields from single_line_text_field to list.single_line_text_field without realizing. Obviously that value was not being correctly checked within my function as the graphql query was returning an array instead of a single value.
Glad you figured this out Gary!
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Hi Garyrgilbert,
Hope you are doing well,
I am currently working on a app which is kind of similar to the one you made. Can you please help me for some doubts and errors. It will be very helpful for me if I get your guideness.
Thank you for your time,
Best regards,
Biptu
Hello Biptu,
Post a new question and then reference me in the question using @garyrgilbert and I should be notified of your post, I will help if I can 🙂
Cheers
Thank you for replying Gary. I am posting a question tagging you.
Hello Gary,
Hope you are well today,
I want to share you that I created a post referencing you four days ago.
Here is the link of the post https://community.shopify.com/c/shopify-apps/hide-certain-payment-method/td-p/2678252
Thanks and regards,
Biptu
Hi Biptu,
Yes sorry, was very busy the last while:)
Cheers,
Gary