@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 MinimalPaymentData
public void setPreImageHash(byte[] preImageHash)
setPreImageHash
in interface MinimalPaymentData
preImageHash
- 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 MinimalPaymentData
public void setOrderAmount(Amount orderAmount)
setOrderAmount
in interface MinimalPaymentData
orderAmount
- 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 MinimalPaymentData
public void setSettled(boolean settled)
setSettled
in interface MinimalPaymentData
settled
- true if related invoice have been settled in full.public java.lang.String getBolt11Invoice()
getBolt11Invoice
in interface FullPaymentData
public void setBolt11Invoice(java.lang.String bolt11Invoice)
setBolt11Invoice
in interface FullPaymentData
bolt11Invoice
- the bolt11 lightning invoice displayed to the end user before
paying and invoice.public java.time.Instant getSettlementValidFrom()
getSettlementValidFrom
in interface FullPaymentData
public void setSettlementValidFrom(java.time.Instant settlementValidFrom)
setSettlementValidFrom
in interface FullPaymentData
settlementValidFrom
- 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 StandardPaymentData
public void setDescription(java.lang.String description)
setDescription
in interface StandardPaymentData
description
- 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 StandardPaymentData
public void setInvoiceAmount(CryptoAmount invoiceAmount)
setInvoiceAmount
in interface StandardPaymentData
invoiceAmount
- 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 StandardPaymentData
public void setInvoiceDate(java.time.Instant invoiceDate)
setInvoiceDate
in interface StandardPaymentData
invoiceDate
- the date the invoice was created in LightningHandler.public java.time.Instant getInvoiceExpireDate()
getInvoiceExpireDate
in interface StandardPaymentData
public void setInvoiceExpireDate(java.time.Instant invoiceExpireDate)
setInvoiceExpireDate
in interface StandardPaymentData
invoiceExpireDate
- 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 StandardPaymentData
public void setSettledAmount(CryptoAmount settledAmount)
setSettledAmount
in interface StandardPaymentData
settledAmount
- 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 StandardPaymentData
public void setSettlementDate(java.time.Instant settlementDate)
setSettlementDate
in interface StandardPaymentData
settlementDate
- 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 StandardPaymentData
FullPaymentData.getSettlementExpireDate()
public void setSettlementDuration(java.time.Duration settlementDuration)
If settlement expire date is set it has precedence over settlementDuration.
setSettlementDuration
in interface StandardPaymentData
settlementDuration
- the specific duration of this message.FullPaymentData.getSettlementExpireDate()
public java.time.Instant getSettlementExpireDate()
FullPaymentData
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.
getSettlementExpireDate
in interface FullPaymentData
StandardPaymentData.getSettlementDuration()
public void setSettlementExpireDate(java.time.Instant settlementExpireDate)
FullPaymentData
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.
setSettlementExpireDate
in interface FullPaymentData
settlementExpireDate
- 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 PerRequestPaymentData
public void setPayPerRequest(boolean payPerRequest)
setPayPerRequest
in interface PerRequestPaymentData
payPerRequest
- 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 PerRequestPaymentData
public void setExecuted(boolean executed)
setExecuted
in interface PerRequestPaymentData
executed
- 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