Skip to content

add payment status dialog and enhance bill payment flow#43

Merged
deveasyclick merged 1 commit intomainfrom
feat/payment-dialog
Nov 24, 2025
Merged

add payment status dialog and enhance bill payment flow#43
deveasyclick merged 1 commit intomainfrom
feat/payment-dialog

Conversation

@deveasyclick
Copy link
Owner

This PR introduces a new PaymentStatusDialog component to provide users with a visual confirmation of their bill payment status. It also updates the useBillPayment hook and payment-related types to handle enhanced metadata, payment references, and statuses. Additionally, the PaymentProvider now integrates the dialog for a smoother client experience.


Changes

  1. PaymentStatusDialog

    • New PaymentStatusDialog component that displays:

      • Loading state with spinner.
      • Success state with reference, amount, and metadata.
      • Error state with message and metadata.
    • Prevents closing while a payment is in progress.

  2. Dialog UI Components

    • Added reusable Dialog components using Radix UI.
    • Includes Dialog, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, DialogOverlay, and DialogTrigger.
  3. useBillPayment hook

    • Added dialog state handling (isDialogOpen).
    • Returns closeDialog() to reset state after closing.
    • Keeps SSR-safe dynamic import of browser-only Paystack SDK.
    • Updated hook to integrate with PaymentStatusDialog.
  4. PaymentProvider

    • Integrates PaymentStatusDialog with useBillPayment for client-side display.
    • Provides dialog context to children via PaymentContext.
  5. Types

    • Updated PayBillResponse type:

      • TransactionRef, ApprovedAmount, and old response fields removed.
      • Added paymentRef, amount, status, and metadata fields.
  6. Dependencies

    • Added @radix-ui/react-dialog for the dialog components.

Benefits

  • Provides clear, interactive feedback for users during bill payments.
  • Maintains SSR-safe execution by dynamically loading browser-only libraries.
  • Standardizes dialog UI across the application.

…s, and enhance bill payment forms with new parameters.
@vercel
Copy link

vercel bot commented Nov 24, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
billpay Ready Ready Preview Comment Nov 24, 2025 6:26pm

@deveasyclick deveasyclick merged commit 36d876e into main Nov 24, 2025
2 of 4 checks passed
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.

1 participant