Skip to content

fix: handle declined and error states in grant interaction page#654

Open
Onyx2406 wants to merge 1 commit intointerledger:mainfrom
Onyx2406:fix/grant-interaction-error-states
Open

fix: handle declined and error states in grant interaction page#654
Onyx2406 wants to merge 1 commit intointerledger:mainfrom
Onyx2406:fix/grant-interaction-error-states

Conversation

@Onyx2406
Copy link
Copy Markdown

@Onyx2406 Onyx2406 commented Apr 3, 2026

Summary

Fixes the grant interaction page showing success UI for all states, including failures.

Before: Declined grants and errors showed a green checkmark with "Payment Complete!" — misleading.

After:

  • Success → green checkmark, "Payment Complete!"
  • Declined (result=grant_rejected) → red X, "Interaction Failed" with "The grant request was declined."
  • Error (invalid params, server error) → red X with specific error message

Also renames the component from PaymentComplete to GrantInteraction to better reflect its purpose.

Changes

File Change
frontend/app/routes/payment-confirmation.tsx Add error/declined state handling, conditional UI rendering

Closes #480

The grant interaction page (payment-confirmation.tsx) previously
showed the success UI with a green checkmark for all states,
including declined grants and server errors. Users saw "Payment
Complete!" even when their grant was rejected.

Changes:
- Check the `result` query parameter for interaction outcome
  (grant_rejected, etc.) and display appropriate error UI
- Use the loader's `success` field to conditionally render
  success or error state with distinct icons and messaging
- Rename the component from PaymentComplete to GrantInteraction
  to better reflect its purpose
- Display the specific error message from the loader

Closes interledger#480
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.

[improvement] better handle state flow in grant interaction page

1 participant