pub struct PaymentProtocolServer;Expand description
BIP70 Payment Protocol server (for receiving payments via P2P)
Note: Node-specific message creation functions are in blvm-node. This struct provides protocol-level processing only.
Implementations§
Source§impl PaymentProtocolServer
impl PaymentProtocolServer
Sourcepub fn create_signed_payment_request(
details: PaymentDetails,
merchant_private_key: &[u8; 32],
authorized_refunds: Option<Vec<SignedRefundAddress>>,
) -> Result<PaymentRequest, Bip70Error>
pub fn create_signed_payment_request( details: PaymentDetails, merchant_private_key: &[u8; 32], authorized_refunds: Option<Vec<SignedRefundAddress>>, ) -> Result<PaymentRequest, Bip70Error>
Create signed payment request (protocol-level).
Sourcepub fn process_payment(
payment: &Payment,
original_request: &PaymentRequest,
merchant_private_key: Option<&[u8; 32]>,
) -> Result<PaymentACK, Bip70Error>
pub fn process_payment( payment: &Payment, original_request: &PaymentRequest, merchant_private_key: Option<&[u8; 32]>, ) -> Result<PaymentACK, Bip70Error>
Process incoming payment (protocol-level validation and ACK creation).
Sourcepub fn sign_refund_address(
address: PaymentOutput,
merchant_private_key: &[u8; 32],
) -> Result<SignedRefundAddress, Bip70Error>
pub fn sign_refund_address( address: PaymentOutput, merchant_private_key: &[u8; 32], ) -> Result<SignedRefundAddress, Bip70Error>
Sign a refund address for inclusion in PaymentRequest.
Sourcepub fn verify_refund_address(
signed_refund: &SignedRefundAddress,
merchant_pubkey: &[u8],
) -> Result<(), Bip70Error>
pub fn verify_refund_address( signed_refund: &SignedRefundAddress, merchant_pubkey: &[u8], ) -> Result<(), Bip70Error>
Verify signed refund address.
Auto Trait Implementations§
impl Freeze for PaymentProtocolServer
impl RefUnwindSafe for PaymentProtocolServer
impl Send for PaymentProtocolServer
impl Sync for PaymentProtocolServer
impl Unpin for PaymentProtocolServer
impl UnsafeUnpin for PaymentProtocolServer
impl UnwindSafe for PaymentProtocolServer
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> 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