pub struct PaygateBuilder<TFacilitator> { /* private fields */ }Available on crate feature
server only.Expand description
Implementations§
Source§impl<TFacilitator> PaygateBuilder<TFacilitator>
impl<TFacilitator> PaygateBuilder<TFacilitator>
Sourcepub fn accepts(self, price_tags: impl IntoIterator<Item = PriceTag>) -> Self
pub fn accepts(self, price_tags: impl IntoIterator<Item = PriceTag>) -> Self
Adds multiple accepted payment options.
Sourcepub fn resource(self, resource: ResourceInfo) -> Self
pub fn resource(self, resource: ResourceInfo) -> Self
Sets the resource metadata returned in 402 responses.
Sourcepub fn hooks<H>(self, hooks: H) -> Selfwhere
H: PaygateHooks + 'static,
pub fn hooks<H>(self, hooks: H) -> Selfwhere
H: PaygateHooks + 'static,
Attaches PaygateHooks for pre- and
post-payment extensibility (Fix-8). Stored as an Arc<dyn> so hook
state can be shared across cloned middleware instances without
duplication.
Sourcepub fn hooks_dyn(self, hooks: Arc<dyn DynPaygateHooks>) -> Self
pub fn hooks_dyn(self, hooks: Arc<dyn DynPaygateHooks>) -> Self
Attaches hooks that are already stored behind an
Arc<dyn DynPaygateHooks>.
This avoids re-wrapping when the same hook object needs to be shared between the middleware layer and the paygate it constructs.
Sourcepub fn with_settlement_tracker(
self,
tracker: BackgroundSettlementTracker,
) -> Self
pub fn with_settlement_tracker( self, tracker: BackgroundSettlementTracker, ) -> Self
Attaches a BackgroundSettlementTracker so background settlement
tasks register with it. Used to await in-flight settlements during
graceful shutdown via Paygate::settlement_tracker +
BackgroundSettlementTracker::wait_for_drain.
Auto Trait Implementations§
impl<TFacilitator> !RefUnwindSafe for PaygateBuilder<TFacilitator>
impl<TFacilitator> !UnwindSafe for PaygateBuilder<TFacilitator>
impl<TFacilitator> Freeze for PaygateBuilder<TFacilitator>where
TFacilitator: Freeze,
impl<TFacilitator> Send for PaygateBuilder<TFacilitator>where
TFacilitator: Send,
impl<TFacilitator> Sync for PaygateBuilder<TFacilitator>where
TFacilitator: Sync,
impl<TFacilitator> Unpin for PaygateBuilder<TFacilitator>where
TFacilitator: Unpin,
impl<TFacilitator> UnsafeUnpin for PaygateBuilder<TFacilitator>where
TFacilitator: UnsafeUnpin,
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