Skip to content

Commit

Permalink
Merge branch 'release/1.12.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
nickvandegroes committed Sep 16, 2019
2 parents 60d3da2 + a73b553 commit 287380d
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 283 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@

## [Unreleased](https://github.com/bunq/sdk_java/tree/HEAD)

[Full Changelog](https://github.com/bunq/sdk_java/compare/1.10.16...HEAD)
[Full Changelog](https://github.com/bunq/sdk_java/compare/1.12.0...HEAD)

**Closed issues:**

- No payment details in the result inquiries of a bunq me tab in the api [\#114](https://github.com/bunq/sdk_java/issues/114)

**Merged pull requests:**

- Feature/object wrapping fix [\#119](https://github.com/bunq/sdk_java/pull/119) ([NickvandeGroes](https://github.com/NickvandeGroes))

## [1.12.0](https://github.com/bunq/sdk_java/tree/1.12.0) (2019-09-10)
[Full Changelog](https://github.com/bunq/sdk_java/compare/1.10.16...1.12.0)

**Closed issues:**

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group 'com.bunq.sdk'
version '1.12.0'
version '1.12.1'

apply plugin: 'java'
apply plugin: 'maven'
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/bunq/sdk/http/BunqHeader.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public enum BunqHeader {
LANGUAGE("X-Bunq-Language", "en_US"),
REGION("X-Bunq-Region", "nl_NL"),
SERVER_SIGNATURE("X-Bunq-Server-Signature"),
USER_AGENT("User-Agent", "bunq-sdk-java/1.12.0");
USER_AGENT("User-Agent", "bunq-sdk-java/1.12.1");

private static final String PREFIX = "X-Bunq-";

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/bunq/sdk/json/BunqGsonBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.bunq.sdk.model.core.Installation;
import com.bunq.sdk.model.core.MonetaryAccountReference;
import com.bunq.sdk.model.core.SessionServer;
import com.bunq.sdk.model.generated.endpoint.BunqMeTabResultInquiry;
import com.bunq.sdk.model.generated.object.Geolocation;
import com.google.gson.GsonBuilder;
import java.math.BigDecimal;
Expand Down Expand Up @@ -35,6 +36,7 @@ public static GsonBuilder buildDefault() {
)
.registerTypeAdapter(InstallationContext.class, new InstallationContextAdapter())
.registerTypeAdapter(Pagination.class, new PaginationAdapter())
.registerTypeAdapter(BunqMeTabResultInquiry.class, new BunqMeTabResultInquiryDeserializer())
.registerTypeHierarchyAdapter(AnchorObjectInterface.class, new AnchorObjectAdapter());
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.bunq.sdk.json;

import com.bunq.sdk.model.generated.endpoint.BunqMeTabResultInquiry;
import com.bunq.sdk.model.generated.endpoint.Payment;
import com.google.gson.*;

import java.lang.reflect.Type;

public class BunqMeTabResultInquiryDeserializer implements JsonDeserializer<BunqMeTabResultInquiry> {
/**
* Field constants.
*/
private static final String FIELD_PAYMENT = "payment";

/**
* Object type constants.
*/
private static final String OBJECT_TYPE_PAYMENT = "Payment";

@Override
public BunqMeTabResultInquiry deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
BunqMeTabResultInquiry tabResultInquiry = new Gson().fromJson(json, BunqMeTabResultInquiry.class);

JsonObject jsonObject = (JsonObject) json;
JsonObject paymentObject = jsonObject.getAsJsonObject(FIELD_PAYMENT);
JsonObject wrappedPaymentObject = paymentObject.getAsJsonObject(OBJECT_TYPE_PAYMENT);

Payment wrappedPayment = new Gson().fromJson(wrappedPaymentObject, Payment.class);
tabResultInquiry.setPayment(wrappedPayment);

return tabResultInquiry;
}
}

This file was deleted.

0 comments on commit 287380d

Please sign in to comment.