Skip to content
Draft
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/acceptance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Setup JDK
uses: actions/setup-java@v4
with:
java-version: '21'
java-version: '25'
distribution: 'temurin'
cache: 'gradle'
- name: Validate Gradle wrapper
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-test-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
matrix:
os: [ ubuntu-latest ]
java-distribution: [ temurin ]
java-version: [ 11, 17, 20, 21, 22, 23 ]
java-version: [ 11, 17, 20, 23, 25 ]
runs-on: ${{ matrix.os }}
outputs:
project_version: ${{ steps.get_project_version.outputs.project_version }}
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
- name: Setup JDK
uses: actions/setup-java@v4
with:
java-version: '21'
java-version: '25'
distribution: 'temurin'
cache: 'gradle'
- name: Validate Gradle wrapper
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Setup JDK
uses: actions/setup-java@v4
with:
java-version: '21'
java-version: '25'
distribution: 'temurin'
cache: 'gradle'
- name: Validate Gradle wrapper
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/workflow-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Setup JDK
uses: actions/setup-java@v4
with:
java-version: '21'
java-version: '25'
distribution: 'temurin'
cache: 'gradle'
- name: Validate Gradle wrapper
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/workflow-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Setup JDK
uses: actions/setup-java@v4
with:
java-version: '21'
java-version: '25'
distribution: 'temurin'
cache: 'gradle'
- name: Validate Gradle wrapper
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +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/).

## [18.0.0] - 2025-x-x
### Added
* icon object to ProviderSelection in authorization flow requests

### Changed
* ⚠️ Breaking: replaced the `withProviderSelection()` flag on authorization flow request builder with a `providerSelection(...)` utility
that helps to set the provider icon object if needed.
* Various dependency updates

