What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Help Debugging Checkout Extension Payment Method

Solved

Help Debugging Checkout Extension Payment Method

garyrgilbert
Shopify Partner
431 41 186

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
431 41 186

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 7 (7)

garyrgilbert
Shopify Partner
431 41 186

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
Community Manager
3108 344 895

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

biptu
Shopify Partner
8 0 0

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

garyrgilbert
Shopify Partner
431 41 186

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

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

Thank you for replying Gary. I am posting a question tagging you.

biptu
Shopify Partner
8 0 0

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

garyrgilbert
Shopify Partner
431 41 186

Hi Biptu,

 

Yes sorry, was very busy the last while:)

 

Cheers,

Gary

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