pub struct RequestProcessor<'pw, F: Facilitator, Req> {
pub paywall: &'pw PayWall<F>,
pub request: Request<Req>,
pub payload: PaymentPayload,
pub selected: PaymentRequirements,
pub payment_state: PaymentState,
}Expand description
Payment processing state before running the resource handler.
See PayWall for usage in the full payment processing flow.
Fields§
§paywall: &'pw PayWall<F>§request: Request<Req>§payload: PaymentPayload§selected: PaymentRequirements§payment_state: PaymentStateImplementations§
Source§impl<'pw, F: Facilitator, Req> RequestProcessor<'pw, F, Req>
impl<'pw, F: Facilitator, Req> RequestProcessor<'pw, F, Req>
Sourcepub async fn verify(self) -> Result<Self, ErrorResponse>
pub async fn verify(self) -> Result<Self, ErrorResponse>
Verify the payment with the facilitator.
self.payment_state.verified will be populated on success.
Sourcepub async fn settle(self) -> Result<Self, ErrorResponse>
pub async fn settle(self) -> Result<Self, ErrorResponse>
Settle the payment with the facilitator.
self.payment_state.settled will be populated on success.
Sourcepub async fn run_handler<Fun, Fut, Res>(
self,
handler: Fun,
) -> Result<ResponseProcessor<'pw, F, Res>, ErrorResponse>
pub async fn run_handler<Fun, Fut, Res>( self, handler: Fun, ) -> Result<ResponseProcessor<'pw, F, Res>, ErrorResponse>
Run the resource handler with the payment state attached to the request extensions.
After running the handler, returns a ResponseProcessor for further processing.
Auto Trait Implementations§
impl<'pw, F, Req> !Freeze for RequestProcessor<'pw, F, Req>
impl<'pw, F, Req> !RefUnwindSafe for RequestProcessor<'pw, F, Req>
impl<'pw, F, Req> Send for RequestProcessor<'pw, F, Req>
impl<'pw, F, Req> Sync for RequestProcessor<'pw, F, Req>
impl<'pw, F, Req> Unpin for RequestProcessor<'pw, F, Req>where
Req: Unpin,
impl<'pw, F, Req> !UnwindSafe for RequestProcessor<'pw, F, Req>
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