Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes from gocardless/gocardless-pro-java-template #133

Merged
merged 5 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ With Maven:
<dependency>
<groupId>com.gocardless</groupId>
<artifactId>gocardless-pro</artifactId>
<version>6.1.0</version>
<version>6.2.0</version>
</dependency>
```

With Gradle:

```
implementation 'com.gocardless:gocardless-pro:6.1.0'
implementation 'com.gocardless:gocardless-pro:6.2.0'
```

## Initializing the client
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ plugins {
sourceCompatibility = 1.8
targetCompatibility = 1.8
group = 'com.gocardless'
version = '6.1.0'
version = '6.2.0'

apply plugin: 'ch.raffael.pegdown-doclet'

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/gocardless/http/HttpClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class HttpClient {
private static final String DISALLOWED_USER_AGENT_CHARACTERS =
"[^\\w!#$%&'\\*\\+\\-\\.\\^`\\|~]";
private static final String USER_AGENT =
String.format("gocardless-pro-java/6.1.0 java/%s %s/%s %s/%s",
String.format("gocardless-pro-java/6.2.0 java/%s %s/%s %s/%s",
cleanUserAgentToken(System.getProperty("java.vm.specification.version")),
cleanUserAgentToken(System.getProperty("java.vm.name")),
cleanUserAgentToken(System.getProperty("java.version")),
Expand All @@ -49,7 +49,7 @@ public class HttpClient {
builder.put("GoCardless-Version", "2015-07-06");
builder.put("Accept", "application/json");
builder.put("GoCardless-Client-Library", "gocardless-pro-java");
builder.put("GoCardless-Client-Version", "6.1.0");
builder.put("GoCardless-Client-Version", "6.2.0");
HEADERS = builder.build();
}
private final OkHttpClient rawClient;
Expand Down
25 changes: 6 additions & 19 deletions src/main/java/com/gocardless/resources/BillingRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,8 @@ private InstalmentScheduleRequest() {
}

private Integer appFee;
private Currency currency;
private List<String> instalments;
private String currency;
private Map<String, Object> instalments;
private Links links;
private Map<String, Object> metadata;
private String name;
Expand All @@ -426,9 +426,9 @@ public Integer getAppFee() {

/**
* [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. Currently
* "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported.
* "USD" and "CAD" are supported.
*/
public Currency getCurrency() {
public String getCurrency() {
return currency;
}

Expand All @@ -438,7 +438,7 @@ public Currency getCurrency() {
* schedule)](#instalment-schedules-create-with-schedule) for more information on how to
* specify instalments.
*/
public List<String> getInstalments() {
public Map<String, Object> getInstalments() {
return instalments;
}

Expand Down Expand Up @@ -493,19 +493,6 @@ public Integer getTotalAmount() {
return totalAmount;
}

public enum Currency {
@SerializedName("AUD")
AUD, @SerializedName("CAD")
CAD, @SerializedName("DKK")
DKK, @SerializedName("EUR")
EUR, @SerializedName("GBP")
GBP, @SerializedName("NZD")
NZD, @SerializedName("SEK")
SEK, @SerializedName("USD")
USD, @SerializedName("unknown")
UNKNOWN
}

public static class Links {
private Links() {
// blank to prevent instantiation
Expand Down Expand Up @@ -1521,7 +1508,7 @@ public Integer getCount() {

/**
* [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. Currently
* "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported.
* "USD" and "CAD" are supported.
*/
public String getCurrency() {
return currency;
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/com/gocardless/resources/MandateImportEntry.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.gocardless.resources;

import java.util.Map;

/**
* Represents a mandate import entry resource returned from the API.
*
Expand Down Expand Up @@ -33,6 +35,7 @@ private MandateImportEntry() {

private String createdAt;
private Links links;
private Map<String, Object> processingErrors;
private String recordIdentifier;

/**
Expand All @@ -49,6 +52,13 @@ public Links getLinks() {
return links;
}

/**
* Per-resource processing errors
*/
public Map<String, Object> getProcessingErrors() {
return processingErrors;
}

/**
* A unique identifier for this entry, which you can use (once the import has been processed by
* GoCardless) to identify the records that have been created. Limited to 255 characters.
Expand Down
Loading
Loading