Exemple #1
0
    def order(self):
        """Create the order object."""
        from pizzapi import Order
        order = Order(self.dominos.closest_store, self.dominos.customer,
                      self.dominos.address, self.dominos.country)

        for code in self._product_codes:
            order.add_item(code)

        return order
Exemple #2
0
    def order(self):
        """Create the order object."""
        if self.dominos.closest_store is None:
            raise StoreException

        order = Order(
            self.dominos.closest_store,
            self.dominos.customer,
            self.dominos.address,
            self.dominos.country,
        )

        for code in self._product_codes:
            order.add_item(code)

        return order
    def order(self):
        """Create the order object."""
        from pizzapi import Order
        from pizzapi.address import StoreException

        if self.dominos.closest_store is None:
            raise StoreException

        order = Order(
            self.dominos.closest_store,
            self.dominos.customer,
            self.dominos.address,
            self.dominos.country)

        for code in self._product_codes:
            order.add_item(code)

        return order
Exemple #4
0
def orderPizza():
    print "starting to order the pizza"
    file = open("info.json").read()
    values = json.loads(file)

    customer = Customer(values["first_name"], values["last_name"],
                        values["email"], values["phone_number"],
                        values["address"])
    address = Address(*customer.address.split(','))
    store = address.closest_store()

    print "ordering from store" + str(store.get_details())

    order = Order(store, customer, address)
    order.add_item(values["pizza_code"])

    card = PaymentObject(values["cc_number"], values["cc_expiration"],
                         values["cc_security"], values["cc_zip"])
    order.pay_with()
    print "congrats! order was succesful"