NotifyCallback.java 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. package com.keao.edu.thirdparty.adapay;
  2. import com.alibaba.fastjson.JSON;
  3. import com.huifu.adapay.model.payment.Payment;
  4. import com.huifu.adapay.model.refund.Refund;
  5. import com.huifu.adapay.notify.INotifyCallback;
  6. /**
  7. * @author jane.zhao
  8. */
  9. public class NotifyCallback implements INotifyCallback {
  10. /**
  11. * 用户接收并处理支付成功的异步消息
  12. * @param payment 成功的支付对象
  13. * @throws Exception 异常
  14. */
  15. @Override
  16. public void paymentSuccessMessageArrived(Payment payment) throws Exception {
  17. System.out.println("receive paymentSuccess msg=" + JSON.toJSONString(payment));
  18. }
  19. /**
  20. * 用户接收并处理支付失败的异步消息
  21. * @param payment 失败的支付对象
  22. * @throws Exception 异常
  23. */
  24. @Override
  25. public void paymentFailedMessageArrived(Payment payment) throws Exception {
  26. System.out.println("receive paymentFailed msg=" + JSON.toJSONString(payment));
  27. }
  28. /**
  29. * 用户接收并处理关闭支付交易成功的异步消息
  30. * @param payment 关闭成功的支付对象
  31. * @throws Exception 异常
  32. */
  33. @Override
  34. public void paymentCloseSuccessMessageArrived(Payment payment) throws Exception {
  35. System.out.println("receive paymentCloseSuccess msg=" + JSON.toJSONString(payment));
  36. }
  37. /**
  38. * 用户接收并处理关闭支付交易失败的异步消息
  39. * @param payment 关闭失败的支付对象
  40. * @throws Exception 异常
  41. */
  42. @Override
  43. public void paymentCloseFailedMessageArrived(Payment payment) throws Exception {
  44. System.out.println("receive paymentCloseFailed msg=" + JSON.toJSONString(payment));
  45. }
  46. /**
  47. * 用户接收并处理退款成功的异步消息
  48. * @param refund 成功的退款对象
  49. * @throws Exception 异常
  50. */
  51. @Override
  52. public void refundSuccessMessageArrived(Refund refund) throws Exception {
  53. System.out.println("receive refundSuccess msg=" + JSON.toJSONString(refund));
  54. }
  55. /**
  56. * 用户接收并处理退款失败的异步消息
  57. * @param refund 失败的退款对象
  58. * @throws Exception 异常
  59. */
  60. @Override
  61. public void refundFailedMessageArrived(Refund refund) throws Exception {
  62. System.out.println("receive refundFailed msg=" + JSON.toJSONString(refund));
  63. }
  64. /**
  65. * 用户接收并处理未知的异步消息
  66. * @param msg 未知消息
  67. * @throws Exception 异常
  68. */
  69. @Override
  70. public void unknownMessageArrived(String msg) throws Exception {
  71. System.out.println("receive unknown msg=" + msg);
  72. }
  73. }