Trait wasmcloud_examples_payments::Payments
source · [−]pub trait Payments {
fn authorize_payment<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 Context,
arg: &'life2 AuthorizePaymentRequest
) -> Pin<Box<dyn Future<Output = RpcResult<AuthorizePaymentResponse>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait;
fn complete_payment<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 Context,
arg: &'life2 CompletePaymentRequest
) -> Pin<Box<dyn Future<Output = RpcResult<CompletePaymentResponse>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait;
fn get_payment_methods<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 Context
) -> Pin<Box<dyn Future<Output = RpcResult<PaymentMethods>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn contract_id() -> &'static str { ... }
}Expand description
wasmbus.contractId: wasmcloud:example:payments wasmbus.providerReceive
Required methods
AuthorizePayment - Validates that a potential payment transaction can go through. If this succeeds then we should assume it is safe to complete a payment. Payments cannot be completed without getting a validation code (in other words, all payments have to be pre-authorized).
fn complete_payment<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 Context,
arg: &'life2 CompletePaymentRequest
) -> Pin<Box<dyn Future<Output = RpcResult<CompletePaymentResponse>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn complete_payment<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 Context,
arg: &'life2 CompletePaymentRequest
) -> Pin<Box<dyn Future<Output = RpcResult<CompletePaymentResponse>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Completes a previously authorized payment. This operation requires the “authorization code” from a successful authorization operation.
fn get_payment_methods<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 Context
) -> Pin<Box<dyn Future<Output = RpcResult<PaymentMethods>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_payment_methods<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 Context
) -> Pin<Box<dyn Future<Output = RpcResult<PaymentMethods>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
GetPaymentMethods - Retrieves an opaque list of payment methods,
which is a list of customer-facing method names and the
tokens
belonging to that payment method. You could think of this list as
a previously saved list of payment methods stored in a “wallet”.
A payment method token is required to authorize and subsequently
complete a payment transaction. A customer could have previously
supplied their credit card and user-friendly labels for those methods
like “personal” and “work”, etc.
Provided methods
fn contract_id() -> &'static str
fn contract_id() -> &'static str
returns the capability contract id for this interface