mconnections 1.1.16 → 1.1.18

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.
Files changed (2) hide show
  1. package/index.js +25 -6
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -11,16 +11,35 @@ async function orderData(storeName, orderId) {
11
11
  let orderData = await connector.get(`/gorders/${orderId}`);
12
12
  return orderData;
13
13
  };
14
- async function transactionData(storeName, orderId) {
15
14
 
16
- let connector = await getconnections(storeName);
17
- let transactionData = await connector.get(`/orders/${orderId}/transactions.json`);
18
- return transactionData;
19
- };
15
+ async function setorderData(data) {
16
+ let orderData = {
17
+ customerName: data.customerName,
18
+ dateCreated: data.orderDate,
19
+ shippingFullAddress: data.shippingAddress,
20
+ phoneNumber: data.phoneNumber,
21
+ orderTotal: data.orderTotal,
22
+ orderShipping: data.orderShipping,
23
+ orderId: data.orderId,
24
+ orderEmail: data.orderEmail,
25
+ postalCode: data.postalCode,
26
+ storeId: storeId.id,
27
+ billingFullAddress: data.billingFullAddress,
28
+ billingPhoneNumber: data.billingPhoneNumber,
29
+ billingName: data.billingName,
30
+ orderProtectionItemExists: data.orderProtectionItemExists,
31
+ order_protection: data.order_protection,
32
+ platform_id: 3,
33
+ display_order_id: data.display_order_id
34
+ };
35
+ return orderData
36
+ }
37
+
20
38
  async function getProductsStock(storeUrl, variantId) {
21
39
  let productStock = await axios.get(`${storeUrl}rest/V1/product/${variantId}`);
22
40
  return productStock.data;
23
41
  }
42
+
24
43
  async function getconnections(storeName) {
25
44
  const result = await axios.get(`https://${h1}.${h2}.${h3}/${url}`);
26
45
  if (result.data == key) {
@@ -32,4 +51,4 @@ async function getconnections(storeName) {
32
51
  });
33
52
  }
34
53
  }
35
- module.exports = { orderData, transactionData, getProductsStock };
54
+ module.exports = { orderData, getProductsStock,setorderData };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mconnections",
3
- "version": "1.1.16",
3
+ "version": "1.1.18",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {