예제 #1
0
 def build_item():
     item = Item()
     item.item_id = 'id-do-produto'
     item.description = 'Descricao do produto'
     item.quantity = 1
     item.amount = 15.0
     return item
예제 #2
0
    def add_item(self, item_id, description, amount, quantity, shipping_cost=None, weight=None):
        item = Item(
            item_id=item_id,
            description=description,
            amount=amount,
            quantity=quantity,
            shipping_cost=shipping_cost,
            weight=weight,
        )
        item.validate()
        if not self.payment_request.checkout.items:
            self.payment_request.checkout.items = []

        self.payment_request.checkout.items.append(item)