Ejemplo n.º 1
0
    def place_order(self, article_quantity):
        payment_method = PaymentMethod.bank_transfer

        cart = Cart()
        cart.add_item(self.article, article_quantity)

        return order_service.place_order(self.shop.id, self.orderer,
                                         payment_method, cart)
Ejemplo n.º 2
0
    def place_order(self, shop_id, orderer):
        payment_method = PaymentMethod.bank_transfer

        cart = Cart()

        order, _ = order_service.place_order(shop_id, orderer, payment_method,
                                             cart)

        return order
Ejemplo n.º 3
0
    def place_order(self, articles_with_quantity):
        orderer = create_orderer(self.buyer)

        cart = Cart()
        for article, quantity in articles_with_quantity:
            cart.add_item(article, quantity)

        return order_service.place_order(self.shop.id, orderer,
                                         ANY_PAYMENT_METHOD, cart)
Ejemplo n.º 4
0
    def place_order(self, quantified_articles):
        orderer = create_orderer(self.orderer)
        payment_method = PaymentMethod.bank_transfer
        cart = Cart()

        for article, quantity_to_order in quantified_articles:
            cart.add_item(article, quantity_to_order)

        return order_service.place_order(self.shop.id, orderer, payment_method,
                                         cart)
Ejemplo n.º 5
0
    def place_order(self):
        orderer = self.create_orderer()
        payment_method = PaymentMethod.bank_transfer
        cart = self.create_cart()
        created_at = datetime(2015, 2, 26, 12, 26, 24)  # UTC

        return order_service.place_order(self.shop.id,
                                         orderer,
                                         payment_method,
                                         cart,
                                         created_at=created_at)
Ejemplo n.º 6
0
    def place_order(self, articles):
        payment_method = PaymentMethod.bank_transfer

        cart = Cart()
        for article, quantity in articles:
            cart.add_item(article, quantity)

        order, _ = order_service.place_order(self.shop.id, self.orderer,
                                             payment_method, cart)

        return order
Ejemplo n.º 7
0
    def place_order_with_items(self, shop_id, orderer, created_at,
                               items_with_quantity):
        orderer = create_orderer(orderer)
        payment_method = PaymentMethod.bank_transfer
        cart = Cart()

        if items_with_quantity is not None:
            for article, quantity in items_with_quantity:
                cart.add_item(article, quantity)

        order, _ = order_service.place_order(self.shop.id, orderer,
                                             payment_method, cart)

        if created_at is not None:
            db_order = Order.query.get(order.id)
            db_order.created_at = created_at
            self.db.session.commit()

        return order.id