package org.springblade.yeePay.listener;

import com.alibaba.fastjson.JSONObject;
import org.springblade.yeePay.event.PayNotifyEvent;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

@Component
public class PayNotifyListener {


	/**
	 * 	支付回调业务逻辑处理
	 * @param  payNotifyEvent 回调解密数据
	 * */
	@EventListener
	@Async
	public void onApplicationEvent(PayNotifyEvent payNotifyEvent) {
		System.out.println("==================================================================");
		JSONObject decryptData = payNotifyEvent.getDecryptData();
		//返回数据
//		{
//			"channelOrderId":"4200001122202107026714708759",
//			"orderId":"1625223889567",
//			"bankOrderId":"5908531301210702",
//			"paySuccessDate":"2021-07-02 19:04:55",
//			"channel":"WECHAT",
//			"payWay":"WECHAT_OFFIACCOUNT",
//			"uniqueOrderNo":"1013202107020000002383974179",
//			"orderAmount":"0.01",
//			"payAmount":"0.01",
//			"payerInfo":"{\"bankCardNo\":\"\",\"bankId\":\"CFT\",\"cardType\":\"CFT\",\"mobilePhoneNo\":\"\",\"userID\":\"o19581K7Nz5lUwsqaT10yTqOe1MI\"}",
//			"realPayAmount":"0.01",
//			"parentMerchantNo":"10086062555",
//			"merchantNo":"10086062555",
//			"status":"SUCCESS"
//		}


	}


}
