Payment Response Handler

This is the PaymentResponse controller index page. It's used for testing and debugging payment responses.

Available Endpoints:

  • Success: /PaymentResponse/Success - Customer redirect after successful payment
  • Failed: /PaymentResponse/Failed - Customer redirect after failed payment
  • Notify: /PaymentResponse/Notify - Server-to-server notification from Fiserv
  • Notifications: /PaymentResponse/Notifications?orderId=ORDER123 - View payment notifications for an order
  • Refunds: /PaymentResponse/Refunds?orderId=ORDER123 - View refunds for an order
  • Logs: /PaymentResponse/Logs - View all database records

How it works:

  1. Customer completes payment on Fiserv's hosted page
  2. Fiserv redirects customer to responseSuccessURL or responseFailURL
  3. Fiserv also sends a server-to-server notification to transactionNotificationURL
  4. Our controller validates the signature and updates the order status
Note: The server-to-server notification is the authoritative source of truth for payment status. The customer redirect URLs are for user experience only.

Database Storage:

Payment notifications and refunds are now stored in a SQLite database located at App_Data/payments.db. This provides persistent storage between application restarts.

Refund Tracking:

The system now tracks refunds separately from payments, including:

  • Refund ID and original transaction ID
  • Refund amount and status
  • Approval codes and timestamps
  • Total refunded amount per order