Skip to content
Merged
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Add this dependency to your project's POM:
<dependency>
<groupId>jp.pay</groupId>
<artifactId>payjp-java</artifactId>
<version>0.7.0</version>
<version>0.7.1</version>
</dependency>
```

Expand All @@ -27,7 +27,7 @@ Add this dependency to your project's POM:
Add this dependency to your project's build file:

```groovy
compile "jp.pay:payjp-java:0.7.0"
compile "jp.pay:payjp-java:0.7.1"
```

### Others
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.7.0
0.7.1
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<groupId>jp.pay</groupId>
<artifactId>payjp-java</artifactId>
<packaging>jar</packaging>
<version>0.7.0</version>
<version>0.7.1</version>
<name>pay-java</name>
<url>https://github.com/payjp/payjp-java</url>
<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/jp/pay/Payjp.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

public abstract class Payjp {
public static final String LIVE_API_BASE = "https://api.pay.jp";
public static final String VERSION = "0.7.0";
public static final String VERSION = "0.7.1";
public static volatile String apiKey;
public static volatile String apiVersion;
public static volatile Integer maxRetry = 0;
Expand Down
15 changes: 14 additions & 1 deletion src/main/java/jp/pay/model/Balance.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public Boolean getLivemode() {
public BigInteger getNet() {
return net;
}

public String getTenantId() {
return tenantId;
}
Expand Down Expand Up @@ -85,4 +85,17 @@ public static BalanceCollection all(Map<String, Object> params,
CardException, APIException {
return request(RequestMethod.GET, classURL(Balance.class), params, BalanceCollection.class, options);
}

public StatementUrl statementUrls(Map<String, Object> params)
throws AuthenticationException, InvalidRequestException,
APIConnectionException, CardException, APIException {
return this.statementUrls(params, (RequestOptions) null);
}

public StatementUrl statementUrls(Map<String, Object> params, RequestOptions options)
throws AuthenticationException, InvalidRequestException,
APIConnectionException, CardException, APIException {
return request(RequestMethod.POST, String.format("%s/statement_urls",
instanceURL(Balance.class, id)), params, StatementUrl.class, options);
}
}
12 changes: 12 additions & 0 deletions src/test/java/jp/pay/model/BalanceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,16 @@ public void testList() throws PayjpException {
assertEquals(balances.get(1).getId(), "balance2");
}

@Test
public void testStatementUrls() throws PayjpException {
stubNetwork(Balance.class, "{\"id\":\"balance1\"}");
Balance balance = Balance.retrieve("balance1");
stubNetwork(StatementUrl.class, "{\"expires\": 1695903280,\"object\": \"statement_url\",\"url\": \"https://pay.jp/_/statements/bd84d2d680b8xxxxxxxxxxxxxxxxxxxx\"}");
Map<String, Object> params = new HashMap<String, Object>();
params.put("platformer", true);
StatementUrl url = balance.statementUrls(params);
verifyPost(StatementUrl.class, "https://api.pay.jp/v1/balances/balance1/statement_urls", params);
assertEquals(url.getUrl(), "https://pay.jp/_/statements/bd84d2d680b8xxxxxxxxxxxxxxxxxxxx");
assertEquals(url.getExpires().intValue(), 1695903280);
}
}