Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exposes order-confirmation api and adds confirmationNumber to order #1682

Merged
merged 3 commits into from
Jan 30, 2024

Conversation

thitemple
Copy link
Contributor

@thitemple thitemple commented Jan 26, 2024

Background

Partially resolves https://github.com/Shopify/checkout-web/issues/27818

Solution

Details for this solution can be found in this discussion

Essentially we are exposing a new API that is available for TYP and Customer Accounts named orderConfirmation which at moment contains the order.id and orderConfirmation.number, this same number will be expose as part of the order.

🎩

  • ...

Checklist

  • I have 🎩'd these changes
  • I have updated relevant documentation

@thitemple thitemple marked this pull request as ready for review January 26, 2024 21:07

This comment has been minimized.

Copy link
Contributor

@jamesvidler jamesvidler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes for the checkout surface need to have shipped in Shopify/checkout-web private package before they should be merged to the public package.

Can you open a PR on checkout-web for these same changes?

@thitemple
Copy link
Contributor Author

These changes for the checkout surface need to have shipped in Shopify/checkout-web private package before they should be merged to the public package.

Can you open a PR on checkout-web for these same changes?

https://github.com/Shopify/checkout-web/pull/29866

Adds confirmationNumber to order

Fixes formatting

Fixes formatting

Adds changeset

Removes order confirmation api from customer-account

Updates the order confimration number comment
Copy link
Contributor

@alxclark alxclark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, we can ship once the other two PRs hit production like James pointed out.

Copy link
Contributor

@jamesvidler jamesvidler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple small differences between checkout-web and ui-extensions to clean up and suggestion for the changelog description but otherwise looks good.

@@ -123,6 +123,10 @@ export type {
CheckoutApi,
} from './api/checkout/checkout';
export type {Order, OrderStatusApi} from './api/order-status/order-status';
export type {
OrderConfirmation,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the checkout-web PR, this export is missing OrderConfirmation. I assume this should be exported? Not a blocker for this PR, but ican do a follow-up PR in checkout-web to keep these in-sync?

For context, there is a script that will actually move these files over to ui-extensions so that they are always the same. In this case we are manually applying the same changes, so they need to be exact otherwise the next script run will overwrite this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can create a quick PR on checkout-web to do that

packages/ui-extensions/src/surfaces/checkout/targets.ts Outdated Show resolved Hide resolved
.changeset/smart-vans-serve.md Outdated Show resolved Hide resolved
thitemple and others added 2 commits January 30, 2024 11:16
Co-authored-by: James Vidler <12719665+jamesvidler@users.noreply.github.com>
@jamesvidler
Copy link
Contributor

jamesvidler commented Jan 30, 2024

To properly document this new API for checkout ui extensions, I've added this issue to follow-up after this PR. Since this is a new API type, there's a handful of small changes required.

@thitemple thitemple merged commit 75875cf into unstable Jan 30, 2024
5 checks passed
@pnmcosta
Copy link

Hi, just here to ask whether this how/will/when be included on ui-extensions-react?

Asking cause I'm in need of the Order Number on a Thank you Checkout UI extension and I've not been able to use any of the existing useOrder or useCustomer hooks.

Many thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants