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
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 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
class LocalStorageFactory { | |
constructor() { | |
if (typeof localStorage === 'undefined' || localStorage === null) { | |
const { LocalStorage } = require('node-localstorage') | |
this.localStorage = new LocalStorage('./localStorage') | |
} else { | |
this.localStorage = window.localStorage | |
} | |
} |
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"); | |
const stripe = require("stripe")(process.env.STRIPE_SECRET); | |
const BigCommerce = require("node-bigcommerce"); | |
const bigCommerce = new BigCommerce({ | |
logLevel: "info", | |
clientId: process.env.BC_CLIENT, | |
accessToken: process.env.BC_TOKEN, | |
storeHash: process.env.STORE_HASH, |
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
// all variable defines here | |
var pageLoading = 1; | |
var cartId = ''; | |
var taxProductId = 118; | |
//var canadaState = ''; | |
var paymentStep = 1; | |
localStorage.removeItem("taxProduct"); | |
localStorage.removeItem('taxProductId'); |
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
add_filter( 'bigcommerce/channels/enable-multi-channel', '__return_true' ); | |
if (function_exists('geoip_detect2_get_info_from_current_ip')) { | |
$userInfo = geoip_detect2_get_info_from_current_ip(); | |
do_action( 'php_console_log', $userInfo->country->isoCode ); | |
if ($userInfo->country->isoCode == 'ES') { | |
add_filter( 'bigcommerce/channel/current', function( $channel ) { | |
// logic to set the channel | |
return get_term( 33, \BigCommerce\Taxonomies\Channel\Channel::NAME ); | |
}, 10, 1 ); |
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
# Node.js | |
# Build a general Node.js project with npm. | |
# Add steps that analyze code, save build artifacts, deploy, and more: | |
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript | |
trigger: | |
- master | |
pool: | |
vmImage: ‘Ubuntu-16.04’ | |
steps: | |
- task: NodeTool@0 |
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 { FC, useEffect, useState, useCallback } from 'react' | |
import { Logo, Button, Input } from '@components/ui' | |
import useLogin from '@framework/use-login' | |
import { useUI } from '@components/ui/context' | |
import { validate } from 'email-validator' | |
interface Props {} | |
const LoginView: FC<Props> = () => { | |
// Form State |