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 for Order Status page · Issue #2259 · Shopify/ui-extensions · GitHub
Please list the related package(s)
checkout-ui-extensions
If this related to specific APIs or components, please list them here
useSelectedPaymentOptions
Is your feature request related to a problem? Please describe.
Somewhere between 2024-04 and 2024-07 the documentation for the useSelectedPaymentOptions
method changed from:
The base API object provided to purchase, and customer-account.order-status extension targets.
to:
The base API object provided to purchase extension targets.
We would like the API to be consistent between the order status and thank you pages so that we can run identical code. We also wish to make a decision on both pages of what to show to a customer based on the payment method chosen so having it not work on one, but work on the other may cause different decisions to be made leading to different application behaviour.
Describe the changes you are looking for
Provide useSelectedPaymentOptions
on the Order Status page.
(Or, alternatively, provide documentation as to why it’s unavailable).
Describe alternatives you’ve considered
I’ve tried to identify why it was removed in a changelog, but I can find any reference in either:
The Updating Guide on Shopify.dev
or
The changelog for this repository
Documentation on changes like this would be appreciated - even if it’s a documentation mistake that was incorrect the first time.
Additional context
James Vidler from Shopify provided some additional context:
To clarify, the
purchase
extension targets do in-fact include the thank you page (purchase.thank-you
). The thank you page does have the ability to read the selected payment. However, thecustomer-account.order-status
page does not, since it is outside the context of a purchase (it has already happened). That being said, I can understand why it would be helpful to have the same API on the order status page. Thank you for your feedback, and we’ll take this into consideration as we look to unify APIs where it makes sense to.