Similar to the getPaymentInstruments but only returns the first element in the list and has a slightly different approach (no joined fetching) to enhance performance.
Syntax
PaymentInstrument
getBestPaymentInstrument
(
final long
customerId
,
final PaymentInstrument.Class
clazz
,
final Set< PaymentInstrument.Type >
types
,
final Currency
currency
,
final boolean
credit
)
Parameters
-
customerId –
-
clazz –
-
types –
-
currency –
-
credit –
Returns
the best payment instrument given the provided filters or null
Usage
the best payment instrument given the provided filters or null