Test Cases: Donations

⚠️ Gateway corrected — TraxionPay is fully removed. The donation feature is real on current code (POST /api/billing/donations, POST /api/billing/donations/invoice for online payment, GET /api/billing/admin/donations/report). Paynamics is the sole payment gateway — every "TraxionPay" reference below means Paynamics. Online donation payment creates an unpaid invoice and then routes through the standard Paynamics checkout; the authoritative sandbox channel codes and test-card values live in the Payments section (currently under active rewrite — do not trust the generic "Test Cards" table below). Manual-payment recording (Cash / Bank / Other) is admin-side and does not use the gateway.

Module: Billing & Invoicing - Donations

Priority: P1

Phase: 2

Backend Endpoints:

Frontend Pages:

Prerequisites

Test Data

FieldValue
Donor MemberMaria Cruz (MEM-2024-0004)
Donation Amount 1PHP 5,000.00 (500000 cents)
Donation Amount 2PHP 1,000.00 (100000 cents)
Donation Amount 3PHP 10,000.00 (1000000 cents)
CurrencyPHP
Admin UserAdmin User (ADMIN)
Finance ManagerAna Reyes (FINANCE_MANAGER)

Paynamics Sandbox Test Cards (placeholder — use the Payments section values)

Card TypeNumberExpiryCVVResult
Visa Success4111 1111 1111 111112/25123Approved
Mastercard Success5500 0000 0000 000412/25123Approved
Declined Card4000 0000 0000 000212/25123Declined

Test Cases

TC-BIL-061: Create Donation - Member Flow (Happy Path)

StepActionExpected Result
1Login as Maria Cruz (MEMBER).Dashboard displayed.
2Navigate to Donations page or "Make a Donation" link.Donation form displayed.
3Enter donation amount: PHP 5,000.00.Amount field populated.
4Verify currency is PHP (default).Currency shows PHP.
5Click "Continue" or "Donate".API POST /api/billing/donations called.
6Verify API response.Status 201 Created. Donation record created with amountCents: 500000, currency: PHP.
7Verify donation ID generated.Unique donation ID returned.
8Verify redirect to payment options.Payment method selection displayed.

TC-BIL-062: Create Donation - Validation Errors

StepActionExpected Result
1Navigate to Donations page (logged in as MEMBER).Donation form displayed.
2Click "Donate" without entering amount.Validation error: "Amount is required".
3Enter amount: 0.Validation error: "Amount must be greater than 0".
4Enter negative amount: -500.Validation error: "Amount must be greater than 0".
5Enter invalid characters: "abc".Validation error: "Invalid amount format".
6Enter valid amount: PHP 1,000.00.Amount accepted, able to proceed.

TC-BIL-063: Create Donation - Minimum Amount Validation

StepActionExpected Result
1Navigate to Donations page.Form displayed.
2Enter very small amount: PHP 0.01 (1 cent).Check if minimum donation threshold applies.
3Verify system behavior.Either accepted or "Minimum donation amount is PHP X" error.

TC-BIL-064: Create Donation Invoice

StepActionExpected Result
1Login as Maria Cruz (MEMBER).Dashboard displayed.
2Create donation: PHP 5,000.00.Donation created successfully.
3System creates invoice for donation.API POST /api/billing/donations/invoice called.
4Verify invoice created.Invoice generated with donation line item.
5Verify invoice details.Amount: PHP 5,000.00, Type: Donation, Status: PENDING.
6Verify invoice number format.Format: RCME-DON-0001 (seeded donation invoices use the RCME-DON- prefix; dues use RCME-DUES-, events RCME-EVT-).
7Verify member ID linked.Invoice linked to Maria Cruz (MEM-2024-0004).

TC-BIL-065: Create Donation Invoice - Guest/Unauthenticated User

StepActionExpected Result
1Access donation page without login (if allowed).Check if guest donations supported.
2Attempt POST /api/billing/donations without auth token.Status 401 Unauthorized.
3Verify error message."Authentication required" or redirect to login.

Payment Flow Test Cases

TC-BIL-066: Donation Payment via Paynamics - Success

StepActionExpected Result
1Login as Maria Cruz (MEMBER).Dashboard displayed.
2Create donation: PHP 5,000.00.Donation and invoice created.
3Select "Pay Online" payment option.Paynamics gateway initiated.
4Enter test card: 4111 1111 1111 1111.Card number accepted (Visa).
5Enter expiry: 12/25.Expiry accepted.
6Enter CVV: 123.CVV accepted.
7Click "Pay Now".Payment processing initiated.
8Wait for gateway response.Success response received.
9Verify redirect to success page."Donation Successful" or "Thank You" page displayed.
10Verify invoice status updated.Invoice status changed to PAID.
11Verify donation status updated.Donation marked as completed/paid.
12Verify payment record created.Payment record with gateway reference.

