Total Complexity | 4 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | """ |
||
2 | :Copyright: 2006-2020 Jochen Kupperschmidt |
||
3 | :License: Modified BSD, see LICENSE for details. |
||
4 | """ |
||
5 | |||
6 | from byceps.services.shop.cart.models import Cart |
||
7 | from byceps.services.shop.order.transfer.models import PaymentMethod |
||
8 | from byceps.services.shop.order import service as order_service |
||
9 | from byceps.services.ticketing import ticket_service |
||
10 | |||
11 | |||
12 | def get_tickets_for_order(order): |
||
13 | return ticket_service.find_tickets_created_by_order(order.order_number) |
||
14 | |||
15 | |||
16 | def place_order(storefront_id, orderer, articles_with_quantity): |
||
17 | cart = Cart() |
||
18 | for article, quantity in articles_with_quantity: |
||
19 | cart.add_item(article, quantity) |
||
20 | |||
21 | order, _ = order_service.place_order(storefront_id, orderer, cart) |
||
22 | |||
23 | return order |
||
24 | |||
25 | |||
26 | def mark_order_as_paid(order_id, admin_id): |
||
27 | order_service.mark_order_as_paid( |
||
28 | order_id, PaymentMethod.bank_transfer, admin_id |
||
29 | ) |
||
30 |