Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/bold-numbers-guess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@godaddy/react": patch
---

[YOLO-3131] successUrl for Confirmation Page - PayLink
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,10 @@ export function useConfirmCheckout() {
},
});

redirectToSuccessUrl(session?.successUrl);
// Use the successUrl from the response (which has the orderId replaced) if available,
// otherwise fall back to the session successUrl
const successUrl = (data as any)?.successUrl || session?.successUrl;
redirectToSuccessUrl(successUrl);
},
onError: (error: unknown, data) => {
if (isCheckoutConfirmationBlockedError(error)) return;
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/lib/godaddy/checkout-mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,8 @@ export const ConfirmCheckoutSessionMutation = graphql(`
mutation ConfirmCheckoutSession($input: MutationConfirmCheckoutSessionInput!, $sessionId: String!) {
confirmCheckoutSession(input: $input, sessionId: $sessionId) {
status
successUrl
orderId
}
}
`);
Expand Down