sc-common-interface 2.2.1__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.1 → sc-common-interface-2.2.2}/PKG-INFO +1 -1
- {sc-common-interface-2.2.1 → sc-common-interface-2.2.2}/sc_common_interface/PostCommonInterface.py +50 -0
- {sc-common-interface-2.2.1 → sc-common-interface-2.2.2}/sc_common_interface.egg-info/PKG-INFO +1 -1
- {sc-common-interface-2.2.1 → sc-common-interface-2.2.2}/setup.py +1 -1
- {sc-common-interface-2.2.1 → sc-common-interface-2.2.2}/sc_common_interface/Platform.py +0 -0
- {sc-common-interface-2.2.1 → sc-common-interface-2.2.2}/sc_common_interface/__init__.py +0 -0
- {sc-common-interface-2.2.1 → sc-common-interface-2.2.2}/sc_common_interface.egg-info/SOURCES.txt +0 -0
- {sc-common-interface-2.2.1 → sc-common-interface-2.2.2}/sc_common_interface.egg-info/dependency_links.txt +0 -0
- {sc-common-interface-2.2.1 → sc-common-interface-2.2.2}/sc_common_interface.egg-info/requires.txt +0 -0
- {sc-common-interface-2.2.1 → sc-common-interface-2.2.2}/sc_common_interface.egg-info/top_level.txt +0 -0
- {sc-common-interface-2.2.1 → sc-common-interface-2.2.2}/setup.cfg +0 -0
{sc-common-interface-2.2.1 → sc-common-interface-2.2.2}/sc_common_interface/PostCommonInterface.py
RENAMED
|
@@ -1387,6 +1387,56 @@ def get_delivery(data):
|
|
|
1387
1387
|
delivery_ids.append(delivery_id)
|
|
1388
1388
|
return delivery_ids,response
|
|
1389
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
|
+
|
|
1390
1440
|
|
|
1391
1441
|
|
|
1392
1442
|
|
|
File without changes
|
|
File without changes
|
{sc-common-interface-2.2.1 → 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.1 → sc-common-interface-2.2.2}/sc_common_interface.egg-info/requires.txt
RENAMED
|
File without changes
|
{sc-common-interface-2.2.1 → sc-common-interface-2.2.2}/sc_common_interface.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|