TC-BIL-067: Donation Payment via Paynamics - Declined Card

StepActionExpected Result
1Create donation: PHP 5,000.00.Donation created.
2Select "Pay Online".Gateway form displayed.
3Enter declined card: 4000 0000 0000 0002.Card entered.
4Complete form and submit.Processing initiated.
5Verify response."Payment declined" error displayed.
6Verify invoice unchanged.Invoice remains PENDING.
7Verify retry option available."Try Again" or alternative payment shown.

TC-BIL-068: Donation Payment via Paynamics - 3D Secure

StepActionExpected Result
1Create donation and proceed to payment.Gateway displayed.
2Use 3DS-enrolled test card (if available).Card entered.
3Submit payment.3DS challenge triggered.
4Complete 3DS verification (OTP).OTP entered and verified.
5Return to merchant site.Success page displayed.
6Verify payment completed.Invoice marked PAID, donation completed.

TC-BIL-069: Donation Payment via Bank Transfer (Manual)

StepActionExpected Result
1Login as Maria Cruz (MEMBER).Dashboard displayed.
2Create donation: PHP 5,000.00.Donation and invoice created.
3Select "Bank Transfer" payment option.Bank details displayed.
4View bank account details.Organization bank account info shown.
5Upload proof of payment (screenshot/receipt).File upload accepted (JPG, PNG, PDF).
6Enter reference number from bank.Reference field populated.
7Submit payment proof.API call to submit manual payment.
8Verify submission confirmation."Payment submitted for verification" message.
9Verify invoice status.Invoice status: PENDING (awaiting admin approval).
10Verify payment record created.Payment record with status PENDING_VERIFICATION.

TC-BIL-070: Donation Payment via GCash (Manual)

StepActionExpected Result
1Create donation: PHP 1,000.00.Donation created.
2Select "GCash" payment option.GCash payment instructions displayed.
3View GCash number/QR code.Organization GCash details shown.
4Upload payment screenshot.Screenshot file uploaded.
5Enter GCash reference number.Reference entered.
6Submit payment.Payment submitted for verification.
7Verify pending status.Invoice: PENDING, Payment: PENDING_VERIFICATION.

TC-BIL-071: Donation Payment via Maya (Manual)

StepActionExpected Result
1Create donation: PHP 2,500.00.Donation created.
2Select "Maya" payment option.Maya payment instructions displayed.
3View Maya account details.Organization Maya details shown.
4Upload payment proof.Proof uploaded.
5Enter Maya transaction reference.Reference entered.
6Submit payment.Payment submitted for verification.
7Verify pending status.Awaiting admin approval.

TC-BIL-072: Manual Payment Approval (Admin)

StepActionExpected Result
1Login as Ana Reyes (FINANCE_MANAGER).Dashboard displayed.
2Navigate to Admin > Payments (pending approvals).List of pending payments displayed.
3Locate Maria Cruz's donation payment.Payment record visible.
4View payment proof attachment.Uploaded proof viewable.
5Verify payment details match.Amount, reference number checked.
6Click "Approve Payment".Approval confirmation dialog.
7Confirm approval.Payment approved.
8Verify invoice status updated.Invoice status: PAID.
9Verify donation status updated.Donation marked as completed.
10Verify receipt email triggered.Email queued for member.

TC-BIL-073: Manual Payment Rejection (Admin)

StepActionExpected Result
1Login as FINANCE_MANAGER.Dashboard displayed.
2Navigate to pending payments.Pending list displayed.
3Locate a donation payment.Payment found.
4Click "Reject Payment".Rejection dialog opens.
5Enter rejection reason: "Invalid payment proof".Reason entered.
6Confirm rejection.Payment rejected.
7Verify invoice unchanged.Invoice remains PENDING.
8Verify notification sent to member.Email/notification about rejection.

Admin Reports Test Cases

TC-BIL-074: Donations Report - Admin Access

StepActionExpected Result
1Login as Admin User (ADMIN).Dashboard displayed.
2Navigate to Admin > Reports > Donations.Donations report page displayed.
3Verify API call.GET /api/billing/admin/donations/report called.
4Verify report columns displayed.Date, Donor, Amount, Status, Payment Method visible.
5Verify total donations summary.Sum of all donations displayed.

TC-BIL-075: Donations Report - Finance Manager Access

StepActionExpected Result
1Login as Ana Reyes (FINANCE_MANAGER).Dashboard displayed.
2Navigate to Donations Report.Report accessible.
3Verify full report functionality.All features available (Manager role).

TC-BIL-076: Donations Report - Date Range Filter

