From 233d7a88642927a30d59dc5f4fcc06bc023235d9 Mon Sep 17 00:00:00 2001 From: federico Date: Thu, 10 Jul 2025 11:47:44 +0100 Subject: [PATCH 1/2] [ACL-253] Add scheme_id field to Payout and Refund transactions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds support for the scheme_id field in merchant account /transactions endpoint responses for Payouts and Refunds. The scheme_id field provides information about the payment scheme used for executing payouts and refunds. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- CHANGELOG.md | 5 +++++ .../entities/transactions/Payout.java | 8 ++++++++ .../entities/transactions/Refund.java | 8 ++++++++ .../entities/transactions/TransactionTests.java | 4 ++++ .../merchant_accounts/200.get_transactions.json | 12 ++++++++---- 5 files changed, 33 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d1cfdab..5c51b850 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/). +## [17.3.0] - TBD +### Added +* Add support for `scheme_id` field in merchant account transaction responses for Payout and Refund transactions +* The `scheme_id` field provides information about the payment scheme used (e.g., "faster_payments_service", "sepa_credit_transfer", "internal_transfer") + ## [17.2.0] - 2025-04-16 ### Added * Add support for `deprecated_at` property to GET payment API response diff --git a/src/main/java/com/truelayer/java/merchantaccounts/entities/transactions/Payout.java b/src/main/java/com/truelayer/java/merchantaccounts/entities/transactions/Payout.java index 83e39603..c5d5d713 100644 --- a/src/main/java/com/truelayer/java/merchantaccounts/entities/transactions/Payout.java +++ b/src/main/java/com/truelayer/java/merchantaccounts/entities/transactions/Payout.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import com.truelayer.java.entities.CurrencyCode; import com.truelayer.java.entities.beneficiary.Beneficiary; +import com.truelayer.java.payouts.entities.SchemeId; import java.time.ZonedDateTime; import java.util.Map; import java.util.Optional; @@ -47,6 +48,8 @@ public class Payout extends Transaction { String payoutId; + SchemeId schemeId; + Map metadata; @JsonGetter @@ -59,6 +62,11 @@ public Optional getExecutedAt() { return Optional.ofNullable(executedAt); } + @JsonGetter + public Optional getSchemeId() { + return Optional.ofNullable(schemeId); + } + @RequiredArgsConstructor @Getter public enum ContextCode { diff --git a/src/main/java/com/truelayer/java/merchantaccounts/entities/transactions/Refund.java b/src/main/java/com/truelayer/java/merchantaccounts/entities/transactions/Refund.java index e4b56e5f..bc8681a6 100644 --- a/src/main/java/com/truelayer/java/merchantaccounts/entities/transactions/Refund.java +++ b/src/main/java/com/truelayer/java/merchantaccounts/entities/transactions/Refund.java @@ -3,6 +3,7 @@ import com.fasterxml.jackson.annotation.JsonGetter; import com.truelayer.java.entities.CurrencyCode; import com.truelayer.java.entities.beneficiary.PaymentSource; +import com.truelayer.java.payouts.entities.SchemeId; import java.time.ZonedDateTime; import java.util.Map; import java.util.Optional; @@ -37,6 +38,8 @@ public class Refund extends Transaction { String paymentId; + SchemeId schemeId; + Map metadata; @JsonGetter @@ -48,4 +51,9 @@ public Optional> getMetadata() { public Optional getExecutedAt() { return Optional.ofNullable(executedAt); } + + @JsonGetter + public Optional getSchemeId() { + return Optional.ofNullable(schemeId); + } } diff --git a/src/test/java/com/truelayer/java/merchantaccounts/entities/transactions/TransactionTests.java b/src/test/java/com/truelayer/java/merchantaccounts/entities/transactions/TransactionTests.java index aa695cd4..b759efcb 100644 --- a/src/test/java/com/truelayer/java/merchantaccounts/entities/transactions/TransactionTests.java +++ b/src/test/java/com/truelayer/java/merchantaccounts/entities/transactions/TransactionTests.java @@ -103,6 +103,7 @@ public void shouldYieldTrueIfPayout() { null, Payout.ContextCode.INTERNAL, UUID.randomUUID().toString(), + null, null); assertTrue(sut.isPayout()); @@ -121,6 +122,7 @@ public void shouldConvertToPayout() { null, Payout.ContextCode.INTERNAL, UUID.randomUUID().toString(), + null, null); assertDoesNotThrow(sut::asPayout); @@ -157,6 +159,7 @@ public void shouldYieldTrueIfRefund() { Payout.ContextCode.INTERNAL, UUID.randomUUID().toString(), UUID.randomUUID().toString(), + null, null); assertTrue(sut.isRefund()); @@ -176,6 +179,7 @@ public void shouldConvertToRefund() { Payout.ContextCode.INTERNAL, UUID.randomUUID().toString(), UUID.randomUUID().toString(), + null, null); assertDoesNotThrow(sut::asRefund); diff --git a/src/test/resources/__files/merchant_accounts/200.get_transactions.json b/src/test/resources/__files/merchant_accounts/200.get_transactions.json index ce59a792..8a8f5284 100644 --- a/src/test/resources/__files/merchant_accounts/200.get_transactions.json +++ b/src/test/resources/__files/merchant_accounts/200.get_transactions.json @@ -75,7 +75,8 @@ ] }, "context_code":"withdrawal", - "payout_id":"string" + "payout_id":"string", + "scheme_id":"faster_payments_service" }, { "type":"payout", @@ -104,7 +105,8 @@ "payout_id": "an-id" }, "context_code":"withdrawal", - "payout_id":"string" + "payout_id":"string", + "scheme_id":"sepa_credit_transfer" }, { "type":"payout", @@ -131,7 +133,8 @@ ] }, "context_code":"withdrawal", - "payout_id":"string" + "payout_id":"string", + "scheme_id":"internal_transfer" }, { "type":"refund", @@ -162,7 +165,8 @@ }, "context_code":"withdrawal", "refund_id":"an-id", - "payment_id":"another-id" + "payment_id":"another-id", + "scheme_id":"faster_payments_service" } ], "pagination": { From 9596842e232083a3af976dff82dd578966eabfe5 Mon Sep 17 00:00:00 2001 From: federico Date: Fri, 11 Jul 2025 11:21:57 +0100 Subject: [PATCH 2/2] Update version to 17.4.0 and fix CHANGELOG entries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add missing ACL-290 entry for version 17.3.0 (sub_merchants support) - Update ACL-253 entry to version 17.4.0 (scheme_id support) - Update gradle.properties version to 17.4.0 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- CHANGELOG.md | 6 +++++- gradle.properties | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c51b850..490fc97f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/). -## [17.3.0] - TBD +## [17.4.0] - TBD ### Added * Add support for `scheme_id` field in merchant account transaction responses for Payout and Refund transactions * The `scheme_id` field provides information about the payment scheme used (e.g., "faster_payments_service", "sepa_credit_transfer", "internal_transfer") +## [17.3.0] - 2025-04-16 +### Added +* Add sub_merchants support to Payments module + ## [17.2.0] - 2025-04-16 ### Added * Add support for `deprecated_at` property to GET payment API response diff --git a/gradle.properties b/gradle.properties index c698af81..56aee0a8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ # Main properties group=com.truelayer archivesBaseName=truelayer-java -version=17.3.0 +version=17.4.0 # Artifacts properties sonatype_repository_url=https://s01.oss.sonatype.org/service/local/