You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

336 lines
20 KiB

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <template id="payment_payplug_button">
  4. <form t-att-action="payplug_url" method="post">
  5. </form>
  6. </template>
  7. <!-- BANNER PAYPLUG IN CART PAYMENT FORM -->
  8. <template id="checkout_inherit" inherit_id="payment.checkout" name="Payment Icon List">
  9. <xpath expr="//div[hasclass('card')]/t[@t-foreach='providers']" position="replace">
  10. <t t-foreach="providers" t-as="provider">
  11. <t t-if="provider.code=='payplug'">
  12. <!-- === Acquirer PayPLug === -->
  13. <t t-if="provider.payment_type_payplug == True and authorized_country_payplug == True and provider.is_published == True">
  14. <div name="o_payment_option_card" data-provider-payplug="payplug" class="card-body o_payment_option_card o_provider_payplug_card">
  15. <label>
  16. <input name="o_payment_radio"
  17. type="radio"
  18. t-att-class="''"
  19. t-att-data-payment-option-id="provider.id"
  20. t-att-data-provider="provider.code"
  21. data-payment-option-type="provider"/>
  22. <!-- === Acquirer name === -->
  23. <span class="payment_option_name">
  24. <b><t t-esc="provider.payplug_display_as or provider.name"/></b>
  25. </span>
  26. <!-- === "Test Mode" badge === -->
  27. <span t-if="provider.state == 'test'"
  28. class="badge-pill badge-warning ml-1">
  29. Test Mode
  30. </span>
  31. <!-- === Extra fees badge === -->
  32. <t t-if="fees_by_provider.get(provider)">
  33. <span class="badge-pill badge-secondary ml-1">
  34. + <t t-esc="fees_by_provider.get(provider)"
  35. t-options="{'widget': 'monetary', 'display_currency': currency}"/>
  36. Fees
  37. </span>
  38. </t>
  39. </label>
  40. <!-- === Payment icon list === -->
  41. <t t-call="payment.icon_list"/>
  42. <!-- === Help message === -->
  43. <div t-if="provider.pre_msg"
  44. t-out="provider.pre_msg"
  45. class="text-muted ml-3"/>
  46. </div>
  47. <!-- === Provider inline form === -->
  48. <div t-attf-id="o_payment_provider_inline_form_{{provider.id}}"
  49. name="o_payment_inline_form"
  50. class="card-footer d-none">
  51. <!-- === Inline form content (filled by acquirer) === -->
  52. <t t-if="provider.sudo()._should_build_inline_form(is_validation=False)">
  53. <t t-set="inline_form_xml_id"
  54. t-value="provider.sudo().inline_form_view_id.xml_id"/>
  55. <div t-if="inline_form_xml_id" class="clearfix">
  56. <t t-call="{{inline_form_xml_id}}">
  57. <t t-set="provider_id" t-value="provider.id"/>
  58. </t>
  59. </div>
  60. </t>
  61. <!-- === "Save my payment details" checkbox === -->
  62. <label t-if="show_tokenize_input[provider.id]">
  63. <input name="o_payment_save_as_token" type="checkbox"/>
  64. Save my payment details
  65. </label>
  66. </div>
  67. </t>
  68. <!-- === Acquirer Oney === -->
  69. <t t-if="provider.payment_type_oney == True and authorized_country_oney == True and provider.is_published == True">
  70. <div name="o_payment_option_card" data-provider-payplug="oney" class="card-body o_payment_option_card o_provider_payplug_card">
  71. <label>
  72. <!-- === Radio button === -->
  73. <!-- Only shown if linked to the only payment option -->
  74. <t t-if="authorized_by_oney==False">
  75. <input name="o_payment_radio"
  76. type="hidden"
  77. t-att-class="'d-none'"
  78. t-att-data-payment-option-id="provider.id"
  79. t-att-data-provider="provider.code"
  80. data-payment-option-type="provider"/>
  81. </t>
  82. <t t-else="">
  83. <input name="o_payment_radio"
  84. type="radio"
  85. t-att-class="'' if provider_count + token_count > 1 else 'd-none'"
  86. t-att-data-payment-option-id="provider.id"
  87. t-att-data-provider="provider.code"
  88. data-payment-option-type="provider"/>
  89. </t>
  90. <!-- === Acquirer name === -->
  91. <span class="payment_option_name">
  92. <b><t t-esc="provider.oney_display_as or provider.name"/></b>
  93. </span>
  94. <!-- === "Test Mode" badge === -->
  95. <span t-if="provider.state == 'test'"
  96. class="badge-pill badge-warning"
  97. style="margin-left:5px">
  98. Test Mode
  99. </span>
  100. </label>
  101. <!-- === Payment icon list specific Oney === -->
  102. <t t-call="acquirer_payplug.icon_list_oney"/>
  103. <!-- <t t-call="payment.icon_list"/> -->
  104. <!-- === Help message === -->
  105. <div t-if="provider.pre_msg"
  106. t-out="provider.pre_msg"
  107. class="text-muted ml-3"/>
  108. </div>
  109. <!-- === Acquirer inline form === -->
  110. <t t-if="provider.sudo()._should_build_inline_form(is_validation=True)">
  111. <div t-attf-id="o_payment_acquirer_inline_form_{{provider.id}}"
  112. name="o_payment_inline_form"
  113. class="card-footer d-none">
  114. <!-- === Inline form content (filled by acquirer) === -->
  115. <t t-set="inline_form_xml_id"
  116. t-value="provider.sudo().inline_form_view_id.xml_id"/>
  117. <div t-if="inline_form_xml_id" class="clearfix">
  118. <t t-call="{{inline_form_xml_id}}">
  119. <t t-set="provider_id" t-value="provider.id"/>
  120. </t>
  121. </div>
  122. </div>
  123. </t>
  124. </t>
  125. <!-- === Acquirer AmEx === -->
  126. <t t-if="provider.payment_type_amex == True and authorized_country_amex == True and provider.is_published == True">
  127. <div name="o_payment_option_card" data-provider-payplug="american_express" class="card-body o_payment_option_card o_provider_payplug_card">
  128. <label>
  129. <input name="o_payment_radio"
  130. type="radio"
  131. t-att-class="'' if provider_count + token_count > 1 else 'd-none'"
  132. t-att-data-payment-option-id="provider.id"
  133. t-att-data-provider="provider.code"
  134. data-payment-option-type="provider"/>
  135. <!-- === Acquirer name === -->
  136. <span class="payment_option_name">
  137. <b><t t-esc="provider.amex_display_as or provider.name"/></b>
  138. </span>
  139. <!-- === "Test Mode" badge === -->
  140. <span t-if="provider.state == 'test'"
  141. class="badge-pill badge-warning ml-1">
  142. Test Mode
  143. </span>
  144. <!-- === Extra fees badge === -->
  145. <t t-if="fees_by_provider.get(provider)">
  146. <span class="badge-pill badge-secondary ml-1">
  147. + <t t-esc="fees_by_provider.get(provider)"
  148. t-options="{'widget': 'monetary', 'display_currency': currency}"/>
  149. Fees
  150. </span>
  151. </t>
  152. </label>
  153. <!-- === Payment specific icon === -->
  154. <ul class="payment_icon_list float-end list-inline" data-max-icons="1">
  155. <img src='/acquirer_payplug/static/src/img/icon/american_express.png' style="max-height: 32px; margin-right: 6px;"/>
  156. </ul>
  157. <!-- === Help message === -->
  158. <div t-if="not is_html_empty(provider.pre_msg)"
  159. t-out="provider.pre_msg"
  160. class="text-muted ms-3"/>
  161. </div>
  162. <!-- === Acquirer inline form === -->
  163. <div t-attf-id="o_payment_provider_inline_form_{{provider.id}}"
  164. name="o_payment_inline_form"
  165. class="card-footer d-none">
  166. <!-- === Inline form content (filled by acquirer) === -->
  167. <t t-if="provider.sudo()._should_build_inline_form(is_validation=False)">
  168. <t t-set="inline_form_xml_id"
  169. t-value="provider.sudo().inline_form_view_id.xml_id"/>
  170. <div t-if="inline_form_xml_id" class="clearfix">
  171. <t t-call="{{inline_form_xml_id}}">
  172. <t t-set="provider_id" t-value="provider.id"/>
  173. </t>
  174. </div>
  175. </t>
  176. <!-- === "Save my payment details" checkbox === -->
  177. <!-- Only included if partner is known and if the choice is given -->
  178. <t t-set="tokenization_required"
  179. t-value="provider._is_tokenization_required(provider=provider.code)"/>
  180. <label t-if="show_tokenize_input and provider.allow_tokenization and not tokenization_required">
  181. <input name="o_payment_save_as_token" type="checkbox"/>
  182. Save my payment details
  183. </label>
  184. </div>
  185. </t>
  186. <!-- === Acquirer Bancontact === -->
  187. <t t-if="provider.payment_type_bancontact == True and authorized_country_bancontact == True and provider.is_published == True">
  188. <div name="o_payment_option_card" data-provider-payplug="bancontact" class="card-body o_payment_option_card o_provider_payplug_card">
  189. <label>
  190. <input name="o_payment_radio"
  191. type="radio"
  192. t-att-class="'' if provider_count + token_count > 1 else 'd-none'"
  193. t-att-data-payment-option-id="provider.id"
  194. t-att-data-provider="provider.code"
  195. data-payment-option-type="provider"/>
  196. <!-- === Acquirer name === -->
  197. <span class="payment_option_name">
  198. <b><t t-esc="provider.bancontact_display_as or provider.name"/></b>
  199. </span>
  200. <!-- === "Test Mode" badge === -->
  201. <span t-if="provider.state == 'test'"
  202. class="badge-pill badge-warning ml-1">
  203. Test Mode
  204. </span>
  205. <!-- === Extra fees badge === -->
  206. <t t-if="fees_by_provider.get(provider)">
  207. <span class="badge-pill badge-secondary ml-1">
  208. + <t t-esc="fees_by_provider.get(provider)"
  209. t-options="{'widget': 'monetary', 'display_currency': currency}"/>
  210. Fees
  211. </span>
  212. </t>
  213. </label>
  214. <!-- === Payment specific icon === -->
  215. <ul class="payment_icon_list float-end list-inline" data-max-icons="1">
  216. <img src='/acquirer_payplug/static/src/img/icon/bancontact.png' style="max-height: 32px; margin-right: 6px;"/>
  217. </ul>
  218. <!-- === Help message === -->
  219. <div t-if="provider.pre_msg"
  220. t-out="provider.pre_msg"
  221. class="text-muted ml-3"/>
  222. </div>
  223. <!-- === Acquirer inline form === -->
  224. <div t-attf-id="o_payment_acquirer_inline_form_{{provider.id}}"
  225. name="o_payment_inline_form"
  226. class="card-footer d-none">
  227. <!-- === Inline form content (filled by acquirer) === -->
  228. <t t-if="provider.sudo()._should_build_inline_form(is_validation=False)">
  229. <t t-set="inline_form_xml_id"
  230. t-value="provider.sudo().inline_form_view_id.xml_id"/>
  231. <div t-if="inline_form_xml_id" class="clearfix">
  232. <t t-call="{{inline_form_xml_id}}">
  233. <t t-set="provider_id" t-value="provider.id"/>
  234. </t>
  235. </div>
  236. </t>
  237. <!-- === "Save my payment details" checkbox === -->
  238. <!-- Only included if partner is known and if the choice is given -->
  239. <t t-set="tokenization_required"
  240. t-value="provider._is_tokenization_required(provider=provider.code)"/>
  241. <label t-if="show_tokenize_input and provider.allow_tokenization and not tokenization_required">
  242. <input name="o_payment_save_as_token" type="checkbox"/>
  243. Save my payment details
  244. </label>
  245. </div>
  246. </t>
  247. </t>
  248. <!-- === Others Acquirer === -->
  249. <t t-else="">
  250. <div name="o_payment_option_card" class="card-body o_payment_option_card">
  251. <label>
  252. <!-- === Radio button === -->
  253. <!-- Only shown if linked to the only payment option -->
  254. <input name="o_payment_radio"
  255. type="radio"
  256. t-att-checked="provider.id == default_payment_option_id"
  257. t-att-class="'' if provider_count + token_count > 1 else 'd-none'"
  258. t-att-data-payment-option-id="provider.id"
  259. t-att-data-provider="provider.code"
  260. data-payment-option-type="provider"/>
  261. <!-- === Acquirer name === -->
  262. <span class="payment_option_name">
  263. <b><t t-esc="provider.display_as or provider.name"/></b>
  264. </span>
  265. <!-- === "Test Mode" badge === -->
  266. <span t-if="provider.state == 'test'"
  267. class="badge-pill badge-warning"
  268. style="margin-left:5px">
  269. Test Mode
  270. </span>
  271. </label>
  272. <!-- === Payment icon list === -->
  273. <t t-call="payment.icon_list"/>
  274. <!-- === Help message === -->
  275. <div t-if="provider.pre_msg"
  276. t-out="provider.pre_msg"
  277. class="text-muted ml-3"/>
  278. </div>
  279. <!-- === Acquirer inline form === -->
  280. <t t-if="provider.sudo()._should_build_inline_form(is_validation=True)">
  281. <div t-attf-id="o_payment_acquirer_inline_form_{{provider.id}}"
  282. name="o_payment_inline_form"
  283. class="card-footer d-none">
  284. <!-- === Inline form content (filled by acquirer) === -->
  285. <t t-set="inline_form_xml_id"
  286. t-value="provider.sudo().inline_form_view_id.xml_id"/>
  287. <div t-if="inline_form_xml_id" class="clearfix">
  288. <t t-call="{{inline_form_xml_id}}">
  289. <t t-set="provider_id" t-value="provider.id"/>
  290. </t>
  291. </div>
  292. </div>
  293. </t>
  294. <!-- === Tokens === -->
  295. <t t-foreach="tokens" t-as="token">
  296. <div name="o_payment_option_card" class="card-body o_payment_option_card">
  297. <label>
  298. <!-- === Radio button === -->
  299. <!-- Only shown if 'assign_token_route' is set -->
  300. <input name="o_payment_radio"
  301. type="radio"
  302. t-att-checked="token.id == default_payment_option_id"
  303. t-att-class="'' if bool(assign_token_route) else 'd-none'"
  304. t-att-data-payment-option-id="token.id"
  305. t-att-data-provider="token.provider"
  306. data-payment-option-type="token"/>
  307. <!-- === Token name === -->
  308. <span class="payment_option_name" t-esc="token.name"/>
  309. <!-- === "V" check mark === -->
  310. <t t-call="payment.verified_token_checkmark"/>
  311. </label>
  312. <!-- === "Delete" token button === -->
  313. <button name="o_payment_delete_token"
  314. class="btn btn-primary btn-sm float-right">
  315. <i class="fa fa-trash"/> Delete
  316. </button>
  317. </div>
  318. <!-- === Token inline form === -->
  319. <div t-attf-id="o_payment_token_inline_form_{{token.id}}"
  320. name="o_payment_inline_form"
  321. class="card-footer d-none"/>
  322. </t>
  323. </t>
  324. </t>
  325. </xpath>
  326. </template>
  327. </odoo>