From 406cb85e00d763dfd7ae58d90669f8139c8ef527 Mon Sep 17 00:00:00 2001 From: Boxiang Sun Date: Fri, 27 Sep 2019 12:10:20 +0200 Subject: [PATCH 01/11] slapos_subscription_request: Add Wechat payment support --- .../slapos_wechat_pre_payment_template.xml | 211 ++++++++++++++++++ .../slapos_wechat_pre_payment_template/1.xml | 51 +++++ .../slapos_wechat_pre_payment_template/2.xml | 51 +++++ ..._subscription_sale_invoice_transaction.xml | 210 +++++++++++++++++ .../1.xml | 121 ++++++++++ ...iptionRequestModule_requestSubscription.py | 2 +- ...ptionRequestModule_requestSubscription.xml | 2 +- ...nRequestModule_requestSubscriptionProxy.py | 29 ++- ...RequestModule_requestSubscriptionProxy.xml | 2 +- ...est_createRelatedSaleInvoiceTransaction.py | 5 +- ...st_createRelatedSaleInvoiceTransaction.xml | 2 +- ...iptionRequest_requestPaymentTransaction.py | 14 +- ...ptionRequest_requestPaymentTransaction.xml | 2 +- ...5.testSlapOSSubscriptionChineseScenario.py | 2 +- .../bt/dependency_list | 1 + .../bt/template_path_list | 4 + 16 files changed, 691 insertions(+), 18 deletions(-) create mode 100644 master/bt5/slapos_subscription_request/PathTemplateItem/accounting_module/slapos_wechat_pre_payment_template.xml create mode 100644 master/bt5/slapos_subscription_request/PathTemplateItem/accounting_module/slapos_wechat_pre_payment_template/1.xml create mode 100644 master/bt5/slapos_subscription_request/PathTemplateItem/accounting_module/slapos_wechat_pre_payment_template/2.xml create mode 100644 master/bt5/slapos_subscription_request/PathTemplateItem/accounting_module/template_wechat_pre_payment_subscription_sale_invoice_transaction.xml create mode 100644 master/bt5/slapos_subscription_request/PathTemplateItem/accounting_module/template_wechat_pre_payment_subscription_sale_invoice_transaction/1.xml create mode 100644 master/bt5/slapos_subscription_request/bt/dependency_list 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 000000000..da77c4124 --- /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 000000000..f2e7b36c8 --- /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 000000000..a0c51ae14 --- /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 000000000..5d513bb39 --- /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 000000000..6b012d39e --- /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_requestSubscription.py b/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequestModule_requestSubscription.py index 1d0285a5f..ba3013ba6 100644 --- a/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequestModule_requestSubscription.py +++ b/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequestModule_requestSubscription.py @@ -19,6 +19,6 @@ user_input_dict = { "amount" : amount} return context.SubscriptionRequestModule_requestSubscriptionProxy( - default_email_text, subscription_reference, + default_email_text, subscription_reference, payment_mode, confirmation_required=bool(confirmation_required), user_input_dict=user_input_dict, batch_mode=0) diff --git a/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequestModule_requestSubscription.xml b/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequestModule_requestSubscription.xml index 0e62c7fc1..c508058e9 100644 --- a/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequestModule_requestSubscription.xml +++ b/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequestModule_requestSubscription.xml @@ -50,7 +50,7 @@ _params - name=None, default_email_text=None, subscription_reference=None, amount=0, confirmation_required=True, REQUEST=None, **kw + name=None, default_email_text=None, payment_mode=None, subscription_reference=None, amount=0, confirmation_required=True, REQUEST=None, **kw id 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 435c654a8..2bd406181 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 @@ -7,15 +7,16 @@ if REQUEST is not None: person, person_is_new = context.SubscriptionRequest_createUser(email, user_input_dict['name']) web_site = context.getWebSiteValue() -# Check if user is already exist, otherwise redirect to ask confirmation -if confirmation_required and not person_is_new: + +# if payment mode not selected, ask user to confirm and select one. +if not payment_mode: base_url = web_site.absolute_url() return context.REQUEST.RESPONSE.redirect( "%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)) @@ -27,21 +28,37 @@ subscription_request = context.subscription_request_module.newContent( subscription_request.setDefaultEmailText(email) -def wrapWithShadow(subscription_request, amount, subscription_reference): +def wrapWithShadow(subscription_request, amount, subscription_reference, payment_mode): 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()) + tag="subscription_%s" % subscription_request.getId(), payment_mode=payment_mode) payment = person.Person_restrictMethodAsShadowUser( shadow_document=person, callable_object=wrapWithShadow, - argument_list=[subscription_request, user_input_dict["amount"], subscription_reference]) + argument_list=[subscription_request, user_input_dict["amount"], subscription_reference, payment_mode]) if batch_mode: return {'subscription' : subscription_request.getRelativeUrl(), 'payment': payment.getRelativeUrl() } +def wrapGetPriceWithShadow(payment): + return payment.PaymentTransaction_getTotalPayablePrice() + +price = person.Person_restrictMethodAsShadowUser( + shadow_document=person, + callable_object=wrapGetPriceWithShadow, + argument_list=[payment,]) + +if payment_mode == "wechat": + 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_redirectToManualPayzenPayment(web_site) diff --git a/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequestModule_requestSubscriptionProxy.xml b/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequestModule_requestSubscriptionProxy.xml index a0b742784..691c6c3d9 100644 --- a/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequestModule_requestSubscriptionProxy.xml +++ b/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequestModule_requestSubscriptionProxy.xml @@ -50,7 +50,7 @@ _params - email, subscription_reference, confirmation_required=False, user_input_dict={}, batch_mode=True, REQUEST=None + email, subscription_reference, payment_mode=None, confirmation_required=False, user_input_dict={}, batch_mode=True, REQUEST=None _proxy_roles 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 8062b7106..ce41add68 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,10 @@ portal = context.getPortalObject() current_invoice = context.getCausalityValue() if current_invoice is None: - invoice_template_path = "accounting_module/template_pre_payment_subscription_sale_invoice_transaction" + if payment_mode == "wechat": + 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_createRelatedSaleInvoiceTransaction.xml b/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_createRelatedSaleInvoiceTransaction.xml index 4f3579ba3..a25ae71c2 100644 --- a/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_createRelatedSaleInvoiceTransaction.xml +++ b/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_createRelatedSaleInvoiceTransaction.xml @@ -50,7 +50,7 @@ _params - amount, tag, payment, REQUEST=None + amount, tag, payment, payment_mode=None, REQUEST=None _proxy_roles 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 45015ecc2..9fbca5e4c 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,13 @@ 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 + if payment_mode == "wechat": + 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 +27,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) @@ -39,6 +43,6 @@ if current_invoice is None: context.reindexObject(activate_kw={'tag': tag}) context.activate(tag=tag).SubscriptionRequest_createRelatedSaleInvoiceTransaction( - amount, tag, current_payment.getRelativeUrl()) + amount, tag, current_payment.getRelativeUrl(), payment_mode) return current_payment diff --git a/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_requestPaymentTransaction.xml b/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_requestPaymentTransaction.xml index 956b550bc..df60f1049 100644 --- a/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_requestPaymentTransaction.xml +++ b/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_requestPaymentTransaction.xml @@ -50,7 +50,7 @@ _params - amount, tag, REQUEST=None + amount, tag, payment_mode=None, REQUEST=None _proxy_roles 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 4010e3eac..74d91a30d 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 000000000..b261d3fee --- /dev/null +++ b/master/bt5/slapos_subscription_request/bt/dependency_list @@ -0,0 +1 @@ +slapos_wechat \ 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 b20e80c41..ee90a8575 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 -- 2.30.9 From c1799cde010b93081eb144134e43f8b2bfd88347 Mon Sep 17 00:00:00 2001 From: Boxiang Sun Date: Fri, 27 Sep 2019 10:23:35 +0000 Subject: [PATCH 02/11] slapos_wechat: Add Wechat payment support --- .../extension.erp5.WechatUtils.py | 258 ++++++++++++++++++ .../extension.erp5.WechatUtils.xml | 124 +++++++++ .../portal_skins/slapos_wechat.xml | 47 ++++ .../Base_generateWechatQRCodeFromCodeURL.py | 2 + .../Base_generateWechatQRCodeFromCodeURL.xml | 62 +++++ .../slapos_wechat/Base_getWechatCodeURL.xml | 28 ++ .../Base_queryWechatOrderStatusByTradeNo.py | 4 + .../Base_queryWechatOrderStatusByTradeNo.xml | 62 +++++ .../Base_receiveWechatPaymentNotify.xml | 28 ++ .../ERP5Site_getWechatPaymentConfiguration.py | 1 + ...ERP5Site_getWechatPaymentConfiguration.xml | 62 +++++ .../ERP5Site_receiveWechatPaymentCallback.py | 16 ++ .../ERP5Site_receiveWechatPaymentCallback.xml | 62 +++++ .../test.erp5.testERP5WechatSecurePayment.py | 60 ++++ .../test.erp5.testERP5WechatSecurePayment.xml | 124 +++++++++ .../bt/template_extension_id_list | 1 + .../slapos_wechat/bt/template_format_version | 1 + .../slapos_wechat/bt/template_skin_id_list | 1 + .../slapos_wechat/bt/template_test_id_list | 1 + master/bt5/slapos_wechat/bt/title | 1 + 20 files changed, 945 insertions(+) create mode 100644 master/bt5/slapos_wechat/ExtensionTemplateItem/portal_components/extension.erp5.WechatUtils.py create mode 100644 master/bt5/slapos_wechat/ExtensionTemplateItem/portal_components/extension.erp5.WechatUtils.xml create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat.xml create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Base_generateWechatQRCodeFromCodeURL.py create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Base_generateWechatQRCodeFromCodeURL.xml create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Base_getWechatCodeURL.xml create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Base_queryWechatOrderStatusByTradeNo.py create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Base_queryWechatOrderStatusByTradeNo.xml create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Base_receiveWechatPaymentNotify.xml create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/ERP5Site_getWechatPaymentConfiguration.py create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/ERP5Site_getWechatPaymentConfiguration.xml create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/ERP5Site_receiveWechatPaymentCallback.py create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/ERP5Site_receiveWechatPaymentCallback.xml create mode 100644 master/bt5/slapos_wechat/TestTemplateItem/portal_components/test.erp5.testERP5WechatSecurePayment.py create mode 100644 master/bt5/slapos_wechat/TestTemplateItem/portal_components/test.erp5.testERP5WechatSecurePayment.xml create mode 100644 master/bt5/slapos_wechat/bt/template_extension_id_list create mode 100644 master/bt5/slapos_wechat/bt/template_format_version create mode 100644 master/bt5/slapos_wechat/bt/template_skin_id_list create mode 100644 master/bt5/slapos_wechat/bt/template_test_id_list create mode 100644 master/bt5/slapos_wechat/bt/title 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 000000000..0cd52cdf5 --- /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 000000000..ca05964b8 --- /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/SkinTemplateItem/portal_skins/slapos_wechat.xml b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat.xml new file mode 100644 index 000000000..a491691b3 --- /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/Base_generateWechatQRCodeFromCodeURL.py b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Base_generateWechatQRCodeFromCodeURL.py new file mode 100644 index 000000000..49cab6339 --- /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 000000000..933c90fb9 --- /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 000000000..4ba47f1db --- /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_queryWechatOrderStatusByTradeNo.py b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Base_queryWechatOrderStatusByTradeNo.py new file mode 100644 index 000000000..ad92e22c6 --- /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 000000000..a002b6a99 --- /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 000000000..066f792ae --- /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 000000000..a56470754 --- /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 000000000..5b7799f3a --- /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 000000000..437ae6367 --- /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 000000000..c756f1b22 --- /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/TestTemplateItem/portal_components/test.erp5.testERP5WechatSecurePayment.py b/master/bt5/slapos_wechat/TestTemplateItem/portal_components/test.erp5.testERP5WechatSecurePayment.py new file mode 100644 index 000000000..81afc7e1d --- /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 000000000..4b0cf361e --- /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/bt/template_extension_id_list b/master/bt5/slapos_wechat/bt/template_extension_id_list new file mode 100644 index 000000000..a7b825090 --- /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 000000000..56a6051ca --- /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_skin_id_list b/master/bt5/slapos_wechat/bt/template_skin_id_list new file mode 100644 index 000000000..b261d3fee --- /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 000000000..d410f2869 --- /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/title b/master/bt5/slapos_wechat/bt/title new file mode 100644 index 000000000..b261d3fee --- /dev/null +++ b/master/bt5/slapos_wechat/bt/title @@ -0,0 +1 @@ +slapos_wechat \ No newline at end of file -- 2.30.9 From c54dfddcca979788f4f6d4dd6e9a1cb475108105 Mon Sep 17 00:00:00 2001 From: Boxiang Sun Date: Mon, 30 Sep 2019 15:02:18 +0000 Subject: [PATCH 03/11] slapos_wechat: Wechat payment improvement --- ...updateWechatConfirmedPaymentTransaction.py | 12 + ...pdateWechatConfirmedPaymentTransaction.xml | 62 + ...m_updateWechatStartedPaymentTransaction.py | 11 + ..._updateWechatStartedPaymentTransaction.xml | 62 + .../Base_getWechatServiceRelativeUrl.py | 9 + .../Base_getWechatServiceRelativeUrl.xml | 70 + .../PaymentTransaction_createWechatEvent.py | 13 + .../PaymentTransaction_createWechatEvent.xml | 62 + ...mentTransaction_redirectToWechatPayment.py | 35 + ...entTransaction_redirectToWechatPayment.xml | 62 + .../PaymentTransaction_startWechatPayment.py | 9 + .../PaymentTransaction_startWechatPayment.xml | 62 + ...ntTransaction_updateWechatPaymentStatus.py | 13 + ...tTransaction_updateWechatPaymentStatus.xml | 62 + .../slapos_wechat/WechatEventMessage_view.xml | 157 ++ .../my_creation_date.xml | 2359 +++++++++++++++++ .../my_predecessor_title.xml | 120 + .../my_text_content.xml | 96 + .../WechatEventMessage_view/my_title.xml | 96 + .../slapos_wechat/WechatEvent_view.xml | 161 ++ .../WechatEvent_view/my_creation_date.xml | 2359 +++++++++++++++++ .../WechatEvent_view/my_destination_title.xml | 120 + .../WechatEvent_view/my_listbox.xml | 124 + .../WechatEvent_view/my_predecessor_title.xml | 120 + .../WechatEvent_view/my_source_title.xml | 125 + .../WechatEvent_view/my_title.xml | 101 + .../my_translated_validation_state_title.xml | 90 + .../my_translated_wechat_state_title.xml | 96 + 28 files changed, 6668 insertions(+) create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Alarm_updateWechatConfirmedPaymentTransaction.py create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Alarm_updateWechatConfirmedPaymentTransaction.xml create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Alarm_updateWechatStartedPaymentTransaction.py create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Alarm_updateWechatStartedPaymentTransaction.xml create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Base_getWechatServiceRelativeUrl.py create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Base_getWechatServiceRelativeUrl.xml create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_createWechatEvent.py create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_createWechatEvent.xml create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_redirectToWechatPayment.py create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_redirectToWechatPayment.xml create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_startWechatPayment.py create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_startWechatPayment.xml create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_updateWechatPaymentStatus.py create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_updateWechatPaymentStatus.xml create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEventMessage_view.xml create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEventMessage_view/my_creation_date.xml create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEventMessage_view/my_predecessor_title.xml create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEventMessage_view/my_text_content.xml create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEventMessage_view/my_title.xml create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEvent_view.xml create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEvent_view/my_creation_date.xml create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEvent_view/my_destination_title.xml create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEvent_view/my_listbox.xml create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEvent_view/my_predecessor_title.xml create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEvent_view/my_source_title.xml create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEvent_view/my_title.xml create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEvent_view/my_translated_validation_state_title.xml create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatEvent_view/my_translated_wechat_state_title.xml 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 000000000..f7c7589ff --- /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 000000000..0ec2f9673 --- /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 000000000..c3dc088a9 --- /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 000000000..71950bf5b --- /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_getWechatServiceRelativeUrl.py b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Base_getWechatServiceRelativeUrl.py new file mode 100644 index 000000000..4f65a7d06 --- /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 000000000..8da580d22 --- /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/PaymentTransaction_createWechatEvent.py b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_createWechatEvent.py new file mode 100644 index 000000000..25ce047bc --- /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': 'Payzen Event', + 'source': portal.Base_getPayzenServiceRelativeUrl(), + '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 000000000..1eee92998 --- /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 000000000..79cda2e59 --- /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, + ) + ''' + system_event.generateManualPaymentPage( + **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 000000000..3a2a249d4 --- /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 000000000..57769f4a4 --- /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 000000000..7fc20f7d0 --- /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 000000000..3f5a7a6c3 --- /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 000000000..35af430b1 --- /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 000000000..36e17dfd7 --- /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 000000000..d340e5b9d --- /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 000000000..1d44df9c7 --- /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 000000000..542f72c53 --- /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 000000000..679b18bb4 --- /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 000000000..89130e8b8 --- /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 000000000..d340e5b9d --- /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 000000000..0401f96f7 --- /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 000000000..3462c9621 --- /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 000000000..1d44df9c7 --- /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 000000000..4ccca6c62 --- /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 000000000..185e614bc --- /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 000000000..f8bf5216b --- /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 000000000..347915011 --- /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 + + + + + + + + -- 2.30.9 From ca4c3f93c0fe6e2da4b059af8025e7c2675be339 Mon Sep 17 00:00:00 2001 From: Boxiang Sun Date: Mon, 30 Sep 2019 15:53:09 +0000 Subject: [PATCH 04/11] slapos_wechat: Wechat payment improvement fixing --- .../PaymentTransaction_createWechatEvent.py | 4 +- ...mentTransaction_redirectToWechatPayment.py | 1 - .../slapos_wechat/WechatService_view.xml | 158 +++++++++ .../WechatService_view/listbox.xml | 186 +++++++++++ .../WechatService_view/my_link_url_string.xml | 304 ++++++++++++++++++ .../my_query_url_string.xml | 304 ++++++++++++++++++ .../WechatService_view/my_reference.xml | 96 ++++++ .../WechatService_view/my_title.xml | 96 ++++++ 8 files changed, 1146 insertions(+), 3 deletions(-) create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatService_view.xml create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatService_view/listbox.xml create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatService_view/my_link_url_string.xml create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatService_view/my_query_url_string.xml create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatService_view/my_reference.xml create mode 100644 master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/WechatService_view/my_title.xml 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 index 25ce047bc..aa0e6a30f 100644 --- 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 @@ -5,8 +5,8 @@ if REQUEST is not None: portal = context.getPortalObject() kw.update({ - 'portal_type': 'Payzen Event', - 'source': portal.Base_getPayzenServiceRelativeUrl(), + 'portal_type': 'Wechat Event', + 'source': portal.Base_getWechatServiceRelativeUrl(), 'destination_value': context, }) 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 index 79cda2e59..763adb7a9 100644 --- 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 @@ -20,7 +20,6 @@ def wrapWithShadow(payment_transaction, web_site, person_relative_url): **vads_url_dict ) ''' - return system_event.contentValues( portal_type="Wechat Event Message")[0].getTextContent() 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 000000000..83817303e --- /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 000000000..af4ecbfdb --- /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 000000000..11f627697 --- /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 000000000..26fd0194e --- /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 000000000..049c218f9 --- /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 000000000..679b18bb4 --- /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 + + + + + + + + -- 2.30.9 From 16cbbeda37158048c7f0076d6b75b1198d560526 Mon Sep 17 00:00:00 2001 From: Boxiang Sun Date: Wed, 2 Oct 2019 14:00:00 +0000 Subject: [PATCH 05/11] slapos_wechat: Wechat payment support improvement 2 --- .../Wechat%20Event%20Message/view.xml | 85 ++++++++++++ .../portal_types/Wechat%20Event/view.xml | 85 ++++++++++++ ...slapos_wechat_update_confirmed_payment.xml | 101 ++++++++++++++ .../slapos_wechat_update_started_payment.xml | 107 ++++++++++++++ .../slapos_wechat_test.xml | 95 +++++++++++++ .../slapos_wechat_test/default_link.xml | 30 ++++ .../allowed_content_types.xml | 8 ++ .../base_category_list.xml | 10 ++ .../property_sheet_list.xml | 5 + .../portal_types/Wechat%20Event%20Message.xml | 131 ++++++++++++++++++ .../portal_types/Wechat%20Event.xml | 131 ++++++++++++++++++ .../portal_types/Wechat%20Service.xml | 121 ++++++++++++++++ .../workflow_chain_type.xml | 10 ++ ...mentTransaction_redirectToWechatPayment.py | 15 +- .../wechat_interface_workflow.xml | 60 ++++++++ .../wechat_interface_workflow/scripts.xml | 28 ++++ ...WechatEvent_callWechatServiceNavigation.py | 9 ++ ...echatEvent_callWechatServiceNavigation.xml | 70 ++++++++++ .../WechatEvent_generateNavigationPage.py | 54 ++++++++ .../WechatEvent_generateNavigationPage.xml | 62 +++++++++ .../scripts/WechatEvent_registerWechat.py | 35 +++++ .../scripts/WechatEvent_registerWechat.xml | 62 +++++++++ .../scripts/WechatEvent_updateStatus.py | 24 ++++ .../scripts/WechatEvent_updateStatus.xml | 62 +++++++++ .../wechat_interface_workflow/states.xml | 28 ++++ .../states/draft.xml | 39 ++++++ .../wechat_interface_workflow/transitions.xml | 28 ++++ .../generate_wechat_payment_page.xml | 62 +++++++++ .../transitions/register_payzen.xml | 62 +++++++++ .../transitions/update_status.xml | 62 +++++++++ .../wechat_interface_workflow/variables.xml | 28 ++++ .../variables/action.xml | 61 ++++++++ .../variables/actor.xml | 61 ++++++++ .../variables/comment.xml | 61 ++++++++ .../variables/error_message.xml | 48 +++++++ .../variables/history.xml | 61 ++++++++ .../variables/portal_type.xml | 48 +++++++ .../variables/time.xml | 61 ++++++++ .../wechat_interface_workflow/worklists.xml | 22 +++ .../bt/template_action_path_list | 2 + .../bt5/slapos_wechat/bt/template_path_list | 4 + ...late_portal_type_allowed_content_type_list | 2 + .../template_portal_type_base_category_list | 4 + .../bt/template_portal_type_id_list | 3 + .../template_portal_type_property_sheet_list | 1 + .../template_portal_type_workflow_chain_list | 4 + .../bt/template_workflow_id_list | 1 + 47 files changed, 2146 insertions(+), 7 deletions(-) create mode 100644 master/bt5/slapos_wechat/ActionTemplateItem/portal_types/Wechat%20Event%20Message/view.xml create mode 100644 master/bt5/slapos_wechat/ActionTemplateItem/portal_types/Wechat%20Event/view.xml create mode 100644 master/bt5/slapos_wechat/PathTemplateItem/portal_alarms/slapos_wechat_update_confirmed_payment.xml create mode 100644 master/bt5/slapos_wechat/PathTemplateItem/portal_alarms/slapos_wechat_update_started_payment.xml create mode 100644 master/bt5/slapos_wechat/PathTemplateItem/portal_secure_payments/slapos_wechat_test.xml create mode 100644 master/bt5/slapos_wechat/PathTemplateItem/portal_secure_payments/slapos_wechat_test/default_link.xml create mode 100644 master/bt5/slapos_wechat/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml create mode 100644 master/bt5/slapos_wechat/PortalTypeBaseCategoryTemplateItem/base_category_list.xml create mode 100644 master/bt5/slapos_wechat/PortalTypePropertySheetTemplateItem/property_sheet_list.xml create mode 100644 master/bt5/slapos_wechat/PortalTypeTemplateItem/portal_types/Wechat%20Event%20Message.xml create mode 100644 master/bt5/slapos_wechat/PortalTypeTemplateItem/portal_types/Wechat%20Event.xml create mode 100644 master/bt5/slapos_wechat/PortalTypeTemplateItem/portal_types/Wechat%20Service.xml create mode 100644 master/bt5/slapos_wechat/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml create mode 100644 master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow.xml create mode 100644 master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts.xml create mode 100644 master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_callWechatServiceNavigation.py create mode 100644 master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_callWechatServiceNavigation.xml create mode 100644 master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_generateNavigationPage.py create mode 100644 master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_generateNavigationPage.xml create mode 100644 master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_registerWechat.py create mode 100644 master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_registerWechat.xml create mode 100644 master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_updateStatus.py create mode 100644 master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_updateStatus.xml create mode 100644 master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/states.xml create mode 100644 master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/states/draft.xml create mode 100644 master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/transitions.xml create mode 100644 master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/transitions/generate_wechat_payment_page.xml create mode 100644 master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/transitions/register_payzen.xml create mode 100644 master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/transitions/update_status.xml create mode 100644 master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/variables.xml create mode 100644 master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/variables/action.xml create mode 100644 master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/variables/actor.xml create mode 100644 master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/variables/comment.xml create mode 100644 master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/variables/error_message.xml create mode 100644 master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/variables/history.xml create mode 100644 master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/variables/portal_type.xml create mode 100644 master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/variables/time.xml create mode 100644 master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/worklists.xml create mode 100644 master/bt5/slapos_wechat/bt/template_action_path_list create mode 100644 master/bt5/slapos_wechat/bt/template_path_list create mode 100644 master/bt5/slapos_wechat/bt/template_portal_type_allowed_content_type_list create mode 100644 master/bt5/slapos_wechat/bt/template_portal_type_base_category_list create mode 100644 master/bt5/slapos_wechat/bt/template_portal_type_id_list create mode 100644 master/bt5/slapos_wechat/bt/template_portal_type_property_sheet_list create mode 100644 master/bt5/slapos_wechat/bt/template_portal_type_workflow_chain_list create mode 100644 master/bt5/slapos_wechat/bt/template_workflow_id_list 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 000000000..9761c0ae0 --- /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 000000000..df89599cb --- /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/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 000000000..fdfbb98f1 --- /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 000000000..8567b2ef8 --- /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 000000000..d77dd826b --- /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 000000000..cceab4de8 --- /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 000000000..72e28d09a --- /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 000000000..8af096f64 --- /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 000000000..634e51943 --- /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 000000000..1ba70e0de --- /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 000000000..c19358eef --- /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 000000000..1eb8b240a --- /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 000000000..ac5ba3db0 --- /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/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_redirectToWechatPayment.py b/master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_redirectToWechatPayment.py index 763adb7a9..02b0c0aa0 100644 --- 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 @@ -3,26 +3,27 @@ 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) + 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, ) - ''' - system_event.generateManualPaymentPage( + + # 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()) 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 000000000..b8b092cff --- /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 000000000..072c8f654 --- /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 000000000..46a33806c --- /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 000000000..41a260367 --- /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 000000000..1c9b15203 --- /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 000000000..c6e14e067 --- /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 000000000..2390ef1fd --- /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 000000000..0f3e2f15e --- /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 000000000..697a4e68a --- /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 000000000..80e0c7766 --- /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 000000000..27ec90690 --- /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 000000000..e3a960be2 --- /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 000000000..aa36144ef --- /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 000000000..15f5b51a5 --- /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 000000000..bed59b72b --- /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 000000000..dd468baa3 --- /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 000000000..bb12bef80 --- /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 000000000..bb5af22d3 --- /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 000000000..8fc1574d2 --- /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 000000000..fda919ee8 --- /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 000000000..535863de2 --- /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 000000000..44306b76d --- /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 000000000..89576a7a5 --- /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 000000000..0d2d8d7e2 --- /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 000000000..c3432aa05 --- /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 000000000..124441b1e --- /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_path_list b/master/bt5/slapos_wechat/bt/template_path_list new file mode 100644 index 000000000..b7c3b1a4e --- /dev/null +++ b/master/bt5/slapos_wechat/bt/template_path_list @@ -0,0 +1,4 @@ +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 000000000..71c6c97a4 --- /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 000000000..d06a38c54 --- /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 000000000..f0765503b --- /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 000000000..1b13839a4 --- /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 000000000..485dfa18f --- /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_workflow_id_list b/master/bt5/slapos_wechat/bt/template_workflow_id_list new file mode 100644 index 000000000..6cc404ff7 --- /dev/null +++ b/master/bt5/slapos_wechat/bt/template_workflow_id_list @@ -0,0 +1 @@ +wechat_interface_workflow \ No newline at end of file -- 2.30.9 From 08948d2a131cb820cdebc7bb98051144bddbf4e6 Mon Sep 17 00:00:00 2001 From: Boxiang Sun Date: Wed, 2 Oct 2019 14:02:31 +0000 Subject: [PATCH 06/11] slapos_wechat: Add Chinese currency Note: it's not RMB, the official abbreviation is CNY --- .../PathTemplateItem/currency_module/CNY.xml | 126 ++++++++++++++++++ .../bt5/slapos_wechat/bt/template_path_list | 1 + 2 files changed, 127 insertions(+) create mode 100644 master/bt5/slapos_wechat/PathTemplateItem/currency_module/CNY.xml 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 000000000..9a2e0b25b --- /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/bt/template_path_list b/master/bt5/slapos_wechat/bt/template_path_list index b7c3b1a4e..037b734a9 100644 --- a/master/bt5/slapos_wechat/bt/template_path_list +++ b/master/bt5/slapos_wechat/bt/template_path_list @@ -1,3 +1,4 @@ +currency_module/CNY portal_alarms/slapos_wechat_update_confirmed_payment portal_alarms/slapos_wechat_update_started_payment portal_secure_payments/slapos_wechat_test -- 2.30.9 From b24cd627c28025efeb8f1c45cc9e63546cce0eb7 Mon Sep 17 00:00:00 2001 From: Boxiang Sun Date: Wed, 2 Oct 2019 14:03:17 +0000 Subject: [PATCH 07/11] WIP: slapos_subscription_request: Check the currency to determine the payment method --- ...iptionRequestModule_requestSubscription.py | 2 +- ...ptionRequestModule_requestSubscription.xml | 2 +- ...nRequestModule_requestSubscriptionProxy.py | 40 ++++++++++++------- ...RequestModule_requestSubscriptionProxy.xml | 2 +- .../SubscriptionRequest_applyCondition.py | 4 +- ...est_createRelatedSaleInvoiceTransaction.py | 5 ++- ...st_createRelatedSaleInvoiceTransaction.xml | 2 +- ...iptionRequest_requestPaymentTransaction.py | 7 +++- ...ptionRequest_requestPaymentTransaction.xml | 2 +- 9 files changed, 42 insertions(+), 24 deletions(-) diff --git a/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequestModule_requestSubscription.py b/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequestModule_requestSubscription.py index ba3013ba6..1d0285a5f 100644 --- a/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequestModule_requestSubscription.py +++ b/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequestModule_requestSubscription.py @@ -19,6 +19,6 @@ user_input_dict = { "amount" : amount} return context.SubscriptionRequestModule_requestSubscriptionProxy( - default_email_text, subscription_reference, payment_mode, + default_email_text, subscription_reference, confirmation_required=bool(confirmation_required), user_input_dict=user_input_dict, batch_mode=0) diff --git a/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequestModule_requestSubscription.xml b/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequestModule_requestSubscription.xml index c508058e9..0e62c7fc1 100644 --- a/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequestModule_requestSubscription.xml +++ b/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequestModule_requestSubscription.xml @@ -50,7 +50,7 @@ _params - name=None, default_email_text=None, payment_mode=None, subscription_reference=None, amount=0, confirmation_required=True, REQUEST=None, **kw + name=None, default_email_text=None, subscription_reference=None, amount=0, confirmation_required=True, REQUEST=None, **kw id 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 2bd406181..126886b74 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 @@ -7,9 +7,8 @@ if REQUEST is not None: person, person_is_new = context.SubscriptionRequest_createUser(email, user_input_dict['name']) web_site = context.getWebSiteValue() - -# if payment mode not selected, ask user to confirm and select one. -if not payment_mode: +# Check if user is already exist, otherwise redirect to ask confirmation +if confirmation_required and not person_is_new: base_url = web_site.absolute_url() return context.REQUEST.RESPONSE.redirect( @@ -28,17 +27,16 @@ subscription_request = context.subscription_request_module.newContent( subscription_request.setDefaultEmailText(email) -def wrapWithShadow(subscription_request, amount, subscription_reference, payment_mode): +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(), payment_mode=payment_mode) + tag="subscription_%s" % subscription_request.getId()) payment = person.Person_restrictMethodAsShadowUser( shadow_document=person, callable_object=wrapWithShadow, - argument_list=[subscription_request, user_input_dict["amount"], subscription_reference, payment_mode]) + argument_list=[subscription_request, user_input_dict["amount"], subscription_reference]) if batch_mode: return {'subscription' : subscription_request.getRelativeUrl(), 'payment': payment.getRelativeUrl() } @@ -51,18 +49,32 @@ price = person.Person_restrictMethodAsShadowUser( callable_object=wrapGetPriceWithShadow, argument_list=[payment,]) -if payment_mode == "wechat": +# 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) -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]) +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]) + 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/SubscriptionRequestModule_requestSubscriptionProxy.xml b/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequestModule_requestSubscriptionProxy.xml index 691c6c3d9..a0b742784 100644 --- a/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequestModule_requestSubscriptionProxy.xml +++ b/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequestModule_requestSubscriptionProxy.xml @@ -50,7 +50,7 @@ _params - email, subscription_reference, payment_mode=None, confirmation_required=False, user_input_dict={}, batch_mode=True, REQUEST=None + email, subscription_reference, confirmation_required=False, user_input_dict={}, batch_mode=True, REQUEST=None _proxy_roles 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 baba39c68..e32fec911 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 ce41add68..ebf52188b 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,10 @@ portal = context.getPortalObject() current_invoice = context.getCausalityValue() if current_invoice is None: - if payment_mode == "wechat": + # 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" diff --git a/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_createRelatedSaleInvoiceTransaction.xml b/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_createRelatedSaleInvoiceTransaction.xml index a25ae71c2..4f3579ba3 100644 --- a/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_createRelatedSaleInvoiceTransaction.xml +++ b/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_createRelatedSaleInvoiceTransaction.xml @@ -50,7 +50,7 @@ _params - amount, tag, payment, payment_mode=None, REQUEST=None + amount, tag, payment, REQUEST=None _proxy_roles 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 9fbca5e4c..56acf1c7e 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 @@ -9,7 +9,10 @@ current_payment = None if current_invoice is None: # Hardcoded value for reservation - if payment_mode == "wechat": + # 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: @@ -43,6 +46,6 @@ if current_invoice is None: context.reindexObject(activate_kw={'tag': tag}) context.activate(tag=tag).SubscriptionRequest_createRelatedSaleInvoiceTransaction( - amount, tag, current_payment.getRelativeUrl(), payment_mode) + amount, tag, current_payment.getRelativeUrl()) return current_payment diff --git a/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_requestPaymentTransaction.xml b/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_requestPaymentTransaction.xml index df60f1049..956b550bc 100644 --- a/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_requestPaymentTransaction.xml +++ b/master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_requestPaymentTransaction.xml @@ -50,7 +50,7 @@ _params - amount, tag, payment_mode=None, REQUEST=None + amount, tag, REQUEST=None _proxy_roles -- 2.30.9 From 3d1cec275662a97a0c3e16dbe97270d2dde81c6c Mon Sep 17 00:00:00 2001 From: Boxiang Sun Date: Wed, 2 Oct 2019 14:08:12 +0000 Subject: [PATCH 08/11] WIP: slapos_wechat: Temporary solution, allow user get preferred wechat service --- .../SlapOSPayzenSystemPreference.xml | 66 +++++++++++++++++++ ...erred_payzen_integration_site_property.xml | 65 ++++++++++++++++++ ...zen_payment_service_reference_property.xml | 65 ++++++++++++++++++ ...hat_payment_service_reference_property.xml | 44 +++++++++++++ .../bt/template_property_sheet_id_list | 1 + 5 files changed, 241 insertions(+) create mode 100644 master/bt5/slapos_wechat/PropertySheetTemplateItem/portal_property_sheets/SlapOSPayzenSystemPreference.xml create mode 100644 master/bt5/slapos_wechat/PropertySheetTemplateItem/portal_property_sheets/SlapOSPayzenSystemPreference/preferred_payzen_integration_site_property.xml create mode 100644 master/bt5/slapos_wechat/PropertySheetTemplateItem/portal_property_sheets/SlapOSPayzenSystemPreference/preferred_payzen_payment_service_reference_property.xml create mode 100644 master/bt5/slapos_wechat/PropertySheetTemplateItem/portal_property_sheets/SlapOSPayzenSystemPreference/preferred_wechat_payment_service_reference_property.xml create mode 100644 master/bt5/slapos_wechat/bt/template_property_sheet_id_list 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 000000000..056a6e8dc --- /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 000000000..e542b28d0 --- /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 000000000..aee0de461 --- /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 000000000..953c927f3 --- /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/bt/template_property_sheet_id_list b/master/bt5/slapos_wechat/bt/template_property_sheet_id_list new file mode 100644 index 000000000..d65b323a1 --- /dev/null +++ b/master/bt5/slapos_wechat/bt/template_property_sheet_id_list @@ -0,0 +1 @@ +SlapOSPayzenSystemPreference \ No newline at end of file -- 2.30.9 From 6f676983d292951756588837b9a22694dc3148ba Mon Sep 17 00:00:00 2001 From: Boxiang Sun Date: Wed, 2 Oct 2019 14:14:28 +0000 Subject: [PATCH 09/11] slapos_payzen: Temparory solution, add wechat service selection in the payzen tab in the preference --- ...hat_payment_service_reference_property.xml | 44 ++++++ .../SystemPreference_viewSlapOSPayzen.xml | 1 + ...erred_wechat_payment_service_reference.xml | 126 ++++++++++++++++++ 3 files changed, 171 insertions(+) create mode 100644 master/bt5/slapos_payzen/PropertySheetTemplateItem/portal_property_sheets/SlapOSPayzenSystemPreference/preferred_wechat_payment_service_reference_property.xml create mode 100644 master/bt5/slapos_payzen/SkinTemplateItem/portal_skins/slapos_payzen/SystemPreference_viewSlapOSPayzen/my_preferred_wechat_payment_service_reference.xml 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 000000000..953c927f3 --- /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 58b73681a..ceb2f72a7 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 000000000..d1897bdfa --- /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\'),))] + + + + + -- 2.30.9 From ea8b72503147d4351c36bc17f617e6c493dced30 Mon Sep 17 00:00:00 2001 From: Boxiang Sun Date: Tue, 8 Oct 2019 16:24:34 +0000 Subject: [PATCH 10/11] slapos_subscription_request: Remove slapos_wechat dependency --- master/bt5/slapos_subscription_request/bt/dependency_list | 1 - 1 file changed, 1 deletion(-) delete mode 100644 master/bt5/slapos_subscription_request/bt/dependency_list diff --git a/master/bt5/slapos_subscription_request/bt/dependency_list b/master/bt5/slapos_subscription_request/bt/dependency_list deleted file mode 100644 index b261d3fee..000000000 --- a/master/bt5/slapos_subscription_request/bt/dependency_list +++ /dev/null @@ -1 +0,0 @@ -slapos_wechat \ No newline at end of file -- 2.30.9 From 81a9805dea1d77a2a49fd1da5f6bf2f6ca0886d7 Mon Sep 17 00:00:00 2001 From: Boxiang Sun Date: Tue, 8 Oct 2019 17:44:46 +0000 Subject: [PATCH 11/11] slapos_subscription_request: Add erp5_commerce as dependency --- master/bt5/slapos_subscription_request/bt/dependency_list | 1 + 1 file changed, 1 insertion(+) create mode 100644 master/bt5/slapos_subscription_request/bt/dependency_list 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 000000000..e90a7680c --- /dev/null +++ b/master/bt5/slapos_subscription_request/bt/dependency_list @@ -0,0 +1 @@ +erp5_commerce \ No newline at end of file -- 2.30.9