コード例 #1
0
ファイル: PaymentService.java プロジェクト: bagnos/othala
  @Override
  public void sendMailAcceptedPyamentAfterPending(
      OrderFullDTO order, MailPropertiesDTO mailProps, TypeStateOrder state)
      throws MailNotSendException {
    // TODO Auto-generated method stub
    String content = null;
    String mail = order.getIdUser();
    try {
      content = Template.getContenFile(TipoTemplate.MailIPNAcceptedPaymemtAfetPending);
    } catch (IOException e) {
      // TODO Auto-generated catch block
      throw new MailNotSendException(e);
    }

    content =
        content.replaceAll(
            "<COMPANY_NAME>", mailProps.getCompanyName() == null ? "" : mailProps.getCompanyName());
    content = content.replaceAll("<NAME>", order.getNameUser() + " " + order.getSurnameUser());
    content = content.replaceAll("<idTransazione>", order.getIdTransaction());
    content = content.replaceAll("<idOrder>", String.valueOf(order.getIdOrder()));
    content = content.replaceAll("<importo>", OthalaCommonUtils.getImporto(order.getImOrdine()));

    String subject = "Pagamento Accettato ";
    subject += mailProps.getCompanyName();

    mailService.inviaMail(new String[] {mail}, subject, content, mailProps);
    // invia le mail al cliente e ai negozi sUll'avvenuta ricezione
    // delpagamento
    sendMailAcceptedPyament(order, mailProps, TypeStateOrder.getDescrState(state.getState()));
  }
コード例 #2
0
ファイル: PaymentService.java プロジェクト: bagnos/othala
  @Override
  public void sendMailRefusedPayment(OrderFullDTO order, MailPropertiesDTO mailProps)
      throws MailNotSendException {
    // TODO Auto-generated method stub
    String content = null;
    String mail = order.getIdUser();
    try {
      content = Template.getContenFile(TipoTemplate.MailIPNRefusePayment);
    } catch (IOException e) {
      // TODO Auto-generated catch block
      throw new MailNotSendException(e);
    }

    content = content.replaceAll("<COMPANY_NAME>", mailProps.getCompanyName());
    content = content.replaceAll("<NAME>", order.getNameUser() + " " + order.getSurnameUser());
    content = content.replaceAll("<idTransazione>", order.getIdTransaction());
    content = content.replaceAll("<idOrder>", String.valueOf(order.getIdOrder()));
    content = content.replaceAll("<importo>", OthalaCommonUtils.getImporto(order.getImOrdine()));

    String subject = "Pagamento Rifiutato ";
    subject += mailProps.getCompanyName();

    mailService.inviaMail(new String[] {mail}, subject, content, mailProps);
  }