Subversion Repositories SmartDukaan

Rev

Rev 35079 | Rev 35367 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 35079 Rev 35308
Line 33... Line 33...
33
            address.put("country", "IN");
33
            address.put("country", "IN");
34
            address.put("phone", store.getUserAddress().getPhoneNumber() != null ? store.getUserAddress().getPhoneNumber() : "");
34
            address.put("phone", store.getUserAddress().getPhoneNumber() != null ? store.getUserAddress().getPhoneNumber() : "");
35
 
35
 
36
            String locationGid = shopifyGraphQLService.createLocation(store.getCode(), address);
36
            String locationGid = shopifyGraphQLService.createLocation(store.getCode(), address);
37
            String numeric = shopifyGraphQLService.extractIdFromGid(locationGid);
37
            String numeric = shopifyGraphQLService.extractIdFromGid(locationGid);
38
            store.setShopifyLocationId(numeric);
38
            //store.setShopifyLocationId(numeric);
39
        }
39
        }
40
 
40
 
41
        if (req.isSyncCustomer()) {
41
        if (req.isSyncCustomer()) {
42
            String email = store.getCode() + "@franchise.example.com";
42
            String email = store.getCode() + "@franchise.example.com";
43
            String customerGid = shopifyGraphQLService.createCustomer(email, store.getCode(), store.getCode());
43
            String customerGid = shopifyGraphQLService.createCustomer(email, store.getCode(), store.getCode());
44
            String numeric = shopifyGraphQLService.extractIdFromGid(customerGid);
44
            String numeric = shopifyGraphQLService.extractIdFromGid(customerGid);
45
            store.setShopifyCustomerId(numeric);
45
            //store.setShopifyCustomerId(numeric);
46
        }
46
        }
47
 
47
 
48
        if (store.getGstNumber() != null && store.getShopifyLocationId() != null) {
48
        /*if (store.getGstNumber() != null && store.getShopifyLocationId() != null) {
49
            String locationGid = shopifyGraphQLService.toGid("Location", store.getShopifyLocationId());
49
            String locationGid = shopifyGraphQLService.toGid("Location", store.getShopifyLocationId());
50
            shopifyGraphQLService.setMetafield(locationGid, "franchise", "gstin", store.getGstNumber(), "SINGLE_LINE_TEXT_FIELD");
50
            shopifyGraphQLService.setMetafield(locationGid, "franchise", "gstin", store.getGstNumber(), "SINGLE_LINE_TEXT_FIELD");
51
        }
51
        }*/
52
 
52
 
53
        return store;
53
        return store;
54
    }
54
    }
55
 
55
 
56
}
56
}