Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新增卡券事件推送的 event handlers #31

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion wechat/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(self, xml=None):
params = [ele for ele in doc.childNodes[0].childNodes
if isinstance(ele, minidom.Element)]
for param in params:
if param.childNodes:
if param.childNodes and hasattr(param.childNodes[0], 'data'):
text = param.childNodes[0]
self.__dict__.update({param.tagName: text.data})
else:
Expand Down
53 changes: 53 additions & 0 deletions wechat/official.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,20 @@ def event_map(self):
'pic_photo_or_album': self.on_pic_photo_or_album,
'pic_weixin': self.on_pic_weixin,
'location_select': self.on_location_select,
'card_pass_check': self.on_card_pass_check,
'card_not_pass_check': self.on_card_not_pass_check,
'user_get_card': self.on_user_get_card,
'user_gifting_card': self.on_user_gifting_card,
'user_del_card': self.on_user_del_card,
'user_consume_card': self.on_user_consume_card,
'user_pay_from_pay_cell': self.on_user_pay_from_pay_cell,
'user_view_card': self.on_user_view_card,
'user_enter_session_from_card': self.on_user_enter_session_from_card,
'update_member_card': self.on_update_member_card,
'card_sku_remind': self.on_card_sku_remind,
'card_pay_order': self.on_card_pay_order,
'submit_membercard_user_info': self.on_submit_membercard_user_info,

}

def on_event(self, event):
Expand Down Expand Up @@ -166,6 +180,45 @@ def on_pic_weixin(self, event):
def on_location_select(self, event):
return WxEmptyResponse()

def on_card_pass_check(self, event):
return WxEmptyResponse()

def on_card_not_pass_check(self, event):
return WxEmptyResponse()

def on_user_get_card(self, event):
return WxEmptyResponse()

def on_user_gifting_card(self, event):
return WxEmptyResponse()

def on_user_del_card(self, event):
return WxEmptyResponse()

def on_user_consume_card(self, event):
return WxEmptyResponse()

def on_user_pay_from_pay_cell(self, event):
return WxEmptyResponse()

def on_user_view_card(self, event):
return WxEmptyResponse()

def on_user_enter_session_from_card(self, event):
return WxEmptyResponse()

def on_update_member_card(self, event):
return WxEmptyResponse()

def on_card_sku_remind(self, event):
return WxEmptyResponse()

def on_card_pay_order(self, event):
return WxEmptyResponse()

def on_submit_membercard_user_info(self, event):
return WxEmptyResponse()

def handler_map(self):
if getattr(self, 'handlers', None):
return self.handlers
Expand Down