-
Notifications
You must be signed in to change notification settings - Fork 8
Term Balance Object #40
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 all commits
78ef726
b37bb70
fc05891
5a09e30
ae6b9e6
e8ec2f8
a01bfe5
7adad90
dd73be4
9e1875a
a208830
cdb36d1
f515fae
b705a94
1cfe8d4
7cd4bbc
5518180
07c9d92
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 0.6.2 | ||
| 0.7.0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| package jp.pay.model; | ||
|
|
||
| import jp.pay.exception.*; | ||
| import jp.pay.net.APIResource; | ||
| import jp.pay.net.RequestOptions; | ||
|
|
||
| import java.math.BigInteger; | ||
| import java.util.Map; | ||
| import java.util.List; | ||
|
|
||
|
|
||
| public class Balance extends APIResource { | ||
| Long created; | ||
| String id; | ||
| Boolean livemode; | ||
| BigInteger net; | ||
| String tenantId; | ||
| List<Statement> statements; | ||
| String state; | ||
| Boolean closed; | ||
| String dueDate; | ||
| BankInfo bankInfo; | ||
|
|
||
| public Long getCreated() { | ||
| return created; | ||
| } | ||
|
|
||
| public String getId() { | ||
| return id; | ||
| } | ||
|
|
||
| public Boolean getLivemode() { | ||
| return livemode; | ||
| } | ||
|
|
||
| public BigInteger getNet() { | ||
| return net; | ||
| } | ||
|
|
||
| public String getTenantId() { | ||
| return tenantId; | ||
| } | ||
|
|
||
| public List<Statement> getStatements() { | ||
| return statements; | ||
| } | ||
|
|
||
| public String getState() { | ||
| return state; | ||
| } | ||
|
|
||
| public Boolean getClosed() { | ||
| return closed; | ||
| } | ||
|
|
||
| public String getDueDate() { | ||
| return dueDate; | ||
| } | ||
|
Comment on lines
+56
to
+58
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ここも null ありえそうですが、String のメソッド使えないくらいなので影響はそれほどなんですかね。 |
||
|
|
||
| public BankInfo getBankInfo() { | ||
| return bankInfo; | ||
| } | ||
|
Comment on lines
+60
to
+62
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. bank_info は null があり得るので、ぬるぽ出ませんかね? balance.getBankInfo().getBankCode()他にも該当するコードはありそう。
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. GSONでのシリアライズ時点では出ないです。一応ローカルのbalance.jsonに |
||
|
|
||
| public static Balance retrieve(String id) throws AuthenticationException, | ||
| InvalidRequestException, APIConnectionException, | ||
| CardException, APIException { | ||
| return retrieve(id, (RequestOptions) null); | ||
| } | ||
|
|
||
| public static BalanceCollection all(Map<String, Object> params) | ||
| throws AuthenticationException, InvalidRequestException, | ||
| APIConnectionException, CardException, APIException { | ||
| return all(params, (RequestOptions) null); | ||
| } | ||
|
|
||
| public static Balance retrieve(String id, RequestOptions options) | ||
| throws AuthenticationException, InvalidRequestException, | ||
| APIConnectionException, CardException, APIException { | ||
| return request(RequestMethod.GET, instanceURL(Balance.class, id), null, Balance.class, options); | ||
| } | ||
|
|
||
| public static BalanceCollection all(Map<String, Object> params, | ||
| RequestOptions options) throws AuthenticationException, | ||
| InvalidRequestException, APIConnectionException, | ||
| CardException, APIException { | ||
| return request(RequestMethod.GET, classURL(Balance.class), params, BalanceCollection.class, options); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| package jp.pay.model; | ||
|
|
||
| public class BalanceCollection extends PayjpCollection<Balance> { | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| package jp.pay.model; | ||
|
|
||
| public class BankInfo { | ||
| String bankCode; | ||
| String bankBranchCode; | ||
| String bankAccountType; | ||
| String bankAccountNumber; | ||
| String bankAccountHolderName; | ||
| String bankAccountStatus; | ||
|
|
||
| public String getBankCode() { | ||
| return bankCode; | ||
| } | ||
|
|
||
| public String getBankBranchCode() { | ||
| return bankBranchCode; | ||
| } | ||
|
|
||
| public String getBankAccountType() { | ||
| return bankAccountType; | ||
| } | ||
|
|
||
| public String getBankAccountNumber() { | ||
| return bankAccountNumber; | ||
| } | ||
|
|
||
| public String getBankAccountHolderName() { | ||
| return bankAccountHolderName; | ||
| } | ||
|
|
||
| public String getBankAccountStatus() { | ||
| return bankAccountStatus; | ||
| } | ||
|
|
||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,6 +52,9 @@ public class PayjpObjectDeserializer implements JsonDeserializer<PayjpObject> { | |
| objectMap.put("transfer", Transfer.class); | ||
| objectMap.put("summary", Summary.class); | ||
| objectMap.put("card", Card.class); | ||
| objectMap.put("term", Term.class); | ||
| objectMap.put("statement", Statement.class); | ||
| objectMap.put("balance", Balance.class); | ||
|
Comment on lines
+55
to
+57
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tab と space 気になったけどどっちに揃えるのがいいんでしょう。
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 4スペースが多そう
現状いろんなとこで入り混じってるので揃えるなら別PRにしてlinter入れたい |
||
| } | ||
|
|
||
| private Object deserializeJsonPrimitive(JsonPrimitive element) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ | |
| import jp.pay.net.APIResource; | ||
| import jp.pay.net.RequestOptions; | ||
|
|
||
| import java.math.BigInteger; | ||
| import java.util.List; | ||
| import java.util.Map; | ||
|
|
||
|
|
@@ -15,6 +16,11 @@ public class Statement extends APIResource { | |
| Boolean livemode; | ||
| String title; | ||
| Long updated; | ||
| Term term; | ||
| String balanceId; | ||
| String tenantId; | ||
| String type; | ||
| BigInteger net; | ||
|
|
||
| public class StatementItem { | ||
| Integer amount; | ||
|
|
@@ -47,6 +53,14 @@ public Long getCreated() { | |
| return created; | ||
| } | ||
|
|
||
| public String getTitle() { | ||
| return title; | ||
| } | ||
|
|
||
| public Long getUpdated() { | ||
| return updated; | ||
| } | ||
|
|
||
| public String getId() { | ||
| return id; | ||
| } | ||
|
|
@@ -59,6 +73,25 @@ public void setLivemode(Boolean livemode) { | |
| this.livemode = livemode; | ||
| } | ||
|
|
||
| public Term getTerm() { | ||
| return term; | ||
| } | ||
|
Comment on lines
+76
to
+78
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ここも term に null がありえそうです。 |
||
|
|
||
| public String getBalanceId() { | ||
| return balanceId; | ||
| } | ||
|
|
||
| public String getTenantId() { | ||
| return tenantId; | ||
| } | ||
|
|
||
| public String getType() { | ||
| return type; | ||
| } | ||
|
|
||
| public BigInteger getNet() { | ||
| return net; | ||
| } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. title の getter がなさそう? |
||
|
|
||
| public static Statement retrieve(String id) throws AuthenticationException, | ||
| InvalidRequestException, APIConnectionException, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| package jp.pay.model; | ||
|
|
||
| import jp.pay.exception.*; | ||
| import jp.pay.net.APIResource; | ||
| import jp.pay.net.RequestOptions; | ||
|
|
||
| import java.util.Map; | ||
|
|
||
|
|
||
| public class Term extends APIResource { | ||
| String id; | ||
| Boolean livemode; | ||
| Long startAt; | ||
| Long endAt; | ||
| Integer chargeCount; | ||
| Integer refundCount; | ||
| Integer disputeCount; | ||
|
|
||
| public String getId() { | ||
| return id; | ||
| } | ||
|
|
||
| public Boolean getLivemode() { | ||
| return livemode; | ||
| } | ||
|
|
||
| public Long getStartAt() { | ||
| return startAt; | ||
| } | ||
|
|
||
| public Long getEndAt() { | ||
| return endAt; | ||
| } | ||
|
|
||
| public Integer getChargeCount() { | ||
| return chargeCount; | ||
| } | ||
|
|
||
| public Integer getRefundCount() { | ||
| return refundCount; | ||
| } | ||
|
|
||
| public Integer getDisputeCount() { | ||
| return disputeCount; | ||
| } | ||
|
|
||
|
|
||
| public static Term retrieve(String id) throws AuthenticationException, | ||
| InvalidRequestException, APIConnectionException, | ||
| CardException, APIException { | ||
| return retrieve(id, (RequestOptions) null); | ||
| } | ||
|
|
||
| public static TermCollection all(Map<String, Object> params) | ||
| throws AuthenticationException, InvalidRequestException, | ||
| APIConnectionException, CardException, APIException { | ||
| return all(params, (RequestOptions) null); | ||
| } | ||
|
|
||
| public static Term retrieve(String id, RequestOptions options) | ||
| throws AuthenticationException, InvalidRequestException, | ||
| APIConnectionException, CardException, APIException { | ||
| return request(RequestMethod.GET, instanceURL(Term.class, id), null, Term.class, options); | ||
| } | ||
|
|
||
| public static TermCollection all(Map<String, Object> params, | ||
| RequestOptions options) throws AuthenticationException, | ||
| InvalidRequestException, APIConnectionException, | ||
| CardException, APIException { | ||
| return request(RequestMethod.GET, classURL(Term.class), params, TermCollection.class, options); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| package jp.pay.model; | ||
|
|
||
| public class TermCollection extends PayjpCollection<Term> { | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
直近のactionsで下記のメッセージが出てた
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2, actions/setup-java@v2. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/