pub struct Carts { /* private fields */ }Implementations§
Source§impl Carts
impl Carts
pub fn into_reference(val: Carts, env: Env) -> Result<Reference<Carts>>
pub fn into_instance(self, env: Env) -> Result<ClassInstance<Carts>>
Source§impl Carts
impl Carts
Sourcepub async fn create(&self, input: CreateCartInput) -> Result<CartOutput>
pub async fn create(&self, input: CreateCartInput) -> Result<CartOutput>
Create a new cart
Sourcepub async fn get_by_number(
&self,
cart_number: String,
) -> Result<Option<CartOutput>>
pub async fn get_by_number( &self, cart_number: String, ) -> Result<Option<CartOutput>>
Get a cart by cart number
Sourcepub async fn update(
&self,
id: String,
input: UpdateCartInput,
) -> Result<CartOutput>
pub async fn update( &self, id: String, input: UpdateCartInput, ) -> Result<CartOutput>
Update a cart
Sourcepub async fn list(&self) -> Result<Vec<CartOutput>>
pub async fn list(&self) -> Result<Vec<CartOutput>>
List all carts
Sourcepub async fn for_customer(&self, customer_id: String) -> Result<Vec<CartOutput>>
pub async fn for_customer(&self, customer_id: String) -> Result<Vec<CartOutput>>
List carts for a customer
Sourcepub async fn add_item(
&self,
cart_id: String,
item: AddCartItemInput,
) -> Result<CartItemOutput>
pub async fn add_item( &self, cart_id: String, item: AddCartItemInput, ) -> Result<CartItemOutput>
Add an item to the cart
Sourcepub async fn update_item(
&self,
item_id: String,
input: UpdateCartItemInput,
) -> Result<CartItemOutput>
pub async fn update_item( &self, item_id: String, input: UpdateCartItemInput, ) -> Result<CartItemOutput>
Update a cart item
Sourcepub async fn remove_item(&self, item_id: String) -> Result<()>
pub async fn remove_item(&self, item_id: String) -> Result<()>
Remove an item from the cart
Sourcepub async fn get_items(&self, cart_id: String) -> Result<Vec<CartItemOutput>>
pub async fn get_items(&self, cart_id: String) -> Result<Vec<CartItemOutput>>
Get items in a cart
Sourcepub async fn clear_items(&self, cart_id: String) -> Result<()>
pub async fn clear_items(&self, cart_id: String) -> Result<()>
Clear all items from the cart
Sourcepub async fn set_shipping_address(
&self,
id: String,
address: CartAddressInput,
) -> Result<CartOutput>
pub async fn set_shipping_address( &self, id: String, address: CartAddressInput, ) -> Result<CartOutput>
Set the shipping address
Sourcepub async fn set_shipping(
&self,
id: String,
input: SetCartShippingInput,
) -> Result<CartOutput>
pub async fn set_shipping( &self, id: String, input: SetCartShippingInput, ) -> Result<CartOutput>
Set shipping selection (address + method/carrier/amount)
Sourcepub async fn set_billing_address(
&self,
id: String,
address: CartAddressInput,
) -> Result<CartOutput>
pub async fn set_billing_address( &self, id: String, address: CartAddressInput, ) -> Result<CartOutput>
Set the billing address
Sourcepub async fn get_shipping_rates(
&self,
id: String,
) -> Result<Vec<ShippingRateOutput>>
pub async fn get_shipping_rates( &self, id: String, ) -> Result<Vec<ShippingRateOutput>>
Get available shipping rates
Sourcepub async fn set_payment(
&self,
id: String,
input: SetCartPaymentInput,
) -> Result<CartOutput>
pub async fn set_payment( &self, id: String, input: SetCartPaymentInput, ) -> Result<CartOutput>
Set payment method
Sourcepub async fn apply_discount(
&self,
id: String,
coupon_code: String,
) -> Result<CartOutput>
pub async fn apply_discount( &self, id: String, coupon_code: String, ) -> Result<CartOutput>
Apply a discount/coupon code
Sourcepub async fn remove_discount(&self, id: String) -> Result<CartOutput>
pub async fn remove_discount(&self, id: String) -> Result<CartOutput>
Remove discount from cart
Sourcepub async fn mark_ready_for_payment(&self, id: String) -> Result<CartOutput>
pub async fn mark_ready_for_payment(&self, id: String) -> Result<CartOutput>
Mark cart as ready for payment
Sourcepub async fn begin_checkout(&self, id: String) -> Result<CartOutput>
pub async fn begin_checkout(&self, id: String) -> Result<CartOutput>
Begin checkout process
Sourcepub async fn complete(&self, id: String) -> Result<CheckoutResultOutput>
pub async fn complete(&self, id: String) -> Result<CheckoutResultOutput>
Complete checkout and create order
Sourcepub async fn cancel(&self, id: String) -> Result<CartOutput>
pub async fn cancel(&self, id: String) -> Result<CartOutput>
Cancel a cart
Sourcepub async fn abandon(&self, id: String) -> Result<CartOutput>
pub async fn abandon(&self, id: String) -> Result<CartOutput>
Mark cart as abandoned
Sourcepub async fn expire(&self, id: String) -> Result<CartOutput>
pub async fn expire(&self, id: String) -> Result<CartOutput>
Mark cart as expired
Sourcepub async fn reserve_inventory(&self, id: String) -> Result<CartOutput>
pub async fn reserve_inventory(&self, id: String) -> Result<CartOutput>
Reserve inventory for cart items
Sourcepub async fn release_inventory(&self, id: String) -> Result<CartOutput>
pub async fn release_inventory(&self, id: String) -> Result<CartOutput>
Release reserved inventory for cart items
Sourcepub async fn recalculate(&self, id: String) -> Result<CartOutput>
pub async fn recalculate(&self, id: String) -> Result<CartOutput>
Recalculate cart totals
Sourcepub async fn get_abandoned(&self) -> Result<Vec<CartOutput>>
pub async fn get_abandoned(&self) -> Result<Vec<CartOutput>>
Get abandoned carts
Sourcepub async fn get_expired(&self) -> Result<Vec<CartOutput>>
pub async fn get_expired(&self) -> Result<Vec<CartOutput>>
Get expired carts
Trait Implementations§
Source§impl FromNapiMutRef for Carts
impl FromNapiMutRef for Carts
Source§unsafe fn from_napi_mut_ref(
env: napi_env,
napi_val: napi_value,
) -> Result<&'static mut Self>
unsafe fn from_napi_mut_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static mut Self>
Safety Read more
Source§impl FromNapiRef for Carts
impl FromNapiRef for Carts
Source§unsafe fn from_napi_ref(
env: napi_env,
napi_val: napi_value,
) -> Result<&'static Self>
unsafe fn from_napi_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static Self>
Safety Read more
Source§impl FromNapiValue for &Carts
impl FromNapiValue for &Carts
Source§unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
Safety Read more
fn from_unknown(value: JsUnknown) -> Result<Self, Error>
Source§impl FromNapiValue for &mut Carts
impl FromNapiValue for &mut Carts
Source§unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
Safety Read more
fn from_unknown(value: JsUnknown) -> Result<Self, Error>
Source§impl ToNapiValue for Carts
impl ToNapiValue for Carts
Source§unsafe fn to_napi_value(env: napi_env, val: Carts) -> Result<napi_value>
unsafe fn to_napi_value(env: napi_env, val: Carts) -> Result<napi_value>
Safety Read more
Source§impl ValidateNapiValue for &Carts
impl ValidateNapiValue for &Carts
Source§unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
Safety Read more
Source§impl ValidateNapiValue for &mut Carts
impl ValidateNapiValue for &mut Carts
Source§unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
Safety Read more
Auto Trait Implementations§
impl Freeze for Carts
impl !RefUnwindSafe for Carts
impl Send for Carts
impl Sync for Carts
impl Unpin for Carts
impl UnsafeUnpin for Carts
impl !UnwindSafe for Carts
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