public class DefaultPaymentTransactionService extends java.lang.Object implements PaymentTransactionService
PaymentTransactionService
interface.
Implements transaction retrieval logic - for latest and accepted transactions.
Constructor and Description |
---|
DefaultPaymentTransactionService() |
Modifier and Type | Method and Description |
---|---|
void |
addProperty(java.lang.String name,
java.lang.String value,
IsvPaymentTransactionEntryModel entry)
Adds provided property to transaction entry's properties.
|
java.util.Optional<PaymentTransactionEntryModel> |
getLatestAcceptedTransactionEntry(PaymentTransactionModel paymentTransaction,
PaymentTransactionType type)
Gets payment transaction entry that matches given type and in ACCEPTED status.
|
java.util.Optional<PaymentTransactionModel> |
getLatestTransaction(PaymentType paymentType,
AbstractOrderModel order)
Gets order latest payment transaction that matches given payment type.
|
java.util.Optional<PaymentTransactionEntryModel> |
getLatestTransactionEntry(PaymentTransactionModel paymentTransaction,
PaymentTransactionType type,
java.lang.String... statuses)
Gets payment transaction entry that matches given type and statuses.
|
java.util.Optional<PaymentTransactionModel> |
getTransaction(PaymentType paymentType,
AbstractOrderModel order)
Gets order payment transaction that matches given payment type.
|
java.util.Optional<CardType> |
getTransactionCardTypeNew(PaymentTransactionModel transaction)
Gets card type for given transaction if present.
|
public java.util.Optional<PaymentTransactionModel> getTransaction(PaymentType paymentType, AbstractOrderModel order)
PaymentTransactionService
getTransaction
in interface PaymentTransactionService
paymentType
- the payment type to match against payment transactionorder
- the order that contains payment transactionspublic java.util.Optional<PaymentTransactionModel> getLatestTransaction(PaymentType paymentType, AbstractOrderModel order)
PaymentTransactionService
getLatestTransaction
in interface PaymentTransactionService
paymentType
- the payment type to match against payment transactionorder
- the order that contains payment transactionspublic java.util.Optional<PaymentTransactionEntryModel> getLatestAcceptedTransactionEntry(PaymentTransactionModel paymentTransaction, PaymentTransactionType type)
PaymentTransactionService
getLatestAcceptedTransactionEntry
in interface PaymentTransactionService
paymentTransaction
- the payment transaction that contains transaction entriestype
- the payment transaction type (e.g. AUTHORIZATION, CAPTURE, etc.)public java.util.Optional<PaymentTransactionEntryModel> getLatestTransactionEntry(PaymentTransactionModel paymentTransaction, PaymentTransactionType type, java.lang.String... statuses)
PaymentTransactionService
getLatestTransactionEntry
in interface PaymentTransactionService
paymentTransaction
- the payment transaction that contains transaction entriestype
- the payment transaction type (e.g. AUTHORIZATION, CAPTURE, etc.)statuses
- the payment transaction statuses (e.g. ACCEPT, REVIEW, etc.)public java.util.Optional<CardType> getTransactionCardTypeNew(PaymentTransactionModel transaction)
PaymentTransactionService
getTransactionCardTypeNew
in interface PaymentTransactionService
transaction
- transaction modelpublic void addProperty(java.lang.String name, java.lang.String value, IsvPaymentTransactionEntryModel entry)
PaymentTransactionService
addProperty
in interface PaymentTransactionService
name
- property namevalue
- property valueentry
- transaction entry to add property for