pub struct MintQuoteCustomResponse<Q> {
pub quote: Q,
pub request: String,
pub amount: Option<Amount>,
pub amount_paid: Amount,
pub amount_issued: Amount,
pub unit: Option<CurrencyUnit>,
pub expiry: Option<u64>,
pub pubkey: Option<PublicKey>,
pub extra: Value,
}Expand description
Custom payment method mint quote response
This is a generic response type for custom payment methods.
The extra field allows payment-method-specific fields to be included
without being nested. When serialized, extra fields merge into the parent JSON:
{
"quote": "abc123",
"amount": 1000,
"amount_paid": 0,
"amount_issued": 0,
"paypal_link": "https://paypal.me/merchant",
"paypal_email": "merchant@example.com"
}This separation enables proper validation layering: the mint verifies well-defined fields (amount, unit, etc.) while passing extra through to the gRPC payment processor for method-specific validation.
It also provides a clean upgrade path: when a payment method becomes speced,
its fields can be promoted from extra to well-defined struct fields without
breaking existing clients (e.g., bolt12’s amount_paid and amount_issued).
Fields§
§quote: QQuote ID
request: StringPayment request string (method-specific format)
amount: Option<Amount>Amount
amount_paid: AmountAmount that has been paid
amount_issued: AmountAmount that has been issued
unit: Option<CurrencyUnit>Currency unit
expiry: Option<u64>Unix timestamp until the quote is valid
pubkey: Option<PublicKey>NUT-19 Pubkey
extra: ValueExtra payment-method-specific fields
These fields are flattened into the JSON representation, allowing custom payment methods to include additional data without nesting.
Implementations§
Source§impl<Q> MintQuoteCustomResponse<Q>where
Q: ToString,
impl<Q> MintQuoteCustomResponse<Q>where
Q: ToString,
Sourcepub fn to_string_id(&self) -> MintQuoteCustomResponse<String>
pub fn to_string_id(&self) -> MintQuoteCustomResponse<String>
Convert the MintQuoteCustomResponse with a quote type Q to a String
Trait Implementations§
Source§impl<Q> Clone for MintQuoteCustomResponse<Q>where
Q: Clone,
impl<Q> Clone for MintQuoteCustomResponse<Q>where
Q: Clone,
Source§fn clone(&self) -> MintQuoteCustomResponse<Q>
fn clone(&self) -> MintQuoteCustomResponse<Q>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<Q> Debug for MintQuoteCustomResponse<Q>where
Q: Debug,
impl<Q> Debug for MintQuoteCustomResponse<Q>where
Q: Debug,
Source§impl<'de, Q> Deserialize<'de> for MintQuoteCustomResponse<Q>where
Q: Serialize + for<'a> Deserialize<'a>,
impl<'de, Q> Deserialize<'de> for MintQuoteCustomResponse<Q>where
Q: Serialize + for<'a> Deserialize<'a>,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<MintQuoteCustomResponse<Q>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<MintQuoteCustomResponse<Q>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl<Q> Eq for MintQuoteCustomResponse<Q>where
Q: Eq,
Source§impl From<MintQuoteCustomResponse<QuoteId>> for MintQuoteCustomResponse<String>
Available on crate feature mint only.
impl From<MintQuoteCustomResponse<QuoteId>> for MintQuoteCustomResponse<String>
mint only.Source§fn from(
value: MintQuoteCustomResponse<QuoteId>,
) -> MintQuoteCustomResponse<String>
fn from( value: MintQuoteCustomResponse<QuoteId>, ) -> MintQuoteCustomResponse<String>
Source§impl<Q> PartialEq for MintQuoteCustomResponse<Q>where
Q: PartialEq,
impl<Q> PartialEq for MintQuoteCustomResponse<Q>where
Q: PartialEq,
Source§fn eq(&self, other: &MintQuoteCustomResponse<Q>) -> bool
fn eq(&self, other: &MintQuoteCustomResponse<Q>) -> bool
self and other values to be equal, and is used by ==.