As requested in [IMPORTANT] Stop creating issues here, use the Shopify Community forum instead · Issue #2521 · Shopify/ui-extensions · GitHub, I am re-raising this issue.
Please find below the details of useSelectedPaymentOptions can return undocumented `undefined` · Issue #2257 · Shopify/ui-extensions · GitHub
Please list the package(s) involved in the issue, and include the version you are using
checkout-ui-extensions
Describe the bug
The documentation for useSelectedPaymentOptions
is defined as returning a number of values for handle
here.
Those options for handle
do not include undefined
.
Steps to reproduce the behavior:
- Make a purchase using a bogus payment gateway, with a fake credit card
- Check the output of
useSelectedPaymentOptions
- Confirm the
handle
isundefined
Worth noting, we can see it in production too - with real clients with real payment methods. We don’t have access to these transactions so we don’t know why this happens.
Expected behavior
I’d expect either:
- The documentation to explain the value can be undefined for some cases and to explain why.
- The code should be updated to never return undefined as per the current documentation.
Screenshots
An example of undefined:
Additional context
I assume this is unrelated to #2068 - but referencing it here for completeness.