OrderExtensions
Extension methods for a Vendr Order
public static class OrderExtensions
Namespace
Methods
AddProduct (1 of 8)
Adds a product to the order
public static Order AddProduct(this Order order, string productReference, decimal qty)
Parameters
Parameter | Description |
---|---|
order |
The Order instance |
productReference |
The unique reference of the product |
qty |
The quantity of the product to add to the order |
Returns
The updated Order
entity
AddProduct (2 of 8)
Adds a product to the order
public static Order AddProduct(this Order order, string productReference, decimal qty,
string bundleId)
Parameters
Parameter | Description |
---|---|
order |
The Order instance |
productReference |
The unique reference of the product |
qty |
The quantity of the product to add to the order |
bundleId |
A bundle ID to assign to the product order line to identify it as a bundle |
Returns
The updated Order
entity
AddProduct (3 of 8)
Adds a product to the order
public static Order AddProduct(this Order order, string productReference, decimal qty,
IDictionary<string, string> properties)
Parameters
Parameter | Description |
---|---|
order |
The Order instance |
productReference |
The unique reference of the product |
qty |
The quantity of the product to add to the order |
properties |
A collection of properties to assign to the product order line |
Returns
The updated Order
entity
AddProduct (4 of 8)
Adds a product to the order
public static Order AddProduct(this Order order, string productReference, decimal qty,
IDictionary<string, string> properties, string bundleId)
Parameters
Parameter | Description |
---|---|
order |
The Order instance |
productReference |
The unique reference of the product |
qty |
The quantity of the product to add to the order |
properties |
A collection of properties to assign to the product order line |
bundleId |
A bundle ID to assign to the product order line to identify it as a bundle |
Returns
The updated Order
entity
AddProduct (5 of 8)
Adds a product to the order
public static Order AddProduct(this Order order, IProductSnapshot productSnapshot, decimal qty)
Parameters
Parameter | Description |
---|---|
order |
The Order instance |
productSnapshot |
A snapshot of the product to add |
qty |
The quantity of the product to add to the order |
Returns
The updated Order
entity
AddProduct (6 of 8)
Adds a product to the order
public static Order AddProduct(this Order order, IProductSnapshot productSnapshot, decimal qty,
string bundleId)
Parameters
Parameter | Description |
---|---|
order |
The Order instance |
productSnapshot |
A snapshot of the product to add |
qty |
The quantity of the product to add to the order |
bundleId |
A bundle ID to assign to the product order line to identify it as a bundle |
Returns
The updated Order
entity
AddProduct (7 of 8)
Adds a product to the order
public static Order AddProduct(this Order order, IProductSnapshot productSnapshot, decimal qty,
IDictionary<string, string> properties)
Parameters
Parameter | Description |
---|---|
order |
The Order instance |
productSnapshot |
A snapshot of the product to add |
qty |
The quantity of the product to add to the order |
properties |
A collection of properties to assign to the product order line |
Returns
The updated Order
entity
AddProduct (8 of 8)
Adds a product to the order
public static Order AddProduct(this Order order, IProductSnapshot productSnapshot, decimal qty,
IDictionary<string, string> properties, string bundleId)
Parameters
Parameter | Description |
---|---|
order |
The Order instance |
productSnapshot |
A snapshot of the product to add |
qty |
The quantity of the product to add to the order |
properties |
A collection of properties to assign to the product order line |
bundleId |
A bundle ID to assign to the product order line to identify it as a bundle |
Returns
The updated Order
entity
AddProductToBundle (1 of 8)
Adds a product to a bundle in the order
public static Order AddProductToBundle(this Order order, string parentBundleId,
string productReference, decimal qty)
Parameters
Parameter | Description |
---|---|
order |
The Order instance |
parentBundleId |
The bundle ID of an existing bundle order line to assign the product order line to as a bundle item |
productReference |
The unique reference of the product |
qty |
The quantity of the product to add to the order |
Returns
The updated Order
entity
AddProductToBundle (2 of 8)
Adds a product to a bundle in the order
public static Order AddProductToBundle(this Order order, string parentBundleId,
string productReference, decimal qty, string bundleId)
Parameters
Parameter | Description |
---|---|
order |
The Order instance |
parentBundleId |
The bundle ID of an existing bundle order line to assign the product order line to as a bundle item |
productReference |
The unique reference of the product |
qty |
The quantity of the product to add to the order |
bundleId |
A bundle ID to assign to the product order line to identify it as a bundle |
Returns
The updated Order
entity
AddProductToBundle (3 of 8)
Adds a product to a bundle in the order
public static Order AddProductToBundle(this Order order, string parentBundleId,
string productReference, decimal qty, IDictionary<string, string> properties)
Parameters
Parameter | Description |
---|---|
order |
The Order instance |
parentBundleId |
The bundle ID of an existing bundle order line to assign the product order line to as a bundle item |
productReference |
The unique reference of the product |
qty |
The quantity of the product to add to the order |
properties |
A collection of properties to assign to the product order line |
Returns
The updated Order
entity
AddProductToBundle (4 of 8)
Adds a product to a bundle in the order
public static Order AddProductToBundle(this Order order, string parentBundleId,
string productReference, decimal qty, IDictionary<string, string> properties, string bundleId)
Parameters
Parameter | Description |
---|---|
order |
The Order instance |
parentBundleId |
The bundle ID of an existing bundle order line to assign the product order line to as a bundle item |
productReference |
The unique reference of the product |
qty |
The quantity of the product to add to the order |
properties |
A collection of properties to assign to the product order line |
bundleId |
A bundle ID to assign to the product order line to identify it as a bundle |
Returns
The updated Order
entity
AddProductToBundle (5 of 8)
Adds a product to a bundle in the order
public static Order AddProductToBundle(this Order order, string parentBundleId,
IProductSnapshot productSnapshot, decimal qty)
Parameters
Parameter | Description |
---|---|
order |
The Order instance |
parentBundleId |
The bundle ID of an existing bundle order line to assign the product order line to as a bundle item |
productSnapshot |
A snapshot of the product to add |
qty |
The quantity of the product to add to the order |
Returns
The updated Order
entity
AddProductToBundle (6 of 8)
Adds a product to a bundle in the order
public static Order AddProductToBundle(this Order order, string parentBundleId,
IProductSnapshot productSnapshot, decimal qty, string bundleId)
Parameters
Parameter | Description |
---|---|
order |
The Order instance |
parentBundleId |
The bundle ID of an existing bundle order line to assign the product order line to as a bundle item |
productSnapshot |
A snapshot of the product to add |
qty |
The quantity of the product to add to the order |
bundleId |
A bundle ID to assign to the product order line to identify it as a bundle |
Returns
The updated Order
entity
AddProductToBundle (7 of 8)
Adds a product to a bundle in the order
public static Order AddProductToBundle(this Order order, string parentBundleId,
IProductSnapshot productSnapshot, decimal qty, IDictionary<string, string> properties)
Parameters
Parameter | Description |
---|---|
order |
The Order instance |
parentBundleId |
The bundle ID of an existing bundle order line to assign the product order line to as a bundle item |
productSnapshot |
A snapshot of the product to add |
qty |
The quantity of the product to add to the order |
properties |
A collection of properties to assign to the product order line |
Returns
The updated Order
entity
AddProductToBundle (8 of 8)
Adds a product to a bundle in the order
public static Order AddProductToBundle(this Order order, string parentBundleId,
IProductSnapshot productSnapshot, decimal qty, IDictionary<string, string> properties,
string bundleId)
Parameters
Parameter | Description |
---|---|
order |
The Order instance |
parentBundleId |
The bundle ID of an existing bundle order line to assign the product order line to as a bundle item |
productSnapshot |
A snapshot of the product to add |
qty |
The quantity of the product to add to the order |
properties |
A collection of properties to assign to the product order line |
bundleId |
A bundle ID to assign to the product order line to identify it as a bundle |
Returns
The updated Order
entity
FinalizeOrUpdateTransaction (1 of 2)
Finalizes or updates the transaction info of the order
public static Order FinalizeOrUpdateTransaction(this Order order, decimal amountAuthorized,
string transactionId, PaymentStatus paymentStatus)
Parameters
Parameter | Description |
---|---|
order |
The Order instance |
amountAuthorized |
The amount authorized by the payment gateway |
transactionId |
The ID of the transaction from the payment gateway |
paymentStatus |
The status of the payment |
Returns
The updated Order
entity
FinalizeOrUpdateTransaction (2 of 2)
Finalizes or updates the transaction info of the order
public static Order FinalizeOrUpdateTransaction(this Order order, decimal amountAuthorized,
decimal transactionFee, string transactionId, PaymentStatus paymentStatus)
Parameters
Parameter | Description |
---|---|
order |
The Order instance |
amountAuthorized |
The amount authorized by the payment gateway |
transactionFee |
The transaction fee charged by the payment gateway |
transactionId |
The ID of the transaction from the payment gateway |
paymentStatus |
The status of the payment |
Returns
The updated Order
entity
InitializeTransaction
Initializes a transaction ready to send to the payment gateway
public static Order InitializeTransaction(this Order order)
Parameters
Parameter | Description |
---|---|
order |
The Order instance |
Returns
The updated Order
entity
Recalculate (1 of 2)
Recalculates the order
public static Order Recalculate(this Order order)
Parameters
Parameter | Description |
---|---|
order |
The Order instance |
Returns
The updated Order
entity
Recalculate (2 of 2)
Recalculates the order
public static Order Recalculate(this Order order, bool force)
Parameters
Parameter | Description |
---|---|
order |
The Order instance |
force |
A boolean flag indicating whether to force recalculation whether the order needs recalculating or not |
Returns
The updated Order
entity
Redeem
Redeems a Discount
or GiftCard
against the order
public static Order Redeem(this Order order, string discountOrGiftCardCode)
Parameters
Parameter | Description |
---|---|
order |
The Order instance |
discountOrGiftCardCode |
Returns
The updated Order
entity