---
title: clsPaymentReturn
summary: API reference for clsPaymentReturn.
status: draft
owner: SAIF
last_reviewed: 2026-07-24
library: SAIF.Business.Payment.EFT
reference_type: package
---

# clsPaymentReturn

`clsPaymentReturn` is the returned/failed EFT payment business object. It records returned ACH payments with their NACHA return reason codes, status, type, customer details, and payment amounts. The insert/update operations target the unqualified `PAYMENT_RETURN` table; reads go through the `PAYMENT_OWNER` schema with multi-table joins to retrieve full return context.

## Purpose
- Create return records when an ACH/EFT payment is returned by the bank (e.g., bad routing number, closed account).
- Retrieve full return detail including reason code descriptions (culture-aware via `PAYMENT_RETURN_REASON_GCODE`), payment detail, authorization, and authorization type information.
- Update return status (e.g., from pending to processed).

## Context
- Namespace: `SAIF.Business.Payment.EFT`
- Assembly/package: `SAIF.BOF.Business.Payment.EFT` (NuGet)
- Implements: `IBusinessCriteria`
- Inherits: `clsBusinessBase` (SAIF.BOF.Framework)

## Public members

| Member | Signature | Purpose |
| --- | --- | --- |
| `PaymentReturnSeqNum` | `Property PaymentReturnSeqNum As Decimal` | Primary key (`PAYMENT_RETURN_SEQ_NUM`). |
| `PaymentDetailSeqNum` | `Property PaymentDetailSeqNum As Decimal` | FK to `PAYMENT_DETAIL`. |
| `PaymentReturnReasonCode` | `Property PaymentReturnReasonCode As String` | NACHA return reason code (FK to `PAYMENT_RETURN_REASON_CODE`). |
| `ReturnStatusCode` | `Property ReturnStatusCode As String` | Return status (FK to `RETURN_STATUS_CODE`). |
| `ReturnTypeCode` | `Property ReturnTypeCode As String` | Return type (FK to `RETURN_TYPE_CODE`). |
| `CreditDebitCode` | `Property CreditDebitCode As String` | Credit or debit indicator. |
| `CustomerID` | `Property CustomerID As String` | Payee customer identifier. |
| `CustomerName` | `Property CustomerName As String` | Payee name at time of return. |
| `PaymentAmt` | `Property PaymentAmt As Decimal` | Original payment amount. |
| `ReturnDate` | `Property ReturnDate As Date` | Date the return was received. |
| `ReturnDetailLine` | `Property ReturnDetailLine As String` | Original detail line from the return file. |
| `ReturnAddendaLine` | `Property ReturnAddendaLine As String` | Addenda line from the return file. |
| `TraceNum` | `Property TraceNum As String` | ACH trace number. |
| `PaymentSourceSystemCode` | `Property PaymentSourceSystemCode As String` | Payment source system. |
| `CreateDate` | `Property CreateDate As Date` | Record creation date. |
| `CreateUser` | `Property CreateUser As String` | User who created the record. |
| `UpdateDate` | `Property UpdateDate As Date` | Last update date. |
| `UpdateUser` | `Property UpdateUser As String` | User who last updated the record. |

## Behavioral notes
- `CreateSQL` calls `SELECT PAYMENT_RETURN_SEQ.NEXTVAL FROM DUAL` before `InsertSQL`.*
- `RetrieveSQL` uses a multi-join query against `PAYMENT_OWNER.PAYMENT_RETURN` with left-outer joins to `PAYMENT_RETURN_REASON_GCODE`, `PAYMENT_OWNER.PAYMENT_DETAIL`, `PAYMENT_OWNER.PAYMENT_AUTHORIZATION`, and `PAYMENT_OWNER.AUTHORIZATION_TYPE_CODE`.*
- Return reason descriptions are culture-aware: the SQL applies a `CASE WHEN prrcG.code_descr IS NULL THEN CAST(prrc.CODE_DESCR...) ELSE prrcG.code_descr END` pattern.*
- `UpdateSQL` updates only `RETURN_STATUS_CODE`, `UPDATE_DATE`, and `UPDATE_USER`.*
- `RowsAffected = 1` enforced for all write operations.*

## Constraints and usage notes
- Insert targets the unqualified `PAYMENT_RETURN` table; reads target `PAYMENT_OWNER.PAYMENT_RETURN`. Ensure DB permissions exist for both access paths.*
- Return reason code classification (NACHA code) drives subsequent business processing such as authorization revocation; the exact state-transition rules were not fully traced.**

> **Note:** Statements marked with `*` were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with `**` could not be confirmed; treat as unknown until verified.

## Sources
- `Business\SAIF.Business.Payment.EFT\clsPaymentReturn.vb`
- `Business\SAIF.Business.Payment.EFT\clsPaymentReturnCollection.vb`
