/** * 支付失败 * * @param sn 支付编号 */ public void failure(String sn) { Payment payment = get(sn); payment.setPaymentStatus(Payment.PaymentStatus.failure); payment.setTradeNo(PaymentContext.getContext().getPayResult().getTradeNo()); payment = this.paymentDao.save(payment); // PaymentContext.getContext().payFailure(PaymentContext.getContext().getPayment()); }
/** * 付款成功 * * @param sn 支付编号 */ public void success(String sn, String tradeNo) { Payment payment = get(sn); payment.setPaymentStatus(Payment.PaymentStatus.success); payment.setTradeNo(tradeNo); this.paymentDao.save(payment); // TODO 订单事件触发方式 // PaymentContext.getContext().paySuccess(PaymentContext.getContext().getPayment()); }
public void close(String sn, String tradeNo) { Payment payment = get(sn); payment.setPaymentStatus(Payment.PaymentStatus.invalid); payment.setTradeNo(tradeNo); this.paymentDao.save(payment); }