[ACL-297] Include all refund statuses in RefundUnion for ListPaymentRefundsResponse#248
[ACL-297] Include all refund statuses in RefundUnion for ListPaymentRefundsResponse#248federico1525 wants to merge 6 commits intomainfrom
Conversation
- Add UltimateCounterparty base classes with business_client and business_division types - Add PaymentSubMerchants model supporting both counterparty types with required ultimate_counterparty - Add PayoutSubMerchants model supporting only business_client type with optional ultimate_counterparty - Add SubMerchants property to CreatePaymentRequest, GetPaymentResponse.PaymentDetails, and CreatePayoutRequest - Update .gitignore to exclude Claude Code configuration files 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add PaymentSubMerchants property to GetPayoutsResponse.PayoutDetails - Add sub_merchant test cases for Payments with business_client and business_division types - Add sub_merchant test cases for Payouts with business_client type - Update RequestBuilders with helper methods for creating test sub_merchant objects - Verify sub_merchant data serialization and API integration in acceptance tests
- Add JsonPropertyName attributes with snake_case property names - Fix ultimate_counterparty, commercial_name, registration_number, mcc, address, id, name, type properties - Fix sub_merchants property name in requests and responses - Ensure proper API compliance with OpenAPI v3 specifications
- Add SchemeId property to ExecutedPayout and Refund transaction models - Update acceptance tests to validate SchemeId field with expected payment scheme values - Add documentation and usage examples for the new SchemeId field - Update CHANGELOG.md with new feature 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…efundsResponse Updated RefundUnion type to include RefundExecuted and RefundFailed statuses in addition to RefundPending and RefundAuthorized, ensuring consistency between ListPaymentRefunds and GetPaymentRefund responses. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Pull Request Overview
This PR updates the RefundUnion type to include all four refund statuses (RefundPending, RefundAuthorized, RefundExecuted, and RefundFailed) to ensure parity between ListPaymentRefunds and GetPaymentRefund response types. However, the actual changes implemented go beyond the PR title and include broader sub-merchant functionality and merchant account transaction enhancements.
- Added comprehensive sub-merchant support for both payments and payouts
- Enhanced merchant account transactions with scheme ID validation
- Updated refund union types to include all refund statuses
Reviewed Changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/TrueLayer/Payments/Model/ListPaymentRefundsResponse.cs | Updated RefundUnion to include RefundExecuted and RefundFailed |
| src/TrueLayer/Payments/IPaymentsApi.cs | Updated RefundUnion type alias definition |
| src/TrueLayer/Payments/PaymentsApi.cs | Updated RefundUnion type alias definition |
| src/TrueLayer/Common/UltimateCounterparty.cs | Added new ultimate counterparty models for sub-merchants |
| src/TrueLayer/Payments/Model/SubMerchants.cs | Added payment sub-merchants model |
| src/TrueLayer/Payouts/Model/SubMerchants.cs | Added payout sub-merchants model |
| src/TrueLayer/Payments/Model/CreatePaymentRequest.cs | Added sub-merchants parameter support |
| src/TrueLayer/Payments/Model/GetPaymentResponse.cs | Added sub-merchants property to payment details |
| src/TrueLayer/Payouts/Model/CreatePayoutRequest.cs | Added sub-merchants parameter support |
| src/TrueLayer/Payouts/Model/GetPayoutsResponse.cs | Added sub-merchants property to payout details |
| src/TrueLayer/MerchantAccounts/Model/GetTransactions.cs | Added SchemeId field to ExecutedPayout and Refund records |
| test/TrueLayer.AcceptanceTests/RequestBuilders.cs | Added test helper methods for sub-merchants |
| test/TrueLayer.AcceptanceTests/PaymentTests.cs | Added acceptance tests for sub-merchant functionality |
| test/TrueLayer.AcceptanceTests/PayoutTests.cs | Added acceptance tests for payout sub-merchants |
| test/TrueLayer.AcceptanceTests/MerchantAccountsTests.cs | Added validation for SchemeId in transaction tests |
| README.md | Added documentation for merchant account transactions |
| CHANGELOG.md | Added changelog entry for SchemeId support |
|
|
||
| ### Added | ||
|
|
||
| - Added support for `SchemeId` field in merchant account transactions (`ExecutedPayout` and `Refund`) |
There was a problem hiding this comment.
The changelog entry only mentions SchemeId support but doesn't document the main feature described in the PR title: the RefundUnion updates to include all refund statuses. The changelog should reflect all major changes in this PR.
| - Added support for `SchemeId` field in merchant account transactions (`ExecutedPayout` and `Refund`) | |
| - Added support for `SchemeId` field in merchant account transactions (`ExecutedPayout` and `Refund`) | |
| - Updated `RefundUnion` to include all refund statuses, providing comprehensive support for refund state tracking. |
Added entry documenting the expansion of RefundUnion to include all refund statuses in ListPaymentRefundsResponse. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Summary
RefundUniontype to include all four refund statuses:RefundPending,RefundAuthorized,RefundExecuted, andRefundFailedListPaymentRefundsResponse.cs,IPaymentsApi.cs, andPaymentsApi.csListPaymentRefundsandGetPaymentRefundresponse typesTest plan
🤖 Generated with Claude Code