pub struct ResponseProcessor<'pw, F, Res>where
F: Facilitator,{
pub paywall: &'pw PayWall<F>,
pub response: Res,
pub payload: PaymentPayload,
pub selected: PaymentRequirements,
pub payment_state: PaymentState,
}Expand description
Payment processing state after running the resource handler.
Fields§
§paywall: &'pw PayWall<F>§response: Res§payload: PaymentPayload§selected: PaymentRequirements§payment_state: PaymentStateImplementations§
Source§impl<'pw, F, Res> ResponseProcessor<'pw, F, Res>where
F: Facilitator,
Res: HttpResponse,
impl<'pw, F, Res> ResponseProcessor<'pw, F, Res>where
F: Facilitator,
Res: HttpResponse,
Sourcepub async fn settle(
self,
) -> Result<ResponseProcessor<'pw, F, Res>, ErrorResponse>
pub async fn settle( self, ) -> Result<ResponseProcessor<'pw, F, Res>, ErrorResponse>
Settle the payment with the facilitator after running the resource handler.
After settlement, self.payment_state.settled will be populated on success.
Sourcepub async fn settle_on(
self,
predicate: impl Fn(&Res) -> bool,
) -> Result<ResponseProcessor<'pw, F, Res>, ErrorResponse>
pub async fn settle_on( self, predicate: impl Fn(&Res) -> bool, ) -> Result<ResponseProcessor<'pw, F, Res>, ErrorResponse>
Conditionally settle the payment based on the provided prediction function.
After settlement, self.payment_state.settled will be populated on success.
Sourcepub async fn settle_on_success(
self,
) -> Result<ResponseProcessor<'pw, F, Res>, ErrorResponse>
pub async fn settle_on_success( self, ) -> Result<ResponseProcessor<'pw, F, Res>, ErrorResponse>
Settle the payment if the response status is a success (2xx).
After settlement, self.payment_state.settled will be populated on success.
Auto Trait Implementations§
impl<'pw, F, Res> Freeze for ResponseProcessor<'pw, F, Res>where
Res: Freeze,
impl<'pw, F, Res> RefUnwindSafe for ResponseProcessor<'pw, F, Res>where
Res: RefUnwindSafe,
F: RefUnwindSafe,
impl<'pw, F, Res> Send for ResponseProcessor<'pw, F, Res>
impl<'pw, F, Res> Sync for ResponseProcessor<'pw, F, Res>
impl<'pw, F, Res> Unpin for ResponseProcessor<'pw, F, Res>where
Res: Unpin,
impl<'pw, F, Res> UnsafeUnpin for ResponseProcessor<'pw, F, Res>where
Res: UnsafeUnpin,
impl<'pw, F, Res> UnwindSafe for ResponseProcessor<'pw, F, Res>where
Res: UnwindSafe,
F: RefUnwindSafe,
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