pub trait Payments: Send + Sync {
// Required methods
fn create_checkout<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 CheckoutRequest,
) -> Pin<Box<dyn Future<Output = Result<CheckoutSession, PaymentsError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn create_subscription_checkout<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 SubscriptionCheckoutRequest,
) -> Pin<Box<dyn Future<Output = Result<CheckoutSession, PaymentsError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn create_connect_account_link<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ConnectAccountLinkRequest,
) -> Pin<Box<dyn Future<Output = Result<ConnectAccountLink, PaymentsError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn charge_with_transfer<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 TransferCharge,
) -> Pin<Box<dyn Future<Output = Result<Charge, PaymentsError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn refund<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 RefundRequest,
) -> Pin<Box<dyn Future<Output = Result<Refund, PaymentsError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn verify_webhook<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
signature_header: &'life1 str,
body: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<WebhookEvent, PaymentsError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait;
}Expand description
Moves money for a venture. Stripe today; the trait names only Stripe identifiers and hosted URLs, never card data.
Required Methods§
Sourcefn create_checkout<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 CheckoutRequest,
) -> Pin<Box<dyn Future<Output = Result<CheckoutSession, PaymentsError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn create_checkout<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 CheckoutRequest,
) -> Pin<Box<dyn Future<Output = Result<CheckoutSession, PaymentsError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
A one-time hosted checkout. Returns the URL to redirect the browser to.
Sourcefn create_subscription_checkout<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 SubscriptionCheckoutRequest,
) -> Pin<Box<dyn Future<Output = Result<CheckoutSession, PaymentsError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn create_subscription_checkout<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 SubscriptionCheckoutRequest,
) -> Pin<Box<dyn Future<Output = Result<CheckoutSession, PaymentsError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
A recurring hosted checkout against a configured Stripe Price.
Sourcefn create_connect_account_link<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ConnectAccountLinkRequest,
) -> Pin<Box<dyn Future<Output = Result<ConnectAccountLink, PaymentsError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn create_connect_account_link<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ConnectAccountLinkRequest,
) -> Pin<Box<dyn Future<Output = Result<ConnectAccountLink, PaymentsError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
A Connect onboarding link for a coach’s account.
Sourcefn charge_with_transfer<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 TransferCharge,
) -> Pin<Box<dyn Future<Output = Result<Charge, PaymentsError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn charge_with_transfer<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 TransferCharge,
) -> Pin<Box<dyn Future<Output = Result<Charge, PaymentsError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
A destination charge with an application fee (the platform’s cut).
Sourcefn refund<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 RefundRequest,
) -> Pin<Box<dyn Future<Output = Result<Refund, PaymentsError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn refund<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 RefundRequest,
) -> Pin<Box<dyn Future<Output = Result<Refund, PaymentsError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Refunds a prior payment, in whole or in part.
Sourcefn verify_webhook<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
signature_header: &'life1 str,
body: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<WebhookEvent, PaymentsError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn verify_webhook<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
signature_header: &'life1 str,
body: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<WebhookEvent, PaymentsError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Verifies a webhook’s signature and timestamp and returns the event.
signature_header is the raw Stripe-Signature header; body is the
exact bytes received (verification is over the raw body). Returns
PaymentsError::SignatureInvalid if verification fails.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".