Skip to content

Commit 2b56e01

Browse files
committed
refund add extra
1 parent 099eb0c commit 2b56e01

3 files changed

Lines changed: 36 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#### 修改
55
- Charge 增加字段 reversed,表示是否已撤销
66
- 针对渠道 isv_scan, isv_qr_isv_wap 增加撤销方法,`Charge.reverse(CHARGE_ID)`
7+
- Refund 增加 extra 字段
78

89
## 2.2.3 (2017-03-27)
910
#### 修改

src/main/java/com/pingplusplus/model/Refund.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public class Refund extends APIResource {
2222
String chargeOrderNo;
2323
String transactionNo;
2424
String fundingSource;
25+
Map<String, Object> extra;
2526

2627
public String getInstanceURL() throws InvalidRequestException {
2728
if (this.charge != null) {
@@ -157,6 +158,14 @@ public void setFundingSource(String fundingSource) {
157158
this.fundingSource = fundingSource;
158159
}
159160

161+
public Map<String, Object> getExtra() {
162+
return extra;
163+
}
164+
165+
public void setExtra(Map<String, Object> extra) {
166+
this.extra = extra;
167+
}
168+
160169
/**
161170
* 创建 refund
162171
*

src/test/java/com/pingplusplus/PingppTest.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,4 +259,30 @@ public class PingppTest {
259259
assertEquals("charge object should be charge", "charge", charge.getObject());
260260
assertNotNull("charge reversed not null", charge.getReversed());
261261
}
262+
263+
@Test public void testRetrieveRefund() {
264+
String chargeId = "ch_Ti1eD0WP08eDPSSqnTOmLWHK";
265+
String refundId = "re_8avPmLWrPaH8TKmXDK5KubrL";
266+
267+
Refund refund = null;
268+
try {
269+
refund = Refund.retrieve(chargeId, refundId);
270+
System.out.println(refund);
271+
} catch (APIConnectionException e) {
272+
e.printStackTrace();
273+
} catch (ChannelException e) {
274+
e.printStackTrace();
275+
} catch (RateLimitException e) {
276+
e.printStackTrace();
277+
} catch (AuthenticationException e) {
278+
e.printStackTrace();
279+
} catch (APIException e) {
280+
e.printStackTrace();
281+
} catch (InvalidRequestException e) {
282+
e.printStackTrace();
283+
}
284+
285+
assertEquals("refund object should be charge", "refund", refund.getObject());
286+
assertNotNull("refund extra not null", refund.getExtra());
287+
}
262288
}

0 commit comments

Comments
 (0)