pub trait PaymentProcessor {
// Required methods
fn process_payment(
&self,
payment: &PaymentRequest,
) -> DeviceResult<PaymentResult>;
fn refund_payment(
&self,
payment_id: &str,
amount: f64,
) -> DeviceResult<RefundResult>;
fn get_processor_name(&self) -> String;
}Expand description
Payment processor trait
Required Methods§
fn process_payment( &self, payment: &PaymentRequest, ) -> DeviceResult<PaymentResult>
fn refund_payment( &self, payment_id: &str, amount: f64, ) -> DeviceResult<RefundResult>
fn get_processor_name(&self) -> String
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".