Ejemplo n.º 1
0
  @SuppressWarnings("unchecked")
  @Test
  public void getUnsettledTransactionListRequest() {

    if (reportingBatchId != null) {
      // batch list request
      net.authorize.reporting.Transaction transaction =
          merchant.createReportingTransaction(TransactionType.GET_UNSETTLED_TRANSACTION_LIST);
      ReportingDetails reportingDetails = ReportingDetails.createReportingDetails();
      transaction.setReportingDetails(reportingDetails);

      Result<Transaction> result = (Result<Transaction>) merchant.postTransaction(transaction);

      Assert.assertNotNull(result);
      result.printMessages();
      Assert.assertTrue(result.isOk());
      Assert.assertNotNull(result.getReportingDetails().getTransactionDetailList());
      Assert.assertTrue(result.getReportingDetails().getTransactionDetailList().size() >= 0);
      for (TransactionDetails transactionDetail :
          result.getReportingDetails().getTransactionDetailList()) {
        Assert.assertNotNull(transactionDetail.getAccountNumber());
        Assert.assertNotNull(transactionDetail.getTransId());
        reportingTransId = transactionDetail.getTransId();
        Assert.assertNotNull(transactionDetail.getAccountType());
        Assert.assertNotNull(transactionDetail.getSettleAmount());
        Assert.assertNotNull(transactionDetail.getSubmitTimeLocal());
        Assert.assertNotNull(transactionDetail.getSubmitTimeUTC());
        Assert.assertNotNull(transactionDetail.getTransactionStatus());
      }
    } else {
      Assert.assertTrue(true);
      System.out.println(
          "getUnsettledTransactionListRequest did not have a reporting batch id to query");
    }
  }
Ejemplo n.º 2
0
  @SuppressWarnings("unchecked")
  @Test
  public void getTransactionListRequestLive() {

    // batch list request
    net.authorize.reporting.Transaction transaction =
        merchant.createReportingTransaction(TransactionType.GET_TRANSACTION_LIST);
    ReportingDetails reportingDetails = ReportingDetails.createReportingDetails();
    reportingDetails.setBatchId(reportingBatchId);
    transaction.setReportingDetails(reportingDetails);

    Result<Transaction> result = (Result<Transaction>) merchant.postTransaction(transaction);

    Assert.assertNotNull(result);
    result.printMessages();
    Assert.assertTrue(result.isOk());
    Assert.assertNotNull(result.getReportingDetails().getTransactionDetailList());
    Assert.assertTrue(result.getReportingDetails().getTransactionDetailList().size() > 0);
    for (TransactionDetails transactionDetail :
        result.getReportingDetails().getTransactionDetailList()) {
      Assert.assertNotNull(transactionDetail.getAccountNumber());
      Assert.assertNotNull(transactionDetail.getTransId());
      reportingTransId = transactionDetail.getTransId();
      Assert.assertNotNull(transactionDetail.getAccountType());
      Assert.assertNotNull(transactionDetail.getSettleAmount());
      Assert.assertNotNull(transactionDetail.getSubmitTimeLocal());
      Assert.assertNotNull(transactionDetail.getSubmitTimeUTC());
      Assert.assertNotNull(transactionDetail.getTransactionStatus());
    }
  }