This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Implementation for embedded.commerce.payments.action.before | |
* This custom function will receive the following context object: | |
{ | |
"exec": { | |
"setActionAmount": { | |
"parameters": [ | |
{ | |
"name": "amount", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id": "", | |
"name": "10 Percent Off - 5700380", | |
"friendlyDescription": "Save 10 percent off on this fancy nest Camera", | |
"doesNotApplyToSalePrice": false, | |
"doesNotApplyToProductsWithSalePrice": false, | |
"scope": "LineItem", | |
"target": "Product", | |
"includeAllProducts": false, | |
"excludeItemsWithExistingProductDiscounts": false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"success": true, | |
"total": 1, | |
"items": [ | |
{ | |
"priceListCode": "100", | |
"productCode": "pc00001", | |
"productName": "test product", | |
"currencyCode": "USD", | |
"startDate": "2017-12-13T03:13:00.000Z", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void CreateOrderNote(ApiContext apiContext, string orderNumber) | |
{ | |
var orderResource = new OrderResource(apiContext); | |
var orderNoteResource = new OrderNoteResource(apiContext); | |
var existingOrder = orderResource.GetOrdersAsync(filter: String.Format("OrderNumber eq '{0}'", Convert.ToInt32(orderNumber))) | |
.Result | |
.Items | |
.FirstOrDefault(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var OrderItemResource = require('mozu-node-sdk/clients/commerce/orders/orderItem'); | |
var OrderResource = require('mozu-node-sdk/clients/commerce/order'); | |
module.exports = function (context, callback) { | |
var orderResource = new OrderResource(context.apiContext); | |
orderResource.context['user-claims'] = null; | |
var orderItemResource = new OrderItemResource(context.apiContext); | |
orderItemResource.context['user-claims'] = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void Fulfill_Order_Pickups() | |
{ | |
var orderResource = new Mozu.Api.Resources.Commerce.OrderResource(_apiContext); | |
var pickupResource = new Mozu.Api.Resources.Commerce.Orders.PickupResource(_apiContext); | |
var fulfillmentInfoResource = new Mozu.Api.Resources.Commerce.Orders.FulfillmentInfoResource(_apiContext); | |
var fulfillmentActionResource = new Mozu.Api.Resources.Commerce.Orders.FulfillmentActionResource(_apiContext); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestMethod] | |
public void Create_Order_Package_And_Fulfill() | |
{ | |
var orderResource = new Mozu.Api.Resources.Commerce.OrderResource(_apiContext); | |
var packageResource = new Mozu.Api.Resources.Commerce.Orders.PackageResource(_apiContext); | |
var shipmentResource = new Mozu.Api.Resources.Commerce.Orders.ShipmentResource(_apiContext); | |
var fulfillmentInfoResource = new Mozu.Api.Resources.Commerce.Orders.FulfillmentInfoResource(_apiContext); | |
var fulfillmentActionResource = new Mozu.Api.Resources.Commerce.Orders.FulfillmentActionResource(_apiContext); | |
var filter = string.Format("OrderNumber eq '{0}'", "34"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void Update_Customer_RecomputeLifeTimeBalance() | |
{ | |
//create instance of customer account resource | |
var accountResource = new Mozu.Api.Resources.Commerce.Customer | |
.CustomerAccountResource(_apiContext); | |
var existingAcct = accountResource.GetAccountsAsync(filter: "EmailAddress eq '[email protected]'") | |
.Result | |
.Items | |
.First(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestMethod] | |
public void Static_Event_Data() | |
{ | |
var eventNotificationResource = new Mozu.Api.Resources.Event.EventNotificationResource(_apiContext); | |
var eventSubscriptionResource = new Mozu.Api.Resources.Event.Push.SubscriptionResource(_apiContext); | |
var eventDeliveryResource = new Mozu.Api.Resources.Event.Push.Subscriptions.EventDeliverySummaryResource(_apiContext); | |
var eventCollection = eventNotificationResource.GetEventsAsync(filter: "topic ne order.abandoned").Result; | |
var subscriptions = eventSubscriptionResource.GetSubscriptionsAsync().Result; | |
var eventDeliveries = eventDeliveryResource.GetDeliveryAttemptSummariesAsync("c5bad72df8564ff08b2da5c4013ba6c9").Result; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var filePath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + "\\Pictures\\"; | |
var fileName = filePath + "bobafett.jpg"; | |
var properties = new JObject(); | |
properties.Add("height", 300); | |
properties.Add("weight", 300); | |
var documentResource = new Mozu.Api.Resources.Content.Documentlists.DocumentResource(_apiContext); | |
var document = new Mozu.Api.Contracts.Content.Document() | |
{ |
NewerOlder