mirror of
https://github.com/pretix/pretix.git
synced 2026-05-08 15:44:02 +00:00
Add meta_info to orders
This commit is contained in:
@@ -16,7 +16,7 @@ from pretix.base.services.orders import OrderError, perform_order
|
||||
from pretix.base.signals import register_payment_providers
|
||||
from pretix.multidomain.urlreverse import eventreverse
|
||||
from pretix.presale.forms.checkout import ContactForm, InvoiceAddressForm
|
||||
from pretix.presale.signals import checkout_flow_steps
|
||||
from pretix.presale.signals import checkout_flow_steps, order_meta_from_request
|
||||
from pretix.presale.views import CartMixin, get_cart_total
|
||||
from pretix.presale.views.async import AsyncAction
|
||||
from pretix.presale.views.questions import QuestionsViewMixin
|
||||
@@ -335,9 +335,12 @@ class ConfirmStep(CartMixin, AsyncAction, TemplateFlowStep):
|
||||
|
||||
def post(self, request):
|
||||
self.request = request
|
||||
meta_info = {}
|
||||
for receiver, response in order_meta_from_request.send(sender=request.event, request=request):
|
||||
meta_info.update(response)
|
||||
return self.do(self.request.event.id, self.payment_provider.identifier,
|
||||
[p.id for p in self.positions], request.session.get('email'),
|
||||
translation.get_language(), self.invoice_address.pk)
|
||||
translation.get_language(), self.invoice_address.pk, meta_info)
|
||||
|
||||
def get_success_message(self, value):
|
||||
return None
|
||||
|
||||
@@ -37,6 +37,17 @@ This signal is sent out to display additional information on the "redeem a vouch
|
||||
As with all plugin signals, the ``sender`` keyword argument will contain the event.
|
||||
"""
|
||||
|
||||
order_meta_from_request = EventPluginSignal(
|
||||
providing_args=["request"]
|
||||
)
|
||||
"""
|
||||
This signal is sent before an order is created through the pretixpresale frontend. It allows you
|
||||
to return a dictionary that will be merged in the meta_info attribute of the order.
|
||||
You will recieve the request triggering the order creation as the ``request`` keyword argument.
|
||||
|
||||
As with all event-plugin signals, the ``sender`` keyword argument will contain the event.
|
||||
"""
|
||||
|
||||
order_info = EventPluginSignal(
|
||||
providing_args=["order"]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user