pub struct PaygateBuilder { /* private fields */ }server only.Expand description
Implementations§
Source§impl PaygateBuilder
impl PaygateBuilder
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_resource_hook(
self,
hook: impl ResourceServerHooks + 'static,
) -> Self
pub fn with_resource_hook( self, hook: impl ResourceServerHooks + 'static, ) -> Self
Registers a transport-agnostic ResourceServerHooks lifecycle hook.
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.