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

Card year expiry date must be saved as Char on the database #24

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion checkout.py
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ def complete_using_credit_card(cls, credit_card_form):
profile_wiz.card_info.expiry_month = \
credit_card_form.expiry_month.data
profile_wiz.card_info.expiry_year = \
credit_card_form.expiry_year.data
str(credit_card_form.expiry_year.data)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not make the expiry_year field itself char ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the validator in the form requires it to be int in order to check correctly that year is in the selection.

Neverdeles, we can cast the selection values to string on the validator.

profile_wiz.card_info.csc = credit_card_form.cvv.data

with Transaction().set_context(return_profile=True):
Expand Down