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
{ | |
"actions": [ | |
{ | |
"actionId": "http.commerce.catalog.storefront.shipping.requestRates.after", | |
"contexts": [ | |
{ | |
"customFunctions": [ | |
{ | |
"applicationKey": "Grobelny.CleanSlateArcApp.1.0.0.Release", | |
"functionId": "http.commerce.catalog.storefront.shipping.requestRates.after", |
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
module.exports = function(context, callback) { | |
try { | |
var firstShippingRatePrice = context.response.body.rates[0].shippingRates[0].amount; | |
context.response.body.rates[0].shippingRates[0].amount = Math.floor(firstShippingRatePrice + (firstShippingRatePrice * 0.25)); | |
} catch(err) { | |
console.error(err); | |
} | |
callback(); | |
}; |
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
module.exports = function(context, callback) { | |
var rates = context.response.body.rates; | |
var shippingRate; | |
try{ | |
for(var i = 0; i < rates.length; i++) { | |
for(var j = 0; j < rates[i].shippingRates.length; j++) { | |
shippingRate = context.response.body.rates[i].shippingRates[j].amount; | |
context.response.body.rates[i].shippingRates[j].amount = Math.floor((shippingRate + (context.response.body.rates[i].shippingRates[j].amount * 0.25))); | |
} | |
} |
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
module.exports = function(context, callback) { | |
console.info(context.response.body.rates[0]); | |
console.info(context.response.body.rates[0].shippingRates[0]); | |
console.info(context.response.body.rates[0].shippingRates[0].amount); | |
callback(); | |
}; |
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
module.exports = function(context, callback) { | |
var rates = context.response.body.rates; | |
for(var i = 0; i < rates.length; i++) { | |
console.info(rates[i]); | |
for(var j = 0; j < rates[i].shippingRates.length; j++) { | |
console.info("\t\t" + rates[i].shippingRates[j].content.name); | |
console.info("\t\t" + rates[i].shippingRates[j].amount); | |
} | |
} | |
callback(); |
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
{ | |
"startIndex": 0, | |
"pageSize": 10, | |
"pageCount": 1, | |
"totalCount": 8, | |
"items": [ | |
{ | |
"name": "files", | |
"namespace": "mozu", | |
"listFQN": "files@mozu", |
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
using System; | |
using System.IO; | |
using Box.V2; | |
using Box.V2.Config; | |
using Box.V2.JWTAuth; | |
namespace BoxPlayground | |
{ | |
public static class BoxService | |
{ |
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
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Text.RegularExpressions; | |
namespace BoxCLI.CommandUtilities | |
{ | |
public static class GeneralUtilities | |
{ |
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
# Change this file path | |
$FILE_PATH = "C:\Users\AM\Documents\Welcome.pptx" | |
$USER_ID = box users create otis --app-user --id-only; | |
$FOLDER_ID = box folders create 0 first-folder --as-user $USER_ID --id-only; | |
box files upload $FILE_PATH --as-user $USER_ID -p $FOLDER_ID; |
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
package com.amsxbg; | |
import com.box.sdk.*; | |
import java.io.FileReader; | |
import java.io.Reader; | |
public class App { | |
public static void main( String[] args ) { | |
try(Reader reader = new FileReader("src/config/config.json")) { | |
BoxConfig boxConfig = BoxConfig.readFrom(reader); | |
BoxDeveloperEditionAPIConnection api = BoxDeveloperEditionAPIConnection.getAppEnterpriseConnection(boxConfig); |