Skip to content

Commit dde4910

Browse files
federico1525claudedili91
authored
[ACL-253] Add scheme_id field to Payout and Refund transactions (#366)
Co-authored-by: Claude <[email protected]> Co-authored-by: Andrea Di Lisio <[email protected]>
1 parent 580a2ce commit dde4910

File tree

6 files changed

+38
-5
lines changed

6 files changed

+38
-5
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/).
77

8+
## [17.4.0] - TBD
9+
### Added
10+
* Add support for `scheme_id` field in merchant account transaction responses for Payout and Refund transactions
11+
* The `scheme_id` field provides information about the payment scheme used (e.g., "faster_payments_service", "sepa_credit_transfer", "internal_transfer")
12+
13+
## [17.3.0] - 2025-04-16
14+
### Added
15+
* Add sub_merchants support to Payments module
16+
817
## [17.2.0] - 2025-04-16
918
### Added
1019
* Add support for `deprecated_at` property to GET payment API response

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Main properties
22
group=com.truelayer
33
archivesBaseName=truelayer-java
4-
version=17.3.1
4+
version=17.4.0
55

66
# Artifacts properties
77
project_name=TrueLayer Java

src/main/java/com/truelayer/java/merchantaccounts/entities/transactions/Payout.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.fasterxml.jackson.annotation.JsonValue;
55
import com.truelayer.java.entities.CurrencyCode;
66
import com.truelayer.java.entities.beneficiary.Beneficiary;
7+
import com.truelayer.java.payouts.entities.SchemeId;
78
import java.time.ZonedDateTime;
89
import java.util.Map;
910
import java.util.Optional;
@@ -47,6 +48,8 @@ public class Payout extends Transaction {
4748

4849
String payoutId;
4950

51+
SchemeId schemeId;
52+
5053
Map<String, String> metadata;
5154

5255
@JsonGetter
@@ -59,6 +62,11 @@ public Optional<ZonedDateTime> getExecutedAt() {
5962
return Optional.ofNullable(executedAt);
6063
}
6164

65+
@JsonGetter
66+
public Optional<SchemeId> getSchemeId() {
67+
return Optional.ofNullable(schemeId);
68+
}
69+
6270
@RequiredArgsConstructor
6371
@Getter
6472
public enum ContextCode {

src/main/java/com/truelayer/java/merchantaccounts/entities/transactions/Refund.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.fasterxml.jackson.annotation.JsonGetter;
44
import com.truelayer.java.entities.CurrencyCode;
55
import com.truelayer.java.entities.beneficiary.PaymentSource;
6+
import com.truelayer.java.payouts.entities.SchemeId;
67
import java.time.ZonedDateTime;
78
import java.util.Map;
89
import java.util.Optional;
@@ -37,6 +38,8 @@ public class Refund extends Transaction {
3738

3839
String paymentId;
3940

41+
SchemeId schemeId;
42+
4043
Map<String, String> metadata;
4144

4245
@JsonGetter
@@ -48,4 +51,9 @@ public Optional<Map<String, String>> getMetadata() {
4851
public Optional<ZonedDateTime> getExecutedAt() {
4952
return Optional.ofNullable(executedAt);
5053
}
54+
55+
@JsonGetter
56+
public Optional<SchemeId> getSchemeId() {
57+
return Optional.ofNullable(schemeId);
58+
}
5159
}

src/test/java/com/truelayer/java/merchantaccounts/entities/transactions/TransactionTests.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ public void shouldYieldTrueIfPayout() {
103103
null,
104104
Payout.ContextCode.INTERNAL,
105105
UUID.randomUUID().toString(),
106+
null,
106107
null);
107108

108109
assertTrue(sut.isPayout());
@@ -121,6 +122,7 @@ public void shouldConvertToPayout() {
121122
null,
122123
Payout.ContextCode.INTERNAL,
123124
UUID.randomUUID().toString(),
125+
null,
124126
null);
125127

126128
assertDoesNotThrow(sut::asPayout);
@@ -157,6 +159,7 @@ public void shouldYieldTrueIfRefund() {
157159
Payout.ContextCode.INTERNAL,
158160
UUID.randomUUID().toString(),
159161
UUID.randomUUID().toString(),
162+
null,
160163
null);
161164

162165
assertTrue(sut.isRefund());
@@ -176,6 +179,7 @@ public void shouldConvertToRefund() {
176179
Payout.ContextCode.INTERNAL,
177180
UUID.randomUUID().toString(),
178181
UUID.randomUUID().toString(),
182+
null,
179183
null);
180184

181185
assertDoesNotThrow(sut::asRefund);

src/test/resources/__files/merchant_accounts/200.get_transactions.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@
7575
]
7676
},
7777
"context_code":"withdrawal",
78-
"payout_id":"string"
78+
"payout_id":"string",
79+
"scheme_id":"faster_payments_service"
7980
},
8081
{
8182
"type":"payout",
@@ -104,7 +105,8 @@
104105
"payout_id": "an-id"
105106
},
106107
"context_code":"withdrawal",
107-
"payout_id":"string"
108+
"payout_id":"string",
109+
"scheme_id":"sepa_credit_transfer"
108110
},
109111
{
110112
"type":"payout",
@@ -131,7 +133,8 @@
131133
]
132134
},
133135
"context_code":"withdrawal",
134-
"payout_id":"string"
136+
"payout_id":"string",
137+
"scheme_id":"internal_transfer"
135138
},
136139
{
137140
"type":"refund",
@@ -162,7 +165,8 @@
162165
},
163166
"context_code":"withdrawal",
164167
"refund_id":"an-id",
165-
"payment_id":"another-id"
168+
"payment_id":"another-id",
169+
"scheme_id":"faster_payments_service"
166170
}
167171
],
168172
"pagination": {

0 commit comments

Comments
 (0)