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.
		
		
		
		
			
				
					41 lines
				
				4.0 KiB
			
		
		
			
		
	
	
					41 lines
				
				4.0 KiB
			| 
								 
											3 years ago
										 
									 | 
							
								package com.bocom.api.example.pmssMpng;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								import com.bocom.api.request.pmssMpng.PmmsMpngNotifyRequestV1;
							 | 
						||
| 
								 | 
							
								import com.bocom.api.response.pmssMpng.PmmsMpngNotifyResponseV1;
							 | 
						||
| 
								 | 
							
								import com.bocom.api.utils.ApiUtils;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/**
							 | 
						||
| 
								 | 
							
								 * <pre>
							 | 
						||
| 
								 | 
							
								 * 交行通知企业回调(通知接收方使用)
							 | 
						||
| 
								 | 
							
								 * </pre>
							 | 
						||
| 
								 | 
							
								 * <p>
							 | 
						||
| 
								 | 
							
								 *
							 | 
						||
| 
								 | 
							
								 * </p>
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								public class PmmsMpngNotifyCustV1Test {
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    public static final String APIGW_PUBLIC_KEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxSJrF8T/5rKB4NnwMjIxUer+ELf1PQXO2GSdZ/fvuQCclOR9tBlNWL4jFOftebeL+bvMVOJ+JHm/aSes1AN8YNIDGiFUpF6aDkSCaLynDdjK/mQTWhSNa2fO0GGO+ywOBTdYUjVjVtzJ48bbyG3NSylf1EdnBWnMpFa8qpXJXR4ELpVpMkPDC+93HBAlxEgUjhcIJlP5VdKIiudsmhE2T07qtpIQSuE5hntXP6X6GKJReCk+yek2QJITvIBq3cHPw8KDsHHCs7MaR81KI3onJRWyqFtTfVYTiKsd9EcYSxv+Gx5MOF8B/P4iJCD8uzx0FrqoB3k5OYGcz4tXs+h+9wIDAQAB";
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    public static void main(String[] args) {
							 | 
						||
| 
								 | 
							
								        try {
							 | 
						||
| 
								 | 
							
								            /**
							 | 
						||
| 
								 | 
							
								             * notifyJson为银行通知给商户的JSON报文,商户通过创建订单时上送的notify_url地址,银行回调该地址
							 | 
						||
| 
								 | 
							
								             */
							 | 
						||
| 
								 | 
							
								            String notifyJson = "{\"notify_biz_content\":{\"notify_url\":\"https://bp.winning-health.com.cn:11571/winupay/n/309/40124787-2/0\",\"tran_type\":\"PAY\",\"mer_tran_no\":\"WNCS20210526043954\",\"tran_state\":\"SUCCESS\",\"tran_state_code\":\"\",\"tran_state_msg\":\"\",\"partner_id\":\"\",\"mer_ptc_id\":\"131007420005887\",\"final_time\":\"20210526164025\",\"total_amount\":\"0.01\",\"buyer_pay_amount\":\"0.01\",\"trd_dsct_amount\":\"0.00\",\"pay_dsct_amount\":\"0.00\",\"currency\":\"CNY\",\"tran_content\":\"\",\"mer_memo\":\"天津市永久医院卫宁测试\",\"require_values\":{\"bank_tran_no\":null,\"third_party\":null,\"third_party_tran_no\":null,\"payment_info\":null,\"refund_info\":null}},\"sign\":\"gpYV8HsUOFuiJVvy4689IJirE5jW4C8TQhwQiPj/9XzrbZ1++7JY5mNzvq3PGqJRKLabBH3AVeqyUSFdV6Ic3btjqGnnp99lmQ7y0Ys86xN50z0vWj/0ZVbZnlhBGGTgR/kHo7knjOqEPu4qq61yZJXYCiUd0FMei7VuOzg5ltTB5I5x2VhHw38tYhbMLWWuyRpMkttLvuGf4hJfZHq0fgT44ZL+6SrJbvq48Y7s1Uv7zFgEFwhgbKKIMs+P93TNB8jJ147ChN1U9h5z2xBeC1HJZGRniLsR5kfRgBBWCf1VbxBsLp3twd2zahKwygnFSZ2xzZj3TJrq1HjG7oZrkQ==\"}";
							 | 
						||
