Initial import from local backup (Documents-Playground/pakerpale)

This commit is contained in:
jeonghwa
2026-07-03 05:27:17 +09:00
commit 04d8af17ae
1043 changed files with 188541 additions and 0 deletions

0
app/__init__.py Normal file
View File

34
app/config/vendor.py Normal file
View File

@@ -0,0 +1,34 @@
import os
import time
import hmac, hashlib
class VendorConfig(object):
datetime = ''
#replace with your own accesskey
accesskey = "****"
#replace with your own secretKey
secretkey = "****"
vendorid = ''
def __init__(self):
super(VendorConfig, self).__init__();
os.environ['TZ'] = 'GMT+0'
self.datetime=time.strftime('%y%m%d')+'T'+time.strftime('%H%M%S')+'Z'
method = "DELETE"
path = "/v2/providers/seller_api/apis/api/v1/marketplace/seller-products/83358541"
message = datetime+method+path
#********************************************************#
#authorize, demonstrate how to generate hmac signature here
signature=hmac.new(secretkey.encode('utf-8'),message.encode('utf-8'),hashlib.sha256).hexdigest()
authorization = "CEA algorithm=HmacSHA256, access-key="+accesskey+", signed-date="+datetime+", signature="+signature
#print out the hmac key
#print(authorization)
#********************************************************#

57
app/product/delete.py Normal file
View File

@@ -0,0 +1,57 @@
import os
import time
import hmac, hashlib
import urllib.parse
import urllib.request
import ssl
import json
os.environ['TZ'] = 'GMT+0'
datetime=time.strftime('%y%m%d')+'T'+time.strftime('%H%M%S')+'Z'
method = "DELETE"
path = "/v2/providers/seller_api/apis/api/v1/marketplace/seller-products/83358541"
message = datetime+method+path
#replace with your own accesskey
accesskey = "****"
#replace with your own secretKey
secretkey = "****"
#********************************************************#
#authorize, demonstrate how to generate hmac signature here
signature=hmac.new(secretkey.encode('utf-8'),message.encode('utf-8'),hashlib.sha256).hexdigest()
authorization = "CEA algorithm=HmacSHA256, access-key="+accesskey+", signed-date="+datetime+", signature="+signature
#print out the hmac key
#print(authorization)
#********************************************************#
# ************* SEND THE REQUEST *************
#url = "http://api-gateway-it-ext.coupang.com"+path
url = "https://api-gateway.coupang.com"+path
req = urllib.request.Request(url)
req.add_header("Content-type","application/json;charset=UTF-8")
req.add_header("Authorization",authorization)
req.get_method = lambda: method
#skipping for ssl cert.
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
try:
resp = urllib.request.urlopen(req, context=ctx)
except urllib.request.HTTPError as e:
print(e.code)
print(e.reason)
except urllib.request.URLError as e:
print(e.errno)
print(e.reason)
else:
# 200
body = resp.read().decode(resp.headers.get_content_charset())
print(body)