Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The CreditCardData.short_expiry property returns the wrong value #3

Open
anthonyjb opened this issue Dec 19, 2018 · 1 comment
Open

Comments

@anthonyjb
Copy link

Currently the example of how to set the expiry date for a card is shown as:

card.exp_month = '01'
card.exp_year = '2019'

However, the <expdate> tag with the request sent to the API is being incorrectly set, so for the example above the <expdate> would be set to 2020.

The reason for this is the short_code property against the CreditCardData class:

    @property
    def short_expiry(self):
        '''
        The card's expiration date in `MMYY` format.
        '''

        month = str(self.exp_month).zfill(2)
        year = str(self.exp_year).zfill(4)[:2]

        return '{}{}'.format(month, year)

The year assignment selects the first 2 digits of the year not the last 2, it needs to be:

year = str(self.exp_year).zfill(4)[2:]
@slogsdon
Copy link

slogsdon commented Jan 8, 2019

@anthonyjb Apologies for the delay, and thanks for the report! We'll work on getting this fixed within the SDK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants