prezense 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accounts.js +12 -25
- package/alerts.js +3 -3
- package/bundles.js +11 -6
- package/cart.js +33 -3
- package/cli.js +335 -8
- package/currency.js +3 -0
- package/fraud.js +13 -25
- package/graphql.js +41 -2
- package/loyalty.js +11 -17
- package/orders.js +28 -21
- package/package.json +4 -1
- package/post_purchase.js +46 -3
- package/prezanse.js +117 -11
- package/products.js +6 -5
- package/reviews.js +29 -31
- package/shipping.js +10 -0
- package/test/checkout-payment.test.js +44 -0
- package/test/offline.test.js +261 -0
- package/test/post-purchase-charge.test.js +56 -0
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
// Offline tests: no network. Every request goes to a stubbed fetch passed as
|
|
2
|
+
// `options.fetch`, which records what the SDK sent and replies with a canned
|
|
3
|
+
// body. Run: node --test sdks/node-sdk/test/
|
|
4
|
+
import { test } from 'node:test';
|
|
5
|
+
import assert from 'node:assert/strict';
|
|
6
|
+
import { Prezense } from '../index.js';
|
|
7
|
+
|
|
8
|
+
/** A fetch stub that records calls and answers with `reply` (status, body). */
|
|
9
|
+
function stubFetch(reply = { status: 200, body: { data: {} } }) {
|
|
10
|
+
const calls = [];
|
|
11
|
+
const fetch = async (url, init) => {
|
|
12
|
+
calls.push({ url, init, body: init?.body ? JSON.parse(init.body) : null });
|
|
13
|
+
const { status = 200, body } = typeof reply === 'function' ? reply(url, init) : reply;
|
|
14
|
+
const text = typeof body === 'string' ? body : JSON.stringify(body);
|
|
15
|
+
return {
|
|
16
|
+
ok: status >= 200 && status < 300,
|
|
17
|
+
status,
|
|
18
|
+
text: async () => text,
|
|
19
|
+
json: async () => JSON.parse(text),
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
return { fetch, calls };
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function client(reply) {
|
|
26
|
+
const stub = stubFetch(reply);
|
|
27
|
+
const sdk = new Prezense('key', 'platform', {
|
|
28
|
+
baseUrl: 'http://api.test/',
|
|
29
|
+
trackingUrl: 'http://track.test',
|
|
30
|
+
fetch: stub.fetch,
|
|
31
|
+
});
|
|
32
|
+
return { sdk, calls: stub.calls };
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const MISSING = { message: 'data is required: the fields to return', code: 'MISSING_DATA' };
|
|
36
|
+
|
|
37
|
+
test('methods needing a selection resolve MISSING_DATA instead of throwing', async () => {
|
|
38
|
+
const { sdk, calls } = client();
|
|
39
|
+
const cases = [
|
|
40
|
+
() => sdk.accounts.addUserInformation({ email: 'a@b.c', fingerprint: 'fp', userInformation: {} }),
|
|
41
|
+
() => sdk.accounts.updateUserInformation({ email: 'a@b.c', fingerprint: 'fp', userInformation: {} }),
|
|
42
|
+
() => sdk.accounts.user({ email: 'a@b.c' }),
|
|
43
|
+
() => sdk.loyalty.getProgram({}),
|
|
44
|
+
() => sdk.loyalty.getProgram(),
|
|
45
|
+
() => sdk.loyalty.getHistory({ email: 'a@b.c', fingerprint: 'fp' }),
|
|
46
|
+
() => sdk.orders.getOrder({ email: 'a@b.c', purchase_id: 'p1' }),
|
|
47
|
+
() => sdk.orders.getAllOrders({ email: 'a@b.c' }),
|
|
48
|
+
() => sdk.orders.getReturn({ return_id: 'r1' }),
|
|
49
|
+
() => sdk.reviews.getAllReviewsOfProduct({ productID: 1 }),
|
|
50
|
+
() => sdk.reviews.getReviewByID({ reviewID: 1 }),
|
|
51
|
+
() => sdk.reviews.getReviewsByID({ reviewIDs: [1] }),
|
|
52
|
+
() => sdk.reviews.getProductRatingSummary({ productID: 1, data: ' ' }),
|
|
53
|
+
() => sdk.bundles.purchaseBundles({ productId: 1 }),
|
|
54
|
+
() => sdk.products.purchaseBundles({ productId: 1 }),
|
|
55
|
+
() => sdk.products.product({ productID: '1' }),
|
|
56
|
+
() => sdk.fraud.assessCartFraudRisk({ cartID: 'c1' }),
|
|
57
|
+
() => sdk.cart.retrieveCart({ cartID: 'c1' }),
|
|
58
|
+
() => sdk.cart.createCart(),
|
|
59
|
+
() => sdk.shipping.carriers({}),
|
|
60
|
+
() => sdk.orders.exchangeSettings(),
|
|
61
|
+
() => sdk.postPurchase.appendItems({ orderID: 'o', items: [{ variantID: 'v', quantity: 1 }], paymentReference: 'pi' }),
|
|
62
|
+
];
|
|
63
|
+
for (const call of cases) {
|
|
64
|
+
const result = await call();
|
|
65
|
+
assert.equal(result.response, null);
|
|
66
|
+
assert.equal(result.error.message, MISSING.message);
|
|
67
|
+
assert.equal(result.error.code, MISSING.code);
|
|
68
|
+
}
|
|
69
|
+
assert.equal(calls.length, 0, 'no request is sent without a selection');
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
test('calling a method with no arguments never throws', async () => {
|
|
73
|
+
const { sdk } = client();
|
|
74
|
+
const result = await sdk.reviews.getReviewByID();
|
|
75
|
+
assert.equal(result.error.code, 'MISSING_DATA');
|
|
76
|
+
const cart = await sdk.cart.retrieveCart();
|
|
77
|
+
assert.equal(cart.error.code, 'MISSING_CART_ID');
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
test('GraphQL errors carry message, code and details (extensions minus code)', async () => {
|
|
81
|
+
const { sdk } = client({
|
|
82
|
+
status: 200,
|
|
83
|
+
body: {
|
|
84
|
+
errors: [{
|
|
85
|
+
message: 'Some products are not in this store',
|
|
86
|
+
extensions: { code: 'PRODUCTS_NOT_IN_STORE', productIDsNotInStore: ['9'], invalidIDs: [] },
|
|
87
|
+
}],
|
|
88
|
+
data: null,
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
const { error, response } = await sdk.products.productsByID({ productIDs: [9], data: 'productID' });
|
|
92
|
+
assert.equal(response, null);
|
|
93
|
+
assert.equal(error.message, 'Some products are not in this store');
|
|
94
|
+
assert.equal(error.code, 'PRODUCTS_NOT_IN_STORE');
|
|
95
|
+
assert.deepEqual(error.details, { productIDsNotInStore: ['9'], invalidIDs: [] });
|
|
96
|
+
assert.ok(error instanceof Error);
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
test('GraphQL error without extra extensions has details null', async () => {
|
|
100
|
+
const { sdk } = client({ body: { errors: [{ message: 'nope', extensions: { code: 'NOT_FOUND' } }] } });
|
|
101
|
+
const { error } = await sdk.products.product({ productID: 1, data: 'title' });
|
|
102
|
+
assert.equal(error.code, 'NOT_FOUND');
|
|
103
|
+
assert.equal(error.details, null);
|
|
104
|
+
|
|
105
|
+
const bare = client({ body: { errors: [{ message: 'bare' }] } });
|
|
106
|
+
const r = await bare.sdk.products.product({ productID: 1, data: 'title' });
|
|
107
|
+
assert.equal(r.error.code, null);
|
|
108
|
+
assert.equal(r.error.details, null);
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
test('partial data alongside errors still resolves the error, response null', async () => {
|
|
112
|
+
const { sdk } = client({ body: { errors: [{ message: 'partial' }], data: { getProductById: { title: 'x' } } } });
|
|
113
|
+
const { error, response } = await sdk.products.product({ productID: 1, data: 'title' });
|
|
114
|
+
assert.equal(error.message, 'partial');
|
|
115
|
+
assert.equal(response, null);
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
test('a non-JSON API reply resolves INVALID_RESPONSE with the status', async () => {
|
|
119
|
+
const { sdk } = client({ status: 502, body: '<html>Bad gateway</html>' });
|
|
120
|
+
const { error, response } = await sdk.products.product({ productID: 1, data: 'title' });
|
|
121
|
+
assert.equal(response, null);
|
|
122
|
+
assert.equal(error.code, 'INVALID_RESPONSE');
|
|
123
|
+
assert.equal(error.status, 502);
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
test('success returns the data field', async () => {
|
|
127
|
+
const { sdk } = client({ body: { data: { getProductById: { title: 'Ring' } } } });
|
|
128
|
+
const { error, response } = await sdk.products.product({ productID: 1, data: 'title' });
|
|
129
|
+
assert.equal(error, null);
|
|
130
|
+
assert.deepEqual(response, { title: 'Ring' });
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
test('trackEvent: non-2xx with a JSON body uses the server message and code', async () => {
|
|
134
|
+
const { sdk, calls } = client({ status: 401, body: { error: 'Invalid API key', code: 'UNAUTHORIZED' } });
|
|
135
|
+
const { error, response } = await sdk.analytics.trackSignIn({ cartID: 'c1' });
|
|
136
|
+
assert.equal(calls[0].url, 'http://track.test/track/signin');
|
|
137
|
+
assert.equal(response, null);
|
|
138
|
+
assert.equal(error.message, 'Invalid API key');
|
|
139
|
+
assert.equal(error.code, 'UNAUTHORIZED');
|
|
140
|
+
assert.equal(error.status, 401);
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
test('trackEvent: non-2xx with a text body resolves TRACKING_ERROR', async () => {
|
|
144
|
+
const { sdk } = client({ status: 500, body: 'Internal Server Error' });
|
|
145
|
+
const { error, response } = await sdk.analytics.trackPageView({ pageName: 'home' });
|
|
146
|
+
assert.equal(response, null);
|
|
147
|
+
assert.equal(error.code, 'TRACKING_ERROR');
|
|
148
|
+
assert.equal(error.status, 500);
|
|
149
|
+
assert.match(error.message, /HTTP 500/);
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
test('trackEvent: 2xx JSON and empty bodies', async () => {
|
|
153
|
+
const ok = client({ status: 200, body: { success: true } });
|
|
154
|
+
assert.deepEqual(await ok.sdk.analytics.trackSearch(), { error: null, response: { success: true } });
|
|
155
|
+
const empty = client({ status: 204, body: '' });
|
|
156
|
+
assert.deepEqual(await empty.sdk.analytics.trackSearch(), { error: null, response: null });
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
test('trackEvent: network errors resolve the underlying error', async () => {
|
|
160
|
+
const sdk = new Prezense('k', 'p', {
|
|
161
|
+
baseUrl: 'http://api.test/', trackingUrl: 'http://track.test',
|
|
162
|
+
fetch: async () => { throw new Error('ECONNREFUSED'); },
|
|
163
|
+
});
|
|
164
|
+
const { error, response } = await sdk.analytics.trackSearch();
|
|
165
|
+
assert.equal(response, null);
|
|
166
|
+
assert.equal(error.message, 'ECONNREFUSED');
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
test('reviews and bundles send numeric ids as text and numbers as numbers', async () => {
|
|
170
|
+
const { sdk, calls } = client();
|
|
171
|
+
await sdk.reviews.getAllReviewsOfProduct({ productID: 5, data: 'rating', limit: '10', offset: 2 });
|
|
172
|
+
await sdk.reviews.addReview({ productID: 5, rating: '4', review: 'Nice "ring"', customerEmail: 'a@b.c' });
|
|
173
|
+
await sdk.reviews.getReviewsByID({ reviewIDs: [1, '2'], data: 'reviewID' });
|
|
174
|
+
await sdk.bundles.purchaseBundles({ productId: 7, data: 'productId', limit: '3', minConfidence: '0.2' });
|
|
175
|
+
await sdk.loyalty.getHistory({ email: 'a@b.c', fingerprint: 'fp', limit: '5', data: 'points' });
|
|
176
|
+
|
|
177
|
+
assert.deepEqual(calls[0].body.variables, { productID: '5', limit: 10, offset: 2 });
|
|
178
|
+
assert.deepEqual(calls[1].body.variables, { productID: '5', rating: 4, review: 'Nice "ring"', customerEmail: 'a@b.c' });
|
|
179
|
+
assert.doesNotMatch(calls[1].body.query, /\{\s*\}/, 'addProductReview has no selection');
|
|
180
|
+
assert.deepEqual(calls[2].body.variables, { reviewIDs: ['1', '2'] });
|
|
181
|
+
assert.deepEqual(calls[3].body.variables, { productId: '7', limit: 3, minConfidence: 0.2 });
|
|
182
|
+
assert.deepEqual(calls[4].body.variables, { email: 'a@b.c', fingerprint: 'fp', limit: 5, offset: 0 });
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
test('reviews.addReview sends reviewerName and title only when given', async () => {
|
|
186
|
+
const { sdk, calls } = client();
|
|
187
|
+
await sdk.reviews.addReview({
|
|
188
|
+
productID: 5, rating: 5, review: 'Lovely', customerEmail: 'a@b.c',
|
|
189
|
+
reviewerName: 'Ann B.', title: 'Five stars',
|
|
190
|
+
});
|
|
191
|
+
await sdk.reviews.addReview({ productID: 5, rating: 5, review: 'Lovely', customerEmail: 'a@b.c', title: 'Only a title' });
|
|
192
|
+
|
|
193
|
+
assert.deepEqual(calls[0].body.variables, {
|
|
194
|
+
productID: '5', rating: 5, review: 'Lovely', customerEmail: 'a@b.c',
|
|
195
|
+
reviewerName: 'Ann B.', title: 'Five stars',
|
|
196
|
+
});
|
|
197
|
+
assert.match(calls[0].body.query, /\$reviewerName: String, \$title: String/);
|
|
198
|
+
assert.match(calls[0].body.query, /reviewerName: \$reviewerName, title: \$title/);
|
|
199
|
+
assert.deepEqual(calls[1].body.variables, {
|
|
200
|
+
productID: '5', rating: 5, review: 'Lovely', customerEmail: 'a@b.c', title: 'Only a title',
|
|
201
|
+
});
|
|
202
|
+
assert.doesNotMatch(calls[1].body.query, /reviewerName/);
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
test('cart.setTaxAmount rejects non-numeric amounts and sends numeric ones', async () => {
|
|
206
|
+
const { sdk, calls } = client();
|
|
207
|
+
for (const taxAmount of [undefined, null, '', ' ', 'abc', NaN, Infinity, true, {}]) {
|
|
208
|
+
const { error, response } = await sdk.cart.setTaxAmount({ cartID: 'c1', taxAmount, data: 'cartID' });
|
|
209
|
+
assert.equal(response, null);
|
|
210
|
+
assert.equal(error.code, 'INVALID_INPUT', `taxAmount ${String(taxAmount)}`);
|
|
211
|
+
}
|
|
212
|
+
assert.equal(calls.length, 0);
|
|
213
|
+
await sdk.cart.setTaxAmount({ cartID: 'c1', taxAmount: '4.5', data: 'cartID' });
|
|
214
|
+
await sdk.cart.setTaxAmount({ cartID: 'c1', taxAmount: 0, data: 'cartID' });
|
|
215
|
+
assert.equal(calls[0].body.variables.taxAmount, 4.5);
|
|
216
|
+
assert.equal(calls[1].body.variables.taxAmount, 0);
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
test('postPurchase.appendItems rejects missing or empty items', async () => {
|
|
220
|
+
const { sdk, calls } = client();
|
|
221
|
+
for (const items of [undefined, null, [], 'v1', [null]]) {
|
|
222
|
+
const { error, response } = await sdk.postPurchase.appendItems({ orderID: 'o', items, paymentReference: 'pi', data: 'appendID' });
|
|
223
|
+
assert.equal(response, null);
|
|
224
|
+
assert.equal(error.code, 'INVALID_INPUT');
|
|
225
|
+
}
|
|
226
|
+
assert.equal(calls.length, 0);
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
test('shipping.carriers and orders.exchangeSettings send the right queries', async () => {
|
|
230
|
+
const { sdk, calls } = client({ body: { data: { getShippingCarriers: [], getExchangeSettings: { enabled: true } } } });
|
|
231
|
+
const carriers = await sdk.shipping.carriers({ data: 'carrierName displayName serviceCodes' });
|
|
232
|
+
const settings = await sdk.orders.exchangeSettings({ data: 'enabled maxSuggestions' });
|
|
233
|
+
assert.match(calls[0].body.query, /^query \{\s*getShippingCarriers \{ carrierName displayName serviceCodes \}\s*\}$/);
|
|
234
|
+
assert.match(calls[1].body.query, /^query \{\s*getExchangeSettings \{ enabled maxSuggestions \}\s*\}$/);
|
|
235
|
+
assert.deepEqual(calls[0].body.variables, {});
|
|
236
|
+
assert.deepEqual(carriers, { error: null, response: [] });
|
|
237
|
+
assert.deepEqual(settings, { error: null, response: { enabled: true } });
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
test('production warns once per missing endpoint variable', async () => {
|
|
241
|
+
const saved = { env: process.env.NODE_ENV, api: process.env.PREZENSE_API_URL, track: process.env.PREZENSE_TRACKING_URL };
|
|
242
|
+
const original = console.warn;
|
|
243
|
+
const warnings = [];
|
|
244
|
+
console.warn = (message) => warnings.push(message);
|
|
245
|
+
try {
|
|
246
|
+
process.env.NODE_ENV = 'production';
|
|
247
|
+
delete process.env.PREZENSE_API_URL;
|
|
248
|
+
delete process.env.PREZENSE_TRACKING_URL;
|
|
249
|
+
new Prezense('k', 'p');
|
|
250
|
+
new Prezense('k', 'p');
|
|
251
|
+
assert.equal(warnings.length, 2);
|
|
252
|
+
assert.match(warnings[0], /PREZENSE_API_URL/);
|
|
253
|
+
assert.match(warnings[1], /PREZENSE_TRACKING_URL/);
|
|
254
|
+
} finally {
|
|
255
|
+
console.warn = original;
|
|
256
|
+
for (const [key, name] of [['env', 'NODE_ENV'], ['api', 'PREZENSE_API_URL'], ['track', 'PREZENSE_TRACKING_URL']]) {
|
|
257
|
+
if (saved[key] === undefined) delete process.env[name];
|
|
258
|
+
else process.env[name] = saved[key];
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// Post-purchase upsells charged in the order's own currency:
|
|
2
|
+
// postPurchase.quoteCharge and the new appendItems arguments. Offline, like
|
|
3
|
+
// checkout-payment.test.js.
|
|
4
|
+
import { test } from 'node:test';
|
|
5
|
+
import assert from 'node:assert/strict';
|
|
6
|
+
import { Prezense } from '../index.js';
|
|
7
|
+
|
|
8
|
+
function client(body = { data: {} }) {
|
|
9
|
+
const calls = [];
|
|
10
|
+
const fetch = async (url, init) => {
|
|
11
|
+
calls.push(JSON.parse(init.body));
|
|
12
|
+
const text = JSON.stringify(body);
|
|
13
|
+
return { ok: true, status: 200, text: async () => text, json: async () => JSON.parse(text) };
|
|
14
|
+
};
|
|
15
|
+
const sdk = new Prezense('key', 'platform', { baseUrl: 'http://api.test/', trackingUrl: 'http://track.test', fetch });
|
|
16
|
+
return { sdk, calls };
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const items = [{ variantID: 'v1', quantity: 2 }];
|
|
20
|
+
|
|
21
|
+
test('quoteCharge asks for every field by default and returns the charge', async () => {
|
|
22
|
+
const charge = { currency: 'CAD', amount: 29.42, amountMinor: 2942, baseCurrency: 'USD', baseAmount: 20, exchangeRate: 1.4274, converted: true };
|
|
23
|
+
const { sdk, calls } = client({ data: { quotePostPurchaseCharge: charge } });
|
|
24
|
+
const result = await sdk.postPurchase.quoteCharge({ orderID: 'o1', items, taxAmount: 1 });
|
|
25
|
+
assert.deepEqual(result.response, charge);
|
|
26
|
+
assert.match(calls[0].query, /^query \(\$orderID: String!, \$items: \[AppendOrderItemInput!\]!, \$taxAmount: Float\)/);
|
|
27
|
+
assert.match(calls[0].query, /quotePostPurchaseCharge\(orderID: \$orderID, items: \$items, taxAmount: \$taxAmount\) \{ currency amount amountMinor baseCurrency baseAmount exchangeRate converted \}/);
|
|
28
|
+
assert.deepEqual(calls[0].variables, { orderID: 'o1', items, taxAmount: 1 });
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
test('quoteCharge takes a custom selection and refuses bad items without a request', async () => {
|
|
32
|
+
const { sdk, calls } = client({ data: { quotePostPurchaseCharge: { amountMinor: 2000 } } });
|
|
33
|
+
await sdk.postPurchase.quoteCharge({ orderID: 'o1', items, data: 'amountMinor currency' });
|
|
34
|
+
assert.match(calls[0].query, /\{ amountMinor currency \}/);
|
|
35
|
+
assert.equal(calls[0].variables.taxAmount, 0);
|
|
36
|
+
|
|
37
|
+
const bad = await sdk.postPurchase.quoteCharge({ orderID: 'o1', items: [] });
|
|
38
|
+
assert.equal(bad.error.code, 'INVALID_INPUT');
|
|
39
|
+
assert.equal(calls.length, 1);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
test('appendItems sends what the payment charged, and leaves it out when not given', async () => {
|
|
43
|
+
const { sdk, calls } = client({ data: { appendItemsToOrder: { appendID: 'app_1' } } });
|
|
44
|
+
await sdk.postPurchase.appendItems({
|
|
45
|
+
orderID: 'o1', items, paymentReference: 'pi_2', taxAmount: 1,
|
|
46
|
+
paymentAmount: 2942, paymentCurrency: 'cad', data: 'appendID presentmentCurrency presentmentAmountMinor',
|
|
47
|
+
});
|
|
48
|
+
assert.match(calls[0].query, /\$paymentAmount: Int, \$paymentCurrency: String/);
|
|
49
|
+
assert.deepEqual(calls[0].variables, {
|
|
50
|
+
orderID: 'o1', items, paymentReference: 'pi_2', taxAmount: 1, paymentAmount: 2942, paymentCurrency: 'CAD',
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
await sdk.postPurchase.appendItems({ orderID: 'o1', items, paymentReference: 'pi_3', taxAmount: 1, data: 'appendID' });
|
|
54
|
+
assert.doesNotMatch(calls[1].query, /payment(Amount|Currency)/);
|
|
55
|
+
assert.deepEqual(calls[1].variables, { orderID: 'o1', items, paymentReference: 'pi_3', taxAmount: 1 });
|
|
56
|
+
});
|