diff --git a/master/bt5/slapos_payzen/PropertySheetTemplateItem/portal_property_sheets/SlapOSPayzenSystemPreference/preferred_wechat_payment_service_reference_property.xml b/master/bt5/slapos_payzen/PropertySheetTemplateItem/portal_property_sheets/SlapOSPayzenSystemPreference/preferred_wechat_payment_service_reference_property.xml new file mode 100644 index 0000000000000000000000000000000000000000..953c927f3aa8d94c814d6beaaa883f9ad915e575 --- /dev/null +++ b/master/bt5/slapos_payzen/PropertySheetTemplateItem/portal_property_sheets/SlapOSPayzenSystemPreference/preferred_wechat_payment_service_reference_property.xml @@ -0,0 +1,44 @@ + + + + + + + + + + categories + + + elementary_type/string + + + + + description + Payment Service to use with Wechat. + + + id + preferred_wechat_payment_service_reference_property + + + portal_type + Standard Property + + + preference + 1 + + + property_default + python: \'\' + + + write_permission + Manage properties + + + + + diff --git a/master/bt5/slapos_payzen/SkinTemplateItem/portal_skins/slapos_payzen/SystemPreference_viewSlapOSPayzen.xml b/master/bt5/slapos_payzen/SkinTemplateItem/portal_skins/slapos_payzen/SystemPreference_viewSlapOSPayzen.xml index 58b73681a1b23d5e3f3658ad00cf8771ef9a496f..ceb2f72a74c6c08bb1110345fc43576403616ca2 100644 --- a/master/bt5/slapos_payzen/SkinTemplateItem/portal_skins/slapos_payzen/SystemPreference_viewSlapOSPayzen.xml +++ b/master/bt5/slapos_payzen/SkinTemplateItem/portal_skins/slapos_payzen/SystemPreference_viewSlapOSPayzen.xml @@ -95,6 +95,7 @@ my_preferred_payzen_integration_site my_preferred_payzen_payment_service_reference + my_preferred_wechat_payment_service_reference diff --git a/master/bt5/slapos_payzen/SkinTemplateItem/portal_skins/slapos_payzen/SystemPreference_viewSlapOSPayzen/my_preferred_wechat_payment_service_reference.xml b/master/bt5/slapos_payzen/SkinTemplateItem/portal_skins/slapos_payzen/SystemPreference_viewSlapOSPayzen/my_preferred_wechat_payment_service_reference.xml new file mode 100644 index 0000000000000000000000000000000000000000..d1897bdfaee29072dea0b03464ff270daddcd1e0 --- /dev/null +++ b/master/bt5/slapos_payzen/SkinTemplateItem/portal_skins/slapos_payzen/SystemPreference_viewSlapOSPayzen/my_preferred_wechat_payment_service_reference.xml @@ -0,0 +1,126 @@ + + + + + + + + + + delegated_list + + + items + title + + + + + id + my_preferred_wechat_payment_service_reference + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + + + + overrides + + + + field_id + + + + form_id + + + + target + + + + + + + tales + + + + field_id + + + + form_id + + + + items + + AAAAAAAAAAI= + + + + target + + + + title + + + + + + + values + + + + field_id + my_category + + + form_id + Base_viewFieldLibrary + + + items + + + + + + target + Click to edit the target + + + title + Preferred Wechat Payment Service + + + + + + + + + + + + + + + _text + python: [(\'\', \'\')] + [(x.getTitle(), x.getReference()) for x in here.portal_catalog(portal_type=\'Wechat Service\', sort_on=((\'title\', \'ASC\'),))] + + + + + diff --git a/master/bt5/slapos_subscription_request/PathTemplateItem/accounting_module/slapos_wechat_pre_payment_template.xml b/master/bt5/slapos_subscription_request/PathTemplateItem/accounting_module/slapos_wechat_pre_payment_template.xml new file mode 100644 index 0000000000000000000000000000000000000000..da77c4124c7e22d9f7ae15271f3de289f148f573 --- /dev/null +++ b/master/bt5/slapos_subscription_request/PathTemplateItem/accounting_module/slapos_wechat_pre_payment_template.xml @@ -0,0 +1,211 @@ + + + + + + + + + + _Access_contents_information_Permission + + + Assignee + Assignor + Associate + Auditor + Manager + Owner + + + + + _Add_portal_content_Permission + + + Assignee + Assignor + Associate + Manager + Owner + + + + + _Delete_objects_Permission + + + Assignee + Assignor + Associate + Manager + Owner + + + + + _Modify_portal_content_Permission + + + Assignee + Assignor + Associate + Manager + Owner + + + + + _View_Permission + + + Assignee + Assignor + Associate + Auditor + Manager + Owner + + + + + _count + + AAAAAAAAAAI= + + + + _mt_index + + AAAAAAAAAAM= + + + + _tree + + AAAAAAAAAAQ= + + + + categories + + + source_payment/organisation_module/slapos/bank_account + source_section/organisation_module/slapos + price_currency/currency_module/EUR + specialise/sale_trade_condition_module/slapos_aggregated_trade_condition + resource/currency_module/CNY + payment_mode/wechat + + + + + comment + + + + + + default_destination_reference + + + + + + default_reference + + + + + + default_source_reference + + + + + + description + + + + + + id + slapos_wechat_pre_payment_template + + + language + + + + + + portal_type + Payment Transaction + + + start_date + + + + + + + + + + + 1533254400.0 + UTC + + + + + + + stop_date + + + + + + + + + 1533313457.88 + UTC + + + + + + + title + Reservation + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + diff --git a/master/bt5/slapos_subscription_request/PathTemplateItem/accounting_module/slapos_wechat_pre_payment_template/1.xml b/master/bt5/slapos_subscription_request/PathTemplateItem/accounting_module/slapos_wechat_pre_payment_template/1.xml new file mode 100644 index 0000000000000000000000000000000000000000..f2e7b36c8574789218f7afe9f1dfc5dbc20480a6 --- /dev/null +++ b/master/bt5/slapos_subscription_request/PathTemplateItem/accounting_module/slapos_wechat_pre_payment_template/1.xml @@ -0,0 +1,51 @@ + + + + + + + + + + categories + + + destination/account_module/payable + source/account_module/receivable + + + + + grouping_date + + + + + + grouping_reference + + + + + + id + 1 + + + portal_type + Accounting Transaction Line + + + price + + + + + + quantity + 0.0 + + + + + diff --git a/master/bt5/slapos_subscription_request/PathTemplateItem/accounting_module/slapos_wechat_pre_payment_template/2.xml b/master/bt5/slapos_subscription_request/PathTemplateItem/accounting_module/slapos_wechat_pre_payment_template/2.xml new file mode 100644 index 0000000000000000000000000000000000000000..a0c51ae1479f3adab355438227e2e071c8cf747a --- /dev/null +++ b/master/bt5/slapos_subscription_request/PathTemplateItem/accounting_module/slapos_wechat_pre_payment_template/2.xml @@ -0,0 +1,51 @@ + + + + + + + + + + categories + + + destination/account_module/bank + source/account_module/bank + + + + + grouping_date + + + + + + grouping_reference + + + + + + id + 2 + + + portal_type + Accounting Transaction Line + + + price + + + + + + quantity + 0.0 + + + + + diff --git a/master/bt5/slapos_subscription_request/PathTemplateItem/accounting_module/template_wechat_pre_payment_subscription_sale_invoice_transaction.xml b/master/bt5/slapos_subscription_request/PathTemplateItem/accounting_module/template_wechat_pre_payment_subscription_sale_invoice_transaction.xml new file mode 100644 index 0000000000000000000000000000000000000000..5d513bb395ef487ab13f734a1f32a9dfd9bc64fb --- /dev/null +++ b/master/bt5/slapos_subscription_request/PathTemplateItem/accounting_module/template_wechat_pre_payment_subscription_sale_invoice_transaction.xml @@ -0,0 +1,210 @@ + + + + + + + + + + _Access_contents_information_Permission + + + Assignee + Assignor + Associate + Auditor + Manager + Owner + + + + + _Add_portal_content_Permission + + + Assignee + Assignor + Associate + Manager + Owner + + + + + _Delete_objects_Permission + + + Assignee + Assignor + Associate + Manager + Owner + + + + + _Modify_portal_content_Permission + + + Assignee + Assignor + Associate + Manager + Owner + + + + + _View_Permission + + + Assignee + Assignor + Associate + Auditor + Manager + Owner + + + + + _count + + AAAAAAAAAAI= + + + + _mt_index + + AAAAAAAAAAM= + + + + _tree + + AAAAAAAAAAQ= + + + + categories + + + source_section/organisation_module/slapos + payment_mode/payzen + specialise/sale_trade_condition_module/slapos_aggregated_trade_condition + price_currency/currency_module/CNY + resource/currency_module/CNY + + + + + comment + + + + + + default_destination_reference + + + + + + default_reference + + + + + + default_source_reference + + + + + + description + + + + + + id + template_wechat_pre_payment_subscription_sale_invoice_transaction + + + language + + + + + + portal_type + Sale Invoice Transaction + + + start_date + + + + + + + + + + + 1325376000.0 + UTC + + + + + + + stop_date + + + + + + + + + 1326582000.0 + GMT+1 + + + + + + + title + template_wechat_pre_payment_subscription_sale_invoice_transaction + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + diff --git a/master/bt5/slapos_subscription_request/PathTemplateItem/accounting_module/template_wechat_pre_payment_subscription_sale_invoice_transaction/1.xml b/master/bt5/slapos_subscription_request/PathTemplateItem/accounting_module/template_wechat_pre_payment_subscription_sale_invoice_transaction/1.xml new file mode 100644 index 0000000000000000000000000000000000000000..6b012d39e46103ada7d0eb472dcd202d574f8477 --- /dev/null +++ b/master/bt5/slapos_subscription_request/PathTemplateItem/accounting_module/template_wechat_pre_payment_subscription_sale_invoice_transaction/1.xml @@ -0,0 +1,121 @@ + + + + + + + + + + categories + + + use/trade/sale + resource/service_module/slapos_reservation_fee + quantity_unit/unit/piece + base_contribution/base_amount/invoicing + + + + + default_reference + 1 + + + description + + + + + + id + 1 + + + index + + AAAAAAAAAAI= + + + + int_index + 1 + + + language + + + + + + portal_type + Invoice Line + + + price + 188.0 + + + quantity + 1.0 + + + stop_date + + + + + + + + + + + 1326585600.0 + UTC + + + + + + + + + + + + + + + + data + + + + movement + + AAAAAAAAAAM= + + + + + + + + + + + + + + + + data + + + + + + + + diff --git a/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequestModule_requestSubscriptionProxy.py b/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequestModule_requestSubscriptionProxy.py index 435c654a8e8258977fa2cebfc3d9becc77f24259..126886b749bd52a19526db82b29d5c5722fde1a1 100644 --- a/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequestModule_requestSubscriptionProxy.py +++ b/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequestModule_requestSubscriptionProxy.py @@ -15,7 +15,7 @@ if confirmation_required and not person_is_new: "%s/#order_confirmation?name=%s&email=%s&amount=%s&subscription_reference=%s" % ( base_url, person.getTitle(), - person.getDefaultEmailText(), + email, user_input_dict["amount"], subscription_reference)) @@ -30,7 +30,6 @@ subscription_request.setDefaultEmailText(email) def wrapWithShadow(subscription_request, amount, subscription_reference): subscription_request.activate(tag="subscription_condition_%s" % subscription_request.getId() ).SubscriptionRequest_applyCondition(subscription_reference) - return subscription_request.SubscriptionRequest_requestPaymentTransaction(amount=amount, tag="subscription_%s" % subscription_request.getId()) @@ -42,10 +41,40 @@ payment = person.Person_restrictMethodAsShadowUser( if batch_mode: return {'subscription' : subscription_request.getRelativeUrl(), 'payment': payment.getRelativeUrl() } -def wrapRedirectWithShadow(payment_transaction, web_site): - return payment_transaction.PaymentTransaction_redirectToManualPayzenPayment(web_site) +def wrapGetPriceWithShadow(payment): + return payment.PaymentTransaction_getTotalPayablePrice() -return person.Person_restrictMethodAsShadowUser( +price = person.Person_restrictMethodAsShadowUser( shadow_document=person, - callable_object=wrapRedirectWithShadow, - argument_list=[payment, web_site]) + callable_object=wrapGetPriceWithShadow, + argument_list=[payment,]) + +# currency = subscription_request.getSpecialiseValue().getPriceCurrency() +# XXX: Test +# currency = "currency_module/EUR" +currency = "currency_module/CNY" + +if currency == "currency_module/CNY": # Wechat payment + ''' + portal = context.getPortalObject() + code_url = portal.Base_getWechatCodeURL(subscription_request.getId(), price, user_input_dict["amount"]) + web_site = context.getWebSiteValue() + base_url = web_site.absolute_url() + return context.REQUEST.RESPONSE.redirect( + "%s/#wechat_payment?amount=%s&trade_no=%s&code_url=%s" % (base_url, user_input_dict["amount"], subscription_request.getId(), code_url)) + ''' + def wrapRedirectWithShadow(payment_transaction, web_site): + return payment_transaction.PaymentTransaction_redirectToWechatPayment(web_site) + + return person.Person_restrictMethodAsShadowUser( + shadow_document=person, + callable_object=wrapRedirectWithShadow, + argument_list=[payment, web_site]) +else: # "currency_module/EUR", Payzen payment + def wrapRedirectWithShadow(payment_transaction, web_site): + return payment_transaction.PaymentTransaction_redirectToManualPayzenPayment(web_site) + + return person.Person_restrictMethodAsShadowUser( + shadow_document=person, + callable_object=wrapRedirectWithShadow, + argument_list=[payment, web_site]) diff --git a/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_applyCondition.py b/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_applyCondition.py index baba39c68d1d78bd95608432bbd2d9da71400b5b..e32fec9112db0a435d24a521d33c8f5807988173 100644 --- a/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_applyCondition.py +++ b/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_applyCondition.py @@ -11,7 +11,7 @@ if subscription_condition_reference is not None: subscription_condition = context.portal_catalog.getResultValue( portal_type="Subscription Condition", reference=subscription_condition_reference, - validation_state="validated") + validation_state="published") # XXX Wechat workaround, validated? else: subscription_condition = context.getSpecialiseValue() @@ -36,7 +36,7 @@ context.edit( root_slave=subscription_condition.getRootSlave(), specialise_value=subscription_condition, price=subscription_condition.getPrice(), - price_currency=subscription_condition.getPriceCurrency() + price_currency="currency_module/CNY", # For test!!! subscription_condition.getPriceCurrency() ) context.setSourceReference(subscription_condition.getSourceReference()) diff --git a/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_createRelatedSaleInvoiceTransaction.py b/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_createRelatedSaleInvoiceTransaction.py index 8062b710699799f0e75b38275f64535c964665c9..ebf52188ba671eccdf91e4b5bedfb04e5b4dd999 100644 --- a/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_createRelatedSaleInvoiceTransaction.py +++ b/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_createRelatedSaleInvoiceTransaction.py @@ -7,7 +7,13 @@ portal = context.getPortalObject() current_invoice = context.getCausalityValue() if current_invoice is None: - invoice_template_path = "accounting_module/template_pre_payment_subscription_sale_invoice_transaction" + # currency = context.getSpecialiseValue().getPriceCurrency() + # currency = "currency_module/EUR" + currency = "currency_module/CNY" + if currency == "currency_module/CNY": # Wechat payment + invoice_template_path = "accounting_module/template_wechat_pre_payment_subscription_sale_invoice_transaction" + else: + invoice_template_path = "accounting_module/template_pre_payment_subscription_sale_invoice_transaction" invoice_template = portal.restrictedTraverse(invoice_template_path) current_invoice = invoice_template.Base_createCloneDocument(batch_mode=1) diff --git a/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_requestPaymentTransaction.py b/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_requestPaymentTransaction.py index 45015ecc27464d76cb803645309a202b7dd3feac..56acf1c7e25d4c314e09fd7cb3065f3dbbae5064 100644 --- a/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_requestPaymentTransaction.py +++ b/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_requestPaymentTransaction.py @@ -8,8 +8,16 @@ current_invoice = context.getCausalityValue() current_payment = None if current_invoice is None: - - payment_template = portal.restrictedTraverse("accounting_module/slapos_pre_payment_template") + # Hardcoded value for reservation + # currency = context.getSpecialiseValue().getPriceCurrency() + # XXX: Test for now + currency = "currency_module/CNY" + if currency == "currency_module/CNY": # Wechat payment + payment_template = portal.restrictedTraverse("accounting_module/slapos_wechat_pre_payment_template") + quantity = int(amount) * 188 + else: + payment_template = portal.restrictedTraverse("accounting_module/slapos_pre_payment_template") + quantity = int(amount)*25 current_payment = payment_template.Base_createCloneDocument(batch_mode=1) current_payment.edit( @@ -22,8 +30,7 @@ if current_invoice is None: stop_date=DateTime() ) - # Hardcoded value for reservation - quantity = int(amount)*25 + for line in current_payment.contentValues(): if line.getSource() == "account_module/bank": line.setQuantity(-1*quantity) diff --git a/master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionChineseScenario.py b/master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionChineseScenario.py index 4010e3eac02a9944c39de26062187d4605ddb178..74d91a30d3423a539e9511ba39ddd26ffa5c17d1 100644 --- a/master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionChineseScenario.py +++ b/master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionChineseScenario.py @@ -23,7 +23,7 @@ class TestSlapOSSubscriptionChineseScenario(TestSlapOSSubscriptionScenarioMixin) url_string=self.generateNewSoftwareReleaseUrl(), root_slave=slave, price=1888.00, - resource="currency_module/RMB", + resource="currency_module/CNY", default_source_reference="default", reference="rapidvm%s" % self.new_id, # Aggregate and Follow up to web pages for product description and diff --git a/master/bt5/slapos_subscription_request/bt/dependency_list b/master/bt5/slapos_subscription_request/bt/dependency_list new file mode 100644 index 0000000000000000000000000000000000000000..e90a7680c6fd7e5bcfb15e28d3593ed57a4c3caa --- /dev/null +++ b/master/bt5/slapos_subscription_request/bt/dependency_list @@ -0,0 +1 @@ +erp5_commerce \ No newline at end of file diff --git a/master/bt5/slapos_subscription_request/bt/template_path_list b/master/bt5/slapos_subscription_request/bt/template_path_list index b20e80c413b0ea383f68de93c6fe22026fb73e04..ee90a8575ddc73fa1d7b5c0711333db0d80f79e1 100644 --- a/master/bt5/slapos_subscription_request/bt/template_path_list +++ b/master/bt5/slapos_subscription_request/bt/template_path_list @@ -1,7 +1,11 @@ accounting_module/slapos_pre_payment_template accounting_module/slapos_pre_payment_template/** +accounting_module/slapos_wechat_pre_payment_template +accounting_module/slapos_wechat_pre_payment_template/** accounting_module/template_pre_payment_subscription_sale_invoice_transaction accounting_module/template_pre_payment_subscription_sale_invoice_transaction/** +accounting_module/template_wechat_pre_payment_subscription_sale_invoice_transaction +accounting_module/template_wechat_pre_payment_subscription_sale_invoice_transaction/** notification_message_module/slapos-free-trial-token portal_alarms/slapos_subscription_request_process_** portal_alarms/slapos_trial_process_** \ No newline at end of file diff --git a/master/bt5/slapos_wechat/ActionTemplateItem/portal_types/Wechat%20Event%20Message/view.xml b/master/bt5/slapos_wechat/ActionTemplateItem/portal_types/Wechat%20Event%20Message/view.xml new file mode 100644 index 0000000000000000000000000000000000000000..9761c0ae041be58f0983ab6c897294311b3cca0d --- /dev/null +++ b/master/bt5/slapos_wechat/ActionTemplateItem/portal_types/Wechat%20Event%20Message/view.xml @@ -0,0 +1,85 @@ + + + + + + + + + + action + + AAAAAAAAAAI= + + + + categories + + + action_type/object_view + + + + + category + object_view + + + condition + + + + description + + + + + + icon + + + + id + view + + + permissions + + + View + + + + + portal_type + Action Information + + + priority + 1.0 + + + title + View + + + visible + 1 + + + + + + + + + + + + text + string:${object_url}/WechatEventMessage_view + + + + + diff --git a/master/bt5/slapos_wechat/ActionTemplateItem/portal_types/Wechat%20Event/view.xml b/master/bt5/slapos_wechat/ActionTemplateItem/portal_types/Wechat%20Event/view.xml new file mode 100644 index 0000000000000000000000000000000000000000..df89599cb2a3aeeac1f6e292283434a3c6fd6738 --- /dev/null +++ b/master/bt5/slapos_wechat/ActionTemplateItem/portal_types/Wechat%20Event/view.xml @@ -0,0 +1,85 @@ + + + + + + + + + + action + + AAAAAAAAAAI= + + + + categories + + + action_type/object_view + + + + + category + object_view + + + condition + + + + description + + + + + + icon + + + + id + view + + + permissions + + + View + + + + + portal_type + Action Information + + + priority + 1.0 + + + title + View + + + visible + 1 + + + + + + + + + + + + text + string:${object_url}/WechatEvent_view + + + + + diff --git a/master/bt5/slapos_wechat/ExtensionTemplateItem/portal_components/extension.erp5.WechatUtils.py b/master/bt5/slapos_wechat/ExtensionTemplateItem/portal_components/extension.erp5.WechatUtils.py new file mode 100644 index 0000000000000000000000000000000000000000..0cd52cdf5784918fae7c6e31c32b0f531f76d19d --- /dev/null +++ b/master/bt5/slapos_wechat/ExtensionTemplateItem/portal_components/extension.erp5.WechatUtils.py @@ -0,0 +1,258 @@ +import random, string, hashlib, urllib2, socket +from urlparse import urlparse +try: + import xml.etree.cElementTree as ET +except ImportError: + import xml.etree.ElementTree as ET + +class WechatException(Exception): + def __init__(self, msg): + super(WechatException, self).__init__(msg) + + +# UFDODER_URL = "https://api.mch.weixin.qq.com/sandboxnew/pay/unifiedorder" # Wechat unified order API +UFDODER_URL = "https://api.mch.weixin.qq.com/pay/unifiedorder" # Wechat unified order API +QUERY_URL = "https://api.mch.weixin.qq.com/pay/orderquery" + + +def generateRandomStr(random_length=24): + alpha_num = string.ascii_letters + string.digits + random_str = ''.join(random.choice(alpha_num) for i in range(random_length)) + return random_str + + +def calculateSign(dict_content, key): + # Calculate the sign according to the data_dict + # The rule was defined by Wechat (Wrote in Chinese): + # https://pay.weixin.qq.com/wiki/doc/api/native.php?chapter=4_3 + + # 1. Sort it by dict order + params_list = sorted(dict_content.items(), key=lambda e: e[0], reverse=False) + # 2. Concatenate the list to a string + params_str = "&".join(u"{}={}".format(k, v) for k, v in params_list) + # 3. Add trade key in the end + params_str = params_str + '&key=' + key + + md5 = hashlib.md5() # Use MD5 mode + md5.update(params_str.encode('utf-8')) + sign = md5.hexdigest().upper() + return sign + + +def convert_xml_to_dict(xml_content): + ''' + The XML returned by Wechat is like: + + + + + + + + + + + + + ''' + try: + t = ET.XML(xml_content) + except ET.ParseError: + return {} + else: + dict_content = dict([(child.tag, child.text) for child in t]) + return dict_content + + +def convert_dict_to_xml(dict_content): + xml = '' + for key, value in dict_content.items(): + xml += '<{0}>{1}'.format(key, value) + xml = '{0}'.format(xml) + return xml + + +def getSandboxKey(self): + SANDBOX_KEY_URL = "https://api.mch.weixin.qq.com/sandboxnew/pay/getsignkey" + wechat_account_configuration = self.ERP5Site_getWechatPaymentConfiguration() + params = {} + params['mch_id'] = wechat_account_configuration['MCH_ID'] + params['nonce_str'] = generateRandomStr() + params['sign'] = calculateSign(params, wechat_account_configuration['API_KEY']) + # construct XML str + request_xml_str = '' + for key, value in params.items(): + if isinstance(value, basestring): + request_xml_str = '%s<%s>' % (request_xml_str, key, value, key, ) + else: + request_xml_str = '%s<%s>%s' % (request_xml_str, key, value, key, ) + request_xml_str = '%s' % request_xml_str + result = urllib2.Request(SANDBOX_KEY_URL, data=request_xml_str) + result_data = urllib2.urlopen(result) + result_read = result_data.read() + result_dict_content = convert_xml_to_dict(result_read) + return_code = result_dict_content.get('return_code', '') + if return_code=="SUCCESS": + result_msg = result_dict_content['return_msg'] + if result_msg=="ok": + sandbox_signkey = result_dict_content['sandbox_signkey'] + return sandbox_signkey + raise Exception(result_dict_content['result_msg'].encode('utf-8')) + raise Exception("Get sanbox key failed: " + str(result_dict_content)) + +def getWechatQRCodeURL(self, order_id, price, amount): + portal = self.getPortalObject() + base_url = portal.absolute_url() + NOTIFY_URL = base_url + "/ERP5Site_receiveWechatPaymentCallback" # Wechat payment callback method + wechat_account_configuration = self.ERP5Site_getWechatPaymentConfiguration() + appid = wechat_account_configuration['APP_ID'] + mch_id = wechat_account_configuration['MCH_ID'] + key = wechat_account_configuration['API_KEY'] + # This is for sandbox test + # key = getSandboxKey() # API_KEY + nonce_str = generateRandomStr() + + result = urlparse(base_url) + spbill_create_ip = socket.gethostbyname(result.netloc) + notify_url = NOTIFY_URL + trade_type = "NATIVE" + + # Construct parameter for calling the Wechat payment URL + params = {} + params['appid'] = appid + params['mch_id'] = mch_id + params['nonce_str'] = nonce_str + params['out_trade_no'] = order_id.encode('utf-8') + # This is for sandbox test, sandbox need the total_fee equal to 101 exactly + # params['total_fee'] = 101 # int(-(price * 100)) # unit is Fen, 1 CNY = 100 Fen + # params['total_fee'] = int(-(price * 100)) # unit is Fen, 1 CNY(RMB) = 100 Fen + params['total_fee'] = 1 #int(-(price * 100)) # unit is Fen, 1 CNY = 100 Fen + params['spbill_create_ip'] = spbill_create_ip + params['notify_url'] = notify_url + params['body'] = "Rapid Space Virtual Machine".encode('utf-8') + params['trade_type'] = trade_type + + # generate signature + params['sign'] = calculateSign(params, key) + + # construct XML str + request_xml_str = '' + for key, value in params.items(): + if isinstance(value, basestring): + request_xml_str = '%s<%s>' % (request_xml_str, key, value, key, ) + else: + request_xml_str = '%s<%s>%s' % (request_xml_str, key, value, key, ) + request_xml_str = '%s' % request_xml_str + + # send data + result = urllib2.Request(UFDODER_URL, data=request_xml_str) + result_data = urllib2.urlopen(result) + result_read = result_data.read() + result_dict_content = convert_xml_to_dict(result_read) + return_code = result_dict_content['return_code'] + if return_code=="SUCCESS": + result_code = result_dict_content['result_code'] + if result_code=="SUCCESS": + code_url = result_dict_content['code_url'] + return code_url + else: + raise Exception("Error description: {0}".format(result_dict_content.get("err_code_des"))) + else: + raise Exception("Error description: {0}".format(result_dict_content.get("return_msg"))) + + +def receiveWechatPaymentNotify(self, request, *args, **kwargs): + ''' + Receive the asychonized callback send by Wechat after user pay the order. + Wechat will give us something like: + + + + + + + + + + + + + + + 1 + + + + ''' + + wechat_account_configuration = self.ERP5Site_getWechatPaymentConfiguration() + params = convert_xml_to_dict(request.body) + + if params.get("return_code") == "SUCCESS": + # Connection is ok + sign = params.pop('sign') + recalcualted_sign = calculateSign(params, wechat_account_configuration['API_KEY']) + if recalcualted_sign == sign: + if params.get("result_code", None) == "SUCCESS": # payment is ok + # order number + # out_trade_no = params.get("out_trade_no") + # Wechat payment order ID + # This is what we should use when we search the order in the wechat + # transaction_id = params.get("out_trade_no") + # Save the wechat payment order ID in somewhere. + # We recevied the payment... + # Process something + # XXX: display the page the payment received. + # container.REQUEST.RESPONSE.redirect("%s/#wechat_payment_confirmed") + # We must tell Wechat we received the response. Otherwise wechat will keep send it within 24 hours + # xml_str = convert_dict_to_xml({"return_code": "SUCCESS"}) + # return container.REQUEST.RESPONSE(xml_str) + return ''' + + + + + ''' + else: + print("{0}:{1}".format(params.get("err_code"), params.get("err_code_des"))) + else: + # Error information + print(params.get("return_msg").encode("utf-8")) + +def queryWechatOrderStatus(self, dict_content): + ''' + query url: https://api.mch.weixin.qq.com/pay/orderquery + documentation(Chinese): https://pay.weixin.qq.com/wiki/doc/api/native.php?chapter=9_2 + The dict_content atleast should contains one of following: + - transaction_id (str): wechat order number, use this in higher priority, it will return in the payment notify callback + - out_trade_no(str): The order ID used inside ERP5, less than 32 characters, digits, alphabets, and "_-|*@", unique in ERP5 + ''' + if "transaction_id" not in dict_content and "out_trade_no" not in dict_content: + raise WechatException("transaction_id or out_trade_no is needed for query the Wechat Order") + wechat_account_configuration = self.ERP5Site_getWechatPaymentConfiguration() + + params = { + "appid": wechat_account_configuration['APP_ID'], + "mch_id": wechat_account_configuration['MCH_ID'], + + "nonce_str": generateRandomStr(), + # "transaction_id": dict_content.get("transaction_id", ""), + "out_trade_no": dict_content.get("out_trade_no", ""), + } + sign = calculateSign(params, wechat_account_configuration['API_KEY']) + params["sign"] = sign + xml_str = convert_dict_to_xml(params) + + result = urllib2.Request(QUERY_URL, data=xml_str) + result_data = urllib2.urlopen(result) + result_read = result_data.read() + result_dict_content = convert_xml_to_dict(result_read) + return_code = result_dict_content['return_code'] + if return_code == "SUCCESS": + result_code = result_dict_content['result_code'] + if result_code == "SUCCESS": + return result_dict_content['trade_state'] + else: + raise Exception("Error description: {0}".format(result_dict_content.get("err_code_des"))) + else: + raise Exception("Error description: {0}".format(result_dict_content.get("return_msg"))) \ No newline at end of file diff --git a/master/bt5/slapos_wechat/ExtensionTemplateItem/portal_components/extension.erp5.WechatUtils.xml b/master/bt5/slapos_wechat/ExtensionTemplateItem/portal_components/extension.erp5.WechatUtils.xml new file mode 100644 index 0000000000000000000000000000000000000000..ca05964b8b67fb790d4bdf8379745223d4d53909 --- /dev/null +++ b/master/bt5/slapos_wechat/ExtensionTemplateItem/portal_components/extension.erp5.WechatUtils.xml @@ -0,0 +1,124 @@ + + + + + + + + + + _recorded_property_dict + + AAAAAAAAAAI= + + + + default_reference + WechatUtils + + + description + + + + + + id + extension.erp5.WechatUtils + + + portal_type + Extension Component + + + sid + + + + + + text_content_error_message + + + + + + text_content_warning_message + + + + + + version + erp5 + + + workflow_history + + AAAAAAAAAAM= + + + + + + + + + + + + + data + + + + + + + + + + + + + + + data + + + + component_validation_workflow + + AAAAAAAAAAQ= + + + + + + + + + + + + + + + + + + + action + validate + + + validation_state + validated + + + + + + + + diff --git a/master/bt5/slapos_wechat/PathTemplateItem/currency_module/CNY.xml b/master/bt5/slapos_wechat/PathTemplateItem/currency_module/CNY.xml new file mode 100644 index 0000000000000000000000000000000000000000..9a2e0b25b388c35df40907cfd6a2ec0ff5e7474f --- /dev/null +++ b/master/bt5/slapos_wechat/PathTemplateItem/currency_module/CNY.xml @@ -0,0 +1,126 @@ + + + + + + + + + + _Access_contents_information_Permission + + + Assignee + Assignor + Associate + Auditor + Author + Manager + Owner + + + + + _Add_portal_content_Permission + + + Assignee + Assignor + Associate + Author + Manager + Owner + + + + + _Modify_portal_content_Permission + + + Assignee + Assignor + Associate + Author + Manager + Owner + + + + + _View_Permission + + + Assignee + Assignor + Associate + Auditor + Author + Manager + Owner + + + + + base_unit_quantity + 0.01 + + + default_reference + CNY + + + description + + + + + + id + CNY + + + index + + AAAAAAAAAAI= + + + + language + + + + + + portal_type + Currency + + + short_title + Yuan + + + title + CNY + + + + + + + + + + + + + + + data + + + + + + + + diff --git a/master/bt5/slapos_wechat/PathTemplateItem/portal_alarms/slapos_wechat_update_confirmed_payment.xml b/master/bt5/slapos_wechat/PathTemplateItem/portal_alarms/slapos_wechat_update_confirmed_payment.xml new file mode 100644 index 0000000000000000000000000000000000000000..fdfbb98f15c1db8e77906dac8e3252bc7bf0b3c3 --- /dev/null +++ b/master/bt5/slapos_wechat/PathTemplateItem/portal_alarms/slapos_wechat_update_confirmed_payment.xml @@ -0,0 +1,101 @@ + + + + + + + + + + active_sense_method_id + Alarm_updateWechatConfirmedPaymentTransaction + + + automatic_solve + 0 + + + description + + + + + + enabled + 1 + + + id + slapos_wechat_update_confirmed_payment + + + periodicity_hour + + + + + + periodicity_minute + + + + + + periodicity_minute_frequency + 5 + + + periodicity_month + + + + + + periodicity_month_day + + + + + + periodicity_start_date + + + + + + + + + + + 1288051200.0 + GMT + + + + + + + periodicity_week + + + + + + portal_type + Alarm + + + sense_method_id + + + + + + title + Handles confirmed Payment Transactions with Wechat interface + + + + + diff --git a/master/bt5/slapos_wechat/PathTemplateItem/portal_alarms/slapos_wechat_update_started_payment.xml b/master/bt5/slapos_wechat/PathTemplateItem/portal_alarms/slapos_wechat_update_started_payment.xml new file mode 100644 index 0000000000000000000000000000000000000000..8567b2ef8449333b07d63c67d34239a4ba0975aa --- /dev/null +++ b/master/bt5/slapos_wechat/PathTemplateItem/portal_alarms/slapos_wechat_update_started_payment.xml @@ -0,0 +1,107 @@ + + + + + + + + + + active_sense_method_id + Alarm_updateWechatStartedPaymentTransaction + + + automatic_solve + 0 + + + description + + + + + + enabled + 1 + + + id + slapos_wechat_update_started_payment + + + periodicity_hour + + + + + + periodicity_hour_frequency + 8 + + + periodicity_minute + + + + + + periodicity_minute_frequency + + + + + + periodicity_month + + + + + + periodicity_month_day + + + + + + periodicity_start_date + + + + + + + + + + + 1288051200.0 + GMT + + + + + + + periodicity_week + + + + + + portal_type + Alarm + + + sense_method_id + + + + + + title + Handles started Payment Transactions with Wechat interface + + + + + diff --git a/master/bt5/slapos_wechat/PathTemplateItem/portal_secure_payments/slapos_wechat_test.xml b/master/bt5/slapos_wechat/PathTemplateItem/portal_secure_payments/slapos_wechat_test.xml new file mode 100644 index 0000000000000000000000000000000000000000..d77dd826b05989d182dbbfab2d51de273011c1ea --- /dev/null +++ b/master/bt5/slapos_wechat/PathTemplateItem/portal_secure_payments/slapos_wechat_test.xml @@ -0,0 +1,95 @@ + + + + + + + + + + _count + + AAAAAAAAAAI= + + + + _local_properties + + + + + id + query_url_string + + + type + string + + + + + + + _mt_index + + AAAAAAAAAAM= + + + + _tree + + AAAAAAAAAAQ= + + + + default_reference + PSERV-Wechat-Test + + + description + + + + + + id + slapos_wechat_test + + + portal_type + Wechat Service + + + query_url_string + https://api.mch.weixin.qq.com/pay/orderquery + + + title + Wechat + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + diff --git a/master/bt5/slapos_wechat/PathTemplateItem/portal_secure_payments/slapos_wechat_test/default_link.xml b/master/bt5/slapos_wechat/PathTemplateItem/portal_secure_payments/slapos_wechat_test/default_link.xml new file mode 100644 index 0000000000000000000000000000000000000000..cceab4de8bc2f0c50e931a8c0438545c0aff0501 --- /dev/null +++ b/master/bt5/slapos_wechat/PathTemplateItem/portal_secure_payments/slapos_wechat_test/default_link.xml @@ -0,0 +1,30 @@ + + + + + + + + + + id + default_link + + + portal_type + Link + + + sid + + + + + + url_string + https://api.mch.weixin.qq.com/pay/unifiedorder + + + + + diff --git a/master/bt5/slapos_wechat/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml b/master/bt5/slapos_wechat/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml new file mode 100644 index 0000000000000000000000000000000000000000..72e28d09a7a4890cffbeaccc9e599cfc3333b76a --- /dev/null +++ b/master/bt5/slapos_wechat/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml @@ -0,0 +1,8 @@ + + + Wechat Event + + + Wechat Event Message + + \ No newline at end of file diff --git a/master/bt5/slapos_wechat/PortalTypeBaseCategoryTemplateItem/base_category_list.xml b/master/bt5/slapos_wechat/PortalTypeBaseCategoryTemplateItem/base_category_list.xml new file mode 100644 index 0000000000000000000000000000000000000000..8af096f64c0006651fbd65ce8b906afbf155635a --- /dev/null +++ b/master/bt5/slapos_wechat/PortalTypeBaseCategoryTemplateItem/base_category_list.xml @@ -0,0 +1,10 @@ + + + destination + destination_section + source + + + predecessor + + \ No newline at end of file diff --git a/master/bt5/slapos_wechat/PortalTypePropertySheetTemplateItem/property_sheet_list.xml b/master/bt5/slapos_wechat/PortalTypePropertySheetTemplateItem/property_sheet_list.xml new file mode 100644 index 0000000000000000000000000000000000000000..634e51943113d5075f9e3149aff3a0705cdde261 --- /dev/null +++ b/master/bt5/slapos_wechat/PortalTypePropertySheetTemplateItem/property_sheet_list.xml @@ -0,0 +1,5 @@ + + + TextDocument + + \ No newline at end of file diff --git a/master/bt5/slapos_wechat/PortalTypeTemplateItem/portal_types/Wechat%20Event%20Message.xml b/master/bt5/slapos_wechat/PortalTypeTemplateItem/portal_types/Wechat%20Event%20Message.xml new file mode 100644 index 0000000000000000000000000000000000000000..1ba70e0de92df42c2144b9e61648d04e4097f22f --- /dev/null +++ b/master/bt5/slapos_wechat/PortalTypeTemplateItem/portal_types/Wechat%20Event%20Message.xml @@ -0,0 +1,131 @@ + + + + + + + + + + _property_domain_dict + + + + short_title + + AAAAAAAAAAI= + + + + title + + AAAAAAAAAAM= + + + + + + + acquire_local_roles + 1 + + + content_icon + + + + + + description + + + + + + factory + addXMLObject + + + group_list + + + + + + id + Wechat Event Message + + + init_script + + + + + + permission + + + + + + portal_type + Base Type + + + type_class + XMLObject + + + type_interface + + + + + + type_mixin + + + + + + + + + + + + + + + domain_name + + + + + + property_name + short_title + + + + + + + + + + + + domain_name + + + + + + property_name + title + + + + + diff --git a/master/bt5/slapos_wechat/PortalTypeTemplateItem/portal_types/Wechat%20Event.xml b/master/bt5/slapos_wechat/PortalTypeTemplateItem/portal_types/Wechat%20Event.xml new file mode 100644 index 0000000000000000000000000000000000000000..c19358eefb4289d9006842955e55e4becc279f77 --- /dev/null +++ b/master/bt5/slapos_wechat/PortalTypeTemplateItem/portal_types/Wechat%20Event.xml @@ -0,0 +1,131 @@ + + + + + + + + + + _property_domain_dict + + + + short_title + + AAAAAAAAAAI= + + + + title + + AAAAAAAAAAM= + + + + + + + acquire_local_roles + 0 + + + content_icon + + + + + + description + + + + + + factory + addXMLObject + + + group_list + + + + + + id + Wechat Event + + + init_script + + + + + + permission + + + + + + portal_type + Base Type + + + type_class + XMLObject + + + type_interface + + + + + + type_mixin + + + + + + + + + + + + + + + domain_name + + + + + + property_name + short_title + + + + + + + + + + + + domain_name + + + + + + property_name + title + + + + + diff --git a/master/bt5/slapos_wechat/PortalTypeTemplateItem/portal_types/Wechat%20Service.xml b/master/bt5/slapos_wechat/PortalTypeTemplateItem/portal_types/Wechat%20Service.xml new file mode 100644 index 0000000000000000000000000000000000000000..1eb8b240a76d520ab11616d6fc50991bbe20765d --- /dev/null +++ b/master/bt5/slapos_wechat/PortalTypeTemplateItem/portal_types/Wechat%20Service.xml @@ -0,0 +1,121 @@ + + + + + + + + + + _property_domain_dict + + + + short_title + + AAAAAAAAAAI= + + + + title + + AAAAAAAAAAM= + + + + + + + content_icon + + + + + + description + + + + + + id + Wechat Service + + + init_script + + + + + + permission + + + + + + portal_type + Base Type + + + title + Wechat Service + + + type_class + PayzenService + + + type_interface + + + + + + type_mixin + + + + + + + + + + + + + + + domain_name + + + + + + property_name + short_title + + + + + + + + + + + + domain_name + + + + + + property_name + title + + + + + diff --git a/master/bt5/slapos_wechat/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml b/master/bt5/slapos_wechat/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml new file mode 100644 index 0000000000000000000000000000000000000000..ac5ba3db019dd4d27ca40637fd8a1dea69f958f9 --- /dev/null +++ b/master/bt5/slapos_wechat/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml @@ -0,0 +1,10 @@ + + + Wechat Event + edit_workflow, system_event_workflow, wechat_interface_workflow + + + Wechat Event Message + edit_workflow + + \ No newline at end of file diff --git a/master/bt5/slapos_wechat/PropertySheetTemplateItem/portal_property_sheets/SlapOSPayzenSystemPreference.xml b/master/bt5/slapos_wechat/PropertySheetTemplateItem/portal_property_sheets/SlapOSPayzenSystemPreference.xml new file mode 100644 index 0000000000000000000000000000000000000000..056a6e8dc96c4fcda394d52f8c6ec7c7b66f5c9e --- /dev/null +++ b/master/bt5/slapos_wechat/PropertySheetTemplateItem/portal_property_sheets/SlapOSPayzenSystemPreference.xml @@ -0,0 +1,66 @@ + + + + + + + + + + _count + + AAAAAAAAAAI= + + + + _mt_index + + AAAAAAAAAAM= + + + + _tree + + AAAAAAAAAAQ= + + + + description + + + + + + id + SlapOSPayzenSystemPreference + + + portal_type + Property Sheet + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + diff --git a/master/bt5/slapos_wechat/PropertySheetTemplateItem/portal_property_sheets/SlapOSPayzenSystemPreference/preferred_payzen_integration_site_property.xml b/master/bt5/slapos_wechat/PropertySheetTemplateItem/portal_property_sheets/SlapOSPayzenSystemPreference/preferred_payzen_integration_site_property.xml new file mode 100644 index 0000000000000000000000000000000000000000..e542b28d07e32203f08ed6086cae7bcecca8f491 --- /dev/null +++ b/master/bt5/slapos_wechat/PropertySheetTemplateItem/portal_property_sheets/SlapOSPayzenSystemPreference/preferred_payzen_integration_site_property.xml @@ -0,0 +1,65 @@ + + + + + + + + + + _local_properties + + + + + id + mode + + + type + string + + + + + + + categories + + + elementary_type/string + + + + + description + Integration site to use with PayZen. + + + id + preferred_payzen_integration_site_property + + + mode + w + + + portal_type + Standard Property + + + preference + 1 + + + property_default + python: \'\' + + + write_permission + Manage properties + + + + + diff --git a/master/bt5/slapos_wechat/PropertySheetTemplateItem/portal_property_sheets/SlapOSPayzenSystemPreference/preferred_payzen_payment_service_reference_property.xml b/master/bt5/slapos_wechat/PropertySheetTemplateItem/portal_property_sheets/SlapOSPayzenSystemPreference/preferred_payzen_payment_service_reference_property.xml new file mode 100644 index 0000000000000000000000000000000000000000..aee0de461fc766b8cb5a19683999df7987768a7f --- /dev/null +++ b/master/bt5/slapos_wechat/PropertySheetTemplateItem/portal_property_sheets/SlapOSPayzenSystemPreference/preferred_payzen_payment_service_reference_property.xml @@ -0,0 +1,65 @@ + + + + + + + + + + _local_properties + + + + + id + mode + + + type + string + + + + + + + categories + + + elementary_type/string + + + + + description + Payment Service to use with PayZen. + + + id + preferred_payzen_payment_service_reference_property + + + mode + w + + + portal_type + Standard Property + + + preference + 1 + + + property_default + python: \'\' + + + write_permission + Manage properties + + + + + diff --git a/master/bt5/slapos_wechat/PropertySheetTemplateItem/portal_property_sheets/SlapOSPayzenSystemPreference/preferred_wechat_payment_service_reference_property.xml b/master/bt5/slapos_wechat/PropertySheetTemplateItem/portal_property_sheets/SlapOSPayzenSystemPreference/preferred_wechat_payment_service_reference_property.xml new file mode 100644 index 0000000000000000000000000000000000000000..953c927f3aa8d94c814d6beaaa883f9ad915e575 --- /dev/null +++ b/master/bt5/slapos_wechat/PropertySheetTemplateItem/portal_property_sheets/SlapOSPayzenSystemPreference/preferred_wechat_payment_service_reference_property.xml @@ -0,0 +1,44 @@ + + + + + + + + + + categories + + + elementary_type/string + + + + + description + Payment Service to use with Wechat. + + + id + preferred_wechat_payment_service_reference_property + + + portal_type + Standard Property + + + preference + 1 + + + property_default + python: \'\' + + + write_permission + Manage properties + + + + + diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat.xml b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat.xml new file mode 100644 index 0000000000000000000000000000000000000000..a491691b36ba9377ca66873ed166018847831c22 --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat.xml @@ -0,0 +1,47 @@ + + + + + + + + + + _local_properties + + + + + id + business_template_skin_layer_priority + + + type + float + + + + + + + _objects + + + + + + business_template_skin_layer_priority + 60.0 + + + id + slapos_wechat + + + title + + + + + + diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Alarm_updateWechatConfirmedPaymentTransaction.py b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Alarm_updateWechatConfirmedPaymentTransaction.py new file mode 100644 index 0000000000000000000000000000000000000000..f7c7589ff07a3845497fb18f37b0915b835c8d1e --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Alarm_updateWechatConfirmedPaymentTransaction.py @@ -0,0 +1,12 @@ +portal = context.getPortalObject() + +portal.portal_catalog.searchAndActivate( + portal_type="Payment Transaction", + simulation_state=["confirmed"], + causality_state=["draft"], + payment_mode_uid=portal.portal_categories.payment_mode.wechat.getUid(), + method_id='PaymentTransaction_startWechatPayment', + packet_size=1, # just one to minimise errors + activate_kw={'tag': tag} + ) +context.activate(after_tag=tag).getId() diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Alarm_updateWechatConfirmedPaymentTransaction.xml b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Alarm_updateWechatConfirmedPaymentTransaction.xml new file mode 100644 index 0000000000000000000000000000000000000000..0ec2f96733361d3142ec8a99413b6f7511dfb728 --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Alarm_updateWechatConfirmedPaymentTransaction.xml @@ -0,0 +1,62 @@ + + + + + + + + + + Script_magic + 3 + + + _bind_names + + + + + + + + + + _asgns + + + + name_container + container + + + name_context + context + + + name_m_self + script + + + name_subpath + traverse_subpath + + + + + + + + + + + _params + tag, fixit, params + + + id + Alarm_updateWechatConfirmedPaymentTransaction + + + + + diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Alarm_updateWechatStartedPaymentTransaction.py b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Alarm_updateWechatStartedPaymentTransaction.py new file mode 100644 index 0000000000000000000000000000000000000000..c3dc088a983a20d01df3cca40e45b0be836e73b0 --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Alarm_updateWechatStartedPaymentTransaction.py @@ -0,0 +1,11 @@ +portal = context.getPortalObject() +portal.portal_catalog.searchAndActivate( + portal_type="Payment Transaction", + simulation_state=["started"], + causality_state=["draft"], + payment_mode_uid=portal.portal_categories.payment_mode.wechat.getUid(), + method_id='PaymentTransaction_updateWechatPaymentStatus', + packet_size=1, # just one to minimise errors + activate_kw={'tag': tag} + ) +context.activate(after_tag=tag).getId() diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Alarm_updateWechatStartedPaymentTransaction.xml b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Alarm_updateWechatStartedPaymentTransaction.xml new file mode 100644 index 0000000000000000000000000000000000000000..71950bf5bbab1b651750ac41f528e09689bc6e57 --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Alarm_updateWechatStartedPaymentTransaction.xml @@ -0,0 +1,62 @@ + + + + + + + + + + Script_magic + 3 + + + _bind_names + + + + + + + + + + _asgns + + + + name_container + container + + + name_context + context + + + name_m_self + script + + + name_subpath + traverse_subpath + + + + + + + + + + + _params + tag, fixit, params + + + id + Alarm_updateWechatStartedPaymentTransaction + + + + + diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Base_generateWechatQRCodeFromCodeURL.py b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Base_generateWechatQRCodeFromCodeURL.py new file mode 100644 index 0000000000000000000000000000000000000000..49cab63394aa3d065b6e0e05fe14efceec0d4efb --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Base_generateWechatQRCodeFromCodeURL.py @@ -0,0 +1,2 @@ +# inspired by Pack_generateCode128BarcodeImage in sanef-evl project +return context.Base_generateBarcodeImage('qrcode', code_url) diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Base_generateWechatQRCodeFromCodeURL.xml b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Base_generateWechatQRCodeFromCodeURL.xml new file mode 100644 index 0000000000000000000000000000000000000000..933c90fb92cc097b622de0ec3da8314e778ba8bc --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Base_generateWechatQRCodeFromCodeURL.xml @@ -0,0 +1,62 @@ + + + + + + + + + + Script_magic + 3 + + + _bind_names + + + + + + + + + + _asgns + + + + name_container + container + + + name_context + context + + + name_m_self + script + + + name_subpath + traverse_subpath + + + + + + + + + + + _params + code_url + + + id + Base_generateWechatQRCodeFromCodeURL + + + + + diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Base_getWechatCodeURL.xml b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Base_getWechatCodeURL.xml new file mode 100644 index 0000000000000000000000000000000000000000..4ba47f1db04ffb483273721e2ee2747870fcfdc7 --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Base_getWechatCodeURL.xml @@ -0,0 +1,28 @@ + + + + + + + + + + _function + getWechatQRCodeURL + + + _module + WechatUtils + + + id + Base_getWechatCodeURL + + + title + + + + + + diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Base_getWechatServiceRelativeUrl.py b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Base_getWechatServiceRelativeUrl.py new file mode 100644 index 0000000000000000000000000000000000000000..4f65a7d06a421572eaf7dad341cf3577b4d7e849 --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Base_getWechatServiceRelativeUrl.py @@ -0,0 +1,9 @@ +from zExceptions import Unauthorized +if REQUEST is not None: + raise Unauthorized + +portal = context.getPortalObject() +payment_service = portal.portal_secure_payments.find( + service_reference=portal.portal_preferences.getPreferredWechatPaymentServiceReference()) + +return payment_service.getRelativeUrl() diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Base_getWechatServiceRelativeUrl.xml b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Base_getWechatServiceRelativeUrl.xml new file mode 100644 index 0000000000000000000000000000000000000000..8da580d22b7ac0642e4e0fb2b4bbc0fbafacf8f7 --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Base_getWechatServiceRelativeUrl.xml @@ -0,0 +1,70 @@ + + + + + + + + + + Script_magic + 3 + + + _bind_names + + + + + + + + + + _asgns + + + + name_container + container + + + name_context + context + + + name_m_self + script + + + name_subpath + traverse_subpath + + + + + + + + + + + _params + REQUEST=None, **kw + + + _proxy_roles + + + Manager + + + + + id + Base_getWechatServiceRelativeUrl + + + + + diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Base_queryWechatOrderStatusByTradeNo.py b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Base_queryWechatOrderStatusByTradeNo.py new file mode 100644 index 0000000000000000000000000000000000000000..ad92e22c665736d645a712d5947b5fb340972bfb --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Base_queryWechatOrderStatusByTradeNo.py @@ -0,0 +1,4 @@ +if not trade_no: + raise Exception("Unknown trade number") + +return context.Base_queryWechatOrderStatus({'out_trade_no': trade_no}) diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Base_queryWechatOrderStatusByTradeNo.xml b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Base_queryWechatOrderStatusByTradeNo.xml new file mode 100644 index 0000000000000000000000000000000000000000..a002b6a992c903379c453028c4216b8d29ac85ef --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Base_queryWechatOrderStatusByTradeNo.xml @@ -0,0 +1,62 @@ + + + + + + + + + + Script_magic + 3 + + + _bind_names + + + + + + + + + + _asgns + + + + name_container + container + + + name_context + context + + + name_m_self + script + + + name_subpath + traverse_subpath + + + + + + + + + + + _params + trade_no=None + + + id + Base_queryWechatOrderStatusByTradeNo + + + + + diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Base_receiveWechatPaymentNotify.xml b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Base_receiveWechatPaymentNotify.xml new file mode 100644 index 0000000000000000000000000000000000000000..066f792ae98a073c23a81a2ac4baa6bfead74536 --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Base_receiveWechatPaymentNotify.xml @@ -0,0 +1,28 @@ + + + + + + + + + + _function + receiveWechatPaymentNotify + + + _module + WechatUtils + + + id + Base_receiveWechatPaymentNotify + + + title + + + + + + diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/ERP5Site_getWechatPaymentConfiguration.py b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/ERP5Site_getWechatPaymentConfiguration.py new file mode 100644 index 0000000000000000000000000000000000000000..a564707544f53459c40ea75859a0a56f3beaa6b6 --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/ERP5Site_getWechatPaymentConfiguration.py @@ -0,0 +1 @@ +return {} diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/ERP5Site_getWechatPaymentConfiguration.xml b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/ERP5Site_getWechatPaymentConfiguration.xml new file mode 100644 index 0000000000000000000000000000000000000000..5b7799f3ad40404200e8c1c6ca0d2f8960f33538 --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/ERP5Site_getWechatPaymentConfiguration.xml @@ -0,0 +1,62 @@ + + + + + + + + + + Script_magic + 3 + + + _bind_names + + + + + + + + + + _asgns + + + + name_container + container + + + name_context + context + + + name_m_self + script + + + name_subpath + traverse_subpath + + + + + + + + + + + _params + + + + id + ERP5Site_getWechatPaymentConfiguration + + + + + diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/ERP5Site_receiveWechatPaymentCallback.py b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/ERP5Site_receiveWechatPaymentCallback.py new file mode 100644 index 0000000000000000000000000000000000000000..437ae63677e5bca5842fdb1e6f898ae2cc9d58b9 --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/ERP5Site_receiveWechatPaymentCallback.py @@ -0,0 +1,16 @@ +# Example code: + +# Import a standard function, and get the HTML request and response objects. +from Products.PythonScripts.standard import html_quote +request = container.REQUEST +response = request.response + +raise Exception(request) +# Return a string identifying this script. +print "This is the", script.meta_type, '"%s"' % script.getId(), +if script.title: + print "(%s)" % html_quote(script.title), +print "in", container.absolute_url() +print response + +return printed diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/ERP5Site_receiveWechatPaymentCallback.xml b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/ERP5Site_receiveWechatPaymentCallback.xml new file mode 100644 index 0000000000000000000000000000000000000000..c756f1b2274f884d97fc6fdf24d2fb502260f8be --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/ERP5Site_receiveWechatPaymentCallback.xml @@ -0,0 +1,62 @@ + + + + + + + + + + Script_magic + 3 + + + _bind_names + + + + + + + + + + _asgns + + + + name_container + container + + + name_context + context + + + name_m_self + script + + + name_subpath + traverse_subpath + + + + + + + + + + + _params + **kw + + + id + ERP5Site_receiveWechatPaymentCallback + + + + + diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_createWechatEvent.py b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_createWechatEvent.py new file mode 100644 index 0000000000000000000000000000000000000000..aa0e6a30f07c5cca47c2293a81c858c677f99aeb --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_createWechatEvent.py @@ -0,0 +1,13 @@ +from zExceptions import Unauthorized +if REQUEST is not None: + raise Unauthorized + +portal = context.getPortalObject() + +kw.update({ + 'portal_type': 'Wechat Event', + 'source': portal.Base_getWechatServiceRelativeUrl(), + 'destination_value': context, +}) + +return portal.system_event_module.newContent(**kw) diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_createWechatEvent.xml b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_createWechatEvent.xml new file mode 100644 index 0000000000000000000000000000000000000000..1eee92998cae5e60c51cb6f7852f6dec6c95ee45 --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_createWechatEvent.xml @@ -0,0 +1,62 @@ + + + + + + + + + + Script_magic + 3 + + + _bind_names + + + + + + + + + + _asgns + + + + name_container + container + + + name_context + context + + + name_m_self + script + + + name_subpath + traverse_subpath + + + + + + + + + + + _params + REQUEST=None, **kw + + + id + PaymentTransaction_createWechatEvent + + + + + diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_redirectToWechatPayment.py b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_redirectToWechatPayment.py new file mode 100644 index 0000000000000000000000000000000000000000..02b0c0aa06e432ebd21f513018482a70b975aa50 --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_redirectToWechatPayment.py @@ -0,0 +1,35 @@ +from zExceptions import Unauthorized +portal = context.getPortalObject() +person = portal.portal_membership.getAuthenticatedMember().getUserValue() + +def wrapWithShadow(payment_transaction, web_site, person_relative_url): + vads_url_dict = payment_transaction.PaymentTransaction_getVADSUrlDict(web_site) + # ??? + + _ , transaction_id = payment_transaction.PaymentTransaction_getPayzenId() + # vads_url_already_registered = vads_url_dict.pop('vads_url_already_registered') + # if transaction_id is not None: + # return context.REQUEST.RESPONSE.redirect(vads_url_already_registered) + system_event = payment_transaction.PaymentTransaction_createWechatEvent( + title='User navigation script for %s' % payment_transaction.getTitle(), + destination_section=person_relative_url, + ) + + # Why I need to login ??? + system_event.generateWechatPaymentPage( + **vads_url_dict + ) + +''' + return system_event.contentValues( + portal_type="Wechat Event Message")[0].getTextContent() +''' +if person is None: + if not portal.portal_membership.isAnonymousUser(): + return wrapWithShadow(context, web_site, context.getDestinationSection()) + raise Unauthorized("You must be logged in") + +return person.Person_restrictMethodAsShadowUser( + shadow_document=person, + callable_object=wrapWithShadow, + argument_list=[context, web_site, person.getRelativeUrl()]) diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_redirectToWechatPayment.xml b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_redirectToWechatPayment.xml new file mode 100644 index 0000000000000000000000000000000000000000..3a2a249d4b6e6ac1ab7d4484b25338ab5ad0cf1f --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_redirectToWechatPayment.xml @@ -0,0 +1,62 @@ + + + + + + + + + + Script_magic + 3 + + + _bind_names + + + + + + + + + + _asgns + + + + name_container + container + + + name_context + context + + + name_m_self + script + + + name_subpath + traverse_subpath + + + + + + + + + + + _params + web_site=None + + + id + PaymentTransaction_redirectToWechatPayment + + + + + diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_startWechatPayment.py b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_startWechatPayment.py new file mode 100644 index 0000000000000000000000000000000000000000..57769f4a47162dae761b52af5694e748a3b7b471 --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_startWechatPayment.py @@ -0,0 +1,9 @@ +from DateTime import DateTime + +state = context.getSimulationState() +transaction_amount = int(round((context.PaymentTransaction_getTotalPayablePrice() * -100), 2)) +if (state != 'confirmed') or (context.getPaymentMode() != 'wechat') or (transaction_amount == 0): + return +else: + # Request manual payment + context.start(comment='Requested manual payment') diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_startWechatPayment.xml b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_startWechatPayment.xml new file mode 100644 index 0000000000000000000000000000000000000000..7fc20f7d02579095abe459eeb6057bf45c95dbbe --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_startWechatPayment.xml @@ -0,0 +1,62 @@ + + + + + + + + + + Script_magic + 3 + + + _bind_names + + + + + + + + + + _asgns + + + + name_container + container + + + name_context + context + + + name_m_self + script + + + name_subpath + traverse_subpath + + + + + + + + + + + _params + + + + id + PaymentTransaction_startWechatPayment + + + + + diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_updateWechatPaymentStatus.py b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_updateWechatPaymentStatus.py new file mode 100644 index 0000000000000000000000000000000000000000..3f5a7a6c3ff246d0a4d2f3ed243ebd7aac4d3bc1 --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_updateWechatPaymentStatus.py @@ -0,0 +1,13 @@ +from DateTime import DateTime +portal = context.getPortalObject() + +state = context.getSimulationState() +if (state != 'started') or (context.getPaymentMode() != 'wechat'): + return +else: + # ??? + transaction_date, transaction_id = context.PaymentTransaction_getPayzenId() + + if transaction_id is not None: + # so the payment is registered in payzen + context.PaymentTransaction_createWechatEvent().updateStatus() diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_updateWechatPaymentStatus.xml b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_updateWechatPaymentStatus.xml new file mode 100644 index 0000000000000000000000000000000000000000..35af430b1fd60d24bffd6f4d413a6649c7dad359 --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_updateWechatPaymentStatus.xml @@ -0,0 +1,62 @@ + + + + + + + + + + Script_magic + 3 + + + _bind_names + + + + + + + + + + _asgns + + + + name_container + container + + + name_context + context + + + name_m_self + script + + + name_subpath + traverse_subpath + + + + + + + + + + + _params + + + + id + PaymentTransaction_updateWechatPaymentStatus + + + + + diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEventMessage_view.xml b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEventMessage_view.xml new file mode 100644 index 0000000000000000000000000000000000000000..36e17dfd79e856b410478afe36c36eefdf1203bf --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEventMessage_view.xml @@ -0,0 +1,157 @@ + + + + + + + + + + _bind_names + + + + + + + + + + _asgns + + + + + + + + + + + _objects + + + + + + action + Base_edit + + + description + + + + edit_order + + + + + + encoding + UTF-8 + + + enctype + + + + group_list + + + left + right + center + bottom + hidden + + + + + groups + + + + bottom + + + + + + center + + + my_text_content + + + + + hidden + + + + + + left + + + my_title + + + + + right + + + my_creation_date + my_predecessor_title + + + + + + + + id + WechatEventMessage_view + + + method + POST + + + name + AuthenticationEvent_view + + + pt + form_view + + + row_length + 4 + + + stored_encoding + UTF-8 + + + title + Wechat Event Message + + + unicode_mode + 0 + + + update_action + + + + update_action_title + + + + + + diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEventMessage_view/my_creation_date.xml b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEventMessage_view/my_creation_date.xml new file mode 100644 index 0000000000000000000000000000000000000000..d340e5b9d146b11c74cc3786e42872085f319c6d --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEventMessage_view/my_creation_date.xml @@ -0,0 +1,2359 @@ + + + + + + + + + + id + my_creation_date + + + message_values + + + + datetime_out_of_range + The date and time you entered were out of range. + + + external_validator_failed + The input failed the external validator. + + + not_datetime + You did not enter a valid date and time. + + + required_not_found + Input is required but no input given. + + + + + + overrides + + + + allow_empty_time + + + + alternate_name + + + + ampm_time_style + + + + css_class + + + + date_only + + + + date_separator + + + + default + + + + default_now + + + + description + + + + editable + + + + enabled + + + + end_datetime + + + + external_validator + + + + hidden + + + + hidden_day_is_last_day + + + + hide_day + + + + input_order + + + + input_style + + + + required + + + + start_datetime + + + + time_separator + + + + timezone_style + + + + title + + + + + + + sub_form + + AAAAAAAAAAI= + + + + tales + + + + allow_empty_time + + + + alternate_name + + + + ampm_time_style + + + + css_class + + + + date_only + + + + date_separator + + + + default + + + + default_now + + + + description + + + + editable + + + + enabled + + + + end_datetime + + + + external_validator + + + + hidden + + + + hidden_day_is_last_day + + + + hide_day + + + + input_order + + AAAAAAAAAAM= + + + + input_style + + + + required + + + + start_datetime + + + + time_separator + + + + timezone_style + + + + title + + + + + + + values + + + + allow_empty_time + 0 + + + alternate_name + + + + ampm_time_style + 0 + + + css_class + date_field + + + date_only + 0 + + + date_separator + / + + + default + + + + + + default_now + 0 + + + description + The Date + + + editable + 0 + + + enabled + 1 + + + end_datetime + + + + + + external_validator + + + + hidden + 0 + + + hidden_day_is_last_day + 0 + + + hide_day + 0 + + + input_order + ymd + + + input_style + text + + + required + 0 + + + start_datetime + + + + + + time_separator + : + + + timezone_style + 0 + + + title + Date + + + + + + + + + + + + + + + action + + + + encoding + UTF-8 + + + enctype + + + + fields + + + + ampm + + AAAAAAAAAAQ= + + + + day + + AAAAAAAAAAU= + + + + hour + + AAAAAAAAAAY= + + + + minute + + AAAAAAAAAAc= + + + + month + + AAAAAAAAAAg= + + + + timezone + + AAAAAAAAAAk= + + + + year + + AAAAAAAAAAo= + + + + + + + group_list + + + Default + date + time + + + + + groups + + + + Default + + + + + + date + + + year + month + day + + + + + time + + + hour + minute + ampm + timezone + + + + + + + + method + POST + + + name + + + + stored_encoding + ISO-8859-1 + + + title + Basic Form + + + unicode_mode + 0 + + + + + + + + + + + + _text + preferences/getPreferredDateOrder | string:ymd + + + + + + + + + + + + id + ampm + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + required_not_found + Input is required but no input given. + + + too_long + Too much input was given. + + + + + + overrides + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + display_maxwidth + + + + display_width + + + + editable + + + + enabled + + + + external_validator + + + + extra + + + + hidden + + + + max_length + + + + required + + + + title + + + + truncate + + + + unicode + + + + whitespace_preserve + + + + + + + tales + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + display_maxwidth + + + + display_width + + + + editable + + + + enabled + + + + external_validator + + + + extra + + + + hidden + + + + max_length + + + + required + + + + title + + + + truncate + + + + unicode + + + + whitespace_preserve + + + + + + + values + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + display_maxwidth + 2 + + + display_width + 2 + + + editable + 1 + + + enabled + 1 + + + external_validator + + + + extra + + + + hidden + 0 + + + max_length + 2 + + + required + 0 + + + title + am/pm + + + truncate + 0 + + + unicode + 0 + + + whitespace_preserve + 0 + + + + + + + + + + + + + + + id + day + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + integer_out_of_range + The integer you entered was out of range. + + + not_integer + You did not enter an integer. + + + required_not_found + Input is required but no input given. + + + + + + overrides + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + display_maxwidth + + + + display_width + + + + editable + + + + enabled + + + + end + + + + external_validator + + + + extra + + + + hidden + + + + required + + + + start + + + + title + + + + whitespace_preserve + + + + + + + tales + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + display_maxwidth + + + + display_width + + + + editable + + + + enabled + + + + end + + + + external_validator + + + + extra + + + + hidden + + + + required + + + + start + + + + title + + + + whitespace_preserve + + + + + + + values + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + display_maxwidth + 2 + + + display_width + 2 + + + editable + 1 + + + enabled + 1 + + + end + + + + external_validator + + + + extra + + + + hidden + 0 + + + required + 0 + + + start + + + + title + Day + + + whitespace_preserve + 0 + + + + + + + + + + + + + + + id + hour + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + integer_out_of_range + The integer you entered was out of range. + + + not_integer + You did not enter an integer. + + + required_not_found + Input is required but no input given. + + + + + + overrides + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + display_maxwidth + + + + display_width + + + + editable + + + + enabled + + + + end + + + + external_validator + + + + extra + + + + hidden + + + + required + + + + start + + + + title + + + + whitespace_preserve + + + + + + + tales + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + display_maxwidth + + + + display_width + + + + editable + + + + enabled + + + + end + + + + external_validator + + + + extra + + + + hidden + + + + required + + + + start + + + + title + + + + whitespace_preserve + + + + + + + values + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + display_maxwidth + 2 + + + display_width + 2 + + + editable + 1 + + + enabled + 1 + + + end + + + + external_validator + + + + extra + + + + hidden + 0 + + + required + 0 + + + start + + + + title + Hour + + + whitespace_preserve + 0 + + + + + + + + + + + + + + + id + minute + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + integer_out_of_range + The integer you entered was out of range. + + + not_integer + You did not enter an integer. + + + required_not_found + Input is required but no input given. + + + + + + overrides + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + display_maxwidth + + + + display_width + + + + editable + + + + enabled + + + + end + + + + external_validator + + + + extra + + + + hidden + + + + required + + + + start + + + + title + + + + whitespace_preserve + + + + + + + tales + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + display_maxwidth + + + + display_width + + + + editable + + + + enabled + + + + end + + + + external_validator + + + + extra + + + + hidden + + + + required + + + + start + + + + title + + + + whitespace_preserve + + + + + + + values + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + display_maxwidth + 2 + + + display_width + 2 + + + editable + 1 + + + enabled + 1 + + + end + + + + external_validator + + + + extra + + + + hidden + 0 + + + required + 0 + + + start + + + + title + Minute + + + whitespace_preserve + 0 + + + + + + + + + + + + + + + id + month + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + integer_out_of_range + The integer you entered was out of range. + + + not_integer + You did not enter an integer. + + + required_not_found + Input is required but no input given. + + + + + + overrides + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + display_maxwidth + + + + display_width + + + + editable + + + + enabled + + + + end + + + + external_validator + + + + extra + + + + hidden + + + + required + + + + start + + + + title + + + + whitespace_preserve + + + + + + + tales + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + display_maxwidth + + + + display_width + + + + editable + + + + enabled + + + + end + + + + external_validator + + + + extra + + + + hidden + + + + required + + + + start + + + + title + + + + whitespace_preserve + + + + + + + values + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + display_maxwidth + 2 + + + display_width + 2 + + + editable + 1 + + + enabled + 1 + + + end + + + + external_validator + + + + extra + + + + hidden + 0 + + + required + 0 + + + start + + + + title + Month + + + whitespace_preserve + 0 + + + + + + + + + + + + + + + id + timezone + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + required_not_found + Input is required but no input given. + + + unknown_selection + You selected an item that was not in the list. + + + + + + overrides + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + editable + + + + enabled + + + + external_validator + + + + extra + + + + extra_item + + + + first_item + + + + hidden + + + + items + + + + required + + + + size + + + + title + + + + unicode + + + + whitespace_preserve + + + + + + + tales + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + editable + + + + enabled + + + + external_validator + + + + extra + + + + extra_item + + + + first_item + + + + hidden + + + + items + + + + required + + + + size + + + + title + + + + unicode + + + + whitespace_preserve + + + + + + + values + + + + alternate_name + + + + css_class + + + + default + GMT + + + description + + + + editable + 1 + + + enabled + 1 + + + external_validator + + + + extra + + + + extra_item + + + + first_item + 0 + + + hidden + 0 + + + items + + + + GMT-12 + GMT-12 + + + GMT-11 + GMT-11 + + + GMT-10 + GMT-10 + + + GMT-9 + GMT-9 + + + GMT-8 + GMT-8 + + + GMT-7 + GMT-7 + + + GMT-6 + GMT-6 + + + GMT-5 + GMT-5 + + + GMT-4 + GMT-4 + + + GMT-3 + GMT-3 + + + GMT-2 + GMT-2 + + + GMT-1 + GMT-1 + + + GMT + GMT + + + GMT+1 + GMT+1 + + + GMT+2 + GMT+2 + + + GMT+3 + GMT+3 + + + GMT+4 + GMT+4 + + + GMT+5 + GMT+5 + + + GMT+6 + GMT+6 + + + GMT+7 + GMT+7 + + + GMT+8 + GMT+8 + + + GMT+9 + GMT+9 + + + GMT+10 + GMT+10 + + + GMT+11 + GMT+11 + + + GMT+12 + GMT+12 + + + + + + required + 0 + + + size + 1 + + + title + Timezone + + + unicode + 0 + + + whitespace_preserve + 0 + + + + + + + + + + + + + + + id + year + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + integer_out_of_range + The integer you entered was out of range. + + + not_integer + You did not enter an integer. + + + required_not_found + Input is required but no input given. + + + + + + overrides + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + display_maxwidth + + + + display_width + + + + editable + + + + enabled + + + + end + + + + external_validator + + + + extra + + + + hidden + + + + required + + + + start + + + + title + + + + whitespace_preserve + + + + + + + tales + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + display_maxwidth + + + + display_width + + + + editable + + + + enabled + + + + end + + + + external_validator + + + + extra + + + + hidden + + + + required + + + + start + + + + title + + + + whitespace_preserve + + + + + + + values + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + display_maxwidth + 4 + + + display_width + 4 + + + editable + 1 + + + enabled + 1 + + + end + + + + external_validator + + + + extra + + + + hidden + 0 + + + required + 0 + + + start + + + + title + Year + + + whitespace_preserve + 0 + + + + + + + + diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEventMessage_view/my_predecessor_title.xml b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEventMessage_view/my_predecessor_title.xml new file mode 100644 index 0000000000000000000000000000000000000000..1d44df9c7d6e2625e19ad259414871885105042e --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEventMessage_view/my_predecessor_title.xml @@ -0,0 +1,120 @@ + + + + + + + + + + delegated_list + + + catalog_index + editable + portal_type + title + + + + + id + my_predecessor_title + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + + + + overrides + + + + extra_context + + + + field_id + + + + form_id + + + + + + + tales + + + + extra_context + + + + field_id + + + + form_id + + + + + + + values + + + + catalog_index + title + + + editable + 0 + + + extra_context + + + + + + field_id + my_relation_field + + + form_id + Base_viewFieldLibrary + + + portal_type + + + + Soap Event + Soap Event + + + + + + title + Predecessor + + + + + + + + diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEventMessage_view/my_text_content.xml b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEventMessage_view/my_text_content.xml new file mode 100644 index 0000000000000000000000000000000000000000..542f72c5362123038661d95ed88a9aaf05cbf5a0 --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEventMessage_view/my_text_content.xml @@ -0,0 +1,96 @@ + + + + + + + + + + delegated_list + + + title + + + + + id + my_text_content + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + + + + overrides + + + + field_id + + + + form_id + + + + target + + + + + + + tales + + + + field_id + + + + form_id + + + + target + + + + + + + values + + + + field_id + my_text_area_field + + + form_id + Base_viewFieldLibrary + + + target + Click to edit the target + + + title + Text Content + + + + + + + + diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEventMessage_view/my_title.xml b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEventMessage_view/my_title.xml new file mode 100644 index 0000000000000000000000000000000000000000..679b18bb42fe38607b2c06711a0f961423313917 --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEventMessage_view/my_title.xml @@ -0,0 +1,96 @@ + + + + + + + + + + delegated_list + + + title + + + + + id + my_title + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + + + + overrides + + + + field_id + + + + form_id + + + + target + + + + + + + tales + + + + field_id + + + + form_id + + + + target + + + + + + + values + + + + field_id + my_string_field + + + form_id + Base_viewFieldLibrary + + + target + Click to edit the target + + + title + Title + + + + + + + + diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEvent_view.xml b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEvent_view.xml new file mode 100644 index 0000000000000000000000000000000000000000..89130e8b8fcc06f27aeb979b0aef8d793d417732 --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEvent_view.xml @@ -0,0 +1,161 @@ + + + + + + + + + + _bind_names + + + + + + + + + + _asgns + + + + + + + + + + + _objects + + + + + + action + Base_edit + + + description + + + + edit_order + + + + + + encoding + UTF-8 + + + enctype + + + + group_list + + + left + right + center + bottom + hidden + + + + + groups + + + + bottom + + + my_listbox + + + + + center + + + + + + hidden + + + + + + left + + + my_title + my_source_title + my_destination_title + + + + + right + + + my_creation_date + my_predecessor_title + my_translated_validation_state_title + my_translated_wechat_state_title + + + + + + + + id + WechatEvent_view + + + method + POST + + + name + AuthenticationEvent_view + + + pt + form_view + + + row_length + 4 + + + stored_encoding + UTF-8 + + + title + Payzen Event + + + unicode_mode + 0 + + + update_action + + + + update_action_title + + + + + + diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEvent_view/my_creation_date.xml b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEvent_view/my_creation_date.xml new file mode 100644 index 0000000000000000000000000000000000000000..d340e5b9d146b11c74cc3786e42872085f319c6d --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEvent_view/my_creation_date.xml @@ -0,0 +1,2359 @@ + + + + + + + + + + id + my_creation_date + + + message_values + + + + datetime_out_of_range + The date and time you entered were out of range. + + + external_validator_failed + The input failed the external validator. + + + not_datetime + You did not enter a valid date and time. + + + required_not_found + Input is required but no input given. + + + + + + overrides + + + + allow_empty_time + + + + alternate_name + + + + ampm_time_style + + + + css_class + + + + date_only + + + + date_separator + + + + default + + + + default_now + + + + description + + + + editable + + + + enabled + + + + end_datetime + + + + external_validator + + + + hidden + + + + hidden_day_is_last_day + + + + hide_day + + + + input_order + + + + input_style + + + + required + + + + start_datetime + + + + time_separator + + + + timezone_style + + + + title + + + + + + + sub_form + + AAAAAAAAAAI= + + + + tales + + + + allow_empty_time + + + + alternate_name + + + + ampm_time_style + + + + css_class + + + + date_only + + + + date_separator + + + + default + + + + default_now + + + + description + + + + editable + + + + enabled + + + + end_datetime + + + + external_validator + + + + hidden + + + + hidden_day_is_last_day + + + + hide_day + + + + input_order + + AAAAAAAAAAM= + + + + input_style + + + + required + + + + start_datetime + + + + time_separator + + + + timezone_style + + + + title + + + + + + + values + + + + allow_empty_time + 0 + + + alternate_name + + + + ampm_time_style + 0 + + + css_class + date_field + + + date_only + 0 + + + date_separator + / + + + default + + + + + + default_now + 0 + + + description + The Date + + + editable + 0 + + + enabled + 1 + + + end_datetime + + + + + + external_validator + + + + hidden + 0 + + + hidden_day_is_last_day + 0 + + + hide_day + 0 + + + input_order + ymd + + + input_style + text + + + required + 0 + + + start_datetime + + + + + + time_separator + : + + + timezone_style + 0 + + + title + Date + + + + + + + + + + + + + + + action + + + + encoding + UTF-8 + + + enctype + + + + fields + + + + ampm + + AAAAAAAAAAQ= + + + + day + + AAAAAAAAAAU= + + + + hour + + AAAAAAAAAAY= + + + + minute + + AAAAAAAAAAc= + + + + month + + AAAAAAAAAAg= + + + + timezone + + AAAAAAAAAAk= + + + + year + + AAAAAAAAAAo= + + + + + + + group_list + + + Default + date + time + + + + + groups + + + + Default + + + + + + date + + + year + month + day + + + + + time + + + hour + minute + ampm + timezone + + + + + + + + method + POST + + + name + + + + stored_encoding + ISO-8859-1 + + + title + Basic Form + + + unicode_mode + 0 + + + + + + + + + + + + _text + preferences/getPreferredDateOrder | string:ymd + + + + + + + + + + + + id + ampm + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + required_not_found + Input is required but no input given. + + + too_long + Too much input was given. + + + + + + overrides + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + display_maxwidth + + + + display_width + + + + editable + + + + enabled + + + + external_validator + + + + extra + + + + hidden + + + + max_length + + + + required + + + + title + + + + truncate + + + + unicode + + + + whitespace_preserve + + + + + + + tales + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + display_maxwidth + + + + display_width + + + + editable + + + + enabled + + + + external_validator + + + + extra + + + + hidden + + + + max_length + + + + required + + + + title + + + + truncate + + + + unicode + + + + whitespace_preserve + + + + + + + values + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + display_maxwidth + 2 + + + display_width + 2 + + + editable + 1 + + + enabled + 1 + + + external_validator + + + + extra + + + + hidden + 0 + + + max_length + 2 + + + required + 0 + + + title + am/pm + + + truncate + 0 + + + unicode + 0 + + + whitespace_preserve + 0 + + + + + + + + + + + + + + + id + day + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + integer_out_of_range + The integer you entered was out of range. + + + not_integer + You did not enter an integer. + + + required_not_found + Input is required but no input given. + + + + + + overrides + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + display_maxwidth + + + + display_width + + + + editable + + + + enabled + + + + end + + + + external_validator + + + + extra + + + + hidden + + + + required + + + + start + + + + title + + + + whitespace_preserve + + + + + + + tales + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + display_maxwidth + + + + display_width + + + + editable + + + + enabled + + + + end + + + + external_validator + + + + extra + + + + hidden + + + + required + + + + start + + + + title + + + + whitespace_preserve + + + + + + + values + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + display_maxwidth + 2 + + + display_width + 2 + + + editable + 1 + + + enabled + 1 + + + end + + + + external_validator + + + + extra + + + + hidden + 0 + + + required + 0 + + + start + + + + title + Day + + + whitespace_preserve + 0 + + + + + + + + + + + + + + + id + hour + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + integer_out_of_range + The integer you entered was out of range. + + + not_integer + You did not enter an integer. + + + required_not_found + Input is required but no input given. + + + + + + overrides + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + display_maxwidth + + + + display_width + + + + editable + + + + enabled + + + + end + + + + external_validator + + + + extra + + + + hidden + + + + required + + + + start + + + + title + + + + whitespace_preserve + + + + + + + tales + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + display_maxwidth + + + + display_width + + + + editable + + + + enabled + + + + end + + + + external_validator + + + + extra + + + + hidden + + + + required + + + + start + + + + title + + + + whitespace_preserve + + + + + + + values + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + display_maxwidth + 2 + + + display_width + 2 + + + editable + 1 + + + enabled + 1 + + + end + + + + external_validator + + + + extra + + + + hidden + 0 + + + required + 0 + + + start + + + + title + Hour + + + whitespace_preserve + 0 + + + + + + + + + + + + + + + id + minute + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + integer_out_of_range + The integer you entered was out of range. + + + not_integer + You did not enter an integer. + + + required_not_found + Input is required but no input given. + + + + + + overrides + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + display_maxwidth + + + + display_width + + + + editable + + + + enabled + + + + end + + + + external_validator + + + + extra + + + + hidden + + + + required + + + + start + + + + title + + + + whitespace_preserve + + + + + + + tales + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + display_maxwidth + + + + display_width + + + + editable + + + + enabled + + + + end + + + + external_validator + + + + extra + + + + hidden + + + + required + + + + start + + + + title + + + + whitespace_preserve + + + + + + + values + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + display_maxwidth + 2 + + + display_width + 2 + + + editable + 1 + + + enabled + 1 + + + end + + + + external_validator + + + + extra + + + + hidden + 0 + + + required + 0 + + + start + + + + title + Minute + + + whitespace_preserve + 0 + + + + + + + + + + + + + + + id + month + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + integer_out_of_range + The integer you entered was out of range. + + + not_integer + You did not enter an integer. + + + required_not_found + Input is required but no input given. + + + + + + overrides + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + display_maxwidth + + + + display_width + + + + editable + + + + enabled + + + + end + + + + external_validator + + + + extra + + + + hidden + + + + required + + + + start + + + + title + + + + whitespace_preserve + + + + + + + tales + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + display_maxwidth + + + + display_width + + + + editable + + + + enabled + + + + end + + + + external_validator + + + + extra + + + + hidden + + + + required + + + + start + + + + title + + + + whitespace_preserve + + + + + + + values + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + display_maxwidth + 2 + + + display_width + 2 + + + editable + 1 + + + enabled + 1 + + + end + + + + external_validator + + + + extra + + + + hidden + 0 + + + required + 0 + + + start + + + + title + Month + + + whitespace_preserve + 0 + + + + + + + + + + + + + + + id + timezone + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + required_not_found + Input is required but no input given. + + + unknown_selection + You selected an item that was not in the list. + + + + + + overrides + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + editable + + + + enabled + + + + external_validator + + + + extra + + + + extra_item + + + + first_item + + + + hidden + + + + items + + + + required + + + + size + + + + title + + + + unicode + + + + whitespace_preserve + + + + + + + tales + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + editable + + + + enabled + + + + external_validator + + + + extra + + + + extra_item + + + + first_item + + + + hidden + + + + items + + + + required + + + + size + + + + title + + + + unicode + + + + whitespace_preserve + + + + + + + values + + + + alternate_name + + + + css_class + + + + default + GMT + + + description + + + + editable + 1 + + + enabled + 1 + + + external_validator + + + + extra + + + + extra_item + + + + first_item + 0 + + + hidden + 0 + + + items + + + + GMT-12 + GMT-12 + + + GMT-11 + GMT-11 + + + GMT-10 + GMT-10 + + + GMT-9 + GMT-9 + + + GMT-8 + GMT-8 + + + GMT-7 + GMT-7 + + + GMT-6 + GMT-6 + + + GMT-5 + GMT-5 + + + GMT-4 + GMT-4 + + + GMT-3 + GMT-3 + + + GMT-2 + GMT-2 + + + GMT-1 + GMT-1 + + + GMT + GMT + + + GMT+1 + GMT+1 + + + GMT+2 + GMT+2 + + + GMT+3 + GMT+3 + + + GMT+4 + GMT+4 + + + GMT+5 + GMT+5 + + + GMT+6 + GMT+6 + + + GMT+7 + GMT+7 + + + GMT+8 + GMT+8 + + + GMT+9 + GMT+9 + + + GMT+10 + GMT+10 + + + GMT+11 + GMT+11 + + + GMT+12 + GMT+12 + + + + + + required + 0 + + + size + 1 + + + title + Timezone + + + unicode + 0 + + + whitespace_preserve + 0 + + + + + + + + + + + + + + + id + year + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + integer_out_of_range + The integer you entered was out of range. + + + not_integer + You did not enter an integer. + + + required_not_found + Input is required but no input given. + + + + + + overrides + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + display_maxwidth + + + + display_width + + + + editable + + + + enabled + + + + end + + + + external_validator + + + + extra + + + + hidden + + + + required + + + + start + + + + title + + + + whitespace_preserve + + + + + + + tales + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + display_maxwidth + + + + display_width + + + + editable + + + + enabled + + + + end + + + + external_validator + + + + extra + + + + hidden + + + + required + + + + start + + + + title + + + + whitespace_preserve + + + + + + + values + + + + alternate_name + + + + css_class + + + + default + + + + description + + + + display_maxwidth + 4 + + + display_width + 4 + + + editable + 1 + + + enabled + 1 + + + end + + + + external_validator + + + + extra + + + + hidden + 0 + + + required + 0 + + + start + + + + title + Year + + + whitespace_preserve + 0 + + + + + + + + diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEvent_view/my_destination_title.xml b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEvent_view/my_destination_title.xml new file mode 100644 index 0000000000000000000000000000000000000000..0401f96f73e95cd994e9ae075bd676715cd9fb0d --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEvent_view/my_destination_title.xml @@ -0,0 +1,120 @@ + + + + + + + + + + delegated_list + + + base_category + catalog_index + portal_type + title + + + + + id + my_destination_title + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + + + + overrides + + + + extra_context + + + + field_id + + + + form_id + + + + + + + tales + + + + extra_context + + + + field_id + + + + form_id + + + + + + + values + + + + base_category + destination + + + catalog_index + title + + + extra_context + + + + + + field_id + my_relation_field + + + form_id + Base_viewFieldLibrary + + + portal_type + + + + Payment Transaction + Payment Transaction + + + + + + title + Payment Transaction + + + + + + + + diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEvent_view/my_listbox.xml b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEvent_view/my_listbox.xml new file mode 100644 index 0000000000000000000000000000000000000000..3462c9621e46056c0b850a9a7d45ec227a5d0442 --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEvent_view/my_listbox.xml @@ -0,0 +1,124 @@ + + + + + + + + + + delegated_list + + + columns + portal_types + title + + + + + id + my_listbox + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + + + + overrides + + + + field_id + + + + form_id + + + + target + + + + + + + tales + + + + field_id + + + + form_id + + + + target + + + + + + + values + + + + columns + + + + title + Title + + + creation_date + Creation Date + + + + + + field_id + my_view_mode_listbox + + + form_id + Base_viewFieldLibrary + + + portal_types + + + + Wechat Event Message + Wechat Event Message + + + + + + target + Click to edit the target + + + title + Wechat Event Messages + + + + + + + + diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEvent_view/my_predecessor_title.xml b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEvent_view/my_predecessor_title.xml new file mode 100644 index 0000000000000000000000000000000000000000..1d44df9c7d6e2625e19ad259414871885105042e --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEvent_view/my_predecessor_title.xml @@ -0,0 +1,120 @@ + + + + + + + + + + delegated_list + + + catalog_index + editable + portal_type + title + + + + + id + my_predecessor_title + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + + + + overrides + + + + extra_context + + + + field_id + + + + form_id + + + + + + + tales + + + + extra_context + + + + field_id + + + + form_id + + + + + + + values + + + + catalog_index + title + + + editable + 0 + + + extra_context + + + + + + field_id + my_relation_field + + + form_id + Base_viewFieldLibrary + + + portal_type + + + + Soap Event + Soap Event + + + + + + title + Predecessor + + + + + + + + diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEvent_view/my_source_title.xml b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEvent_view/my_source_title.xml new file mode 100644 index 0000000000000000000000000000000000000000..4ccca6c621578a442c556cee26f21bb03b0e1612 --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEvent_view/my_source_title.xml @@ -0,0 +1,125 @@ + + + + + + + + + + delegated_list + + + base_category + catalog_index + editable + portal_type + title + + + + + id + my_source_title + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + + + + overrides + + + + extra_context + + + + field_id + + + + form_id + + + + + + + tales + + + + extra_context + + + + field_id + + + + form_id + + + + + + + values + + + + base_category + destination + + + catalog_index + title + + + editable + 0 + + + extra_context + + + + + + field_id + my_relation_field + + + form_id + Base_viewFieldLibrary + + + portal_type + + + + Wechat Service + Wechat Service + + + + + + title + Wechat Service + + + + + + + + diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEvent_view/my_title.xml b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEvent_view/my_title.xml new file mode 100644 index 0000000000000000000000000000000000000000..185e614bc375e9b1e794d9996e4cfbe28d39d3c6 --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEvent_view/my_title.xml @@ -0,0 +1,101 @@ + + + + + + + + + + delegated_list + + + editable + title + + + + + id + my_title + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + + + + overrides + + + + field_id + + + + form_id + + + + target + + + + + + + tales + + + + field_id + + + + form_id + + + + target + + + + + + + values + + + + editable + 0 + + + field_id + my_string_field + + + form_id + Base_viewFieldLibrary + + + target + Click to edit the target + + + title + Title + + + + + + + + diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEvent_view/my_translated_validation_state_title.xml b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEvent_view/my_translated_validation_state_title.xml new file mode 100644 index 0000000000000000000000000000000000000000..f8bf5216b58f242f89e84c2b71a6fa143dfe5460 --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEvent_view/my_translated_validation_state_title.xml @@ -0,0 +1,90 @@ + + + + + + + + + + delegated_list + + + + + + id + my_translated_validation_state_title + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + + + + overrides + + + + field_id + + + + form_id + + + + target + + + + + + + tales + + + + field_id + + + + form_id + + + + target + + + + + + + values + + + + field_id + my_view_mode_translated_workflow_state_title + + + form_id + Base_viewFieldLibrary + + + target + Click to edit the target + + + + + + + + diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEvent_view/my_translated_wechat_state_title.xml b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEvent_view/my_translated_wechat_state_title.xml new file mode 100644 index 0000000000000000000000000000000000000000..3479150110dd30796259331432c1cfa7973cbbda --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEvent_view/my_translated_wechat_state_title.xml @@ -0,0 +1,96 @@ + + + + + + + + + + delegated_list + + + title + + + + + id + my_translated_wechat_state_title + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + + + + overrides + + + + field_id + + + + form_id + + + + target + + + + + + + tales + + + + field_id + + + + form_id + + + + target + + + + + + + values + + + + field_id + my_view_mode_translated_workflow_state_title + + + form_id + Base_viewFieldLibrary + + + target + Click to edit the target + + + title + Wechat State + + + + + + + + diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatService_view.xml b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatService_view.xml new file mode 100644 index 0000000000000000000000000000000000000000..83817303e17c149e61ccaf21177ec3200ae39001 --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatService_view.xml @@ -0,0 +1,158 @@ + + + + + + + + + + _bind_names + + + + + + + + + + _asgns + + + + + + + + + + + _objects + + + + + + action + Base_edit + + + description + + + + edit_order + + + + + + encoding + UTF-8 + + + enctype + + + + group_list + + + left + right + center + bottom + hidden + + + + + groups + + + + bottom + + + listbox + + + + + center + + + + + + hidden + + + + + + left + + + my_title + my_reference + + + + + right + + + my_link_url_string + my_query_url_string + + + + + + + + id + WechatService_view + + + method + POST + + + name + PayzenService_view + + + pt + form_view + + + row_length + 4 + + + stored_encoding + UTF-8 + + + title + Payzen Service + + + unicode_mode + 0 + + + update_action + + + + update_action_title + + + + + + diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatService_view/listbox.xml b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatService_view/listbox.xml new file mode 100644 index 0000000000000000000000000000000000000000..af4ecbfdba5f006c662d3958ddf7ee97cd84d01c --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatService_view/listbox.xml @@ -0,0 +1,186 @@ + + + + + + + + + + delegated_list + + + anchor + columns + editable_columns + portal_types + selection_name + sort + title + url_columns + + + + + id + listbox + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + + + + overrides + + + + field_id + + + + form_id + + + + target + + + + + + + tales + + + + field_id + + + + form_id + + + + target + + + + + + + values + + + + anchor + 0 + + + columns + + + + int_index + Index + + + title + Title + + + translated_id + Coordinate Function + + + url_string + URL + + + + + + editable_columns + + + + int_index + Index + + + title + Title + + + + + + field_id + my_view_mode_listbox + + + form_id + Base_viewFieldLibrary + + + portal_types + + + + Link + Link + + + + + + selection_name + payzen_service_link_selection + + + sort + + + + portal_type + Type + + + int_index + Index + + + + + + target + Click to edit the target + + + title + Coordinates + + + url_columns + + + + url_string + Coordinate_asURL + + + + + + + + + + + diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatService_view/my_link_url_string.xml b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatService_view/my_link_url_string.xml new file mode 100644 index 0000000000000000000000000000000000000000..11f627697eebde1ada00df0b2ecfdb4c4b0fe57a --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatService_view/my_link_url_string.xml @@ -0,0 +1,304 @@ + + + + + + + + + + id + my_link_url_string + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + not_link + The specified link is broken. + + + required_not_found + Input is required but no input given. + + + too_long + Too much input was given. + + + + + + overrides + + + + alternate_name + + + + check_link + + + + check_timeout + + + + css_class + + + + default + + + + description + + + + display_maxwidth + + + + display_width + + + + editable + + + + enabled + + + + external_validator + + + + extra + + + + hidden + + + + link_type + + + + max_length + + + + required + + + + title + + + + truncate + + + + unicode + + + + whitespace_preserve + + + + + + + tales + + + + alternate_name + + + + check_link + + + + check_timeout + + + + css_class + + + + default + + + + description + + + + display_maxwidth + + + + display_width + + + + editable + + + + enabled + + + + external_validator + + + + extra + + + + hidden + + + + link_type + + + + max_length + + + + required + + + + title + + + + truncate + + + + unicode + + + + whitespace_preserve + + + + + + + values + + + + alternate_name + + + + check_link + 0 + + + check_timeout + 7.0 + + + css_class + + + + default + + + + description + + + + display_maxwidth + + + + display_width + 20 + + + editable + 1 + + + enabled + 1 + + + external_validator + + + + extra + + + + hidden + 0 + + + input_type + text + + + link_type + external + + + max_length + + + + required + 0 + + + title + Wechat Unify Order URL + + + truncate + 0 + + + unicode + 0 + + + whitespace_preserve + 0 + + + + + + + + diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatService_view/my_query_url_string.xml b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatService_view/my_query_url_string.xml new file mode 100644 index 0000000000000000000000000000000000000000..26fd0194e3caad43083d8d7e6b4f97abb08514c0 --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatService_view/my_query_url_string.xml @@ -0,0 +1,304 @@ + + + + + + + + + + id + my_query_url_string + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + not_link + The specified link is broken. + + + required_not_found + Input is required but no input given. + + + too_long + Too much input was given. + + + + + + overrides + + + + alternate_name + + + + check_link + + + + check_timeout + + + + css_class + + + + default + + + + description + + + + display_maxwidth + + + + display_width + + + + editable + + + + enabled + + + + external_validator + + + + extra + + + + hidden + + + + link_type + + + + max_length + + + + required + + + + title + + + + truncate + + + + unicode + + + + whitespace_preserve + + + + + + + tales + + + + alternate_name + + + + check_link + + + + check_timeout + + + + css_class + + + + default + + + + description + + + + display_maxwidth + + + + display_width + + + + editable + + + + enabled + + + + external_validator + + + + extra + + + + hidden + + + + link_type + + + + max_length + + + + required + + + + title + + + + truncate + + + + unicode + + + + whitespace_preserve + + + + + + + values + + + + alternate_name + + + + check_link + 0 + + + check_timeout + 7.0 + + + css_class + + + + default + + + + description + + + + display_maxwidth + + + + display_width + 20 + + + editable + 1 + + + enabled + 1 + + + external_validator + + + + extra + + + + hidden + 0 + + + input_type + text + + + link_type + external + + + max_length + + + + required + 0 + + + title + Wechat Query URL + + + truncate + 0 + + + unicode + 0 + + + whitespace_preserve + 0 + + + + + + + + diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatService_view/my_reference.xml b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatService_view/my_reference.xml new file mode 100644 index 0000000000000000000000000000000000000000..049c218f9595b7b6a5cf4cf00203b11876379f02 --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatService_view/my_reference.xml @@ -0,0 +1,96 @@ + + + + + + + + + + delegated_list + + + title + + + + + id + my_reference + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + + + + overrides + + + + field_id + + + + form_id + + + + target + + + + + + + tales + + + + field_id + + + + form_id + + + + target + + + + + + + values + + + + field_id + my_string_field + + + form_id + Base_viewFieldLibrary + + + target + Click to edit the target + + + title + Reference + + + + + + + + diff --git a/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatService_view/my_title.xml b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatService_view/my_title.xml new file mode 100644 index 0000000000000000000000000000000000000000..679b18bb42fe38607b2c06711a0f961423313917 --- /dev/null +++ b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatService_view/my_title.xml @@ -0,0 +1,96 @@ + + + + + + + + + + delegated_list + + + title + + + + + id + my_title + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + + + + overrides + + + + field_id + + + + form_id + + + + target + + + + + + + tales + + + + field_id + + + + form_id + + + + target + + + + + + + values + + + + field_id + my_string_field + + + form_id + Base_viewFieldLibrary + + + target + Click to edit the target + + + title + Title + + + + + + + + diff --git a/master/bt5/slapos_wechat/TestTemplateItem/portal_components/test.erp5.testERP5WechatSecurePayment.py b/master/bt5/slapos_wechat/TestTemplateItem/portal_components/test.erp5.testERP5WechatSecurePayment.py new file mode 100644 index 0000000000000000000000000000000000000000..81afc7e1da4665af1df60bbe31718dd2f179658e --- /dev/null +++ b/master/bt5/slapos_wechat/TestTemplateItem/portal_components/test.erp5.testERP5WechatSecurePayment.py @@ -0,0 +1,60 @@ +############################################################################## +# +# Copyright (c) 2002-2011 Nexedi SA and Contributors. All Rights Reserved. +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsibility of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# guarantees and support are strongly advised to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +############################################################################## + +from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase + +class TestERP5WechatSecurePayment(ERP5TypeTestCase): + """ + An ERP5 Wechat Secure Payment test case + """ + + def getTitle(self): + return "ERP5 Wechat Secure Payment" + + def afterSetUp(self): + pass + + def test_submit_wechat_order(self): + self.portal = self.getPortalObject() + # '20190925-226AD' is the trade number which submitted to the wechat server manually + # Use this to check our query function + # TODO: + # - Move wechat urls to slapos_vifib/ERP5Site_getWechatPaymentConfiguration.py + # - Add fake urls in slapos_subscription_request/ERP5Site_getWechatPaymentConfiguration.py + # Mock the wechat call + + + # return_code = self.portal.Base_getWechatCodeURL('23456789-AAAAA', 1, 1) + # self.assertEqual(return_code[:14], 'weixin://wxpay/') + + + def test_query_wechat_order(self): + self.portal = self.getPortalObject() + # '20190925-226AD' is the trade number which submitted to the wechat server manually + # Use this to check our query function + return_code = self.portal.Base_queryWechatOrderStatusByTradeNo(trade_no='20190925-226AD') + self.assertEqual(return_code, 'SUCCESS') diff --git a/master/bt5/slapos_wechat/TestTemplateItem/portal_components/test.erp5.testERP5WechatSecurePayment.xml b/master/bt5/slapos_wechat/TestTemplateItem/portal_components/test.erp5.testERP5WechatSecurePayment.xml new file mode 100644 index 0000000000000000000000000000000000000000..4b0cf361eb51c0349c4863b794dbcdec9d2aa634 --- /dev/null +++ b/master/bt5/slapos_wechat/TestTemplateItem/portal_components/test.erp5.testERP5WechatSecurePayment.xml @@ -0,0 +1,124 @@ + + + + + + + + + + _recorded_property_dict + + AAAAAAAAAAI= + + + + default_reference + testERP5WechatSecurePayment + + + description + + + + + + id + test.erp5.testERP5WechatSecurePayment + + + portal_type + Test Component + + + sid + + + + + + text_content_error_message + + + + + + text_content_warning_message + + + + + + version + erp5 + + + workflow_history + + AAAAAAAAAAM= + + + + + + + + + + + + + data + + + + + + + + + + + + + + + data + + + + component_validation_workflow + + AAAAAAAAAAQ= + + + + + + + + + + + + + + + + + + + action + validate + + + validation_state + validated + + + + + + + + diff --git a/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow.xml b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow.xml new file mode 100644 index 0000000000000000000000000000000000000000..b8b092cff54eed8aed32a280ed1d27b5e81d55c0 --- /dev/null +++ b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow.xml @@ -0,0 +1,60 @@ + + + + + + + + + + _objects + + + + + + creation_guard + + + + + + description + + + + groups + + + + + + id + wechat_interface_workflow + + + initial_state + draft + + + manager_bypass + 0 + + + permissions + + + + + + state_var + wechat_state + + + title + Wechat Interface Workflow + + + + + diff --git a/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts.xml b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts.xml new file mode 100644 index 0000000000000000000000000000000000000000..072c8f6540c07806bee17a34c920ec09b2de1bd5 --- /dev/null +++ b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts.xml @@ -0,0 +1,28 @@ + + + + + + + + + + _mapping + + + + + + _objects + + + + + + id + scripts + + + + + diff --git a/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_callWechatServiceNavigation.py b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_callWechatServiceNavigation.py new file mode 100644 index 0000000000000000000000000000000000000000..46a33806cca50af4fbe23ecfc811e06238e238ea --- /dev/null +++ b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_callWechatServiceNavigation.py @@ -0,0 +1,9 @@ +from DateTime import DateTime +wechat_event = state_change['object'] + +payment_service = wechat_event.getSourceValue(portal_type="Wechat Service") +return payment_service.navigate( + page_template='wechat_event', + pay='Click to pay', + # payzen_dict=payzen_dict, +) diff --git a/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_callWechatServiceNavigation.xml b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_callWechatServiceNavigation.xml new file mode 100644 index 0000000000000000000000000000000000000000..41a2603671cfc5815ab7d029892c81446d3fc1d8 --- /dev/null +++ b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_callWechatServiceNavigation.xml @@ -0,0 +1,70 @@ + + + + + + + + + + Script_magic + 3 + + + _bind_names + + + + + + + + + + _asgns + + + + name_container + container + + + name_context + context + + + name_m_self + script + + + name_subpath + traverse_subpath + + + + + + + + + + + _params + state_change, payzen_dict + + + _proxy_roles + + + Manager + + + + + id + WechatEvent_callWechatServiceNavigation + + + + + diff --git a/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_generateNavigationPage.py b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_generateNavigationPage.py new file mode 100644 index 0000000000000000000000000000000000000000..1c9b152034d2d6f463ecf7ddda530615943c8952 --- /dev/null +++ b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_generateNavigationPage.py @@ -0,0 +1,54 @@ +from DateTime import DateTime +wechat_event = state_change['object'] +''' +# Get required arguments +kwargs = state_change.kwargs + +# Required args +# Raise TypeError if all parameters are not provided +try: + vads_url_cancel = kwargs['vads_url_cancel'] + vads_url_error = kwargs['vads_url_error'] + vads_url_referral = kwargs['vads_url_referral'] + vads_url_refused = kwargs['vads_url_refused'] + vads_url_success = kwargs['vads_url_success'] + vads_url_return = kwargs['vads_url_return'] +except KeyError: + raise TypeError, "WechatEvent_generateNavigationPage takes exactly 6 arguments" + +payment_transaction = wechat_event.getDestinationValue(portal_type="Payment Transaction") +now = DateTime() +payment_transaction.AccountingTransaction_updateStartDate(now) + +transaction_date, transaction_id = payment_transaction.PaymentTransaction_generatePayzenId() +if transaction_id is None: + raise ValueError, "Transaction already registered" + +today = now.toZone('UTC').asdatetime().strftime('%Y%m%d') +payzen_dict = { + 'vads_currency': 'currency_module/EUR', # payment_transaction.getResourceValue().Currency_getIntegrationMapping(), + 'vads_amount': str(int(round((payment_transaction.PaymentTransaction_getTotalPayablePrice() * -100), 0))), + 'vads_trans_date': now.toZone('UTC').asdatetime().strftime('%Y%m%d%H%M%S'), + 'vads_trans_id': transaction_id, + 'vads_language': 'en', + 'vads_url_cancel': vads_url_cancel, + 'vads_url_error': vads_url_error, + 'vads_url_referral': vads_url_referral, + 'vads_url_refused': vads_url_refused, + 'vads_url_success': vads_url_success, + 'vads_url_return': vads_url_return, +} +''' +# XXX +# html_document = context.WechatEvent_callWechatServiceNavigation(state_change, payzen_dict) + +''' +wechat_event.newContent( + title='Shown Page', + portal_type='Wechat Event Message', + text_content="XXX", #html_document, +) + +wechat_event.confirm() +wechat_event.acknowledge(comment='Automatic acknowledge as result of correct communication') +''' diff --git a/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_generateNavigationPage.xml b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_generateNavigationPage.xml new file mode 100644 index 0000000000000000000000000000000000000000..c6e14e067c7116a3993e135fb087018c9b37501e --- /dev/null +++ b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_generateNavigationPage.xml @@ -0,0 +1,62 @@ + + + + + + + + + + Script_magic + 3 + + + _bind_names + + + + + + + + + + _asgns + + + + name_container + container + + + name_context + context + + + name_m_self + script + + + name_subpath + traverse_subpath + + + + + + + + + + + _params + state_change + + + id + WechatEvent_generateNavigationPage + + + + + diff --git a/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_registerWechat.py b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_registerWechat.py new file mode 100644 index 0000000000000000000000000000000000000000..2390ef1fd21dcadeda73a0c5ee3500eaf2cc776e --- /dev/null +++ b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_registerWechat.py @@ -0,0 +1,35 @@ +"""Registers current transaction in payment + +In order to not transmit sensitive information the registration is done by looking the newest +payzen related transaction for destination_section and doing its duplicate""" + +from DateTime import DateTime +wechat_event = state_change['object'] +transaction = wechat_event.getDestinationValue() +payment_service = wechat_event.getSourceValue(portal_type="Wechat Service") + +previous_id = transaction.PaymentTransaction_getPreviousPayzenId() +if previous_id is None: + wechat_event.confirm(comment='No previous id found') + return + +transaction_date, transaction_id = transaction.PaymentTransaction_generatePayzenId() +if transaction_id is None: + raise ValueError('Transaction already mapped in integration tool.') + +# do causality mapping in integration_site between transaction.getRelativeUrl and today + transaction_id +payzen_dict = {} +payzen_dict.update( + devise=transaction.getResourceValue().Currency_getIntegrationMapping(), + amount=str(int(round((transaction.PaymentTransaction_getTotalPayablePrice() * -100), 0))), + presentationDate=transaction.getStartDate().toZone('UTC').asdatetime(), + newTransactionId=transaction_id, + transmissionDate=transaction_date.asdatetime(), + transactionId=previous_id +) + +data_kw, signature, sent_text, received_text = payment_service.soap_duplicate(**payzen_dict) + +sent = wechat_event.newContent(title='Sent SOAP', portal_type='Wechat Event Message', text_content=sent_text) +received = wechat_event.newContent(title='Received SOAP', text_content=received_text, predecessor_value=sent, portal_type='Wechat Event Message') +context.WechatEvent_processUpdate(state_change, data_kw, signature) diff --git a/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_registerWechat.xml b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_registerWechat.xml new file mode 100644 index 0000000000000000000000000000000000000000..0f3e2f15e88fe23be21eaa51876907068e955c49 --- /dev/null +++ b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_registerWechat.xml @@ -0,0 +1,62 @@ + + + + + + + + + + Script_magic + 3 + + + _bind_names + + + + + + + + + + _asgns + + + + name_container + container + + + name_context + context + + + name_m_self + script + + + name_subpath + traverse_subpath + + + + + + + + + + + _params + state_change + + + id + WechatEvent_registerWechat + + + + + diff --git a/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_updateStatus.py b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_updateStatus.py new file mode 100644 index 0000000000000000000000000000000000000000..697a4e68ae7eeb6709c81cfeeaa29da998724c5c --- /dev/null +++ b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_updateStatus.py @@ -0,0 +1,24 @@ +wechat_event = state_change['object'] +raise NotImplementedError(wechat_event, "In WechatEvent_updateStatus") +payment_transaction = wechat_event.getDestinationValue(portal_type="Payment Transaction") +portal = payment_transaction.getPortalObject() + +transaction_date, transaction_id = payment_transaction.PaymentTransaction_getPayzenId() +if transaction_id is None: + raise ValueError('Transaction not registered in wechat integration tool') + +payment_service = wechat_event.getSourceValue(portal_type="Wechat Service") +data_kw, signature, sent_text, received_text = payment_service.soap_getInfo( + transaction_date.toZone('UTC').asdatetime(), + transaction_id) + +sent = wechat_event.newContent( + title='Sent SOAP', + portal_type='Wechat Event Message', + text_content=sent_text) +received = wechat_event.newContent( + title='Received SOAP', + portal_type='Wechat Event Message', + text_content=received_text, + predecessor_value=sent) +wechat_event.WechatEvent_processUpdate(data_kw, signature) diff --git a/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_updateStatus.xml b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_updateStatus.xml new file mode 100644 index 0000000000000000000000000000000000000000..80e0c7766548f06536bad90c0e8e5b1a9d4cca16 --- /dev/null +++ b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_updateStatus.xml @@ -0,0 +1,62 @@ + + + + + + + + + + Script_magic + 3 + + + _bind_names + + + + + + + + + + _asgns + + + + name_container + container + + + name_context + context + + + name_m_self + script + + + name_subpath + traverse_subpath + + + + + + + + + + + _params + state_change + + + id + WechatEvent_updateStatus + + + + + diff --git a/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/states.xml b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/states.xml new file mode 100644 index 0000000000000000000000000000000000000000..27ec9069024e0f59bf4b612113789f37da98879b --- /dev/null +++ b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/states.xml @@ -0,0 +1,28 @@ + + + + + + + + + + _mapping + + + + + + _objects + + + + + + id + states + + + + + diff --git a/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/states/draft.xml b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/states/draft.xml new file mode 100644 index 0000000000000000000000000000000000000000..e3a960be2515e17eed226a0e0448515cfd5b99f8 --- /dev/null +++ b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/states/draft.xml @@ -0,0 +1,39 @@ + + + + + + + + + + description + + + + id + draft + + + title + Draft + + + transitions + + + generate_wechat_payment_page + update_status + + + + + type_list + + + + + + + + diff --git a/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/transitions.xml b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/transitions.xml new file mode 100644 index 0000000000000000000000000000000000000000..aa36144efed916b804f5f80df9452b1e3166bdec --- /dev/null +++ b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/transitions.xml @@ -0,0 +1,28 @@ + + + + + + + + + + _mapping + + + + + + _objects + + + + + + id + transitions + + + + + diff --git a/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/transitions/generate_wechat_payment_page.xml b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/transitions/generate_wechat_payment_page.xml new file mode 100644 index 0000000000000000000000000000000000000000..15f5b51a5cddf7a829fdc20400a6f4458fdd11fe --- /dev/null +++ b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/transitions/generate_wechat_payment_page.xml @@ -0,0 +1,62 @@ + + + + + + + + + + actbox_category + workflow + + + actbox_icon + + + + actbox_name + + + + actbox_url + + + + after_script_name + WechatEvent_generateNavigationPage + + + description + + + + guard + + + + + + id + generate_wechat_payment_page + + + new_state_id + + + + script_name + + + + title + + + + trigger_type + 2 + + + + + diff --git a/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/transitions/register_payzen.xml b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/transitions/register_payzen.xml new file mode 100644 index 0000000000000000000000000000000000000000..bed59b72b702843588453c9d52a95330d69110bc --- /dev/null +++ b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/transitions/register_payzen.xml @@ -0,0 +1,62 @@ + + + + + + + + + + actbox_category + workflow + + + actbox_icon + + + + actbox_name + + + + actbox_url + + + + after_script_name + WechatEvent_registerWechat + + + description + + + + guard + + + + + + id + register_payzen + + + new_state_id + + + + script_name + + + + title + + + + trigger_type + 2 + + + + + diff --git a/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/transitions/update_status.xml b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/transitions/update_status.xml new file mode 100644 index 0000000000000000000000000000000000000000..dd468baa3d877d936abdcb75f3d49fc31f7b65bc --- /dev/null +++ b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/transitions/update_status.xml @@ -0,0 +1,62 @@ + + + + + + + + + + actbox_category + workflow + + + actbox_icon + + + + actbox_name + + + + actbox_url + + + + after_script_name + WechatEvent_updateStatus + + + description + + + + guard + + + + + + id + update_status + + + new_state_id + + + + script_name + + + + title + + + + trigger_type + 2 + + + + + diff --git a/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/variables.xml b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/variables.xml new file mode 100644 index 0000000000000000000000000000000000000000..bb12bef805f190ec50e023368d6ee5c6c990b816 --- /dev/null +++ b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/variables.xml @@ -0,0 +1,28 @@ + + + + + + + + + + _mapping + + + + + + _objects + + + + + + id + variables + + + + + diff --git a/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/variables/action.xml b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/variables/action.xml new file mode 100644 index 0000000000000000000000000000000000000000..bb5af22d393b9d5705b4db17eab482f3c69afa35 --- /dev/null +++ b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/variables/action.xml @@ -0,0 +1,61 @@ + + + + + + + + + + default_expr + + AAAAAAAAAAI= + + + + default_value + + + + description + Transition id + + + for_catalog + 0 + + + for_status + 1 + + + id + action + + + info_guard + + + + + + update_always + 1 + + + + + + + + + + + + text + transition/getId|nothing + + + + + diff --git a/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/variables/actor.xml b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/variables/actor.xml new file mode 100644 index 0000000000000000000000000000000000000000..8fc1574d2524cc86b5429fb6930d67c56e2157a1 --- /dev/null +++ b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/variables/actor.xml @@ -0,0 +1,61 @@ + + + + + + + + + + default_expr + + AAAAAAAAAAI= + + + + default_value + + + + description + Name of the user who performed transition + + + for_catalog + 0 + + + for_status + 1 + + + id + actor + + + info_guard + + + + + + update_always + 1 + + + + + + + + + + + + text + user/getUserName + + + + + diff --git a/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/variables/comment.xml b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/variables/comment.xml new file mode 100644 index 0000000000000000000000000000000000000000..fda919ee8613b8374150500ddfd080ca5d68d7bd --- /dev/null +++ b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/variables/comment.xml @@ -0,0 +1,61 @@ + + + + + + + + + + default_expr + + AAAAAAAAAAI= + + + + default_value + + + + description + Comment about transition + + + for_catalog + 0 + + + for_status + 1 + + + id + comment + + + info_guard + + + + + + update_always + 1 + + + + + + + + + + + + text + python:state_change.kwargs.get(\'comment\', \'\') + + + + + diff --git a/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/variables/error_message.xml b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/variables/error_message.xml new file mode 100644 index 0000000000000000000000000000000000000000..535863de2a26221cff2a356674852ea83bcee061 --- /dev/null +++ b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/variables/error_message.xml @@ -0,0 +1,48 @@ + + + + + + + + + + default_expr + + + + + + default_value + + + + description + Error message if validation failed + + + for_catalog + 0 + + + for_status + 1 + + + id + error_message + + + info_guard + + + + + + update_always + 1 + + + + + diff --git a/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/variables/history.xml b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/variables/history.xml new file mode 100644 index 0000000000000000000000000000000000000000..44306b76d7460536661dc87f7786d58d071917d2 --- /dev/null +++ b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/variables/history.xml @@ -0,0 +1,61 @@ + + + + + + + + + + default_expr + + AAAAAAAAAAI= + + + + default_value + + + + description + Provides access to workflow history + + + for_catalog + 0 + + + for_status + 0 + + + id + history + + + info_guard + + + + + + update_always + 0 + + + + + + + + + + + + text + state_change/getHistory + + + + + diff --git a/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/variables/portal_type.xml b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/variables/portal_type.xml new file mode 100644 index 0000000000000000000000000000000000000000..89576a7a56ae4e16ceb1cf44e2f9ff9e2ff85f3f --- /dev/null +++ b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/variables/portal_type.xml @@ -0,0 +1,48 @@ + + + + + + + + + + default_expr + + + + + + default_value + + + + description + Portal type (used as filter for worklists) + + + for_catalog + 1 + + + for_status + 0 + + + id + portal_type + + + info_guard + + + + + + update_always + 0 + + + + + diff --git a/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/variables/time.xml b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/variables/time.xml new file mode 100644 index 0000000000000000000000000000000000000000..0d2d8d7e22159b7b4db1fe60eea58cb239a5105a --- /dev/null +++ b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/variables/time.xml @@ -0,0 +1,61 @@ + + + + + + + + + + default_expr + + AAAAAAAAAAI= + + + + default_value + + + + description + Transition timestamp + + + for_catalog + 0 + + + for_status + 1 + + + id + time + + + info_guard + + + + + + update_always + 1 + + + + + + + + + + + + text + state_change/getDateTime + + + + + diff --git a/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/worklists.xml b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/worklists.xml new file mode 100644 index 0000000000000000000000000000000000000000..c3432aa051eac2d67ec0692a384adb38d1b6bac8 --- /dev/null +++ b/master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/worklists.xml @@ -0,0 +1,22 @@ + + + + + + + + + + _mapping + + + + + + id + worklists + + + + + diff --git a/master/bt5/slapos_wechat/bt/template_action_path_list b/master/bt5/slapos_wechat/bt/template_action_path_list new file mode 100644 index 0000000000000000000000000000000000000000..124441b1e7316f9341922a85d35924583897c66d --- /dev/null +++ b/master/bt5/slapos_wechat/bt/template_action_path_list @@ -0,0 +1,2 @@ +Wechat Event Message | view +Wechat Event | view \ No newline at end of file diff --git a/master/bt5/slapos_wechat/bt/template_extension_id_list b/master/bt5/slapos_wechat/bt/template_extension_id_list new file mode 100644 index 0000000000000000000000000000000000000000..a7b825090622b58ead02cb498b6696de640a14e7 --- /dev/null +++ b/master/bt5/slapos_wechat/bt/template_extension_id_list @@ -0,0 +1 @@ +extension.erp5.WechatUtils \ No newline at end of file diff --git a/master/bt5/slapos_wechat/bt/template_format_version b/master/bt5/slapos_wechat/bt/template_format_version new file mode 100644 index 0000000000000000000000000000000000000000..56a6051ca2b02b04ef92d5150c9ef600403cb1de --- /dev/null +++ b/master/bt5/slapos_wechat/bt/template_format_version @@ -0,0 +1 @@ +1 \ No newline at end of file diff --git a/master/bt5/slapos_wechat/bt/template_path_list b/master/bt5/slapos_wechat/bt/template_path_list new file mode 100644 index 0000000000000000000000000000000000000000..037b734a949c7cc6522871bd308d33fd2e254dbc --- /dev/null +++ b/master/bt5/slapos_wechat/bt/template_path_list @@ -0,0 +1,5 @@ +currency_module/CNY +portal_alarms/slapos_wechat_update_confirmed_payment +portal_alarms/slapos_wechat_update_started_payment +portal_secure_payments/slapos_wechat_test +portal_secure_payments/slapos_wechat_test/** \ No newline at end of file diff --git a/master/bt5/slapos_wechat/bt/template_portal_type_allowed_content_type_list b/master/bt5/slapos_wechat/bt/template_portal_type_allowed_content_type_list new file mode 100644 index 0000000000000000000000000000000000000000..71c6c97a4b6262d0727845f0196d01dfc0043298 --- /dev/null +++ b/master/bt5/slapos_wechat/bt/template_portal_type_allowed_content_type_list @@ -0,0 +1,2 @@ +System Event Module | Wechat Event +Wechat Event | Wechat Event Message \ No newline at end of file diff --git a/master/bt5/slapos_wechat/bt/template_portal_type_base_category_list b/master/bt5/slapos_wechat/bt/template_portal_type_base_category_list new file mode 100644 index 0000000000000000000000000000000000000000..d06a38c545216768e1776a6d2d3a77b78b55876c --- /dev/null +++ b/master/bt5/slapos_wechat/bt/template_portal_type_base_category_list @@ -0,0 +1,4 @@ +Wechat Event Message | predecessor +Wechat Event | destination +Wechat Event | destination_section +Wechat Event | source \ No newline at end of file diff --git a/master/bt5/slapos_wechat/bt/template_portal_type_id_list b/master/bt5/slapos_wechat/bt/template_portal_type_id_list new file mode 100644 index 0000000000000000000000000000000000000000..f0765503beadfa602159599528baa30efc26f295 --- /dev/null +++ b/master/bt5/slapos_wechat/bt/template_portal_type_id_list @@ -0,0 +1,3 @@ +Wechat Event +Wechat Event Message +Wechat Service \ No newline at end of file diff --git a/master/bt5/slapos_wechat/bt/template_portal_type_property_sheet_list b/master/bt5/slapos_wechat/bt/template_portal_type_property_sheet_list new file mode 100644 index 0000000000000000000000000000000000000000..1b13839a4a45958b3f3dabf0fe6938c59242e525 --- /dev/null +++ b/master/bt5/slapos_wechat/bt/template_portal_type_property_sheet_list @@ -0,0 +1 @@ +Wechat Event Message | TextDocument \ No newline at end of file diff --git a/master/bt5/slapos_wechat/bt/template_portal_type_workflow_chain_list b/master/bt5/slapos_wechat/bt/template_portal_type_workflow_chain_list new file mode 100644 index 0000000000000000000000000000000000000000..485dfa18fc20ada3fc5a87a8c657e7b7bc664266 --- /dev/null +++ b/master/bt5/slapos_wechat/bt/template_portal_type_workflow_chain_list @@ -0,0 +1,4 @@ +Wechat Event Message | edit_workflow +Wechat Event | edit_workflow +Wechat Event | system_event_workflow +Wechat Event | wechat_interface_workflow \ No newline at end of file diff --git a/master/bt5/slapos_wechat/bt/template_property_sheet_id_list b/master/bt5/slapos_wechat/bt/template_property_sheet_id_list new file mode 100644 index 0000000000000000000000000000000000000000..d65b323a10799199339a53fc232cb02547b2407c --- /dev/null +++ b/master/bt5/slapos_wechat/bt/template_property_sheet_id_list @@ -0,0 +1 @@ +SlapOSPayzenSystemPreference \ No newline at end of file diff --git a/master/bt5/slapos_wechat/bt/template_skin_id_list b/master/bt5/slapos_wechat/bt/template_skin_id_list new file mode 100644 index 0000000000000000000000000000000000000000..b261d3fee6befd0f09baba72944f67741394ce9b --- /dev/null +++ b/master/bt5/slapos_wechat/bt/template_skin_id_list @@ -0,0 +1 @@ +slapos_wechat \ No newline at end of file diff --git a/master/bt5/slapos_wechat/bt/template_test_id_list b/master/bt5/slapos_wechat/bt/template_test_id_list new file mode 100644 index 0000000000000000000000000000000000000000..d410f28691675fab7ef6d13b426dfb25e1b34d6f --- /dev/null +++ b/master/bt5/slapos_wechat/bt/template_test_id_list @@ -0,0 +1 @@ +test.erp5.testERP5WechatSecurePayment \ No newline at end of file diff --git a/master/bt5/slapos_wechat/bt/template_workflow_id_list b/master/bt5/slapos_wechat/bt/template_workflow_id_list new file mode 100644 index 0000000000000000000000000000000000000000..6cc404ff79070010b2ebc5ba4ec85d3976d12ace --- /dev/null +++ b/master/bt5/slapos_wechat/bt/template_workflow_id_list @@ -0,0 +1 @@ +wechat_interface_workflow \ No newline at end of file diff --git a/master/bt5/slapos_wechat/bt/title b/master/bt5/slapos_wechat/bt/title new file mode 100644 index 0000000000000000000000000000000000000000..b261d3fee6befd0f09baba72944f67741394ce9b --- /dev/null +++ b/master/bt5/slapos_wechat/bt/title @@ -0,0 +1 @@ +slapos_wechat \ No newline at end of file