Search for transactions

Find a single transaction

Finding a single transaction based on the UID returned to when the transaction was created is easy.

Transaction transaction = gw.transaction().find("txn_8rCKriXE8TBBAC");

When searching for multiple transactions, you can use search criteria appropriate to the specific data type.

You can search for transactions using a multitude of different search filters. Depending on the data type of the search field, different search operators (e.g. is, in, contains, beginsWith, endsWith) are available to you.

Customer

Searching for transactions based on Customer data.

TransactionSearchRequest searchReq = new TransactionSearchRequest()
    .customerUids().in("cust_8rCKriXE8TBBAC", "cust_1rCKriXE8T1BAC")
    .customerCompany().is("company name")
    .customerFirstName().is("John")
    .customerLastName().is("Hancock")
    .customerEmail().is("j.hancock@server.com")
    .customerMobile().is("091 123 4567")
    .customerPhone().is("01 123 1234");

Billing address

You can search for transactions based on billing address.

TransactionSearchRequest searchReq = new TransactionSearchRequest()
    .billingCompany().is("company name")
    .billingFirstName().is("John")
    .billingLastName().is("Hancock")
    .billingLine1().is("street address 123")
    .billingLine2().is("")
    .billingCity().is("Zagreb")
    .billingPostalCode().is("AD123")
    .billingCountryIsoCode2().is("HR");

Credit Card

Searching for transactions based on CreditCard data.

TransactionSearchRequest searchReq = new TransactionSearchRequest()
    .cardholderName().is("John Hancock")
    .cardBin().is("435010")
    .cardNumberLast4().is("1002")
    .cardExpiryDate().is("10/2020");

Transaction properties

Search for transactions based on other properties, like transaction ID, type, payment method used etc.

TransactionSearchRequest searchReq = new TransactionSearchRequest()
    .ids().in("511244", "656733")
    .approvalCode().is("")
    .amount().between(new BigDecimal("2.00"), new BigDecimal("10.00"))
    .currencyCode().is("EUR")
    .orderId().is("123")
    .paymentMethod().is(Transaction.PaymentMethodType.VISA)
    .status().is(Transaction.Status.AUTHORIZED)
    .tags().in("TAG1", "TAG2");