Manages line items for an order. Can also be used to generate a web checkout link to check out in browser.
More...
|
| Cart (ShopifyClient client) |
| Constructs a new cart using a ShopifyClient . Typically, carts won't be instantiated directly, but will rather be instatiated using ShopifyBuy.Client().Cart() . More...
|
|
void | Reset () |
| Resets the cart by removing all line items and resets all internal state. More...
|
|
decimal | Subtotal () |
| Returns the current sub total for the cart More...
|
|
void | GetWebCheckoutLink (GetWebCheckoutLinkSuccessCallback success, GetWebCheckoutLinkFailureCallback failure) |
| Returns the web URL for checking out the contents of this Cart. For presenting the user with a web view that loads this URL see CheckoutWithWebView. More...
|
|
void | CheckoutWithWebView (CheckoutSuccessCallback success, CheckoutCancelCallback cancelled, CheckoutFailureCallback failure) |
| Launches a platform-specific web view screen with the Cart's web checkout link loaded. This can be used to perform a cart checkout from within your application instead of being directed to an external web application. Typically this can be used as a fallback measure in cases where the user's device doesn't support native pay methods. More...
|
|
void | CheckoutWithNativePay (string key, CheckoutSuccessCallback success, CheckoutCancelCallback cancelled, CheckoutFailureCallback failure) |
| Launches a platform-specific native pay UI for checking out the Cart's contents. Currently supported native pay options include: More...
|
|
void | CanShowNativePaySetup (CanShowNativePaySetupCallback callback) |
| Determine whether the user can be shown to setup their native payment solution More...
|
|
void | ShowNativePaySetup () |
| Launch a native payment app to prompt the user to setup their payment card More...
|
|
void | CanCheckoutWithNativePay (CanCheckoutWithNativePayCallback callback) |
| Determine whether the user can checkout by paying with their native payment solution More...
|
|
|
CartLineItems | LineItems [get] |
| Current line items for this Cart . More...
|
|
List< CheckoutUserError > | UserErrors [get] |
| A list of all the user errors with the current checkout. For example, when a user enters invalid information in a field during checkout, the API will return a list of user errors which gets stored here. In general, a failure callback is invoked and the developer can reference this field to handle these issues. More...
|
|
Checkout | CurrentCheckout [get] |
|
Manages line items for an order. Can also be used to generate a web checkout link to check out in browser.
◆ Cart()
Constructs a new cart using a ShopifyClient . Typically, carts won't be instantiated directly, but will rather be instatiated using ShopifyBuy.Client().Cart() .
- Parameters
-
client | client associated with this cart |
ShopifyClient client = new ShopifyClient(accessToken, shopDomain);
Debug.Log(cart.LineItems.All().Count);
Cart(ShopifyClient client)
Constructs a new cart using a ShopifyClient . Typically, carts won't be instantiated directly,...
Definition: Cart.cs:117
◆ CanCheckoutWithNativePay()
void Shopify.Unity.Cart.CanCheckoutWithNativePay |
( |
CanCheckoutWithNativePayCallback |
callback | ) |
|
|
inline |
Determine whether the user can checkout by paying with their native payment solution
- Parameters
-
callback | Closure that is invoked with the result. True is returned if the user is able to pay with their native payment solution |
◆ CanShowNativePaySetup()
void Shopify.Unity.Cart.CanShowNativePaySetup |
( |
CanShowNativePaySetupCallback |
callback | ) |
|
|
inline |
Determine whether the user can be shown to setup their native payment solution
- Parameters
-
callback | Closure that is invoked with the result. True is returned if the user can be shown a native payment app to setup their payment card |
◆ CheckoutWithNativePay()
void Shopify.Unity.Cart.CheckoutWithNativePay |
( |
string |
key, |
|
|
CheckoutSuccessCallback |
success, |
|
|
CheckoutCancelCallback |
cancelled, |
|
|
CheckoutFailureCallback |
failure |
|
) |
| |
|
inline |
Launches a platform-specific native pay UI for checking out the Cart's contents. Currently supported native pay options include:
- Exceptions
-
System.PlatformNotSupportedException | Thrown when invoking this method on an unsupported platform. |
- Parameters
-
key | Vendor-specific key for identifying the merchant. For iOS devices this is the merchant ID. |
success | called whenever the checkout process has completed successfully. |
cancelled | called whenever the user cancels out of the native pay flow. |
failure | called whenever an error or failure is encountered during native pay. |
◆ CheckoutWithWebView()
void Shopify.Unity.Cart.CheckoutWithWebView |
( |
CheckoutSuccessCallback |
success, |
|
|
CheckoutCancelCallback |
cancelled, |
|
|
CheckoutFailureCallback |
failure |
|
) |
| |
|
inline |
Launches a platform-specific web view screen with the Cart's web checkout link loaded. This can be used to perform a cart checkout from within your application instead of being directed to an external web application. Typically this can be used as a fallback measure in cases where the user's device doesn't support native pay methods.
- Parameters
-
success | called when the web checkout screen has been dismissed and the checkout was successful. |
cancelled | called when the web checkout screen was dismissed before completing a checkout. |
failure | called when an error was encountered after the web checkout screen has been dismissed. |
◆ GetWebCheckoutLink()
void Shopify.Unity.Cart.GetWebCheckoutLink |
( |
GetWebCheckoutLinkSuccessCallback |
success, |
|
|
GetWebCheckoutLinkFailureCallback |
failure |
|
) |
| |
|
inline |
Returns the web URL for checking out the contents of this Cart. For presenting the user with a web view that loads this URL see CheckoutWithWebView.
- Parameters
-
success | called when the checkout url was successfully generated. |
failure | called when generating the checkout url failed. |
◆ Reset()
void Shopify.Unity.Cart.Reset |
( |
| ) |
|
|
inline |
Resets the cart by removing all line items and resets all internal state.
◆ ShowNativePaySetup()
void Shopify.Unity.Cart.ShowNativePaySetup |
( |
| ) |
|
|
inline |
Launch a native payment app to prompt the user to setup their payment card
- Exceptions
-
PlatformNotSupportedException | Thrown when the device does not support this feature |
◆ Subtotal()
decimal Shopify.Unity.Cart.Subtotal |
( |
| ) |
|
|
inline |
Returns the current sub total for the cart
◆ LineItems
Current line items for this Cart .
◆ UserErrors
A list of all the user errors with the current checkout. For example, when a user enters invalid information in a field during checkout, the API will return a list of user errors which gets stored here. In general, a failure callback is invoked and the developer can reference this field to handle these issues.
- Returns
- A list of user errors
for this Cart
The documentation for this class was generated from the following file:
- Assets/Shopify/Unity/Cart.cs