## [17.5.1] - 2025-10-31
### Fixed
* Update Sonatype Central badge url in order to show latest version
Expand Down
56 changes: 34 additions & 22 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import com.vanniktech.maven.publish.JavadocJar
plugins {
id 'java-library'
// to unleash the lombok magic
id "io.freefair.lombok" version "8.13.1"
id "io.freefair.lombok" version "9.1.0"
// to make our tests output more fancy
id 'com.adarshr.test-logger' version '4.0.0'
// code linting
id "com.diffplug.spotless" version "7.0.3"
id "com.diffplug.spotless" version "8.1.0"
// test coverage
id 'jacoco'
id 'com.github.kt3k.coveralls' version '2.12.2'
Expand Down Expand Up @@ -58,7 +58,17 @@ testlogger {
theme 'mocha'
}

tasks.withType(Test).configureEach {
testlogger {
theme 'mocha'
}
}

tasks.register('unit-tests', Test) {
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath

dependsOn testClasses
outputs.upToDateWhen { false }
useJUnitPlatform{
excludeTags "integration"
Expand All @@ -67,13 +77,21 @@ tasks.register('unit-tests', Test) {
}

tasks.register('integration-tests', Test) {
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath

dependsOn testClasses
outputs.upToDateWhen { false }
useJUnitPlatform{
includeTags "integration"
}
}

tasks.register('acceptance-tests', Test) {
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath

dependsOn testClasses
outputs.upToDateWhen { false }
useJUnitPlatform{
includeTags "acceptance"
Expand All @@ -84,46 +102,40 @@ tasks.register('acceptance-tests', Test) {

dependencies {
// Utilities
implementation group: 'org.apache.commons', name: 'commons-configuration2', version: '2.11.0'
implementation group: 'org.apache.commons', name: 'commons-configuration2', version: '2.13.0'

// HTTP client
def retrofitVersion = '2.9.0'
def retrofitVersion = '3.0.0'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is huge and to be validated. They have updated the underlying OkHTTP version

implementation group: 'com.squareup.retrofit2', name: 'retrofit', version: retrofitVersion
implementation group: 'com.squareup.retrofit2', name: 'converter-jackson', version: retrofitVersion

// TL signing library
implementation group: 'com.truelayer', name: 'truelayer-signing', version: '0.2.6'

// Serialization
def jacksonVersion = '2.14.1'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: jacksonVersion
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: jacksonVersion
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jdk8', version: jacksonVersion
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: jacksonVersion
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: jacksonVersion
def jacksonVersion = '3.0.3'
implementation group: 'tools.jackson.core', name: 'jackson-core', version: jacksonVersion
implementation group: 'tools.jackson.core', name: 'jackson-databind', version: jacksonVersion
def jacksonDatatypeVersion = '2.20.1'
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jdk8', version: jacksonDatatypeVersion
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: jacksonDatatypeVersion
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.20'

// Logging
def tinyLogVersion = '2.5.0'
def tinyLogVersion = '2.7.0'
implementation group: 'org.tinylog', name: 'tinylog-api', version: tinyLogVersion
implementation group: 'org.tinylog', name: 'tinylog-impl', version: tinyLogVersion

// JUnit test framework.
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter', version: '5.12.2'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter', version: '6.0.1'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

// Mocking libraries
testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.17.0'
testImplementation group: 'org.wiremock', name: 'wiremock', version: '3.12.1'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.21.0'
testImplementation group: 'org.wiremock', name: 'wiremock', version: '3.13.2'

// Wait test utility
testImplementation group: 'org.awaitility', name: 'awaitility', version: '4.3.0'

// Transitive dependencies constraints
constraints {
implementation('com.squareup.okhttp3:okhttp:4.12.0') {
because 'version 3.14.9 used by com.squareup.retrofit2:retrofit:2.9.0 has known vulnerabilities'
}
}
}

jacocoTestReport {
Expand All @@ -132,7 +144,7 @@ jacocoTestReport {
xml.required = true
html.required = true
}
getExecutionData().setFrom(fileTree(buildDir).include("/jacoco/unit-tests.exec"))
getExecutionData().setFrom(fileTree(rootProject.layout.buildDirectory).include("/jacoco/unit-tests.exec"))
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Main properties
group=com.truelayer
archivesBaseName=truelayer-java
version=17.5.1
version=18.0.0

# Artifacts properties
project_name=TrueLayer Java
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/com/truelayer/java/entities/ResourceType.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
@RequiredArgsConstructor
@Getter
public enum ResourceType {
// TODO: can this be deprecated? We should leverage the HPP URI generated by the payments-gateway instead.
// note that deprecating would probably mean creating a new type for our test utils
PAYMENT("payments", "payment_id", HPP),
Comment on lines +12 to 14
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO


MANDATE("mandates", "mandate_id", HPP),
PAYOUT("payouts", "payout_id", HP2),
;
PAYOUT("payouts", "payout_id", HP2);

private final String hppLinkPath;
private final String hppLinkQueryParameter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,9 @@ public class CreatePaymentRequest {
* Optional field for sub-merchant details
*/
private SubMerchants subMerchants;

/**
* Optional field for configuring the authorization flow
*/
private StartAuthorizationFlowRequest authorizationFlow;
}
Original file line number Diff line number Diff line change
@@ -1,27 +1,55 @@
package com.truelayer.java.payments.entities;

import com.fasterxml.jackson.annotation.JsonValue;
import com.truelayer.java.payments.entities.paymentdetail.forminput.Input;
import java.net.URI;
import java.util.List;
import java.util.Map;
import lombok.*;

@Getter
@RequiredArgsConstructor
@Builder
@ToString
@EqualsAndHashCode
public class StartAuthorizationFlowRequest {

private final ProviderSelection providerSelection;

private final Map<String, String> schemeSelection;

private final Redirect redirect;

private final Consent consent;

private final Form form;

@Builder
@ToString
@EqualsAndHashCode
public static class ProviderSelection {}
public static class ProviderSelection {
private final Icon icon;

@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode
@ToString
public static class Icon {
IconType type;

@RequiredArgsConstructor
@Getter
public enum IconType {
DEFAULT("default"),
EXTENDED("extended"),
EXTENDED_SMALL("extended_small"),
EXTENDED_MEDIUM("extended_medium"),
EXTENDED_LARGE("extended_large");

@JsonValue
private final String type;
}
}
}

@Builder
@Getter
Expand All @@ -45,43 +73,4 @@ public static class Consent {}
public static class Form {
List<Input.Type> inputTypes;
}

public static StartAuthorizationFlowRequestBuilder builder() {
return new StartAuthorizationFlowRequestBuilder();
}

public static class StartAuthorizationFlowRequestBuilder {
private boolean withProviderSelection;

private Redirect redirect;

private Consent consent;

private Form form;

public StartAuthorizationFlowRequestBuilder withProviderSelection() {
this.withProviderSelection = true;
return this;
}

public StartAuthorizationFlowRequestBuilder redirect(Redirect redirect) {
this.redirect = redirect;
return this;
}

public StartAuthorizationFlowRequestBuilder consent(Consent consent) {
this.consent = consent;
return this;
}

public StartAuthorizationFlowRequestBuilder form(Form form) {
this.form = form;
return this;
}

public StartAuthorizationFlowRequest build() {
return new StartAuthorizationFlowRequest(
withProviderSelection ? new ProviderSelection() : null, redirect, consent, form);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ public void itShouldGetFunds(String mandatesScope, Mandate.Type mandateType) {

// start auth flow
StartAuthorizationFlowRequest startAuthorizationFlowRequest = StartAuthorizationFlowRequest.builder()
.withProviderSelection()
.providerSelection(StartAuthorizationFlowRequest.ProviderSelection.builder()
.build())
.redirect(StartAuthorizationFlowRequest.Redirect.builder()
.returnUri(URI.create(RETURN_URI))
.build())
Expand Down Expand Up @@ -209,7 +210,8 @@ public void itShouldGetConstraints(String mandatesScope, Mandate.Type mandateTyp

// start auth flow
StartAuthorizationFlowRequest startAuthorizationFlowRequest = StartAuthorizationFlowRequest.builder()
.withProviderSelection()
.providerSelection(StartAuthorizationFlowRequest.ProviderSelection.builder()
.build())
.redirect(StartAuthorizationFlowRequest.Redirect.builder()
.returnUri(URI.create(RETURN_URI))
.build())
Expand Down Expand Up @@ -323,7 +325,8 @@ public void itShouldCreateAPaymentOnMandate(String mandatesScope, Mandate.Type m

// start auth flow
StartAuthorizationFlowRequest startAuthorizationFlowRequest = StartAuthorizationFlowRequest.builder()
.withProviderSelection()
.providerSelection(StartAuthorizationFlowRequest.ProviderSelection.builder()
.build())
.redirect(StartAuthorizationFlowRequest.Redirect.builder()
.returnUri(URI.create(RETURN_URI))
.build())
Expand Down Expand Up @@ -449,7 +452,8 @@ private CreateMandateRequest createMandateRequest(
private ApiResponse<AuthorizationFlowResponse> startAuthFlowForMandate(String mandateId) {
// start auth flow
StartAuthorizationFlowRequest startAuthorizationFlowRequest = StartAuthorizationFlowRequest.builder()
.withProviderSelection()
.providerSelection(StartAuthorizationFlowRequest.ProviderSelection.builder()
.build())
.redirect(StartAuthorizationFlowRequest.Redirect.builder()
.returnUri(URI.create(RETURN_URI))
.build())
Expand Down
Loading
Loading