## $Id$
##
## Copyright (C) 2015 Uli Fouquet & Henrik Bettermann
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##
"""
Helpers for tests with payment components
"""
import decimal
from zope.interface import implementer
from waeup.ikoba.payments.payment import PaymentItem
from waeup.ikoba.payments.interfaces import IPayer, IPayable


@implementer(IPayer)
class FakePayer(object):

    def __init__(
        self, payer_id=u'PAYER_01', first_name=u'Anna', last_name='Tester'):
        self.payer_id = payer_id
        self.first_name = first_name
        self.last_name = last_name


FAKE_PAYMENT_ITEMS = (
    PaymentItem(u'Item title 1', decimal.Decimal("1.00")),
    PaymentItem(u'Item title 2', decimal.Decimal("2.2")),
    )


@implementer(IPayable)
class FakePayable(object):

    payable_id = u'id1'

    def __init__(self, payable_id=u'PAYABLE_01', title=u'title',
                 currency=u'USD', payment_items=FAKE_PAYMENT_ITEMS):
        self.payable_id = payable_id
        self.title = title
        self.currency = currency
        self.payment_items = payment_items