| 
								 | 
							
								            PmmsMpngNotifyRequestV1.PmmsMpngNotifyRequestV1Biz request = (PmmsMpngNotifyRequestV1.PmmsMpngNotifyRequestV1Biz) ApiUtils.parseNotifyJsonWithBocomSign(notifyJson, "UTF-8", APIGW_PUBLIC_KEY, PmmsMpngNotifyRequestV1.PmmsMpngNotifyRequestV1Biz.class);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								//            PmmsMpngNotifyResponseV1.PmmsMpngNotifyRequestV1Biz request = (PmmsMpngNotifyRequestV1.PmmsMpngNotifyRequestV1Biz) ApiUtils.parseNotifyJsonWithBocomSign(notifyJson, "UTF-8", APIGW_PUBLIC_KEY, PmmsMpngNotifyRequestV1.PmmsMpngNotifyRequestV1Biz.class);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								//            TradeCallbackResponseV1 response = (TradeCallbackResponseV1) ApiUtils.parseNotifyJsonWithBocomSign(notifyJson, "UTF-8", APIGW_PUBLIC_KEY, TradeCallbackResponseV1.class);
							 | 
						||
| 
								 | 
							
								//            System.out.println(response);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								//            String notifyJson = "{\"notify_biz_content\":{\"tran_type\":\"PAY\",\"mer_tran_no\":\"ZSW201907230001\",\"tran_state\":\"SUCCESS\",\"tran_state_code\":\"\",\"tran_state_msg\":\"\",\"batch_no\":\"20190723\",\"final_time\":\"20190723093745\",\"amount\":\"1.10\",\"currency\":\"CNY\",\"tran_content\":\"微信线下34\",\"mer_memo\":\"微信线下34\",\"bank_tran_no\":\"0102201907230936440039860133\",\"third_party\":\"微信\",\"notify_url\":\"aaa\",\"partner_id\":\"301140880629503\",\"mer_ptc_id\":\"301910053990034\",\"req_time\":\"20190723093745\"},\"sign\":\"gw2z0qjTci5BEq8NNY1MeZoBFEM2OW0UfgEcXIsIJiKIZn0aL8WoLiJApphB7FaS3NEW3J/O9pM4xJOeuHuUQGC7cS//lBd5vkOp2I8gmcpRjxkV5ma6GTVA5srgHk9ftF8e2QlHaFSzGZ5foc+53Vt98/kudTBdcE0rOoJD/Drxy4AIGgVgH2sSsIk7MTCQCEicMNOmMkc6NEY+abqWkisTBPpfDBy6tyZAcQ6e5liqQQ/yCiieGlSoQJpgzl7nxh6ZoQj5364IgW7JXFxoyDJuC8qZoeMqqHVIomS5kqtWiT/6MCoAvqfhNnKIaI0dgxYtzreFKa1mnOkze+C0mg==\"}";
							 | 
						||
| 
								 | 
							
								//            TradeCallbackResponseV1 response = (TradeCallbackResponseV1) ApiUtils.parseNotifyJsonWithBocomSign(notifyJson, "UTF-8", APIGW_PUBLIC_KEY, TradeCallbackResponseV1.class);
							 | 
						||
| 
								 | 
							
								//            System.out.println(response);
							 | 
						||
| 
								 | 
							
								        } catch (Exception e) {
							 | 
						||
| 
								 | 
							
								            e.printStackTrace();
							 | 
						||
| 
								 | 
							
								        }
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								}
							 |