pub struct Payment {
pub transactions: Vec<Vec<u8>>,
pub refund_to: Option<Vec<PaymentOutput>>,
pub merchant_data: Option<Vec<u8>>,
pub memo: Option<String>,
}Expand description
Payment - Customer payment transaction(s)
Fields§
§transactions: Vec<Vec<u8>>Serialized transaction(s)
refund_to: Option<Vec<PaymentOutput>>Refund addresses (if change needed)
merchant_data: Option<Vec<u8>>Merchant data (echo back from PaymentRequest)
memo: Option<String>Memo from customer
Implementations§
Source§impl Payment
impl Payment
Sourcepub fn with_refund_to(self, outputs: Vec<PaymentOutput>) -> Self
pub fn with_refund_to(self, outputs: Vec<PaymentOutput>) -> Self
Add refund address (must be pre-authorized in PaymentRequest)
Sourcepub fn validate_refund_addresses(
&self,
authorized_refunds: &[SignedRefundAddress],
) -> Result<(), Bip70Error>
pub fn validate_refund_addresses( &self, authorized_refunds: &[SignedRefundAddress], ) -> Result<(), Bip70Error>
Validate refund addresses against PaymentRequest authorized list
Sourcepub fn with_merchant_data(self, data: Vec<u8>) -> Self
pub fn with_merchant_data(self, data: Vec<u8>) -> Self
Set merchant data (echo from PaymentRequest)
Sourcepub fn validate(&self) -> Result<(), Bip70Error>
pub fn validate(&self) -> Result<(), Bip70Error>
Validate payment
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Payment
impl<'de> Deserialize<'de> for Payment
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Payment
impl RefUnwindSafe for Payment
impl Send for Payment
impl Sync for Payment
impl Unpin for Payment
impl UnsafeUnpin for Payment
impl UnwindSafe for Payment
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more