sc-common-interface 2.2.2__tar.gz → 2.2.4__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.2 → sc-common-interface-2.2.4}/PKG-INFO +1 -1
- {sc-common-interface-2.2.2 → sc-common-interface-2.2.4}/sc_common_interface/PostCommonInterface.py +40 -38
- {sc-common-interface-2.2.2 → sc-common-interface-2.2.4}/sc_common_interface.egg-info/PKG-INFO +1 -1
- {sc-common-interface-2.2.2 → sc-common-interface-2.2.4}/setup.py +1 -1
- {sc-common-interface-2.2.2 → sc-common-interface-2.2.4}/sc_common_interface/Platform.py +0 -0
- {sc-common-interface-2.2.2 → sc-common-interface-2.2.4}/sc_common_interface/__init__.py +0 -0
- {sc-common-interface-2.2.2 → sc-common-interface-2.2.4}/sc_common_interface.egg-info/SOURCES.txt +0 -0
- {sc-common-interface-2.2.2 → sc-common-interface-2.2.4}/sc_common_interface.egg-info/dependency_links.txt +0 -0
- {sc-common-interface-2.2.2 → sc-common-interface-2.2.4}/sc_common_interface.egg-info/requires.txt +0 -0
- {sc-common-interface-2.2.2 → sc-common-interface-2.2.4}/sc_common_interface.egg-info/top_level.txt +0 -0
- {sc-common-interface-2.2.2 → sc-common-interface-2.2.4}/setup.cfg +0 -0
{sc-common-interface-2.2.2 → sc-common-interface-2.2.4}/sc_common_interface/PostCommonInterface.py
RENAMED
|
@@ -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"
|
|
@@ -1351,7 +1351,7 @@ def end_post(data):
|
|
|
1351
1351
|
response = requests.put(url,headers=headers).json()
|
|
1352
1352
|
return response
|
|
1353
1353
|
|
|
1354
|
-
def
|
|
1354
|
+
def get_oa_payment(data):
|
|
1355
1355
|
env = data["env"]
|
|
1356
1356
|
headers = data["headers"]
|
|
1357
1357
|
type_value = data["type"]
|
|
@@ -1369,7 +1369,7 @@ def get_payment(data):
|
|
|
1369
1369
|
payment_ids.append(payment_id)
|
|
1370
1370
|
return payment_ids,response
|
|
1371
1371
|
|
|
1372
|
-
def
|
|
1372
|
+
def get_oa_delivery(data):
|
|
1373
1373
|
env = data["env"]
|
|
1374
1374
|
headers = data["headers"]
|
|
1375
1375
|
type_value = data["type"]
|
|
@@ -1399,7 +1399,7 @@ def set_payment(data):
|
|
|
1399
1399
|
if "payment_id" in data:
|
|
1400
1400
|
payment_id = data["payment_id"]
|
|
1401
1401
|
else:
|
|
1402
|
-
payment_ids,__ =
|
|
1402
|
+
payment_ids,__ = get_oa_payment(data)
|
|
1403
1403
|
payment_id = payment_ids[0]
|
|
1404
1404
|
body = {
|
|
1405
1405
|
|
|
@@ -1425,7 +1425,7 @@ def set_delivery(data):
|
|
|
1425
1425
|
if "delivery_id" in data:
|
|
1426
1426
|
delivery_id = data["delivery_id"]
|
|
1427
1427
|
else:
|
|
1428
|
-
delivery_ids, __ =
|
|
1428
|
+
delivery_ids, __ = get_oa_delivery(data)
|
|
1429
1429
|
delivery_id = delivery_ids[0]
|
|
1430
1430
|
body = {
|
|
1431
1431
|
"delivery_option_id": delivery_id,
|
|
@@ -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,6 +1450,6 @@ def set_delivery(data):
|
|
|
1448
1450
|
|
|
1449
1451
|
|
|
1450
1452
|
if __name__=="__main__":
|
|
1451
|
-
|
|
1453
|
+
data = {'env': 'https://front-admin-preview.shoplineapp.com', 'headers': {'Content-Type': 'application/json', 'authorization': 'Bearer eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJhMjQ0ZTUwMmMyYzIwY2E5MWVhZDg0NWQ2YTk4YzVlNCIsImRhdGEiOnsibWVyY2hhbnRfaWQiOiI2MWE4N2M5NzYzYjcwYzAwNTEwNmZiZDAiLCJhcHBsaWNhdGlvbl9pZCI6IjVmNTlmMTI4MzcyZWIzMDAwNmRjNDcwMSJ9LCJpc3MiOiJodHRwczovL2RldmVsb3BlcnMtcHJldmlldy5zaG9wbGluZWFwcC5jb20iLCJhdWQiOltdLCJzdWIiOiI2MWE4N2M5NzYzYjcwYzAwNTEwNmZiZDAifQ.8m_bKPfZJxan6M6hv_4byPROt_UtvHqnyWAT9Ox1CO0', 'lang': 'en'}, 'platform': 'INSTAGRAM', 'patternModel': 'INCLUDE_MATCH', 'sales_id': 423810, 'since': '1685030400', 'user_id': '4255666934537806', 'key': '5e3bba98882fc0fb22a0607238bc5b8f', 'keyword': '无规格商品关键字'}
|
|
1454
|
+
response = manual_order(data)
|
|
1452
1455
|
|
|
1453
|
-
|
|
File without changes
|
|
File without changes
|
{sc-common-interface-2.2.2 → sc-common-interface-2.2.4}/sc_common_interface.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{sc-common-interface-2.2.2 → sc-common-interface-2.2.4}/sc_common_interface.egg-info/requires.txt
RENAMED
|
File without changes
|
{sc-common-interface-2.2.2 → sc-common-interface-2.2.4}/sc_common_interface.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|