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 fs from 'fs' | |
import axios from 'axios' | |
const { REACT_APP_API_ENDPOINT, BIGCOMMERCE_STORE_HASH, BIGCOMMERCE_STORE_API_TOKEN } = process.env | |
// REACT_APP_API_ENDPOINT=http://localhost:3030 | |
// BIGCOMMERCE_STORE_HASH=WQiOjEsImN | |
// BIGCOMMERCE_STORE_API_TOKEN=FsaG9zdDozMDMwIl0sImVhdCI6MTdww3 |
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
<?php | |
// Authenticate wordpress user 1 (ID) | |
wp_set_auth_cookie(1); | |
/** | |
* If doesn't works, try this: | |
wp_clear_auth_cookie(); | |
wp_set_current_user ( 1 ); | |
wp_set_auth_cookie ( 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
import type { NextApiHandler, NextApiRequest, NextApiResponse } from 'next' | |
import jwt from 'jsonwebtoken'; | |
import {v4 as uuidv4} from 'uuid'; | |
import concatHeader from '../utils/concat-cookie' | |
import getConfig from '../utils/get-config' | |
function getSsoLoginUrl(customerId: number, storeHash: string, storeUrl: string, clientId: string, clientSecret: string) { | |
const dateCreated = Math.round((new Date()). getTime() / 1000); | |
const payload = { | |
"iss": clientId, |
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 { productPrices, multipleChoiceOptionFragment } from '@framework/api/fragments/product'; | |
const productInfoFragment = /* GraphQL */ ` | |
fragment productInfo on Product { | |
entityId | |
name | |
path | |
brand { | |
entityId | |
} |
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
console.disableYellowBox = true; | |
// Your react-native app |
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
#!/usr/bin/env bash | |
# Prevent send to bugsnag in not selected branches | |
if [ "$APPCENTER_BRANCH" != "production" ] && [ "$APPCENTER_BRANCH" != "qa" ] && [ "$APPCENTER_BRANCH" != "staging" ] | |
then | |
echo "This branch is not in the selected ones:" $APPCENTER_BRANCH | |
exit | |
fi | |
# Set platform | |
echo "Setting Platform..." |
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 { Linking } from 'react-native' | |
import BugTracker from 'BUGSNAG/SENTRY/FIREBASE...' | |
export const openUnsafeUrl = async (url: string): void => { | |
try { | |
const supported = await Linking.canOpenURL(url) | |
if (!supported) { | |
BugTracker.sendMessage(`Can't handle url: ${url}`) | |
} | |
await Linking.openURL(url) |