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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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 src/main/java/com/gocardless/resources/BillingRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ private InstalmentScheduleRequest() {

private Integer appFee;
private Currency currency;
private List<String> instalments;
private Map<String, Object> instalments;
private Links links;
private Map<String, Object> metadata;
private String name;
Expand Down Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public BillingRequestCreateRequest withInstalmentScheduleRequestCurrency(
* specify instalments.
*/
public BillingRequestCreateRequest withInstalmentScheduleRequestInstalments(
List<String> instalments) {
Map<String, String> instalments) {
if (instalmentScheduleRequest == null) {
instalmentScheduleRequest = new InstalmentScheduleRequest();
}
Expand Down Expand Up @@ -893,7 +893,7 @@ public String toString() {
public static class InstalmentScheduleRequest {
private Integer appFee;
private Currency currency;
private List<String> instalments;
private Map<String, String> instalments;
private Map<String, String> metadata;
private String name;
private String paymentReference;
Expand Down Expand Up @@ -925,7 +925,7 @@ public InstalmentScheduleRequest withCurrency(Currency currency) {
* schedule)](#instalment-schedules-create-with-schedule) for more information on how to
* specify instalments.
*/
public InstalmentScheduleRequest withInstalments(List<String> instalments) {
public InstalmentScheduleRequest withInstalments(Map<String, String> instalments) {
this.instalments = instalments;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public InstalmentScheduleCreateWithDatesRequest withCurrency(Currency currency)

/**
* An explicit array of instalment payments, each specifying at least an `amount` and
* `charge_date`.
* `charge_date`. See [create (with dates)](#instalment-schedules-create-with-dates)
*/
public InstalmentScheduleCreateWithDatesRequest withInstalments(
List<Instalments> instalments) {
Expand All @@ -163,7 +163,7 @@ public InstalmentScheduleCreateWithDatesRequest withInstalments(

/**
* An explicit array of instalment payments, each specifying at least an `amount` and
* `charge_date`.
* `charge_date`. See [create (with dates)](#instalment-schedules-create-with-dates)
*/
public InstalmentScheduleCreateWithDatesRequest withInstalments(Instalments instalments) {
if (this.instalments == null) {
Expand Down Expand Up @@ -433,7 +433,8 @@ public InstalmentScheduleCreateWithScheduleRequest withCurrency(Currency currenc

/**
* Frequency of the payments you want to create, together with an array of payment amounts
* to be collected, with a specified start date for the first payment.
* to be collected, with a specified start date for the first payment. See [create (with
* schedule)](#instalment-schedules-create-with-schedule)
*
*/
public InstalmentScheduleCreateWithScheduleRequest withInstalments(
Expand Down
22 changes: 22 additions & 0 deletions src/main/java/com/gocardless/services/MandatePdfService.java
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,18 @@ public MandatePdfCreateRequest withLinks(Links links) {
return this;
}

/**
* ID of an existing [creditor](#core-endpoints-creditors). Only required if your account
* manages multiple creditors.
*/
public MandatePdfCreateRequest withLinksCreditor(String creditor) {
if (links == null) {
links = new Links();
}
links.withCreditor(creditor);
return this;
}

/**
* ID of an existing [mandate](#core-endpoints-mandates) to build the PDF from. The
* customer's bank details will be censored in the generated PDF. No other parameters may be
Expand Down Expand Up @@ -391,8 +403,18 @@ public String toString() {
}

public static class Links {
private String creditor;
private String mandate;

/**
* ID of an existing [creditor](#core-endpoints-creditors). Only required if your
* account manages multiple creditors.
*/
public Links withCreditor(String creditor) {
this.creditor = creditor;
return this;
}

/**
* ID of an existing [mandate](#core-endpoints-mandates) to build the PDF from. The
* customer's bank details will be censored in the generated PDF. No other parameters
Expand Down
Loading