Skip to content

Commit ad655b1

Browse files
authored
Merge pull request #91 from bunq/fix_monetary_account_joint_retrieval_bunq/sdk_java#45
Fix monetary account joint retrieval #45
2 parents 159490d + 81935e7 commit ad655b1

17 files changed

+616
-156
lines changed

src/main/java/com/bunq/sdk/http/ApiClient.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ public class ApiClient {
9292
* Prefix for bunq's own headers.
9393
*/
9494
private static final String USER_AGENT_BUNQ = "bunq-sdk-java/0.13.1";
95-
private static final String LANGUAGE_EN_US = "en_US";
96-
private static final String REGION_NL_NL = "nl_NL";
97-
private static final String GEOLOCATION_ZERO = "0 0 0 0 000";
95+
public static final String LANGUAGE_EN_US = "en_US";
96+
public static final String REGION_NL_NL = "nl_NL";
97+
public static final String GEOLOCATION_ZERO = "0 0 0 0 000";
9898
private static final String SCHEME_HTTPS = "https";
9999

100100
/**

src/main/java/com/bunq/sdk/model/generated/endpoint/BillingContractSubscription.java

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,20 @@ public class BillingContractSubscription extends BunqModel {
8383
@SerializedName("subscription_type")
8484
private String subscriptionType;
8585

86+
/**
87+
* The subscription status.
88+
*/
89+
@Expose
90+
@SerializedName("status")
91+
private String status;
92+
93+
/**
94+
* The subscription substatus.
95+
*/
96+
@Expose
97+
@SerializedName("sub_status")
98+
private String subStatus;
99+
86100
/**
87101
* @param subscriptionType The subscription type of the user. Can be one of PERSON_LIGHT_V1,
88102
* PERSON_MORE_V1, PERSON_FREE_V1, PERSON_PREMIUM_V1, COMPANY_V1, or COMPANY_V2.
@@ -207,6 +221,28 @@ public void setSubscriptionType(String subscriptionType) {
207221
this.subscriptionType = subscriptionType;
208222
}
209223

224+
/**
225+
* The subscription status.
226+
*/
227+
public String getStatus() {
228+
return this.status;
229+
}
230+
231+
public void setStatus(String status) {
232+
this.status = status;
233+
}
234+
235+
/**
236+
* The subscription substatus.
237+
*/
238+
public String getSubStatus() {
239+
return this.subStatus;
240+
}
241+
242+
public void setSubStatus(String subStatus) {
243+
this.subStatus = subStatus;
244+
}
245+
210246
/**
211247
*/
212248
public boolean isAllFieldNull() {
@@ -238,6 +274,14 @@ public boolean isAllFieldNull() {
238274
return false;
239275
}
240276

277+
if (this.status != null) {
278+
return false;
279+
}
280+
281+
if (this.subStatus != null) {
282+
return false;
283+
}
284+
241285
return true;
242286
}
243287

src/main/java/com/bunq/sdk/model/generated/endpoint/CardReplace.java

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public class CardReplace extends BunqModel {
2929
/**
3030
* Field constants.
3131
*/
32+
public static final String FIELD_NAME_ON_CARD = "name_on_card";
3233
public static final String FIELD_PIN_CODE = "pin_code";
3334
public static final String FIELD_SECOND_LINE = "second_line";
3435

@@ -41,17 +42,20 @@ public class CardReplace extends BunqModel {
4142

4243
/**
4344
* Request a card replacement.
45+
* @param nameOnCard The user's name as it will be on the card. Check 'card-name' for the
46+
* available card names for a user.
4447
* @param pinCode The plaintext pin code. Requests require encryption to be enabled.
4548
* @param secondLine The second line on the card.
4649
*/
47-
public static BunqResponse<Integer> create(Integer cardId, String pinCode, String secondLine, Map<String, String> customHeaders) {
50+
public static BunqResponse<Integer> create(Integer cardId, String nameOnCard, String pinCode, String secondLine, Map<String, String> customHeaders) {
4851
ApiClient apiClient = new ApiClient(getApiContext());
4952

5053
if (customHeaders == null) {
5154
customHeaders = new HashMap<>();
5255
}
5356

5457
HashMap<String, Object> requestMap = new HashMap<>();
58+
requestMap.put(FIELD_NAME_ON_CARD, nameOnCard);
5559
requestMap.put(FIELD_PIN_CODE, pinCode);
5660
requestMap.put(FIELD_SECOND_LINE, secondLine);
5761

@@ -63,19 +67,23 @@ public static BunqResponse<Integer> create(Integer cardId, String pinCode, Strin
6367
}
6468

6569
public static BunqResponse<Integer> create() {
66-
return create(null, null, null, null);
70+
return create(null, null, null, null, null);
6771
}
6872

6973
public static BunqResponse<Integer> create(Integer cardId) {
70-
return create(cardId, null, null, null);
74+
return create(cardId, null, null, null, null);
7175
}
7276

73-
public static BunqResponse<Integer> create(Integer cardId, String pinCode) {
74-
return create(cardId, pinCode, null, null);
77+
public static BunqResponse<Integer> create(Integer cardId, String nameOnCard) {
78+
return create(cardId, nameOnCard, null, null, null);
7579
}
7680

77-
public static BunqResponse<Integer> create(Integer cardId, String pinCode, String secondLine) {
78-
return create(cardId, pinCode, secondLine, null);
81+
public static BunqResponse<Integer> create(Integer cardId, String nameOnCard, String pinCode) {
82+
return create(cardId, nameOnCard, pinCode, null, null);
83+
}
84+
85+
public static BunqResponse<Integer> create(Integer cardId, String nameOnCard, String pinCode, String secondLine) {
86+
return create(cardId, nameOnCard, pinCode, secondLine, null);
7987
}
8088

8189
/**

src/main/java/com/bunq/sdk/model/generated/endpoint/DraftShareInviteApiKey.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
package com.bunq.sdk.model.generated.endpoint;
22

3-
import com.bunq.sdk.context.ApiContext;
43
import com.bunq.sdk.http.ApiClient;
54
import com.bunq.sdk.http.BunqResponse;
65
import com.bunq.sdk.http.BunqResponseRaw;
76
import com.bunq.sdk.model.core.BunqModel;
8-
import com.bunq.sdk.model.core.MonetaryAccountReference;
97
import com.bunq.sdk.model.generated.object.LabelUser;
108
import com.google.gson.annotations.Expose;
119
import com.google.gson.annotations.SerializedName;
1210
import com.google.gson.stream.JsonReader;
13-
import java.math.BigDecimal;
14-
import java.util.ArrayList;
11+
1512
import java.util.HashMap;
1613
import java.util.List;
1714
import java.util.Map;
18-
import javax.lang.model.type.NullType;
1915

2016
/**
2117
* Used to create a draft share invite for a user with another bunq user. The user that accepts

src/main/java/com/bunq/sdk/model/generated/endpoint/DraftShareInviteApiKeyQrCodeContent.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,12 @@
11
package com.bunq.sdk.model.generated.endpoint;
22

3-
import com.bunq.sdk.context.ApiContext;
43
import com.bunq.sdk.http.ApiClient;
54
import com.bunq.sdk.http.BunqResponse;
65
import com.bunq.sdk.http.BunqResponseRaw;
76
import com.bunq.sdk.model.core.BunqModel;
8-
import com.bunq.sdk.model.core.MonetaryAccountReference;
9-
import com.google.gson.annotations.Expose;
10-
import com.google.gson.annotations.SerializedName;
117
import com.google.gson.stream.JsonReader;
12-
import java.math.BigDecimal;
13-
import java.util.ArrayList;
14-
import java.util.HashMap;
15-
import java.util.List;
8+
169
import java.util.Map;
17-
import javax.lang.model.type.NullType;
1810

1911
/**
2012
* This call returns the raw content of the QR code that links to this draft share invite. When

src/main/java/com/bunq/sdk/model/generated/endpoint/ExportAnnualOverview.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public class ExportAnnualOverview extends BunqModel {
2525
*/
2626
protected static final String ENDPOINT_URL_CREATE = "user/%s/export-annual-overview";
2727
protected static final String ENDPOINT_URL_READ = "user/%s/export-annual-overview/%s";
28+
protected static final String ENDPOINT_URL_DELETE = "user/%s/export-annual-overview/%s";
2829
protected static final String ENDPOINT_URL_LISTING = "user/%s/export-annual-overview";
2930

3031
/**
@@ -123,6 +124,19 @@ public static BunqResponse<ExportAnnualOverview> get(Integer exportAnnualOvervie
123124
return get(exportAnnualOverviewId, params, null);
124125
}
125126

127+
/**
128+
*/
129+
public static BunqResponse<ExportAnnualOverview> delete(Integer exportAnnualOverviewId, Map<String, String> customHeaders) {
130+
ApiClient apiClient = new ApiClient(getApiContext());
131+
BunqResponseRaw responseRaw = apiClient.delete(String.format(ENDPOINT_URL_DELETE, determineUserId(), exportAnnualOverviewId), customHeaders);
132+
133+
return new BunqResponse<>(null, responseRaw.getHeaders());
134+
}
135+
136+
public static BunqResponse<ExportAnnualOverview> delete(Integer exportAnnualOverviewId) {
137+
return delete(exportAnnualOverviewId, null);
138+
}
139+
126140
/**
127141
* List all the annual overviews for a user.
128142
*/

src/main/java/com/bunq/sdk/model/generated/endpoint/IdealMerchantTransaction.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ public class IdealMerchantTransaction extends BunqModel {
3131
*/
3232
public static final String FIELD_AMOUNT_REQUESTED = "amount_requested";
3333
public static final String FIELD_ISSUER = "issuer";
34-
public static final String FIELD_CALLBACK_TYPE = "callback_type";
3534

3635
/**
3736
* Object type.

src/main/java/com/bunq/sdk/model/generated/endpoint/MasterCardAction.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,14 @@ public class MasterCardAction extends BunqModel {
207207
@SerializedName("secure_code_id")
208208
private Integer secureCodeId;
209209

210+
/**
211+
* The ID of the wallet provider as defined by MasterCard. 420 = bunq Android app with Tap&Pay;
212+
* 103 = Apple Pay.
213+
*/
214+
@Expose
215+
@SerializedName("wallet_provider_id")
216+
private String walletProviderId;
217+
210218
/**
211219
* The reference to the object used for split the bill. Can be RequestInquiry or
212220
* RequestInquiryBatch
@@ -537,6 +545,18 @@ public void setSecureCodeId(Integer secureCodeId) {
537545
this.secureCodeId = secureCodeId;
538546
}
539547

548+
/**
549+
* The ID of the wallet provider as defined by MasterCard. 420 = bunq Android app with Tap&Pay;
550+
* 103 = Apple Pay.
551+
*/
552+
public String getWalletProviderId() {
553+
return this.walletProviderId;
554+
}
555+
556+
public void setWalletProviderId(String walletProviderId) {
557+
this.walletProviderId = walletProviderId;
558+
}
559+
540560
/**
541561
* The reference to the object used for split the bill. Can be RequestInquiry or
542562
* RequestInquiryBatch
@@ -652,6 +672,10 @@ public boolean isAllFieldNull() {
652672
return false;
653673
}
654674

675+
if (this.walletProviderId != null) {
676+
return false;
677+
}
678+
655679
if (this.requestReferenceSplitTheBill != null) {
656680
return false;
657681
}

0 commit comments

Comments
 (0)