fix: default private app type
This commit is contained in:
parent
09f4e0b19c
commit
c8ad8bb7aa
@ -32,12 +32,11 @@ class ShopifySettings(Document):
|
|||||||
url = get_shopify_url('admin/api/2019-04/webhooks.json', self)
|
url = get_shopify_url('admin/api/2019-04/webhooks.json', self)
|
||||||
print('url', url)
|
print('url', url)
|
||||||
for method in webhooks:
|
for method in webhooks:
|
||||||
if method in created_webhooks:
|
print('method', method)
|
||||||
continue
|
|
||||||
|
|
||||||
session = get_request_session()
|
session = get_request_session()
|
||||||
print('session', session)
|
print('session', session)
|
||||||
try:
|
try:
|
||||||
|
print(get_header(self))
|
||||||
d = session.post(url, data=json.dumps({
|
d = session.post(url, data=json.dumps({
|
||||||
"webhook": {
|
"webhook": {
|
||||||
"topic": method,
|
"topic": method,
|
||||||
@ -84,11 +83,7 @@ def get_shopify_url(path, settings):
|
|||||||
def get_header(settings):
|
def get_header(settings):
|
||||||
header = {'Content-Type': 'application/json'}
|
header = {'Content-Type': 'application/json'}
|
||||||
|
|
||||||
if settings.app_type == "Private":
|
return header;
|
||||||
return header
|
|
||||||
else:
|
|
||||||
header["X-Shopify-Access-Token"] = settings.access_token
|
|
||||||
return header
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_series():
|
def get_series():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user