forked from MONEI/Shopify-api-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon.js
More file actions
50 lines (43 loc) · 1.21 KB
/
common.js
File metadata and controls
50 lines (43 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
'use strict';
const nock = require('nock');
const pkg = require('../package');
const Shopify = require('..');
const accessToken = 'f85632530bf277ec9ac6f649fc327f17';
const password = '72297d971271bc62ca899bba7432acb1';
const apiKey = 'bc731e500840231da5b43bb3f388d2f0';
const apiVersion = '2019-04';
const shopName = 'johns-apparel';
const shopify = new Shopify({ shopName, accessToken });
const shopifyWithPresentmentOption = new Shopify({
accessToken,
presentmentPrices: true,
shopName
});
const scope = nock(`https://${shopName}.myshopify.com`, {
reqheaders: {
'User-Agent': `${pkg.name}/${pkg.version}`,
'X-Shopify-Access-Token': accessToken,
Accept: 'application/json'
},
badheaders: ['Authorization', 'X-Shopify-Api-Features']
});
const presentmentApiScope = nock(`https://${shopName}.myshopify.com`, {
reqheaders: {
'User-Agent': `${pkg.name}/${pkg.version}`,
'X-Shopify-Access-Token': accessToken,
'X-Shopify-Api-Features': 'include-presentment-prices',
Accept: 'application/json'
},
badheaders: ['Authorization']
});
module.exports = {
accessToken,
apiKey,
apiVersion,
password,
presentmentApiScope,
scope,
shopify,
shopifyWithPresentmentOption,
shopName
};