Skip to content

Commit d4bd1d6

Browse files
authored
Merge pull request #45 from wepay/feature-version-2016-12-07
Feature version 2016 12 07
2 parents b7f9edb + 9eab849 commit d4bd1d6

File tree

7 files changed

+23
-4
lines changed

7 files changed

+23
-4
lines changed

CHANGELOG

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2016-12-21
2+
* Released v8.0.0, updating API support to 2016-12-07
3+
* Added support for optional account_id in CreditCard.authorize()
4+
* Added CreditCard.getBackingInstrumentName()
5+
16
2016-12-21
27
* Released v7.0.0, updating API support to 2016-08-10
38
* No other changes

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ WePay-Java-SDK
33

44
Note
55
================================
6-
This WePay-Java-SDK is for <a href = "https://www.wepay.com/developer/version/2016-08-10">WePay Api Version 2016-08-10</a>. The jar for the previous API versions can be found in the lib folder.
6+
This WePay-Java-SDK is for <a href = "https://www.wepay.com/developer/version/2016-12-07">WePay Api Version 2016-12-07</a>. The jar for the previous API versions can be found in the lib folder.
77

88
Building
99
================================

lib/wepay-2016-08-10.jar

55.5 KB
Binary file not shown.

lib/wepay.jar

140 Bytes
Binary file not shown.

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<groupId>com.wepay</groupId>
1010
<artifactId>wepay-java-sdk</artifactId>
11-
<version>7.0.0</version>
11+
<version>8.0.0</version>
1212

1313
<name>wepay-java-sdk</name>
1414
<description>WePay Java SDK</description>

src/main/java/com/wepay/model/CreditCard.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public class CreditCard extends WePayResource {
2323
protected Integer expirationMonth;
2424
protected Integer expirationYear;
2525
protected String lastFour;
26+
protected String backingInstrumentName;
2627
protected Boolean autoUpdate;
2728
protected Long[] rbitIds;
2829

@@ -58,10 +59,19 @@ public static CreditCard modify(Long creditCardId, String accessToken, Boolean a
5859
}
5960

6061
public void authorize(String accessToken) throws JSONException, IOException, WePayException {
62+
this.authorize(0L, accessToken);
63+
}
64+
65+
public void authorize(Long account_id, String accessToken) throws JSONException, IOException, WePayException {
6166
JSONObject params = new JSONObject();
6267
params.put("credit_card_id", this.creditCardId);
6368
params.put("client_id", WePay.clientId);
6469
params.put("client_secret", WePay.clientSecret);
70+
71+
if (account_id > 0) {
72+
params.put("account_id", account_id);
73+
}
74+
6575
request("/credit_card/authorize", params, accessToken);
6676
}
6777

@@ -152,6 +162,10 @@ public String getLastFour() {
152162
return lastFour;
153163
}
154164

165+
public String getBackingInstrumentName() {
166+
return backingInstrumentName;
167+
}
168+
155169
public Boolean getAutoUpdate() {
156170
return autoUpdate;
157171
}

src/main/java/com/wepay/net/WePayResource.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ protected static javax.net.ssl.HttpsURLConnection httpsConnect(String call, Stri
5454
connection.setDoInput(true);
5555
connection.setRequestMethod("POST");
5656
connection.setRequestProperty("Content-Type", "application/json");
57-
connection.setRequestProperty("Api-Version", "2016-08-10");
58-
connection.setRequestProperty("User-Agent", "WePay Java SDK v7.0.0");
57+
connection.setRequestProperty("Api-Version", "2016-12-07");
58+
connection.setRequestProperty("User-Agent", "WePay Java SDK v8.0.0");
5959
if (accessToken != null) {
6060
connection.setRequestProperty("Authorization", "Bearer " + accessToken);
6161
}

0 commit comments

Comments
 (0)