sc-common-interface 2.2.3__tar.gz → 2.2.5__tar.gz
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.
- {sc-common-interface-2.2.3 → sc-common-interface-2.2.5}/PKG-INFO +1 -1
- {sc-common-interface-2.2.3 → sc-common-interface-2.2.5}/sc_common_interface/PostCommonInterface.py +38 -45
- {sc-common-interface-2.2.3 → sc-common-interface-2.2.5}/sc_common_interface.egg-info/PKG-INFO +1 -1
- {sc-common-interface-2.2.3 → sc-common-interface-2.2.5}/setup.py +1 -1
- {sc-common-interface-2.2.3 → sc-common-interface-2.2.5}/sc_common_interface/Platform.py +0 -0
- {sc-common-interface-2.2.3 → sc-common-interface-2.2.5}/sc_common_interface/__init__.py +0 -0
- {sc-common-interface-2.2.3 → sc-common-interface-2.2.5}/sc_common_interface.egg-info/SOURCES.txt +0 -0
- {sc-common-interface-2.2.3 → sc-common-interface-2.2.5}/sc_common_interface.egg-info/dependency_links.txt +0 -0
- {sc-common-interface-2.2.3 → sc-common-interface-2.2.5}/sc_common_interface.egg-info/requires.txt +0 -0
- {sc-common-interface-2.2.3 → sc-common-interface-2.2.5}/sc_common_interface.egg-info/top_level.txt +0 -0
- {sc-common-interface-2.2.3 → sc-common-interface-2.2.5}/setup.cfg +0 -0
{sc-common-interface-2.2.3 → sc-common-interface-2.2.5}/sc_common_interface/PostCommonInterface.py
RENAMED
|
@@ -177,6 +177,9 @@ def search_oa_product(data):
|
|
|
177
177
|
env = data["env"]
|
|
178
178
|
headers = data["headers"]
|
|
179
179
|
url = "%s/openApi/proxy/v1/products?page=1&per_page=4" %env
|
|
180
|
+
if "query" in data:
|
|
181
|
+
query = data["query"]
|
|
182
|
+
url = "%s/openApi/proxy/v1/products?page=1&per_page=4&query=%s" % (env,query)
|
|
180
183
|
response = requests.get(url, headers=headers).json()
|
|
181
184
|
return response
|
|
182
185
|
|
|
@@ -350,9 +353,6 @@ def get_page_post(data):
|
|
|
350
353
|
:return:响应
|
|
351
354
|
"""
|
|
352
355
|
#时间戳转换
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
356
|
env = data["env"]
|
|
357
357
|
headers = data["headers"]
|
|
358
358
|
platform = "FACEBOOK"
|
|
@@ -792,35 +792,35 @@ def merge_customer(data):
|
|
|
792
792
|
user_id = data["user_id"]
|
|
793
793
|
page_id = data["page_id"]
|
|
794
794
|
platform = data["platform"]
|
|
795
|
+
customer_id = jsonpath(response,"$..customer_id")[0]
|
|
795
796
|
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
body = {"email": "", "mobile_phone": phone, "mobile_phone_country_calling_code": "86",
|
|
802
|
-
"name": name, "page_scoped_id": user_id, "locale_code": None, "country_code": "cn",
|
|
803
|
-
"id": None, "party_channel_id": page_id, "platform": platform, "is_member": True}
|
|
804
|
-
if items != []:
|
|
805
|
-
id = jsonpath(response, "$..id")[0]
|
|
806
|
-
customer_id = id
|
|
797
|
+
if customer_id==None:
|
|
798
|
+
response = search_customer(data)
|
|
799
|
+
items = response["data"]["items"]
|
|
800
|
+
# 创建会员
|
|
801
|
+
url = "%s/uc/customers/merge" % env
|
|
807
802
|
body = {"email": "", "mobile_phone": phone, "mobile_phone_country_calling_code": "86",
|
|
808
803
|
"name": name, "page_scoped_id": user_id, "locale_code": None, "country_code": "cn",
|
|
809
|
-
"id":
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
email = "%d@qq.com"%int(time.time())
|
|
817
|
-
body = {"email": email, "mobile_phone": "", "mobile_phone_country_calling_code": "86",
|
|
818
|
-
"name": name, "page_scoped_id": user_id, "locale_code": None, "country_code": "cn",
|
|
819
|
-
"id": "", "party_channel_id": page_id, "platform": platform, "is_member": False}
|
|
804
|
+
"id": None, "party_channel_id": page_id, "platform": platform, "is_member": True}
|
|
805
|
+
if items != []:
|
|
806
|
+
id = jsonpath(response, "$..id")[0]
|
|
807
|
+
customer_id = id
|
|
808
|
+
body = {"email": "", "mobile_phone": phone, "mobile_phone_country_calling_code": "86",
|
|
809
|
+
"name": name, "page_scoped_id": user_id, "locale_code": None, "country_code": "cn",
|
|
810
|
+
"id": id, "party_channel_id": page_id, "platform": platform, "is_member": True}
|
|
820
811
|
response = requests.put(url, headers=headers, json=body)
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
812
|
+
print("合并会员返回",response.json())
|
|
813
|
+
# print("创建会员请求体",body)
|
|
814
|
+
if response.raise_for_status():
|
|
815
|
+
customer_id = response.json()["data"]["id"]
|
|
816
|
+
elif response.json()["code"]=="UC0409":
|
|
817
|
+
email = "%d@qq.com"%int(time.time())
|
|
818
|
+
body = {"email": email, "mobile_phone": "", "mobile_phone_country_calling_code": "86",
|
|
819
|
+
"name": name, "page_scoped_id": user_id, "locale_code": None, "country_code": "cn",
|
|
820
|
+
"id": "", "party_channel_id": page_id, "platform": platform, "is_member": False}
|
|
821
|
+
response = requests.put(url, headers=headers, json=body)
|
|
822
|
+
else:
|
|
823
|
+
customer_id = response.json()["data"]["id"]
|
|
824
824
|
return response,customer_id
|
|
825
825
|
|
|
826
826
|
|
|
@@ -851,8 +851,8 @@ def manual_order(data):
|
|
|
851
851
|
# 先查询号码或邮箱是否被占有
|
|
852
852
|
#创建会员
|
|
853
853
|
response,customer_id = merge_customer(data)
|
|
854
|
-
print("会员ID",customer_id)
|
|
855
|
-
print("创建会员返回,",response.text)
|
|
854
|
+
# print("会员ID",customer_id)
|
|
855
|
+
# print("创建会员返回,",response.text)
|
|
856
856
|
#给会员新增物流地址
|
|
857
857
|
url = "%s/uc/customers/%s" % (env,customer_id)
|
|
858
858
|
postcode = "76653"
|
|
@@ -1436,11 +1436,13 @@ def set_delivery(data):
|
|
|
1436
1436
|
response = requests.put(url, headers=headers, json=body).json()
|
|
1437
1437
|
return response
|
|
1438
1438
|
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1439
|
+
def get_mc_order_link(url):
|
|
1440
|
+
response = requests.get(url)
|
|
1441
|
+
print(response.headers)
|
|
1442
|
+
location = response.headers.get("Location")
|
|
1443
|
+
# print(location)
|
|
1444
|
+
key = location.split("/")[-1].split("?")[0]
|
|
1445
|
+
return key
|
|
1444
1446
|
|
|
1445
1447
|
|
|
1446
1448
|
|
|
@@ -1448,13 +1450,4 @@ def set_delivery(data):
|
|
|
1448
1450
|
|
|
1449
1451
|
|
|
1450
1452
|
if __name__=="__main__":
|
|
1451
|
-
|
|
1452
|
-
url = "https://message-center-order.shoplinestg.com/orders/f79e29a466139ccf97cd2d759f5d4a5c?merchant_id=6229a7baea70642a8b65ebda&locale=zh-cn"
|
|
1453
|
-
match = re.search(r"/orders/([^/?]+)", url)
|
|
1454
|
-
if match:
|
|
1455
|
-
order_id = match.group(1)
|
|
1456
|
-
print(order_id)
|
|
1457
|
-
else:
|
|
1458
|
-
print("未找到订单 ID")
|
|
1459
|
-
|
|
1460
|
-
|
|
1453
|
+
pass
|
|
File without changes
|
|
File without changes
|
{sc-common-interface-2.2.3 → sc-common-interface-2.2.5}/sc_common_interface.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{sc-common-interface-2.2.3 → sc-common-interface-2.2.5}/sc_common_interface.egg-info/requires.txt
RENAMED
|
File without changes
|
{sc-common-interface-2.2.3 → sc-common-interface-2.2.5}/sc_common_interface.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|