sc-common-interface 2.2.0__tar.gz → 2.2.2__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.0 → sc-common-interface-2.2.2}/PKG-INFO +1 -1
- {sc-common-interface-2.2.0 → sc-common-interface-2.2.2}/sc_common_interface/PostCommonInterface.py +90 -1
- {sc-common-interface-2.2.0 → sc-common-interface-2.2.2}/sc_common_interface.egg-info/PKG-INFO +1 -1
- {sc-common-interface-2.2.0 → sc-common-interface-2.2.2}/setup.py +1 -1
- {sc-common-interface-2.2.0 → sc-common-interface-2.2.2}/sc_common_interface/Platform.py +0 -0
- {sc-common-interface-2.2.0 → sc-common-interface-2.2.2}/sc_common_interface/__init__.py +0 -0
- {sc-common-interface-2.2.0 → sc-common-interface-2.2.2}/sc_common_interface.egg-info/SOURCES.txt +0 -0
- {sc-common-interface-2.2.0 → sc-common-interface-2.2.2}/sc_common_interface.egg-info/dependency_links.txt +0 -0
- {sc-common-interface-2.2.0 → sc-common-interface-2.2.2}/sc_common_interface.egg-info/requires.txt +0 -0
- {sc-common-interface-2.2.0 → sc-common-interface-2.2.2}/sc_common_interface.egg-info/top_level.txt +0 -0
- {sc-common-interface-2.2.0 → sc-common-interface-2.2.2}/setup.cfg +0 -0
{sc-common-interface-2.2.0 → sc-common-interface-2.2.2}/sc_common_interface/PostCommonInterface.py
RENAMED
|
@@ -1031,7 +1031,7 @@ def modify_order_delivery_status(data):
|
|
|
1031
1031
|
arrived:已到达
|
|
1032
1032
|
collected:已取货
|
|
1033
1033
|
returned:已退货
|
|
1034
|
-
returning
|
|
1034
|
+
returning:退回中
|
|
1035
1035
|
:return:
|
|
1036
1036
|
"""
|
|
1037
1037
|
oa_env = data["oa_env"]
|
|
@@ -1351,6 +1351,95 @@ def end_post(data):
|
|
|
1351
1351
|
response = requests.put(url,headers=headers).json()
|
|
1352
1352
|
return response
|
|
1353
1353
|
|
|
1354
|
+
def get_payment(data):
|
|
1355
|
+
env = data["env"]
|
|
1356
|
+
headers = data["headers"]
|
|
1357
|
+
type_value = data["type"]
|
|
1358
|
+
name = ""
|
|
1359
|
+
if "name" in data:
|
|
1360
|
+
name = data["name"]
|
|
1361
|
+
url = "%s/openApi/proxy/v1/payments?page=1&per_page=999&include_fields[]=config_data.tappay"%env
|
|
1362
|
+
response = requests.get(url,headers=headers).json()
|
|
1363
|
+
type_list = [item["type"] for item in response["data"]["items"]]
|
|
1364
|
+
payment_ids = []
|
|
1365
|
+
for i in type_list:
|
|
1366
|
+
if i==type_value:
|
|
1367
|
+
index = type_list.index(i)
|
|
1368
|
+
payment_id = response["data"]["items"][index]["id"]
|
|
1369
|
+
payment_ids.append(payment_id)
|
|
1370
|
+
return payment_ids,response
|
|
1371
|
+
|
|
1372
|
+
def get_delivery(data):
|
|
1373
|
+
env = data["env"]
|
|
1374
|
+
headers = data["headers"]
|
|
1375
|
+
type_value = data["type"]
|
|
1376
|
+
name = ""
|
|
1377
|
+
if "name" in data:
|
|
1378
|
+
name = data["name"]
|
|
1379
|
+
url = "%s/openApi/proxy/v1/delivery_options?page=1&per_page=999"%env
|
|
1380
|
+
response = requests.get(url,headers=headers).json()
|
|
1381
|
+
type_list = [item["type"] for item in response["data"]["items"]]
|
|
1382
|
+
delivery_ids = []
|
|
1383
|
+
for i in type_list:
|
|
1384
|
+
if i==type_value:
|
|
1385
|
+
index = type_list.index(i)
|
|
1386
|
+
delivery_id = response["data"]["items"][index]["id"]
|
|
1387
|
+
delivery_ids.append(delivery_id)
|
|
1388
|
+
return delivery_ids,response
|
|
1389
|
+
|
|
1390
|
+
def set_payment(data):
|
|
1391
|
+
env = data["env"]
|
|
1392
|
+
headers = data["headers"]
|
|
1393
|
+
customer_id = data["customer_id"]
|
|
1394
|
+
owner_type = data["owner_type"]
|
|
1395
|
+
url = "%s/openApi/proxy/v1/internal/mc/api/carts/%s?owner_type=%s&cart_uid=%s&created_by=sc_manual_order&skip_reapply_promotion=false"%(
|
|
1396
|
+
env,customer_id,owner_type,customer_id
|
|
1397
|
+
)
|
|
1398
|
+
payment_id = ""
|
|
1399
|
+
if "payment_id" in data:
|
|
1400
|
+
payment_id = data["payment_id"]
|
|
1401
|
+
else:
|
|
1402
|
+
payment_ids,__ = get_payment(data)
|
|
1403
|
+
payment_id = payment_ids[0]
|
|
1404
|
+
body = {
|
|
1405
|
+
|
|
1406
|
+
"owner_id": customer_id,
|
|
1407
|
+
"payment_id": payment_id
|
|
1408
|
+
}
|
|
1409
|
+
response = requests.put(url, headers=headers, json = body).json()
|
|
1410
|
+
return response
|
|
1411
|
+
|
|
1412
|
+
|
|
1413
|
+
def set_delivery(data):
|
|
1414
|
+
env = data["env"]
|
|
1415
|
+
headers = data["headers"]
|
|
1416
|
+
customer_id = data["customer_id"]
|
|
1417
|
+
owner_type = data["owner_type"]
|
|
1418
|
+
url = "%s/openApi/proxy/v1/internal/mc/api/carts/%s?owner_type=%s&cart_uid=%s&created_by=sc_manual_order&skip_reapply_promotion=false" % (
|
|
1419
|
+
env, customer_id, owner_type, customer_id
|
|
1420
|
+
)
|
|
1421
|
+
country = "TW"
|
|
1422
|
+
if "country" in data:
|
|
1423
|
+
country = data["country"]
|
|
1424
|
+
delivery_id = ""
|
|
1425
|
+
if "delivery_id" in data:
|
|
1426
|
+
delivery_id = data["delivery_id"]
|
|
1427
|
+
else:
|
|
1428
|
+
delivery_ids, __ = get_payment(data)
|
|
1429
|
+
delivery_id = delivery_ids[0]
|
|
1430
|
+
body = {
|
|
1431
|
+
"delivery_option_id": delivery_id,
|
|
1432
|
+
"country": country,
|
|
1433
|
+
"owner_id": customer_id,
|
|
1434
|
+
"payment_id": ""
|
|
1435
|
+
}
|
|
1436
|
+
response = requests.put(url, headers=headers, json=body).json()
|
|
1437
|
+
return response
|
|
1438
|
+
|
|
1439
|
+
|
|
1440
|
+
|
|
1441
|
+
|
|
1442
|
+
|
|
1354
1443
|
|
|
1355
1444
|
|
|
1356
1445
|
|
|
File without changes
|
|
File without changes
|
{sc-common-interface-2.2.0 → sc-common-interface-2.2.2}/sc_common_interface.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{sc-common-interface-2.2.0 → sc-common-interface-2.2.2}/sc_common_interface.egg-info/requires.txt
RENAMED
|
File without changes
|
{sc-common-interface-2.2.0 → sc-common-interface-2.2.2}/sc_common_interface.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|