Right now the field, used to store credit card expiration date is using kCCDateFormatter
. It appears that there is a bug in the formatter class and following code was added to OrdersItem
class to overcome this:
Code Block | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
public function SetFieldsFromHash($hash, $skip_fields = Array (), $set_fields = Array ()) { parent::SetFieldsFromHash($hash, $skip_fields, $set_fields); $options = $this->GetFieldOptions('PaymentCCExpDate'); if ( $this->GetDirtyField($options['month_field']) || $this->GetDirtyField($options['year_field']) ) { $this->SetDirtyField('PaymentCCExpDate', 0); $this->SetField('PaymentCCExpDate', 0); } } |
...
- set the formatter on month/year fields, but do nothing
- the
kDBItem::UpdateFormattersMasterFields
method is called already before validation happens and combines both fields into one