pub trait ResourceServerHooks: Send + Sync {
// Provided methods
fn before_verify<'a>(
&'a self,
_ctx: &'a PaymentHookContext,
) -> impl Future<Output = BeforeOpDecision<VerifyResponse>> + Send + 'a { ... }
fn after_verify<'a>(
&'a self,
_ctx: &'a VerifyResultContext,
) -> impl Future<Output = AfterVerifyDecision> + Send + 'a { ... }
fn on_verify_failure<'a>(
&'a self,
_ctx: &'a PaymentHookContext,
_error: &'a FacilitatorError,
) -> impl Future<Output = FailureRecovery<VerifyResponse>> + Send + 'a { ... }
fn before_settle<'a>(
&'a self,
_ctx: &'a SettleContext,
) -> impl Future<Output = BeforeOpDecision<SettleResponse>> + Send + 'a { ... }
fn after_settle<'a>(
&'a self,
_ctx: &'a SettleResultContext,
) -> impl Future<Output = ()> + Send + 'a { ... }
fn on_settle_failure<'a>(
&'a self,
_ctx: &'a SettleContext,
_error: &'a FacilitatorError,
) -> impl Future<Output = FailureRecovery<SettleResponse>> + Send + 'a { ... }
fn on_verified_payment_canceled<'a>(
&'a self,
_ctx: &'a VerifiedPaymentCanceledContext,
) -> impl Future<Output = ()> + Send + 'a { ... }
}Expand description
Lifecycle hooks for the resource server (transport-agnostic).
All methods default to no-ops. Override only what you need.
Provided Methods§
Sourcefn before_verify<'a>(
&'a self,
_ctx: &'a PaymentHookContext,
) -> impl Future<Output = BeforeOpDecision<VerifyResponse>> + Send + 'a
fn before_verify<'a>( &'a self, _ctx: &'a PaymentHookContext, ) -> impl Future<Output = BeforeOpDecision<VerifyResponse>> + Send + 'a
Runs before facilitator verify.
Sourcefn after_verify<'a>(
&'a self,
_ctx: &'a VerifyResultContext,
) -> impl Future<Output = AfterVerifyDecision> + Send + 'a
fn after_verify<'a>( &'a self, _ctx: &'a VerifyResultContext, ) -> impl Future<Output = AfterVerifyDecision> + Send + 'a
Runs after a successful verify (including skip / failure recovery).
Sourcefn on_verify_failure<'a>(
&'a self,
_ctx: &'a PaymentHookContext,
_error: &'a FacilitatorError,
) -> impl Future<Output = FailureRecovery<VerifyResponse>> + Send + 'a
fn on_verify_failure<'a>( &'a self, _ctx: &'a PaymentHookContext, _error: &'a FacilitatorError, ) -> impl Future<Output = FailureRecovery<VerifyResponse>> + Send + 'a
Runs when facilitator verify returns an error.
Sourcefn before_settle<'a>(
&'a self,
_ctx: &'a SettleContext,
) -> impl Future<Output = BeforeOpDecision<SettleResponse>> + Send + 'a
fn before_settle<'a>( &'a self, _ctx: &'a SettleContext, ) -> impl Future<Output = BeforeOpDecision<SettleResponse>> + Send + 'a
Runs before facilitator settle.
Sourcefn after_settle<'a>(
&'a self,
_ctx: &'a SettleResultContext,
) -> impl Future<Output = ()> + Send + 'a
fn after_settle<'a>( &'a self, _ctx: &'a SettleResultContext, ) -> impl Future<Output = ()> + Send + 'a
Runs after a successful settle (including skip / failure recovery).
Sourcefn on_settle_failure<'a>(
&'a self,
_ctx: &'a SettleContext,
_error: &'a FacilitatorError,
) -> impl Future<Output = FailureRecovery<SettleResponse>> + Send + 'a
fn on_settle_failure<'a>( &'a self, _ctx: &'a SettleContext, _error: &'a FacilitatorError, ) -> impl Future<Output = FailureRecovery<SettleResponse>> + Send + 'a
Runs when facilitator settle returns an error.
Sourcefn on_verified_payment_canceled<'a>(
&'a self,
_ctx: &'a VerifiedPaymentCanceledContext,
) -> impl Future<Output = ()> + Send + 'a
fn on_verified_payment_canceled<'a>( &'a self, _ctx: &'a VerifiedPaymentCanceledContext, ) -> impl Future<Output = ()> + Send + 'a
Runs when a verified payment will not be settled.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".