Solved

Help Debugging Checkout Extension Payment Method

garyrgilbert
Shopify Partner
391 40 162

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

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
Accepted Solution (1)

garyrgilbert
Shopify Partner
391 40 162

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.

 

 

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution

View solution in original post

Replies 2 (2)

garyrgilbert
Shopify Partner
391 40 162

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.

 

 

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
Liam
Shopify Staff
2731 298 769

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