You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			
				
					
					
						
							67 lines
						
					
					
						
							2.7 KiB
						
					
					
				
			
		
		
	
	
							67 lines
						
					
					
						
							2.7 KiB
						
					
					
				| package com.bocom.api.example.pmssMpng;
 | |
| 
 | |
| import com.alibaba.fastjson.JSON;
 | |
| import com.bocom.api.DefaultBocomClient;
 | |
| import com.bocom.api.helper.DateHelper;
 | |
| import com.bocom.api.helper.MyConfig;
 | |
| import com.bocom.api.request.pmssMpng.MPNG020703RequestV1;
 | |
| import com.bocom.api.request.pmssMpng.MPNG020703RequestV1.MPNG020703RequestV1Biz.ReqBody;
 | |
| import com.bocom.api.request.pmssMpng.MPNG020703RequestV1.MPNG020703RequestV1Biz.ReqHead;
 | |
| import com.bocom.api.response.pmssMpng.MPNG020703ResponseV1;
 | |
| 
 | |
| import java.util.Date;
 | |
| import java.util.UUID;
 | |
| 
 | |
| /**
 | |
|  * <pre>
 | |
|  * 退款查询@MPNG-MAPI
 | |
|  * </pre>
 | |
|  * <p>
 | |
|  *
 | |
|  * </p>
 | |
|  */
 | |
| public class MPNG020703V1Test {
 | |
| 
 | |
|     public static void main(String[] args) {
 | |
| 
 | |
|         try {
 | |
|             DefaultBocomClient client = new DefaultBocomClient(MyConfig.APP_ID, MyConfig.MY_PRIVATE_KEY, MyConfig.APIGW_PUBLIC_KEY);
 | |
|             /**
 | |
|              * 测试环境可以忽略SSL证书告警,生产环境不可忽略
 | |
|              */
 | |
|             client.ignoreSSLHostnameVerifier();
 | |
| 
 | |
|             MPNG020703RequestV1 request = new MPNG020703RequestV1();
 | |
|             request.setServiceUrl(MyConfig.APIGW_URL_ADDRESS + "/api/pmssMpng/MPNG020703/v1");
 | |
| 
 | |
|             MPNG020703RequestV1.MPNG020703RequestV1Biz bizContent = new MPNG020703RequestV1.MPNG020703RequestV1Biz();
 | |
|             ReqHead reqHead = new ReqHead();
 | |
|             bizContent.setReqHead(reqHead);
 | |
|             reqHead.setTransTime(DateHelper.dateToStr(new Date(), DateHelper.DateEnum.yyyyMMddHHmmss)); // 交易时间 yyyyMMddHHmmss
 | |
|             reqHead.setVersion("1.0");
 | |
|             ReqBody reqBody = new ReqBody();
 | |
|             bizContent.setReqBody(reqBody);
 | |
|             reqBody.setTranScene("B2C-JSAPI-WECHAT");
 | |
|             reqBody.setRefundMerTranNo("Refund_xbd_3034");
 | |
| 
 | |
|             reqBody.setMerPtcId(MyConfig.MER_PTC_ID);  // 商户编号
 | |
|             reqBody.setPartnerId(MyConfig.PARTNER_ID); // 服务商编号(!!!!!!!!!!!!!!!!!!!!!!!!!!)
 | |
| 
 | |
|             reqBody.setMerRefundDate(DateHelper.dateToStr(new Date(), DateHelper.DateEnum.yyyyMMdd));
 | |
| //            reqBody.setSysOrderNo("012185644621782145185");
 | |
|             request.setBizContent(bizContent);
 | |
|             MPNG020703ResponseV1 response = client.execute(request, UUID.randomUUID().toString().replace("-", ""));
 | |
| 
 | |
|             System.out.println("resp:" + JSON.toJSONString(response));
 | |
|             if (response.isSuccess()) {
 | |
|                 System.out.println("success");
 | |
|                 System.out.println(response.toString());
 | |
|             } else {
 | |
|                 System.out.println(response.getRspCode());
 | |
|                 System.out.println(response.getRspMsg());
 | |
|             }
 | |
|         } catch (Exception xcp) {
 | |
|             xcp.printStackTrace();
 | |
|         }
 | |
|     }
 | |
| }
 | |
| 
 |