예제 #1
0
 public void payServiceTest() {
   Worker worker = workerDAO.getWorkerById(7);
   Order order = orderDAO.getOrderById(8);
   Bankcard bankcard = bankcardDAO.getCardById(2);
   PayStatus status = payService.payForOrder(order, worker, bankcard);
   System.out.println(status.toString());
 }
예제 #2
0
  public void paymentTest() {
    Payment payment = new Payment();
    // 取出订单
    Order order = orderDAO.getOrderById(8);
    // 取出订单顾客
    Customer customer = order.getCustomer();
    // 取出操作员
    Worker worker = workerDAO.getWorkerById(7);
    // 取出银行卡
    Bankcard bankcard = customer.getBankcardList().get(0);

    payment.setPayCustomer(customer);
    System.out.println("OrderId:" + order.getOrderId());
    payment.setPayOrder(order);
    System.out.println(bankcard);
    payment.setPayCard(bankcard);
    payment.setPayPrice(order.getOrderPrice());
    payment.setPayType(1);
    payment.setWorker(worker);

    paymentDAO.createPayment(payment);
  }