Skip to content

[ACL-297] Include all refund statuses in RefundUnion for ListPaymentRefundsResponse#248

Closed
federico1525 wants to merge 6 commits intomainfrom
feature/acl-297-complete-refund-union
Closed

[ACL-297] Include all refund statuses in RefundUnion for ListPaymentRefundsResponse#248
federico1525 wants to merge 6 commits intomainfrom
feature/acl-297-complete-refund-union

Conversation

@federico1525
Copy link
Contributor

Summary

  • Updated RefundUnion type to include all four refund statuses: RefundPending, RefundAuthorized, RefundExecuted, and RefundFailed
  • Applied changes consistently across ListPaymentRefundsResponse.cs, IPaymentsApi.cs, and PaymentsApi.cs
  • Ensures parity between ListPaymentRefunds and GetPaymentRefund response types

Test plan

  • Verify code compiles without errors
  • Run existing unit tests to ensure no regressions
  • Test ListPaymentRefunds API with refunds in different statuses (if available in test environment)

🤖 Generated with Claude Code

federico1525 and others added 5 commits June 12, 2025 16:53
- 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>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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`)
Copy link

Copilot AI Jul 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
- 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.

Copilot uses AI. Check for mistakes.
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants