From 87cdc80e50e907e385ddeb2f72daa2908d4a0793 Mon Sep 17 00:00:00 2001 From: DanRidh Date: Fri, 20 Sep 2024 11:38:06 +0900 Subject: [PATCH 1/2] add request_id to endpoints --- .../autogen/requests/TopupWithCreditCardMdkToken.java | 7 ++++++- .../autogen/requests/TopupWithCreditCardMembership.java | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/pokepaylib/src/main/java/jp/pokepay/pokepaylib/BankAPI/autogen/requests/TopupWithCreditCardMdkToken.java b/pokepaylib/src/main/java/jp/pokepay/pokepaylib/BankAPI/autogen/requests/TopupWithCreditCardMdkToken.java index 208571b..25cc53f 100644 --- a/pokepaylib/src/main/java/jp/pokepay/pokepaylib/BankAPI/autogen/requests/TopupWithCreditCardMdkToken.java +++ b/pokepaylib/src/main/java/jp/pokepay/pokepaylib/BankAPI/autogen/requests/TopupWithCreditCardMdkToken.java @@ -14,14 +14,16 @@ public class TopupWithCreditCardMdkToken extends BankRequest { private String token; private String accountId; private Integer amount; + private String requestId; private String organizationCode; private Boolean isCardholderNameSpecified; - public TopupWithCreditCardMdkToken(String userId, String token, String accountId, int amount, String organizationCode) { + public TopupWithCreditCardMdkToken(String userId, String token, String accountId, Integer amount, String requestId, String organizationCode) { this.userId = userId; this.token = token; this.accountId = accountId; this.amount = amount; + this.requestId = requestId; this.organizationCode = organizationCode; } @@ -55,6 +57,9 @@ protected final Map parameters() { if (amount != null) { put("amount", amount); } + if (requestId != null) { + put("request_id", requestId); + } if (organizationCode != null) { put("organization_code", organizationCode); } diff --git a/pokepaylib/src/main/java/jp/pokepay/pokepaylib/BankAPI/autogen/requests/TopupWithCreditCardMembership.java b/pokepaylib/src/main/java/jp/pokepay/pokepaylib/BankAPI/autogen/requests/TopupWithCreditCardMembership.java index 44042a5..e48f7e1 100644 --- a/pokepaylib/src/main/java/jp/pokepay/pokepaylib/BankAPI/autogen/requests/TopupWithCreditCardMembership.java +++ b/pokepaylib/src/main/java/jp/pokepay/pokepaylib/BankAPI/autogen/requests/TopupWithCreditCardMembership.java @@ -14,14 +14,16 @@ public class TopupWithCreditCardMembership extends BankRequest { private String cardRegisteredAt; private String accountId; private Integer amount; + private String requestId; private Boolean deleteCardIfAuthFail; private String organizationCode; - public TopupWithCreditCardMembership(String userId, String cardRegisteredAt, String accountId, int amount, String organizationCode) { + public TopupWithCreditCardMembership(String userId, String cardRegisteredAt, String accountId, Integer amount, String requestId, String organizationCode) { this.userId = userId; this.cardRegisteredAt = cardRegisteredAt; this.accountId = accountId; this.amount = amount; + this.requestId = requestId; this.organizationCode = organizationCode; } @@ -55,6 +57,9 @@ protected final Map parameters() { if (amount != null) { put("amount", amount); } + if (requestId != null) { + put("request_id", requestId); + } if (deleteCardIfAuthFail != null) { put("delete_card_if_auth_fail", deleteCardIfAuthFail); } From c712afdbddf804727409adc8589ed7a9e7d7e827 Mon Sep 17 00:00:00 2001 From: DanRidh Date: Thu, 17 Oct 2024 13:05:02 +0900 Subject: [PATCH 2/2] use builder pattern --- .../requests/TopupWithCreditCardMdkToken.java | 16 ++++++++++------ .../requests/TopupWithCreditCardMembership.java | 16 ++++++++++------ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/pokepaylib/src/main/java/jp/pokepay/pokepaylib/BankAPI/autogen/requests/TopupWithCreditCardMdkToken.java b/pokepaylib/src/main/java/jp/pokepay/pokepaylib/BankAPI/autogen/requests/TopupWithCreditCardMdkToken.java index 25cc53f..6839a96 100644 --- a/pokepaylib/src/main/java/jp/pokepay/pokepaylib/BankAPI/autogen/requests/TopupWithCreditCardMdkToken.java +++ b/pokepaylib/src/main/java/jp/pokepay/pokepaylib/BankAPI/autogen/requests/TopupWithCreditCardMdkToken.java @@ -14,16 +14,15 @@ public class TopupWithCreditCardMdkToken extends BankRequest { private String token; private String accountId; private Integer amount; - private String requestId; private String organizationCode; private Boolean isCardholderNameSpecified; + private String requestId; - public TopupWithCreditCardMdkToken(String userId, String token, String accountId, Integer amount, String requestId, String organizationCode) { + public TopupWithCreditCardMdkToken(String userId, String token, String accountId, Integer amount, String organizationCode) { this.userId = userId; this.token = token; this.accountId = accountId; this.amount = amount; - this.requestId = requestId; this.organizationCode = organizationCode; } @@ -32,6 +31,11 @@ public TopupWithCreditCardMdkToken isCardholderNameSpecified(Boolean cardholderN return this; } + public TopupWithCreditCardMdkToken requestId(String requestId) { + this.requestId = requestId; + return this; + } + @Override protected final Request.Method method() { return Request.Method.POST; @@ -57,15 +61,15 @@ protected final Map parameters() { if (amount != null) { put("amount", amount); } - if (requestId != null) { - put("request_id", requestId); - } if (organizationCode != null) { put("organization_code", organizationCode); } if (isCardholderNameSpecified != null) { put("is_cardholder_name_specified", isCardholderNameSpecified); } + if (requestId != null) { + put("request_id", requestId); + } }}; } diff --git a/pokepaylib/src/main/java/jp/pokepay/pokepaylib/BankAPI/autogen/requests/TopupWithCreditCardMembership.java b/pokepaylib/src/main/java/jp/pokepay/pokepaylib/BankAPI/autogen/requests/TopupWithCreditCardMembership.java index e48f7e1..8de7562 100644 --- a/pokepaylib/src/main/java/jp/pokepay/pokepaylib/BankAPI/autogen/requests/TopupWithCreditCardMembership.java +++ b/pokepaylib/src/main/java/jp/pokepay/pokepaylib/BankAPI/autogen/requests/TopupWithCreditCardMembership.java @@ -14,16 +14,15 @@ public class TopupWithCreditCardMembership extends BankRequest { private String cardRegisteredAt; private String accountId; private Integer amount; - private String requestId; private Boolean deleteCardIfAuthFail; private String organizationCode; + private String requestId; - public TopupWithCreditCardMembership(String userId, String cardRegisteredAt, String accountId, Integer amount, String requestId, String organizationCode) { + public TopupWithCreditCardMembership(String userId, String cardRegisteredAt, String accountId, Integer amount, String organizationCode) { this.userId = userId; this.cardRegisteredAt = cardRegisteredAt; this.accountId = accountId; this.amount = amount; - this.requestId = requestId; this.organizationCode = organizationCode; } @@ -32,6 +31,11 @@ public TopupWithCreditCardMembership deleteCardIfAuthFail(Boolean deleteCardIfAu return this; } + public TopupWithCreditCardMembership requestId(String requestId) { + this.requestId = requestId; + return this; + } + @Override protected final Request.Method method() { return Request.Method.POST; @@ -57,15 +61,15 @@ protected final Map parameters() { if (amount != null) { put("amount", amount); } - if (requestId != null) { - put("request_id", requestId); - } if (deleteCardIfAuthFail != null) { put("delete_card_if_auth_fail", deleteCardIfAuthFail); } if (organizationCode != null) { put("organization_code", organizationCode); } + if (requestId != null) { + put("request_id", requestId); + } }}; }