StepActionExpected Result
1Open Donations Report as ADMIN.Report displayed.
2Set date range: Start of current month to today.Filter applied.
3Verify filtered results.Only donations within range displayed.
4Verify totals recalculated.Sum updated for filtered period.

TC-BIL-077: Donations Report - Status Filter

StepActionExpected Result
1Open Donations Report.Report displayed.
2Filter by status: "Completed".Only completed donations shown.
3Filter by status: "Pending".Only pending donations shown.
4Clear filter to show all.All donations displayed.

TC-BIL-078: Donations Report - Export to CSV

StepActionExpected Result
1Open Donations Report with filters applied.Filtered report displayed.
2Click "Export CSV" or download button.CSV download initiated.
3Open downloaded CSV file.File contains filtered donation data.
4Verify CSV columns.Date, Donor Name, Amount, Status, Payment Method, Reference.
5Verify CSV totals row.Total amount included (if applicable).

TC-BIL-079: Donations Report - Permission Denied (Member)

StepActionExpected Result
1Login as Maria Cruz (MEMBER).Member dashboard displayed.
2Attempt to navigate to Admin > Donations Report.Menu not visible or access denied.
3Attempt direct API call GET /api/billing/admin/donations/report.Status 403 Forbidden.
4Verify error message."Access denied" or "Insufficient permissions".

Donation Receipt Email Test Cases

TC-BIL-080: Donation Receipt Email - Sent on Payment Success

StepActionExpected Result
1Complete donation payment (Paynamics or approved manual).Payment successful.
2Check MailHog for outgoing emails.Email queued.
3Verify recipient.Email sent to testmember@rcme.membervu.com.
4Verify subject line."Donation Receipt" or "Thank You for Your Donation".
5Verify email body contains donation details.Amount: PHP 5,000.00, Date, Reference/Invoice number.
6Verify organization name in email.Rotary Club of Manila Expats.
7Verify PDF attachment (if applicable).Donation receipt PDF attached.

TC-BIL-081: Donation Receipt Email - Content Verification

StepActionExpected Result
1Open donation receipt email.Email content displayed.
2Verify donor name."Dear Maria Cruz" or member name.
3Verify donation amount.PHP 5,000.00 displayed correctly.
4Verify donation date.Date of donation shown.
5Verify invoice/receipt number.Reference number included.
6Verify payment method."Credit Card" or "Bank Transfer" etc.
7Verify organization contact info.Contact details for questions.
8Verify thank you message.Appropriate acknowledgment text.

TC-BIL-082: Donation Receipt - No Email for Pending Payments

StepActionExpected Result
1Submit manual donation payment (not yet approved).Payment pending verification.
2Check MailHog for receipt email.No donation receipt sent.
3Verify only confirmation email (if any)."Payment submitted" notification, not receipt.
4Admin approves payment.Payment approved.
5Verify receipt email now sent.Receipt triggered after approval.

Donation History Test Cases

TC-BIL-083: Member View Own Donation History

StepActionExpected Result
1Login as Maria Cruz (MEMBER).Dashboard displayed.
2Navigate to Donations History or My Donations.Donation history page displayed.
3Verify own donations listed.All donations by Maria Cruz visible.
4Verify columns displayed.Date, Amount, Status, Receipt/Invoice link.
5Verify default sorting.Sorted by date (newest first).

TC-BIL-084: Member View Donation Details

StepActionExpected Result
1View donation history list.List displayed.
2Click on a donation entry.Donation detail view opens.
3Verify donation details.Amount, date, payment method, status displayed.
4Verify linked invoice visible.Invoice number with link to invoice detail.
5Verify receipt download option."Download Receipt" button (for completed donations).

TC-BIL-085: Download Donation Receipt from History

StepActionExpected Result
1Navigate to donation history.History displayed.
2Locate a completed donation.Donation with PAID status.
3Click "Download Receipt" or receipt icon.PDF download initiated.
4Verify PDF content.Receipt contains donation details, organization info.
5Verify PDF filename.Format: donation-receipt-YYYY-XXXX.pdf or similar.

TC-BIL-086: Member Cannot View Other Members' Donations

StepActionExpected Result
1Login as Maria Cruz (MEMBER).Dashboard displayed.
2View donation history.Only Maria Cruz's donations shown.
3Attempt to access another member's donation by URL manipulation.Access denied or 404 Not Found.
4Verify API endpoint restriction.Donations filtered by authenticated memberId.

TC-BIL-087: Donation History - Empty State

StepActionExpected Result
1Login as member with no previous donations.Dashboard displayed.
2Navigate to Donation History.Empty state displayed.
3Verify empty message."No donations yet" or similar message.
4Verify "Make a Donation" call-to-action.Link/button to start donating.

