Commit 6a4483ab authored by Lucas Carvalho's avatar Lucas Carvalho

Renamed some scripts.

- from: ERP5Site_unrestrictedGetPrice
- to: WebSection_unrestrictedGetPrice
Fixed: WebSection_viewSelectedProductWidget
erp5_web_multiflex5_commerce_layout/product_list_decoratedPrice

- from: ERP5Base_submitPaypalNVPRequest
- to: WebSection_submitPaypalNVPRequest
Fixed: WebSection_getNewPaypalToken
WebSection_doExpressCheckoutPayment
WebSection_getExpressCheckoutDetails

- from: SaleOrder_getShoppingCartDefaultCurrencySymbole
- to: SaleOrder_getShoppingCartDefaultCurrencySymbol
Fixed: WebSection_viewSelectedProductWidget

- from: WebSite_getExpressCheckoutDetails
- to: WebSection_getExpressCheckoutDetails
Fixed: WebSection_doPaypalPayment
WebSection_checkPaypalIdentification

- from: WebSite_doExpressCheckoutPayment
- to: WebSection_doExpressCheckoutPayment
Fixed: WebSection_doPaypalPayment

- from: WebSite_getNewPaypalToken
- to: WebSection_getNewPaypalToken
Fixed: SaleOrder_viewPaypalForm

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28396 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c78c4e7d
......@@ -125,7 +125,7 @@ return context.getPortalObject().SaleOrder_getShoppingCartDefaultCurrency().getR
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Get default currency symbole for shop</string> </value>
<value> <string>Get default currency symbol for shop</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -121,7 +121,7 @@ return context.getPortalObject().SaleOrder_getShoppingCartDefaultCurrency().getS
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SaleOrder_getShoppingCartDefaultCurrencySymbole</string> </value>
<value> <string>SaleOrder_getShoppingCartDefaultCurrencySymbol</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -54,16 +54,22 @@
<item>
<key> <string>_body</string> </key>
<value> <string># redirect the user to the good payment form\n
translateString = context.Base_translateString\n
\n
if field_my_payment_mode is None:\n
return "error"\n
\n
if field_my_payment_mode == \'Credit Card\':\n
return context.getWebSectionValue().SaleOrder_viewAsWebConfirmCreditCardPayment()\n
elif field_my_payment_mode.lower() == \'paypal\':\n
return context.getWebSectionValue().SaleOrder_viewAsWebConfirmPayPalPayment()\n
msg = translateString("You must select a payment mode.")\n
else:\n
return "This method is actually not activated, sorry : %s" % field_my_payment_mode\n
if field_my_payment_mode.lower() == \'credit card\':\n
return context.getWebSectionValue().SaleOrder_viewAsWebConfirmCreditCardPayment()\n
elif field_my_payment_mode.lower() == \'paypal\':\n
return context.getWebSectionValue().SaleOrder_viewAsWebConfirmPayPalPayment()\n
else:\n
msg = translateString("This payment mode is actually not activated, sorry: ${payment_mode}", \n
mapping=dict(payment_mode=field_my_payment_mode))\n
\n
context.Base_redirect(\'SaleOrder_viewAsWebConfirmPaymentMode\', \\\n
keep_items={\'portal_status_message\': msg})\n
return\n
</string> </value>
</item>
<item>
......@@ -102,9 +108,12 @@ else:\n
<tuple>
<string>field_my_payment_mode</string>
<string>kw</string>
<string>None</string>
<string>_getattr_</string>
<string>context</string>
<string>translateString</string>
<string>None</string>
<string>msg</string>
<string>dict</string>
</tuple>
</value>
</item>
......
......@@ -54,12 +54,11 @@
<item>
<key> <string>_body</string> </key>
<value> <string>translateString = context.Base_translateString\n
web_site = context.getWebSiteValue()\n
\n
token = context.REQUEST.get(\'token\')\n
payer_id = context.REQUEST.get(\'PayerID\')\n
\n
parameter_dict = web_site.WebSite_getExpressCheckoutDetails(token)\n
parameter_dict = context.WebSection_getExpressCheckoutDetails(token)\n
\n
if parameter_dict[\'ACK\'] != \'Success\':\n
return "Identification failed.1 : %s" % parameter_dict[\'ACK\']\n
......@@ -109,7 +108,6 @@ context.ERP5Site_redirect(\'%s/checkout\' % context.getWebSiteValue().absolute_u
<string>_getattr_</string>
<string>context</string>
<string>translateString</string>
<string>web_site</string>
<string>token</string>
<string>payer_id</string>
<string>parameter_dict</string>
......
......@@ -60,7 +60,7 @@ order_parameter_dict[\'TOKEN\'] = token\n
order_parameter_dict[\'PAYERID\'] = payer_id\n
order_parameter_dict[\'METHOD\'] = \'DoExpressCheckoutPayment\'\n
\n
response_parameter_dict = context.ERP5Base_submitPaypalNVPRequest(parameter_dict=order_parameter_dict,\n
response_parameter_dict = context.WebSection_submitPaypalNVPRequest(parameter_dict=order_parameter_dict,\n
nvp_url=context.WebSite_getPaypalUrl(api=\'nvp\'))\n
return response_parameter_dict\n
</string> </value>
......@@ -123,7 +123,7 @@ return response_parameter_dict\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebSite_doExpressCheckoutPayment</string> </value>
<value> <string>WebSection_doExpressCheckoutPayment</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -66,14 +66,14 @@ if isAnon:\n
return\n
\n
## check if the id of the token correspond to the good products\n
parameter_dict = context.WebSite_getExpressCheckoutDetails(token)\n
parameter_dict = context.WebSection_getExpressCheckoutDetails(token)\n
if parameter_dict[\'ACK\'] != \'Success\':\n
msg = translateString("This paypal session is not initialised with the actual card.")\n
context.Base_redirect(\'\', \\\n
keep_items={\'portal_status_message\': msg,})\n
\n
payer_id = parameter_dict[\'PAYERID\']\n
response_dict = context.WebSite_doExpressCheckoutPayment(token, payer_id)\n
response_dict = context.WebSection_doExpressCheckoutPayment(token, payer_id)\n
\n
if response_dict[\'ACK\'] != \'Success\':\n
msg = translateString("Your payment failed because of ")\n
......
......@@ -59,7 +59,7 @@ if security_parameter_dict is None:\n
security_parameter_dict[\'TOKEN\'] = token\n
security_parameter_dict[\'METHOD\'] = \'GetExpressCheckoutDetails\'\n
\n
response_parameter_dict = context.ERP5Base_submitPaypalNVPRequest(parameter_dict=security_parameter_dict,\n
response_parameter_dict = context.WebSection_submitPaypalNVPRequest(parameter_dict=security_parameter_dict,\n
nvp_url=context.WebSite_getPaypalUrl(api=\'nvp\', alternative_url=alternative_url))\n
return response_parameter_dict\n
</string> </value>
......@@ -124,7 +124,7 @@ return response_parameter_dict\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebSite_getExpressCheckoutDetails</string> </value>
<value> <string>WebSection_getExpressCheckoutDetails</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -53,7 +53,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>response_parameter_dict = context.ERP5Base_submitPaypalNVPRequest(parameter_dict=context.WebSite_getPaypalOrderParameterDict(),\n
<value> <string>response_parameter_dict = context.WebSection_submitPaypalNVPRequest(parameter_dict=context.WebSite_getPaypalOrderParameterDict(),\n
nvp_url=context.WebSite_getPaypalUrl(api=\'nvp\', alternative_url=alternative_url))\n
\n
if response_parameter_dict is None:\n
......@@ -122,7 +122,7 @@ return \'\'\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebSite_getNewPaypalToken</string> </value>
<value> <string>WebSection_getNewPaypalToken</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -19,7 +19,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Base_submitPaypalNVPRequest</string> </value>
<value> <string>WebSection_submitPaypalNVPRequest</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -19,7 +19,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_unrestrictedGetPrice</string> </value>
<value> <string>WebSection_unrestrictedGetPrice</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -275,7 +275,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: \'%s %s\' % (here.ERP5Site_unrestrictedGetPrice(cell), cell.SaleOrder_getShoppingCartDefaultCurrencyCode())</string> </value>
<value> <string>python: \'%s %s\' % (here.WebSection_unrestrictedGetPrice(cell), cell.SaleOrder_getShoppingCartDefaultCurrencyCode())</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -39,8 +39,7 @@
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
<tal:block tal:define="web_site python: here.getWebSiteValue();\n
shopping_cart here/SaleOrder_getShoppingCart;\n
<tal:block tal:define="shopping_cart here/SaleOrder_getShoppingCart;\n
shopping_cart_item_list shopping_cart/SaleOrder_getShoppingCartItemList;\n
shopping_cart_price python: float(shopping_cart.SaleOrder_getShoppingCartTotalPrice());\n
taxes_amount python: float(shopping_cart.SaleOrder_getShoppingCartTotalPrice(include_taxes=True, include_shipping=True)) -\n
......@@ -59,7 +58,7 @@
\n
<!-- # can be _cart, _xclick, _express-checkout -->\n
<tal:block tal:condition="python: paypal_method == \'_express-checkout\'">\n
<tal:block tal:define="token python: web_site.WebSite_getNewPaypalToken()">\n
<tal:block tal:define="token python: here.WebSection_getNewPaypalToken()">\n
<a tal:condition="python: token is not None and token != \'\'"\n
tal:attributes="href python: \'%s?cmd=_express-checkout&token=%s&AMT=70.0&CURRENCYCODE=EUR\' % (action, token)">\n
<img src="https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif" alt="PayPal - The safer, easier way to pay online!" style="border:none;">\n
......
......@@ -57,12 +57,12 @@
<div tal:define="site_url python:here.getWebSiteValue().absolute_url();\n
current_web_section python:request.get(\'current_web_section\', here);\n
shopping_cart here/SaleOrder_getShoppingCart;\n
currency_symbole python: shopping_cart.SaleOrder_getShoppingCartDefaultCurrencySymbole();"\n
currency_symbol python: shopping_cart.SaleOrder_getShoppingCartDefaultCurrencySymbol();"\n
i18n:translate="" i18n:domain="ui" i18n:attributes="title"\n
title="Sections accessible from here." class="selected-product">\n
<tal:block tal:repeat="product python: here.WebSection_getProductList(limit=5)">\n
<div tal:define="product_href python: \'%s/product_module/%s/%s\' % (site_url, product.getId(), \'Resource_viewAsShop\');\n
price python: here.ERP5Site_unrestrictedGetPrice(product)">\n
price python: here.WebSection_unrestrictedGetPrice(product)">\n
<a href="#" tal:attributes="href product_href">\n
<img tal:condition="python: product.getDefaultImageValue() not in (None, \'\') and product.getDefaultImageValue().getData() not in (None, \'\')"\n
tal:attributes="src python: product.getDefaultImageAbsoluteUrl() + \'?display=thumbnail&format=png&resolution=75\'" width="75"/>\n
......@@ -77,7 +77,7 @@
tal:attributes="href product_href">A product</a>\n
<br />\n
<tal:block tal:condition="python: price is not None">\n
<span tal:content="python: \'%s %s\' % (price, currency_symbole)"></span>\n
<span tal:content="python: \'%s %s\' % (price, currency_symbol)"></span>\n
</tal:block>\n
<tal:block tal:condition="python: price is None">\n
<span>The price is not setted yet.</span>\n
......
148
\ No newline at end of file
155
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment