Prerequisites
- An active Payrails session (see Quick Start)
- The
Sessionreference returned byPayrails.createSession(...)
Query session data with session.query()
Hold on to the Session returned by createSession(...) and call query() on it with
a typed key from PayrailsQuery:
null when the queried data is not present. No exception is thrown.
Available keys
PayrailsQuery.ExecutionId
The unique identifier for the active payment execution.
PayrailsQuery.HolderReference
The holder reference for the active session.
PayrailsQuery.Amount
The current checkout amount as a PayrailsAmount.
PayrailsQuery.BinLookup
The BIN lookup action link from the session config, as a
PayrailsLink.
PayrailsQuery.InstrumentDelete
The stored instrument delete action link.
PayrailsQuery.InstrumentUpdate
The stored instrument update action link.
PayrailsQuery.PaymentMethodConfig
Configuration for a specific payment method, as a
PayrailsPaymentMethodConfig.
"card", "paypal") as the parameter. Returns
null if the code is not present in the session config.
PayrailsQuery.PaymentMethodInstruments
Stored instruments for a specific payment method.
null if the payment method code is unrecognised or has no stored instruments.
Never returns an empty list — use null as the “nothing available” signal.
Discovering redirect-capable payment methods
PayrailsQuery.AvailableRedirectMethods has been removed. To list redirect-based
payment methods configured for the session, use
session.getPaymentMethodConfig(PaymentMethodFilter.Redirect):
null) when no redirect methods are configured. Use this to
dynamically build your redirect payment UI rather than hardcoding method codes.
See How to Accept Redirect Payments for the full
integration guide.