pub struct MintQuoteCustomResponse<Q> {
pub quote: Q,
pub request: String,
pub amount: Option<Amount>,
pub unit: Option<CurrencyUnit>,
pub state: QuoteState,
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",
"state": "UNPAID",
"amount": 1000,
"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, state, 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
unit: Option<CurrencyUnit>Currency unit
state: QuoteStateQuote State
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 · 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>,
Source§impl From<MintQuoteCustomResponse<QuoteId>> for MintQuoteCustomResponse<String>
Available on crate feature mint only.
impl From<MintQuoteCustomResponse<QuoteId>> for MintQuoteCustomResponse<String>
mint only.