TC-BIL-088: Donation History - Pagination

StepActionExpected Result
1Login as member with many donations (>10).Dashboard displayed.
2View donation history.First page of donations displayed.
3Verify pagination controls.Page numbers or "Load More" visible.
4Navigate to next page.Additional donations loaded.
5Verify consistent sorting.Date order maintained across pages.

API Test Cases

TC-BIL-API-061: POST /api/billing/donations - Valid Request

Request:

{

"amountCents": 500000,

"currency": "PHP"

}

Headers: Authorization: Bearer

Expected Response: 201 Created

{

"id": "uuid",

"memberId": "MEM-2024-0004",

"amountCents": 500000,

"currency": "PHP",

"status": "PENDING",

"createdAt": "timestamp"

}

TC-BIL-API-062: POST /api/billing/donations - Missing Amount

Request:

{

"currency": "PHP"

}

Expected Response: 400 Bad Request

{

"error": "VALIDATION_ERROR",

"message": "amountCents is required"

}

TC-BIL-API-063: POST /api/billing/donations - Invalid Amount (Zero)

Request:

{

"amountCents": 0,

"currency": "PHP"

}

Expected Response: 400 Bad Request

{

"error": "VALIDATION_ERROR",

"message": "Amount must be greater than 0"

}

TC-BIL-API-064: POST /api/billing/donations - Invalid Amount (Negative)

Request:

{

"amountCents": -100000,

"currency": "PHP"

}

Expected Response: 400 Bad Request

{

"error": "VALIDATION_ERROR",

"message": "Amount must be greater than 0"

}

TC-BIL-API-065: POST /api/billing/donations - Unauthorized

Headers: No auth token or invalid token

Expected Response: 401 Unauthorized

{

"error": "UNAUTHORIZED",

"message": "Authentication required"

}

TC-BIL-API-066: POST /api/billing/donations/invoice - Create Invoice for Donation

Request:

{

"donationId": "donation-uuid"

}

Headers: Authorization: Bearer

Expected Response: 201 Created

{

"id": "uuid",

"invoiceNumber": "RCME-DON-XXXX",

"donationId": "donation-uuid",

"memberId": "MEM-2024-0004",

"amountCents": 500000,

"status": "PENDING",

"createdAt": "timestamp"

}

TC-BIL-API-067: GET /api/billing/admin/donations/report - Authorized (Manager)

Headers: Authorization: Bearer

Expected Response: 200 OK

{

"donations": [

{

"id": "uuid",

"memberName": "Maria Cruz",

"amountCents": 500000,

"currency": "PHP",

"status": "PAID",

"paymentMethod": "CARD",

"createdAt": "timestamp"

}

],

"totalCount": 15,

"totalAmountCents": 7500000,

"currency": "PHP"

}

TC-BIL-API-068: GET /api/billing/admin/donations/report - Unauthorized (Member)

Headers: Authorization: Bearer

Expected Response: 403 Forbidden

{

"error": "FORBIDDEN",

"message": "Insufficient permissions"

}

TC-BIL-API-069: GET /api/billing/admin/donations/report - With Date Filter

Request: GET /api/billing/admin/donations/report?startDate=2024-01-01&endDate=2024-12-31

Headers: Authorization: Bearer

Expected Response: 200 OK

{

"donations": [...],

"totalCount": 10,

"totalAmountCents": 5000000,

"currency": "PHP",

"dateRange": {

"start": "2024-01-01",

"end": "2024-12-31"

}

}


Edge Cases

TC-BIL-090: Large Donation Amount

StepActionExpected Result
1Create donation: PHP 1,000,000.00.Large amount entered.
2Verify system accepts amount.No overflow or formatting issues.
3Verify display formatting.PHP 1,000,000.00 displayed correctly.
4Verify payment gateway handles amount.Gateway accepts large transaction.

TC-BIL-091: Multiple Concurrent Donations

StepActionExpected Result
1Open two browser tabs as same member.Both tabs logged in.
2Initiate donation in both tabs simultaneously.Both donations created.
3Verify both donations tracked separately.Unique IDs, separate invoices.
4Verify no data corruption.Amounts and details correct for each.

TC-BIL-092: Donation During System Maintenance

StepActionExpected Result
1Simulate backend unavailable during payment.Error occurs.
2Verify graceful error handling.User-friendly error message.
3Verify no partial data.No orphaned donation or invoice records.
4Verify retry possible when system restored.User can restart donation flow.

Summary

CategoryTest Case Count
Create Donation (Member)4
Create Donation Invoice2
Payment via Paynamics3
Payment via Manual Methods5
Donations Report (Admin)6
Donation Receipt Email3
Donation History (Member)6
API Test Cases9
Edge Cases3
Total41