pub struct AxumPaymentConfig {
pub base_config: PaymentMiddlewareConfig,
pub axum_options: AxumOptions,
}Expand description
Axum-specific payment middleware configuration
Fields§
§base_config: PaymentMiddlewareConfigBase payment middleware config
axum_options: AxumOptionsAdditional Axum-specific options
Implementations§
Source§impl AxumPaymentConfig
impl AxumPaymentConfig
Sourcepub fn new(amount: Decimal, pay_to: impl Into<String>) -> Self
pub fn new(amount: Decimal, pay_to: impl Into<String>) -> Self
Create a new Axum payment config
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Set the payment description
Sourcepub fn with_mime_type(self, mime_type: impl Into<String>) -> Self
pub fn with_mime_type(self, mime_type: impl Into<String>) -> Self
Set the MIME type
Sourcepub fn with_max_timeout_seconds(self, max_timeout_seconds: u32) -> Self
pub fn with_max_timeout_seconds(self, max_timeout_seconds: u32) -> Self
Set the maximum timeout
Sourcepub fn with_output_schema(self, output_schema: Value) -> Self
pub fn with_output_schema(self, output_schema: Value) -> Self
Set the output schema
Sourcepub fn with_facilitator_config(
self,
facilitator_config: FacilitatorConfig,
) -> Self
pub fn with_facilitator_config( self, facilitator_config: FacilitatorConfig, ) -> Self
Set the facilitator configuration
Sourcepub fn with_testnet(self, testnet: bool) -> Self
pub fn with_testnet(self, testnet: bool) -> Self
Set whether this is a testnet
Sourcepub fn with_custom_paywall_html(self, html: impl Into<String>) -> Self
pub fn with_custom_paywall_html(self, html: impl Into<String>) -> Self
Set custom paywall HTML
Sourcepub fn with_resource(self, resource: impl Into<String>) -> Self
pub fn with_resource(self, resource: impl Into<String>) -> Self
Set the resource URL
Sourcepub fn with_resource_root_url(self, url: impl Into<String>) -> Self
pub fn with_resource_root_url(self, url: impl Into<String>) -> Self
Set the resource root URL
Sourcepub fn with_tracing(self) -> Self
pub fn with_tracing(self) -> Self
Enable request tracing
Sourcepub fn with_error_handler<F>(self, handler: F) -> Self
pub fn with_error_handler<F>(self, handler: F) -> Self
Set custom error handler
Sourcepub fn into_middleware(self) -> PaymentMiddleware
pub fn into_middleware(self) -> PaymentMiddleware
Convert to PaymentMiddleware
Sourcepub fn create_service(&self) -> ServiceBuilder<Identity>
pub fn create_service(&self) -> ServiceBuilder<Identity>
Create a service builder with this configuration
Trait Implementations§
Source§impl Clone for AxumPaymentConfig
impl Clone for AxumPaymentConfig
Source§fn clone(&self) -> AxumPaymentConfig
fn clone(&self) -> AxumPaymentConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for AxumPaymentConfig
impl !UnwindSafe for AxumPaymentConfig
impl Freeze for AxumPaymentConfig
impl Send for AxumPaymentConfig
impl Sync for AxumPaymentConfig
impl Unpin for AxumPaymentConfig
impl UnsafeUnpin for AxumPaymentConfig
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