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 #125

Closed
wants to merge 5 commits into from
Closed
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>5.25.0</version>
<version>5.26.0</version>
</dependency>
```

With Gradle:

```
implementation 'com.gocardless:gocardless-pro:5.25.0'
implementation 'com.gocardless:gocardless-pro:5.26.0'
```

## Initializing the client
Expand Down
13 changes: 12 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ buildscript {
repositories {
mavenCentral()
maven { url 'https://plugins.gradle.org/m2/' }
jcenter()
google()
maven {
url 'https://maven.google.com'
}
}

dependencies {
Expand All @@ -20,12 +25,18 @@ plugins {
sourceCompatibility = 1.8
targetCompatibility = 1.8
group = 'com.gocardless'
version = '5.25.0'
version = '5.26.0'

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

repositories {
mavenCentral()
maven { url 'https://plugins.gradle.org/m2/' }
jcenter()
google()
maven {
url 'https://maven.google.com'
}
}

dependencies {
Expand Down
1 change: 1 addition & 0 deletions gradlew
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env sh
set -x

##############################################################################
##
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/5.25.0 java/%s %s/%s %s/%s",
String.format("gocardless-pro-java/5.26.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", "5.25.0");
builder.put("GoCardless-Client-Version", "5.26.0");
HEADERS = builder.build();
}
private final OkHttpClient rawClient;
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/com/gocardless/resources/Subscription.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ private Subscription() {
private Map<String, Object> metadata;
private Month month;
private String name;
private Boolean parentPlanPaused;
private String paymentReference;
private Boolean retryIfPossible;
private String startDate;
Expand Down Expand Up @@ -186,6 +187,13 @@ public String getName() {
return name;
}

/**
* Whether the parent plan of this subscription is paused.
*/
public Boolean getParentPlanPaused() {
return parentPlanPaused;
}

/**
* An optional payment reference. This will be set as the reference on each payment created and
* will appear on your customer's bank statement. See the documentation for the [create payment
Expand Down
14 changes: 12 additions & 2 deletions src/main/java/com/gocardless/services/LogoService.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ public LogoService(HttpClient httpClient) {
/**
* Creates a new logo associated with a creditor. If a creditor already has a logo, this will
* update the existing logo linked to the creditor.
*
* We support JPG and PNG formats. Your logo will be scaled to a maximum of 300px by 40px. For
* more guidance on how to upload logos that will look great across your customer payment page
* and notification emails see
* [here](https://developer.gocardless.com/gc-embed/setting-up-branding#tips_for_uploading_your_logo).
*/
public LogoCreateForCreditorRequest createForCreditor() {
return new LogoCreateForCreditorRequest(httpClient);
Expand All @@ -33,6 +38,11 @@ public LogoCreateForCreditorRequest createForCreditor() {
*
* Creates a new logo associated with a creditor. If a creditor already has a logo, this will
* update the existing logo linked to the creditor.
*
* We support JPG and PNG formats. Your logo will be scaled to a maximum of 300px by 40px. For
* more guidance on how to upload logos that will look great across your customer payment page
* and notification emails see
* [here](https://developer.gocardless.com/gc-embed/setting-up-branding#tips_for_uploading_your_logo).
*/
public static final class LogoCreateForCreditorRequest extends PostRequest<Logo> {
private String image;
Expand All @@ -52,7 +62,7 @@ public LogoCreateForCreditorRequest withLinks(Links links) {
}

/**
* ID of the creditor the payer theme belongs to
* ID of the creditor the logo belongs to
*/
public LogoCreateForCreditorRequest withLinksCreditor(String creditor) {
if (links == null) {
Expand Down Expand Up @@ -95,7 +105,7 @@ public static class Links {
private String creditor;

/**
* ID of the creditor the payer theme belongs to
* ID of the creditor the logo belongs to
*/
public Links withCreditor(String creditor) {
this.creditor = creditor;
Expand Down
30 changes: 30 additions & 0 deletions src/main/java/com/gocardless/services/MandatePdfService.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,11 @@ public static final class MandatePdfCreateRequest extends PostRequest<MandatePdf
private String bic;
private String branchCode;
private String city;
private String companyName;
private String countryCode;
private String danishIdentityNumber;
private String familyName;
private String givenName;
private String iban;
private Links links;
private String mandateReference;
Expand Down Expand Up @@ -182,6 +185,15 @@ public MandatePdfCreateRequest withCity(String city) {
return this;
}

/**
* The customer's company name. Used to populate the "Customer Name or Company name" field
* on the PDF.
*/
public MandatePdfCreateRequest withCompanyName(String companyName) {
this.companyName = companyName;
return this;
}

/**
* [ISO
* 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
Expand All @@ -201,6 +213,24 @@ public MandatePdfCreateRequest withDanishIdentityNumber(String danishIdentityNum
return this;
}

/**
* The customer's family name (i.e. last name). Used to populate the "Customer Name or
* Company name" field on the PDF. Ignored if `company_name` is provided.
*/
public MandatePdfCreateRequest withFamilyName(String familyName) {
this.familyName = familyName;
return this;
}

/**
* The customer's given name (i.e. first name). Used to populate the "Customer Name or
* Company name" field on the PDF. Ignored if `company_name` is provided.
*/
public MandatePdfCreateRequest withGivenName(String givenName) {
this.givenName = givenName;
return this;
}

/**
* International Bank Account Number. Alternatively you can provide [local
* details](#appendix-local-bank-details). IBANs cannot be provided for Autogiro mandates.
Expand Down
1 change: 1 addition & 0 deletions tmp-push-files-checkout
Submodule tmp-push-files-checkout added at 3848df
Loading