ti2-ventrata 1.0.38 → 1.0.39
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/index.js +1 -1
- package/index.test.js +1 -1
- package/package.json +1 -1
- package/resolvers/availability.js +8 -2
package/index.js
CHANGED
|
@@ -487,7 +487,7 @@ class Plugin {
|
|
|
487
487
|
notes,
|
|
488
488
|
resellerReference: reference,
|
|
489
489
|
settlementMethod,
|
|
490
|
-
|
|
490
|
+
emailReceipt: true, // always send email to the customer
|
|
491
491
|
};
|
|
492
492
|
|
|
493
493
|
try {
|
package/index.test.js
CHANGED
package/package.json
CHANGED
|
@@ -5,15 +5,16 @@ const jwt = require('jsonwebtoken');
|
|
|
5
5
|
|
|
6
6
|
const resolvers = {
|
|
7
7
|
Query: {
|
|
8
|
-
key: (root, args) => {
|
|
8
|
+
key: (root, args, context) => {
|
|
9
9
|
const {
|
|
10
10
|
productId,
|
|
11
11
|
optionId,
|
|
12
12
|
currency,
|
|
13
13
|
unitsWithQuantity,
|
|
14
14
|
jwtKey,
|
|
15
|
-
settlementMethods,
|
|
16
15
|
} = args;
|
|
16
|
+
// Get settlementMethods from context if not in args
|
|
17
|
+
const settlementMethods = args.settlementMethods || (context && context.settlementMethods) || [];
|
|
17
18
|
if (!jwtKey) return null;
|
|
18
19
|
return jwt.sign({
|
|
19
20
|
productId,
|
|
@@ -58,11 +59,16 @@ const translateAvailability = async ({ rootValue, variableValues, typeDefs, quer
|
|
|
58
59
|
typeDefs,
|
|
59
60
|
resolvers,
|
|
60
61
|
});
|
|
62
|
+
// Extract settlementMethods from variableValues to pass via context
|
|
63
|
+
const settlementMethods = variableValues.settlementMethods || [];
|
|
61
64
|
const retVal = await graphql({
|
|
62
65
|
schema,
|
|
63
66
|
rootValue,
|
|
64
67
|
source: query,
|
|
65
68
|
variableValues,
|
|
69
|
+
contextValue: {
|
|
70
|
+
settlementMethods,
|
|
71
|
+
},
|
|
66
72
|
});
|
|
67
73
|
if (retVal.errors) throw new Error(retVal.errors);
|
|
68
74
|
return retVal.data;
|