File tree Expand file tree Collapse file tree
main/java/com/pingplusplus/model
test/java/com/pingplusplus Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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#### 修改
Original file line number Diff line number Diff 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 *
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments