first commit
This commit is contained in:
2
modules/web_shop_vue_storefront_stripe/__init__.py
Normal file
2
modules/web_shop_vue_storefront_stripe/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
Binary file not shown.
Binary file not shown.
7
modules/web_shop_vue_storefront_stripe/locale/bg.po
Normal file
7
modules/web_shop_vue_storefront_stripe/locale/bg.po
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:web.shop,stripe_journal:"
|
||||
msgid "Stripe Journal"
|
||||
msgstr ""
|
||||
7
modules/web_shop_vue_storefront_stripe/locale/ca.po
Normal file
7
modules/web_shop_vue_storefront_stripe/locale/ca.po
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:web.shop,stripe_journal:"
|
||||
msgid "Stripe Journal"
|
||||
msgstr "Diari Stripe"
|
||||
7
modules/web_shop_vue_storefront_stripe/locale/cs.po
Normal file
7
modules/web_shop_vue_storefront_stripe/locale/cs.po
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:web.shop,stripe_journal:"
|
||||
msgid "Stripe Journal"
|
||||
msgstr ""
|
||||
7
modules/web_shop_vue_storefront_stripe/locale/de.po
Normal file
7
modules/web_shop_vue_storefront_stripe/locale/de.po
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:web.shop,stripe_journal:"
|
||||
msgid "Stripe Journal"
|
||||
msgstr "Stripe Journal"
|
||||
7
modules/web_shop_vue_storefront_stripe/locale/es.po
Normal file
7
modules/web_shop_vue_storefront_stripe/locale/es.po
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:web.shop,stripe_journal:"
|
||||
msgid "Stripe Journal"
|
||||
msgstr "Diario Stripe"
|
||||
7
modules/web_shop_vue_storefront_stripe/locale/es_419.po
Normal file
7
modules/web_shop_vue_storefront_stripe/locale/es_419.po
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:web.shop,stripe_journal:"
|
||||
msgid "Stripe Journal"
|
||||
msgstr ""
|
||||
7
modules/web_shop_vue_storefront_stripe/locale/et.po
Normal file
7
modules/web_shop_vue_storefront_stripe/locale/et.po
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:web.shop,stripe_journal:"
|
||||
msgid "Stripe Journal"
|
||||
msgstr ""
|
||||
7
modules/web_shop_vue_storefront_stripe/locale/fa.po
Normal file
7
modules/web_shop_vue_storefront_stripe/locale/fa.po
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:web.shop,stripe_journal:"
|
||||
msgid "Stripe Journal"
|
||||
msgstr ""
|
||||
7
modules/web_shop_vue_storefront_stripe/locale/fi.po
Normal file
7
modules/web_shop_vue_storefront_stripe/locale/fi.po
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:web.shop,stripe_journal:"
|
||||
msgid "Stripe Journal"
|
||||
msgstr ""
|
||||
7
modules/web_shop_vue_storefront_stripe/locale/fr.po
Normal file
7
modules/web_shop_vue_storefront_stripe/locale/fr.po
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:web.shop,stripe_journal:"
|
||||
msgid "Stripe Journal"
|
||||
msgstr "Journal Stripe"
|
||||
7
modules/web_shop_vue_storefront_stripe/locale/hu.po
Normal file
7
modules/web_shop_vue_storefront_stripe/locale/hu.po
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:web.shop,stripe_journal:"
|
||||
msgid "Stripe Journal"
|
||||
msgstr ""
|
||||
7
modules/web_shop_vue_storefront_stripe/locale/id.po
Normal file
7
modules/web_shop_vue_storefront_stripe/locale/id.po
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:web.shop,stripe_journal:"
|
||||
msgid "Stripe Journal"
|
||||
msgstr ""
|
||||
7
modules/web_shop_vue_storefront_stripe/locale/it.po
Normal file
7
modules/web_shop_vue_storefront_stripe/locale/it.po
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:web.shop,stripe_journal:"
|
||||
msgid "Stripe Journal"
|
||||
msgstr "Libro giornale di Stripe"
|
||||
7
modules/web_shop_vue_storefront_stripe/locale/lo.po
Normal file
7
modules/web_shop_vue_storefront_stripe/locale/lo.po
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:web.shop,stripe_journal:"
|
||||
msgid "Stripe Journal"
|
||||
msgstr ""
|
||||
7
modules/web_shop_vue_storefront_stripe/locale/lt.po
Normal file
7
modules/web_shop_vue_storefront_stripe/locale/lt.po
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:web.shop,stripe_journal:"
|
||||
msgid "Stripe Journal"
|
||||
msgstr ""
|
||||
7
modules/web_shop_vue_storefront_stripe/locale/nl.po
Normal file
7
modules/web_shop_vue_storefront_stripe/locale/nl.po
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:web.shop,stripe_journal:"
|
||||
msgid "Stripe Journal"
|
||||
msgstr "Stripe journaal"
|
||||
7
modules/web_shop_vue_storefront_stripe/locale/pl.po
Normal file
7
modules/web_shop_vue_storefront_stripe/locale/pl.po
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:web.shop,stripe_journal:"
|
||||
msgid "Stripe Journal"
|
||||
msgstr ""
|
||||
8
modules/web_shop_vue_storefront_stripe/locale/pt.po
Normal file
8
modules/web_shop_vue_storefront_stripe/locale/pt.po
Normal file
@@ -0,0 +1,8 @@
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:web.shop,stripe_journal:"
|
||||
msgid "Stripe Journal"
|
||||
msgstr "Diário Stripe"
|
||||
7
modules/web_shop_vue_storefront_stripe/locale/ro.po
Normal file
7
modules/web_shop_vue_storefront_stripe/locale/ro.po
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:web.shop,stripe_journal:"
|
||||
msgid "Stripe Journal"
|
||||
msgstr "Jurnal Stripe"
|
||||
7
modules/web_shop_vue_storefront_stripe/locale/ru.po
Normal file
7
modules/web_shop_vue_storefront_stripe/locale/ru.po
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:web.shop,stripe_journal:"
|
||||
msgid "Stripe Journal"
|
||||
msgstr ""
|
||||
7
modules/web_shop_vue_storefront_stripe/locale/sl.po
Normal file
7
modules/web_shop_vue_storefront_stripe/locale/sl.po
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:web.shop,stripe_journal:"
|
||||
msgid "Stripe Journal"
|
||||
msgstr ""
|
||||
7
modules/web_shop_vue_storefront_stripe/locale/tr.po
Normal file
7
modules/web_shop_vue_storefront_stripe/locale/tr.po
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:web.shop,stripe_journal:"
|
||||
msgid "Stripe Journal"
|
||||
msgstr ""
|
||||
7
modules/web_shop_vue_storefront_stripe/locale/uk.po
Normal file
7
modules/web_shop_vue_storefront_stripe/locale/uk.po
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:web.shop,stripe_journal:"
|
||||
msgid "Stripe Journal"
|
||||
msgstr ""
|
||||
7
modules/web_shop_vue_storefront_stripe/locale/zh_CN.po
Normal file
7
modules/web_shop_vue_storefront_stripe/locale/zh_CN.po
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:web.shop,stripe_journal:"
|
||||
msgid "Stripe Journal"
|
||||
msgstr ""
|
||||
2
modules/web_shop_vue_storefront_stripe/tests/__init__.py
Normal file
2
modules/web_shop_vue_storefront_stripe/tests/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
Binary file not shown.
Binary file not shown.
12
modules/web_shop_vue_storefront_stripe/tests/test_module.py
Normal file
12
modules/web_shop_vue_storefront_stripe/tests/test_module.py
Normal file
@@ -0,0 +1,12 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
from trytond.tests.test_tryton import ModuleTestCase
|
||||
|
||||
|
||||
class WebShopVueStorefrontStripeTestCase(ModuleTestCase):
|
||||
'Test Web Shop Vue Storefront Stripe module'
|
||||
module = 'web_shop_vue_storefront_stripe'
|
||||
|
||||
|
||||
del ModuleTestCase
|
||||
14
modules/web_shop_vue_storefront_stripe/tryton.cfg
Normal file
14
modules/web_shop_vue_storefront_stripe/tryton.cfg
Normal file
@@ -0,0 +1,14 @@
|
||||
[tryton]
|
||||
version=7.8.0
|
||||
depends:
|
||||
account_payment_stripe
|
||||
ir
|
||||
sale_payment
|
||||
web_shop
|
||||
web_shop_vue_storefront
|
||||
xml:
|
||||
web.xml
|
||||
|
||||
[register]
|
||||
model:
|
||||
web.Shop
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<data>
|
||||
<xpath expr="//notebook/page[@id='vsf']" position="inside">
|
||||
<label name="stripe_journal"/>
|
||||
<field name="stripe_journal" widget="selection"/>
|
||||
</xpath>
|
||||
</data>
|
||||
45
modules/web_shop_vue_storefront_stripe/web.py
Normal file
45
modules/web_shop_vue_storefront_stripe/web.py
Normal file
@@ -0,0 +1,45 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
from trytond.model import fields
|
||||
from trytond.pool import Pool, PoolMeta
|
||||
from trytond.pyson import Eval
|
||||
|
||||
|
||||
class Shop(metaclass=PoolMeta):
|
||||
__name__ = 'web.shop'
|
||||
|
||||
stripe_journal = fields.Many2One(
|
||||
'account.payment.journal', "Stripe Journal",
|
||||
domain=[
|
||||
('stripe_account', '!=', None),
|
||||
('currency', '=', Eval('currency', -1)),
|
||||
],
|
||||
depends=['currency'])
|
||||
|
||||
def vsf_order_create(self, data, sale, user):
|
||||
pool = Pool()
|
||||
Payment = pool.get('account.payment')
|
||||
PaymentGroup = pool.get('account.payment.group')
|
||||
sale = super().vsf_order_create(data, sale, user)
|
||||
payment_method = data['addressInformation']['payment_method_code']
|
||||
if payment_method == 'stripe':
|
||||
payment_method_additional = (
|
||||
data['addressInformation']['payment_method_additional'])
|
||||
payment = Payment()
|
||||
payment.company = sale.company
|
||||
payment.kind = 'receivable'
|
||||
payment.party = sale.party
|
||||
payment.origin = sale
|
||||
payment.amount = sale.total_amount
|
||||
payment.journal = self.stripe_journal
|
||||
payment.stripe_token = payment_method_additional['id']
|
||||
payment.stripe_chargeable = True
|
||||
payment.save()
|
||||
Payment.approve([payment])
|
||||
group = PaymentGroup(
|
||||
company=payment.company,
|
||||
journal=payment.journal,
|
||||
kind=payment.kind)
|
||||
group.save()
|
||||
Payment.process([payment], lambda: group)
|
||||
return sale
|
||||
12
modules/web_shop_vue_storefront_stripe/web.xml
Normal file
12
modules/web_shop_vue_storefront_stripe/web.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<tryton>
|
||||
<data>
|
||||
<record model="ir.ui.view" id="shop_view_form">
|
||||
<field name="model">web.shop</field>
|
||||
<field name="inherit" ref="web_shop.shop_view_form"/>
|
||||
<field name="name">shop_form</field>
|
||||
</record>
|
||||
</data>
|
||||
</tryton>
|
||||
Reference in New Issue
Block a user