pub trait SchemeNetworkServer: Send + Sync {
// Required methods
fn scheme(&self) -> &str;
fn default_asset_transfer_method(&self) -> &str;
fn payment_flows(&self) -> &HashMap<String, PaymentFlowConfig>;
// Provided methods
fn dynamic_extra_fields(&self) -> &[&str] { ... }
fn enrich_payment_required_response<'a>(
&'a self,
_ctx: &'a SchemePaymentRequiredContext<'a>,
) -> impl Future<Output = Option<Vec<PaymentRequirements>>> + Send + 'a { ... }
fn enrich_settlement_payload<'a>(
&'a self,
_ctx: &'a SettleContext,
) -> impl Future<Output = Result<Option<Map<String, Value>>, FacilitatorError>> + Send + 'a { ... }
fn enrich_settlement_response<'a>(
&'a self,
_ctx: &'a SettleResultContext,
) -> impl Future<Output = Option<Map<String, Value>>> + Send + 'a { ... }
fn settle_on_cancel<'a>(
&'a self,
_ctx: &'a VerifiedPaymentCanceledContext,
) -> impl Future<Output = Option<PaymentRequirements>> + Send + 'a { ... }
fn settles_on_cancel(&self) -> bool { ... }
fn validate_facilitator_support(
&self,
network: &ChainId,
kind: &SupportedPaymentKind,
facilitator_extensions: &[CompactString],
) -> Result<(), FacilitatorSupportError> { ... }
}server only.Expand description
Scheme/network adapter registered on crate::ResourceServer.
Enrich hooks are AFIT async. Defaults are no-ops.
Required Methods§
Sourcefn default_asset_transfer_method(&self) -> &str
fn default_asset_transfer_method(&self) -> &str
ATM used when requirements.extra.assetTransferMethod is absent.
Sourcefn payment_flows(&self) -> &HashMap<String, PaymentFlowConfig>
fn payment_flows(&self) -> &HashMap<String, PaymentFlowConfig>
Payment flows supported per asset-transfer method.
Provided Methods§
Sourcefn dynamic_extra_fields(&self) -> &[&str]
fn dynamic_extra_fields(&self) -> &[&str]
Extra keys omitted from requirement matching.
Sourcefn enrich_payment_required_response<'a>(
&'a self,
_ctx: &'a SchemePaymentRequiredContext<'a>,
) -> impl Future<Output = Option<Vec<PaymentRequirements>>> + Send + 'a
fn enrich_payment_required_response<'a>( &'a self, _ctx: &'a SchemePaymentRequiredContext<'a>, ) -> impl Future<Output = Option<Vec<PaymentRequirements>>> + Send + 'a
Optional 402 accept enrichment. None leaves accepts unchanged.
Sourcefn enrich_settlement_payload<'a>(
&'a self,
_ctx: &'a SettleContext,
) -> impl Future<Output = Result<Option<Map<String, Value>>, FacilitatorError>> + Send + 'a
fn enrich_settlement_payload<'a>( &'a self, _ctx: &'a SettleContext, ) -> impl Future<Output = Result<Option<Map<String, Value>>, FacilitatorError>> + Send + 'a
Optional additive settle-payload enrichment.
Ok(None) leaves the client payload unchanged. Ok(Some(map)) is
merged additively. Err fails the settle.
Sourcefn enrich_settlement_response<'a>(
&'a self,
_ctx: &'a SettleResultContext,
) -> impl Future<Output = Option<Map<String, Value>>> + Send + 'a
fn enrich_settlement_response<'a>( &'a self, _ctx: &'a SettleResultContext, ) -> impl Future<Output = Option<Map<String, Value>>> + Send + 'a
Optional additive settle-response enrichment.
Sourcefn settle_on_cancel<'a>(
&'a self,
_ctx: &'a VerifiedPaymentCanceledContext,
) -> impl Future<Output = Option<PaymentRequirements>> + Send + 'a
fn settle_on_cancel<'a>( &'a self, _ctx: &'a VerifiedPaymentCanceledContext, ) -> impl Future<Output = Option<PaymentRequirements>> + Send + 'a
Requirements to settle when a verified payment is canceled.
None skips cancel settle.
Sourcefn settles_on_cancel(&self) -> bool
fn settles_on_cancel(&self) -> bool
true iff Self::settle_on_cancel can return Some.
HTTP construct cannot await Self::settle_on_cancel. Default false.
Sourcefn validate_facilitator_support(
&self,
network: &ChainId,
kind: &SupportedPaymentKind,
facilitator_extensions: &[CompactString],
) -> Result<(), FacilitatorSupportError>
fn validate_facilitator_support( &self, network: &ChainId, kind: &SupportedPaymentKind, facilitator_extensions: &[CompactString], ) -> Result<(), FacilitatorSupportError>
Advertised /supported kind extra for this scheme. Default Ok(()).
§Errors
FacilitatorSupportError when the advertised kind cannot serve this scheme.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".