pub struct Checkout<P> {Show 14 fields
pub id: String,
pub state: State,
pub currency: Currency,
pub promo_codes: Vec<String>,
pub items: Vec<Item>,
pub contact: Option<Contact>,
pub shipping_address: Option<Address>,
pub fulfillment: Option<Fulfillment>,
pub shipping_quotes: Vec<ShippingQuote>,
pub invoice: Option<Invoice>,
pub payment_id: Option<String>,
pub order_id: Option<String>,
pub payment: Option<P>,
pub order: Option<Order<P>>,
}Fields§
§id: String§state: State§currency: Currency§promo_codes: Vec<String>§items: Vec<Item>§contact: Option<Contact>§shipping_address: Option<Address>§fulfillment: Option<Fulfillment>§shipping_quotes: Vec<ShippingQuote>§invoice: Option<Invoice>§payment_id: Option<String>§order_id: Option<String>§payment: Option<P>§order: Option<Order<P>>Implementations§
Source§impl<P: Sync + Send + Serialize + DeserializeOwned> Checkout<P>
impl<P: Sync + Send + Serialize + DeserializeOwned> Checkout<P>
pub async fn add_item<C: Context + Send>( &mut self, ctx: &mut C, sku: String, quantity: u64, ) -> Result<(), Error>
pub async fn remove_item<C: Context + Send>( &mut self, ctx: &mut C, sku: String, quantity: u64, ) -> Result<(), Error>
pub async fn confirm_items<C: Context + Send>( &mut self, ctx: &mut C, ) -> Result<(), Error>
pub async fn update_contact<C: Context + Send>( &mut self, ctx: &mut C, contact: Contact, ) -> Result<(), Error>
pub async fn update_shipping_address<C: Context + Send>( &mut self, ctx: &mut C, address: Address, ) -> Result<(), Error>
pub async fn update_fulfillment<C: Context + Send>( &mut self, ctx: &mut C, fulfillment: FulfillmentSelection, ) -> Result<(), Error>
pub async fn initiate_payment<C: Context + Send>( &mut self, ctx: &mut C, args: <C as PaymentProcessor>::InitArgs, ) -> Result<(), Error>
pub async fn initiate_order<C: Context + Send>( &mut self, internal_ctx: &InternalContext, ctx: &mut C, payment_args: <C as PaymentProcessor>::InitArgs, ) -> Result<(), Error>
pub async fn release<C: Context + Send>( &mut self, ctx: &mut C, ) -> Result<(), Error>
pub async fn complete<C: Context + Send>( &mut self, internal_ctx: &InternalContext, ctx: &mut C, ) -> Result<(), Error>
pub async fn populate_associations<C: Context + Send>( &mut self, ctx: &mut C, ) -> Result<(), Error>
Trait Implementations§
Source§impl<'de, P> Deserialize<'de> for Checkout<P>where
P: Deserialize<'de>,
impl<'de, P> Deserialize<'de> for Checkout<P>where
P: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<P: JsonSchema> JsonSchema for Checkout<P>
impl<P: JsonSchema> JsonSchema for Checkout<P>
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl<P> Freeze for Checkout<P>where
P: Freeze,
impl<P> RefUnwindSafe for Checkout<P>where
P: RefUnwindSafe,
impl<P> Send for Checkout<P>where
P: Send,
impl<P> Sync for Checkout<P>where
P: Sync,
impl<P> Unpin for Checkout<P>where
P: Unpin,
impl<P> UnwindSafe for Checkout<P>where
P: UnwindSafe,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more