Skip to content

Commit 1b639a8

Browse files
authored
Add Open Banking API (#1558)
* Generate code from OpenAPI * Add unit tests * Add OpenBanking API to README * Correct referecne in README * Code format
1 parent ddf7e8f commit 1b639a8

27 files changed

+4509
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@ The Library supports all APIs under the following services:
1717
| [Configuration API](https://docs.adyen.com/api-explorer/balanceplatform/2/overview) | The Configuration API enables you to create a platform where you can onboard your users as account holders and create balance accounts, cards, and business accounts. | balanceplatform package subclasses | **v2** |
1818
| [DataProtection API](https://docs.adyen.com/development-resources/data-protection-api) | Adyen Data Protection API provides a way for you to process [Subject Erasure Requests](https://gdpr-info.eu/art-17-gdpr/) as mandated in GDPR. Use our API to submit a request to delete shopper's data, including payment details and other related information (for example, delivery address or shopper email) | DataProtection | **v1** |
1919
| [Legal Entity Management API](https://docs.adyen.com/api-explorer/legalentity/3/overview) | Manage legal entities that contain information required for verification. | legalentitymanagement package subclasses | **v3** |
20-
| [Local/Cloud-based Terminal API](https://docs.adyen.com/point-of-sale/terminal-api-reference) | Our point-of-sale integration. | TerminalLocalAPI or TerminalCloudAPI | **v1** |
20+
| [Local/Cloud-based Terminal API](https://docs.adyen.com/point-of-sale/terminal-api-reference) | Our point-of-sale integration. | TerminalLocalAPI or TerminalCloudAPI | **v1** |
2121
| [Management API](https://docs.adyen.com/api-explorer/Management/3/overview) | Configure and manage your Adyen company and merchant accounts, stores, and payment terminals. | management package subclasses | **v3** |
22+
| [Open Banking API](https://docs.adyen.com/api-explorer/open-banking/1/overview) | The Open Banking API provides secure endpoints to share financial data and services with third parties. | openbanking package subclasses | **v1** |
2223
| [Payments API](https://docs.adyen.com/api-explorer/Payment/68/overview) | Our classic integration for online payments. | Payment | **v68** |
2324
| [Payouts API](https://docs.adyen.com/api-explorer/Payout/68/overview) | Endpoints for sending funds to your customers. | Payout | **v68** |
2425
| [POS Terminal Management API](https://docs.adyen.com/api-explorer/postfmapi/1/overview) | ~~Endpoints for managing your point-of-sale payment terminals.~~ ‼️ **Deprecated**: use instead the [Management API](https://docs.adyen.com/api-explorer/Management/latest/overview) for the management of your terminal fleet. | ~~TerminalManagement~~ | ~~**v1**~~ |
2526
| [Recurring API](https://docs.adyen.com/api-explorer/Recurring/68/overview) | Endpoints for managing saved payment details. | Recurring | **v68** |
26-
| [Session Authentication API](https://docs.adyen.com/api-explorer/sessionauthentication/1/overview) | Create and manage the JSON Web Tokens (JWT) required for integrating [Onboarding](https://docs.adyen.com/platforms/onboard-users/components) and [Platform Experience](https://docs.adyen.com/platforms/build-user-dashboards) components. | SessionAuthentication | **v1** |
27+
| [Session Authentication API](https://docs.adyen.com/api-explorer/sessionauthentication/1/overview) | Create and manage the JSON Web Tokens (JWT) required for integrating [Onboarding](https://docs.adyen.com/platforms/onboard-users/components) and [Platform Experience](https://docs.adyen.com/platforms/build-user-dashboards) components. | SessionAuthentication | **v1** |
2728
| [Stored Value API](https://docs.adyen.com/payment-methods/gift-cards/stored-value-api) | Manage both online and point-of-sale gift cards and other stored-value cards. | StoredValue | **v46** |
2829
| [Transfers API](https://docs.adyen.com/api-explorer/transfers/4/overview) | The Transfers API provides endpoints that can be used to get information about all your transactions, move funds within your balance platform or send funds from your balance platform to a transfer instrument. | Transfers | **v4** |
2930
| [Webhooks](https://docs.adyen.com/api-explorer/Webhooks/1/overview) | Adyen uses webhooks to send notifications about payment status updates, newly available reports, and other events that can be subscribed to. For more information, refer to our [documentation](https://docs.adyen.com/development-resources/webhooks). | *Models only* | **v1** |
Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
/*
2+
* Open Banking API
3+
*
4+
* The version of the OpenAPI document: 1
5+
*
6+
*
7+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
8+
* https://openapi-generator.tech
9+
* Do not edit the class manually.
10+
*/
11+
12+
package com.adyen.model.openbanking;
13+
14+
import com.fasterxml.jackson.annotation.JsonInclude;
15+
import com.fasterxml.jackson.annotation.JsonProperty;
16+
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
17+
import com.fasterxml.jackson.core.JsonProcessingException;
18+
import java.util.*;
19+
20+
/** ACHAccountIdentifier */
21+
@JsonPropertyOrder({
22+
ACHAccountIdentifier.JSON_PROPERTY_ACCOUNT_NUMBER,
23+
ACHAccountIdentifier.JSON_PROPERTY_ROUTING_NUMBER
24+
})
25+
public class ACHAccountIdentifier {
26+
public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber";
27+
private String accountNumber;
28+
29+
public static final String JSON_PROPERTY_ROUTING_NUMBER = "routingNumber";
30+
private String routingNumber;
31+
32+
public ACHAccountIdentifier() {}
33+
34+
/**
35+
* The account number of the bank account.
36+
*
37+
* @param accountNumber The account number of the bank account.
38+
* @return the current {@code ACHAccountIdentifier} instance, allowing for method chaining
39+
*/
40+
public ACHAccountIdentifier accountNumber(String accountNumber) {
41+
this.accountNumber = accountNumber;
42+
return this;
43+
}
44+
45+
/**
46+
* The account number of the bank account.
47+
*
48+
* @return accountNumber The account number of the bank account.
49+
*/
50+
@JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER)
51+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
52+
public String getAccountNumber() {
53+
return accountNumber;
54+
}
55+
56+
/**
57+
* The account number of the bank account.
58+
*
59+
* @param accountNumber The account number of the bank account.
60+
*/
61+
@JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER)
62+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
63+
public void setAccountNumber(String accountNumber) {
64+
this.accountNumber = accountNumber;
65+
}
66+
67+
/**
68+
* The [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without
69+
* separators or whitespace.
70+
*
71+
* @param routingNumber The [routing
72+
* number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or
73+
* whitespace.
74+
* @return the current {@code ACHAccountIdentifier} instance, allowing for method chaining
75+
*/
76+
public ACHAccountIdentifier routingNumber(String routingNumber) {
77+
this.routingNumber = routingNumber;
78+
return this;
79+
}
80+
81+
/**
82+
* The [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without
83+
* separators or whitespace.
84+
*
85+
* @return routingNumber The [routing
86+
* number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or
87+
* whitespace.
88+
*/
89+
@JsonProperty(JSON_PROPERTY_ROUTING_NUMBER)
90+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
91+
public String getRoutingNumber() {
92+
return routingNumber;
93+
}
94+
95+
/**
96+
* The [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without
97+
* separators or whitespace.
98+
*
99+
* @param routingNumber The [routing
100+
* number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or
101+
* whitespace.
102+
*/
103+
@JsonProperty(JSON_PROPERTY_ROUTING_NUMBER)
104+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
105+
public void setRoutingNumber(String routingNumber) {
106+
this.routingNumber = routingNumber;
107+
}
108+
109+
/** Return true if this ACHAccountIdentifier object is equal to o. */
110+
@Override
111+
public boolean equals(Object o) {
112+
if (this == o) {
113+
return true;
114+
}
115+
if (o == null || getClass() != o.getClass()) {
116+
return false;
117+
}
118+
ACHAccountIdentifier acHAccountIdentifier = (ACHAccountIdentifier) o;
119+
return Objects.equals(this.accountNumber, acHAccountIdentifier.accountNumber)
120+
&& Objects.equals(this.routingNumber, acHAccountIdentifier.routingNumber);
121+
}
122+
123+
@Override
124+
public int hashCode() {
125+
return Objects.hash(accountNumber, routingNumber);
126+
}
127+
128+
@Override
129+
public String toString() {
130+
StringBuilder sb = new StringBuilder();
131+
sb.append("class ACHAccountIdentifier {\n");
132+
sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n");
133+
sb.append(" routingNumber: ").append(toIndentedString(routingNumber)).append("\n");
134+
sb.append("}");
135+
return sb.toString();
136+
}
137+
138+
/**
139+
* Convert the given object to string with each line indented by 4 spaces (except the first line).
140+
*/
141+
private String toIndentedString(Object o) {
142+
if (o == null) {
143+
return "null";
144+
}
145+
return o.toString().replace("\n", "\n ");
146+
}
147+
148+
/**
149+
* Create an instance of ACHAccountIdentifier given an JSON string
150+
*
151+
* @param jsonString JSON string
152+
* @return An instance of ACHAccountIdentifier
153+
* @throws JsonProcessingException if the JSON string is invalid with respect to
154+
* ACHAccountIdentifier
155+
*/
156+
public static ACHAccountIdentifier fromJson(String jsonString) throws JsonProcessingException {
157+
return JSON.getMapper().readValue(jsonString, ACHAccountIdentifier.class);
158+
}
159+
160+
/**
161+
* Convert an instance of ACHAccountIdentifier to an JSON string
162+
*
163+
* @return JSON string
164+
*/
165+
public String toJson() throws JsonProcessingException {
166+
return JSON.getMapper().writeValueAsString(this);
167+
}
168+
}
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
/*
2+
* Open Banking API
3+
*
4+
* The version of the OpenAPI document: 1
5+
*
6+
*
7+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
8+
* https://openapi-generator.tech
9+
* Do not edit the class manually.
10+
*/
11+
12+
package com.adyen.model.openbanking;
13+
14+
import com.fasterxml.jackson.annotation.JsonValue;
15+
import jakarta.ws.rs.core.GenericType;
16+
import java.util.Map;
17+
import java.util.Objects;
18+
19+
/** Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */
20+
public abstract class AbstractOpenApiSchema {
21+
22+
// store the actual instance of the schema/object
23+
private Object instance;
24+
25+
// is nullable
26+
private Boolean isNullable;
27+
28+
// schema type (e.g. oneOf, anyOf)
29+
private final String schemaType;
30+
31+
/**
32+
* @param schemaType the schema type
33+
* @param isNullable whether the instance is nullable
34+
*/
35+
public AbstractOpenApiSchema(String schemaType, Boolean isNullable) {
36+
this.schemaType = schemaType;
37+
this.isNullable = isNullable;
38+
}
39+
40+
/**
41+
* Get the list of oneOf/anyOf composed schemas allowed to be stored in this object
42+
*
43+
* @return an instance of the actual schema/object
44+
*/
45+
public abstract Map<String, GenericType<?>> getSchemas();
46+
47+
/**
48+
* Get the actual instance
49+
*
50+
* @return an instance of the actual schema/object
51+
*/
52+
@JsonValue
53+
public Object getActualInstance() {
54+
return instance;
55+
}
56+
57+
/**
58+
* Set the actual instance
59+
*
60+
* @param instance the actual instance of the schema/object
61+
*/
62+
public void setActualInstance(Object instance) {
63+
this.instance = instance;
64+
}
65+
66+
/**
67+
* Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf
68+
* schema as well
69+
*
70+
* @return an instance of the actual schema/object
71+
*/
72+
public Object getActualInstanceRecursively() {
73+
return getActualInstanceRecursively(this);
74+
}
75+
76+
private Object getActualInstanceRecursively(AbstractOpenApiSchema object) {
77+
if (object.getActualInstance() == null) {
78+
return null;
79+
} else if (object.getActualInstance() instanceof AbstractOpenApiSchema) {
80+
return getActualInstanceRecursively((AbstractOpenApiSchema) object.getActualInstance());
81+
} else {
82+
return object.getActualInstance();
83+
}
84+
}
85+
86+
/**
87+
* Get the schema type (e.g. anyOf, oneOf)
88+
*
89+
* @return the schema type
90+
*/
91+
public String getSchemaType() {
92+
return schemaType;
93+
}
94+
95+
@Override
96+
public String toString() {
97+
StringBuilder sb = new StringBuilder();
98+
sb.append("class ").append(getClass()).append(" {\n");
99+
sb.append(" instance: ").append(toIndentedString(instance)).append("\n");
100+
sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n");
101+
sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n");
102+
sb.append("}");
103+
return sb.toString();
104+
}
105+
106+
/**
107+
* Convert the given object to string with each line indented by 4 spaces (except the first line).
108+
*/
109+
private String toIndentedString(Object o) {
110+
if (o == null) {
111+
return "null";
112+
}
113+
return o.toString().replace("\n", "\n ");
114+
}
115+
116+
public boolean equals(Object o) {
117+
if (this == o) {
118+
return true;
119+
}
120+
if (o == null || getClass() != o.getClass()) {
121+
return false;
122+
}
123+
AbstractOpenApiSchema a = (AbstractOpenApiSchema) o;
124+
return Objects.equals(this.instance, a.instance)
125+
&& Objects.equals(this.isNullable, a.isNullable)
126+
&& Objects.equals(this.schemaType, a.schemaType);
127+
}
128+
129+
@Override
130+
public int hashCode() {
131+
return Objects.hash(instance, isNullable, schemaType);
132+
}
133+
134+
/**
135+
* Is nullable
136+
*
137+
* @return true if it's nullable
138+
*/
139+
public Boolean isNullable() {
140+
return Boolean.TRUE.equals(isNullable);
141+
}
142+
}

0 commit comments

Comments
 (0)