Ignore:
Timestamp:
20 Jan 2015, 06:13:00 (10 years ago)
Author:
uli
Message:

Adapt (nice) change in official Paypal API for ICreditCardToken.

Location:
main/waeup.ikoba/trunk/src/waeup/ikoba/payments
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/payments/paypal.py

    r12496 r12497  
    462462        )
    463463
    464     payer_id = schema.TextLine(
     464    external_customer_id = schema.TextLine(
    465465        title=u'Payer ID',
    466466        description=(u'A unique identifier for the credit card. This '
     
    512512    grok.implements(ICreditCardToken)
    513513
    514     def __init__(self, credit_card_id, payer_id=None, last4=None,
     514    def __init__(self, credit_card_id, external_customer_id=None, last4=None,
    515515                 credit_card_type=None, expire_month=None, expire_year=None):
    516516        self.credit_card_id = credit_card_id
    517         self.payer_id = payer_id
     517        self.external_customer_id = external_customer_id
    518518        self.last4 = last4
    519519        self.credit_card_type = credit_card_type
  • main/waeup.ikoba/trunk/src/waeup/ikoba/payments/tests/test_paypal.py

    r12496 r12497  
    386386            )
    387387        assert token.credit_card_id == u"12345678"
    388         assert token.payer_id is None
     388        assert token.external_customer_id is None
    389389        assert token.credit_card_type is None
    390390        assert token.expire_month is None
     
    392392        assert token.last4 is None
    393393
    394     def test_payer_id_given(self):
    395         # we do not override given payer ids
     394    def test_customer_id_given(self):
     395        # we do not override given customer ids
    396396        token = CreditCardToken(
    397397            credit_card_id=u"12345678",
    398             payer_id=u'MySpecialPayerId',
    399             )
    400         assert token.payer_id == u'MySpecialPayerId'
     398            external_customer_id=u'MySpecialPayerId',
     399            )
     400        assert token.external_customer_id == u'MySpecialPayerId'
    401401
    402402    def test_to_str(self):
     
    404404        token = CreditCardToken(
    405405            credit_card_type=u"visa",
    406             payer_id=u"PAYER_0123456789012345678901",
     406            external_customer_id=u"PAYER_0123456789012345678901",
    407407            credit_card_id=u"12345678",
    408408            last4="8901",
     
    414414            {
    415415                "credit_card_id": u"12345678",
    416                 "payer_id": u"PAYER_0123456789012345678901",
     416                "external_customer_id": u"PAYER_0123456789012345678901",
    417417                "last4": u"8901",
    418418                "type": u"visa",
     
    457457        token = CreditCardToken(
    458458            credit_card_type=u"visa",
    459             payer_id=u"PAYER_0123456789012345678901",
     459            external_customer_id=u"PAYER_0123456789012345678901",
    460460            credit_card_id=u"12345678",
    461461            last4="8901",
     
    470470                "credit_card_token": {
    471471                    "credit_card_id": u"12345678",
    472                     "payer_id": u"PAYER_0123456789012345678901",
     472                    "external_customer_id": u"PAYER_0123456789012345678901",
    473473                    "last4": u"8901",
    474474                    "type": u"visa",
Note: See TracChangeset for help on using the changeset viewer.