This file contains 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 request = require("request"); | |
var options = { | |
method: "PUT", | |
url: "https://api.bigcommerce.com/stores/STORE_HASH/v2/orders/100", | |
headers: { | |
"X-Auth-Client": "XXXXXX", | |
"X-Auth-Token": "XXXXXX", | |
"Content-Type": "application/json", | |
Accept: "application/json" |
This file contains 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
/* eslint-disable */ | |
import React from "react"; | |
import ReactDOM from "react-dom"; | |
import PageManager from "../page-manager"; | |
import ApolloClient from "apollo-boost"; | |
import gql from "graphql-tag"; | |
function getProducts(token, productIds) { | |
const client = new ApolloClient({ |
This file contains 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
"use strict"; | |
const request = require("request-promise"); | |
async function getOrderData(orderDataId) { | |
const options = { | |
method: "GET", | |
uri: `https://api.bigcommerce.com/stores/XXXX/v2/orders/${orderDataId}`, | |
headers: { | |
accept: "application/json", |
This file contains 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
service: aws-nodejs | |
provider: | |
name: aws | |
runtime: nodejs10.x | |
functions: | |
members: | |
handler: handler.OrderWebhooksHandler | |
events: | |
- http: | |
path: OrderWebhooksHandler |
This file contains 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
"use strict"; | |
const he = require("he"); | |
const _ = require("lodash"); | |
const request = require("request-promise"); | |
//use for invetory | |
var BigCommerce = require("node-bigcommerce"); | |
var bigCommerce = new BigCommerce({ |
This file contains 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
'use strict' | |
const request = require('request-promise') | |
async function checkoutBC(cartData) { | |
// https://api.bigcommerce.com/stores/{{store_hash}}/v3/carts/{{cart_id}}/redirect_urls | |
const options = { | |
method: 'POST', | |
uri: `https://api.bigcommerce.com/stores/q5fk0ac2gk/v3/carts/${cartData.data.id}/redirect_urls`, | |
headers: { | |
accept: 'application/json', |
This file contains 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
'use strict' | |
const request = require('request-promise') | |
async function checkoutBC(cartData) { | |
// https://api.bigcommerce.com/stores/{{store_hash}}/v3/carts/{{cart_id}}/redirect_urls | |
const options = { | |
method: 'POST', | |
uri: `https://api.bigcommerce.com/stores/q5fk0ac2gk/v3/carts/${cartData.data.id}/redirect_urls`, | |
headers: { | |
accept: 'application/json', |
This file contains 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
import React from "react" | |
import Layout from "../components/layout" | |
import ReactDOM from "react-dom" | |
import Embedcheckout from "../components/embedcheckout" | |
export default () => { | |
function testing(){if(typeof window !== 'undefined'){ | |
console.log('windowstaturl',window.history.state.checkoutData.data.embedded_checkout_url) | |
return window.history.state.checkoutData.data.embedded_checkout_url |
This file contains 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
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script> | |
//Add calander | |
<script src="https://unpkg.com/js-datepicker"></script> | |
//Add Calander script you want to use | |
<script> | |
//observe timmer to ensure element is present to add calander on after | |
var obs = new MutationObserver(function(mutations, observer) { | |
$.each(mutations, function(i, mutation) { | |
var addedNodes = $(mutation.addedNodes); |
This file contains 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
class LocalStorageFactory { | |
constructor() { | |
if (typeof localStorage === 'undefined' || localStorage === null) { | |
const { LocalStorage } = require('node-localstorage') | |
this.localStorage = new LocalStorage('./localStorage') | |
} else { | |
this.localStorage = window.localStorage | |
} | |
} |