@Entity public class DemoFullPaymentData extends java.lang.Object implements FullPaymentData
| Constructor and Description |
|---|
DemoFullPaymentData() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getBolt11Invoice() |
java.lang.String |
getDescription() |
java.lang.Integer |
getId() |
CryptoAmount |
getInvoiceAmount() |
java.time.Instant |
getInvoiceDate() |
java.time.Instant |
getInvoiceExpireDate() |
Amount |
getOrderAmount() |
byte[] |
getPreImageHash()
Unique identifier of a payment in the system and also used in LightningHandler
to identify an invoice.
|
CryptoAmount |
getSettledAmount() |
java.time.Instant |
getSettlementDate() |
java.time.Duration |
getSettlementDuration()
The settlement duration indicates how long time a generated settlement should be valid.
|
java.time.Instant |
getSettlementExpireDate()
The settlement expire date sets the timestamp when a generated settlement token should expire.
|
java.time.Instant |
getSettlementValidFrom() |
boolean |
isExecuted() |
boolean |
isPayPerRequest() |
boolean |
isSettled() |
void |
setBolt11Invoice(java.lang.String bolt11Invoice) |
void |
setDescription(java.lang.String description) |
void |
setExecuted(boolean executed) |
void |
setId(java.lang.Integer id) |
void |
setInvoiceAmount(CryptoAmount invoiceAmount) |
void |
setInvoiceDate(java.time.Instant invoiceDate) |
void |
setInvoiceExpireDate(java.time.Instant invoiceExpireDate) |
void |
setOrderAmount(Amount orderAmount) |
void |
setPayPerRequest(boolean payPerRequest) |
void |
setPreImageHash(byte[] preImageHash) |
void |
setSettled(boolean settled) |
void |
setSettledAmount(CryptoAmount settledAmount) |
void |
setSettlementDate(java.time.Instant settlementDate) |
void |
setSettlementDuration(java.time.Duration settlementDuration)
The settlement duration indicates how long time a generated settlement should be valid.
|
void |
setSettlementExpireDate(java.time.Instant settlementExpireDate)
The settlement expire date sets the timestamp when a generated settlement token should expire.
|
void |
setSettlementValidFrom(java.time.Instant settlementValidFrom) |
java.lang.String |
toString() |
public java.lang.Integer getId()
public void setId(java.lang.Integer id)
id - Unique Id of database row.public byte[] getPreImageHash()
getPreImageHash in interface MinimalPaymentDatapublic void setPreImageHash(byte[] preImageHash)
setPreImageHash in interface MinimalPaymentDatapreImageHash - unique identifier of a payment in the system and also used in LightningHandler
to identify an invoice. Should be generated by TokenGenerator when
creating an order and not set manually.public Amount getOrderAmount()
getOrderAmount in interface MinimalPaymentDatapublic void setOrderAmount(Amount orderAmount)
setOrderAmount in interface MinimalPaymentDataorderAmount - the requested amount for payment. This can be either a FiatAmount or CryptoAmount but
always make sure the systems configured CurrencyConverter supports this currency when converting
into a currency accepted by the LightningHandler later in the payment flow.public boolean isSettled()
isSettled in interface MinimalPaymentDatapublic void setSettled(boolean settled)
setSettled in interface MinimalPaymentDatasettled - true if related invoice have been settled in full.public java.lang.String getBolt11Invoice()
getBolt11Invoice in interface FullPaymentDatapublic void setBolt11Invoice(java.lang.String bolt11Invoice)
setBolt11Invoice in interface FullPaymentDatabolt11Invoice - the bolt11 lightning invoice displayed to the end user before
paying and invoice.public java.time.Instant getSettlementValidFrom()
getSettlementValidFrom in interface FullPaymentDatapublic void setSettlementValidFrom(java.time.Instant settlementValidFrom)
setSettlementValidFrom in interface FullPaymentDatasettlementValidFrom - the valid from timestamp used in generated settlement tokens. If null is
no valid from used, only validUntil.public java.lang.String getDescription()
getDescription in interface StandardPaymentDatapublic void setDescription(java.lang.String description)
setDescription in interface StandardPaymentDatadescription - a short description of the payment used in the lightning invoice and might
be displayed to the end user.public CryptoAmount getInvoiceAmount()
getInvoiceAmount in interface StandardPaymentDatapublic void setInvoiceAmount(CryptoAmount invoiceAmount)
setInvoiceAmount in interface StandardPaymentDatainvoiceAmount - the amount set in the lightning invoice, this is the same as orderAmount if
the same currency is used in order as in lightning invoice, otherwise is the currency
converted before creating the invoice in LightningHandler and the actual invoiced amount
is specified here.public java.time.Instant getInvoiceDate()
getInvoiceDate in interface StandardPaymentDatapublic void setInvoiceDate(java.time.Instant invoiceDate)
setInvoiceDate in interface StandardPaymentDatainvoiceDate - the date the invoice was created in LightningHandler.public java.time.Instant getInvoiceExpireDate()
getInvoiceExpireDate in interface StandardPaymentDatapublic void setInvoiceExpireDate(java.time.Instant invoiceExpireDate)
setInvoiceExpireDate in interface StandardPaymentDatainvoiceExpireDate - the date a generated invoice should expire, this value will be used
when creating invoice in LightningHandler. If null will default invoice validity
be used to calculate an expire date automatically.public CryptoAmount getSettledAmount()
getSettledAmount in interface StandardPaymentDatapublic void setSettledAmount(CryptoAmount settledAmount)
setSettledAmount in interface StandardPaymentDatasettledAmount - the amount that was settled in the LightningHandlers supported crypto currency.
Should be equal to invoiceAmount if fully settled. Null if invoice isn't settled yet.public java.time.Instant getSettlementDate()
getSettlementDate in interface StandardPaymentDatapublic void setSettlementDate(java.time.Instant settlementDate)
setSettlementDate in interface StandardPaymentDatasettlementDate - the timestamp the invoice was settled in LightningHandler. Null if not settled yet.public java.time.Duration getSettlementDuration()
If settlement expire date is set it has precedence over settlementDuration.
Important: Data in this field is only set to instruct the settlement token generator of expiration date. the actual settlement date is not updated in this field.
getSettlementDuration in interface StandardPaymentDataFullPaymentData.getSettlementExpireDate()public void setSettlementDuration(java.time.Duration settlementDuration)
If settlement expire date is set it has precedence over settlementDuration.
setSettlementDuration in interface StandardPaymentDatasettlementDuration - the specific duration of this message.FullPaymentData.getSettlementExpireDate()public java.time.Instant getSettlementExpireDate()
FullPaymentDataIf settlement expire date is set it has precedence over settlementDuration.
Important: Data in this field is only set to instruct the settlement token generator of expiration date. the actual settlement date is not updated in this field.
getSettlementExpireDate in interface FullPaymentDataStandardPaymentData.getSettlementDuration()public void setSettlementExpireDate(java.time.Instant settlementExpireDate)
FullPaymentDataIf settlement expire date is set it has precedence over settlementDuration.
Important: Data in this field is only set to instruct the settlement token generator of expiration date. the actual settlement date is not updated in this field.
setSettlementExpireDate in interface FullPaymentDatasettlementExpireDate - the date the settlement will expire used to indicate how long a settlement token should be valid.
If null will default settlement validity be used.StandardPaymentData.getSettlementDuration()public boolean isPayPerRequest()
isPayPerRequest in interface PerRequestPaymentDatapublic void setPayPerRequest(boolean payPerRequest)
setPayPerRequest in interface PerRequestPaymentDatapayPerRequest - flag indicating that this payment is for one request only. The implementation
can take the payPerRequest flag from the order request as guidance, but it is the PaymentHandler
that ultimately decides if payPerRequest should be set.public boolean isExecuted()
isExecuted in interface PerRequestPaymentDatapublic void setExecuted(boolean executed)
setExecuted in interface PerRequestPaymentDataexecuted - true if related request have been executed, is set after successful processing
if a payed call and used to indicate that it cannot be processed again.public java.lang.String toString()
toString in class java.lang.Object