summaryrefslogtreecommitdiff
path: root/FS/FS/payinfo_Mixin.pm
diff options
context:
space:
mode:
authorJonathan Prykop <jonathan@freeside.biz>2016-01-15 12:41:48 -0600
committerJonathan Prykop <jonathan@freeside.biz>2016-01-15 12:41:48 -0600
commit768ab093771b3305a67c9d929b461ef777ecdad8 (patch)
tree96738b388cea6031b564e96ceeaa884cd336d06f /FS/FS/payinfo_Mixin.pm
parent873c5e2e62ccdbfc0632fdc27151cd040a12c3f6 (diff)
RT#38363: use cust_payby when saving cards during payments
Diffstat (limited to 'FS/FS/payinfo_Mixin.pm')
-rw-r--r--FS/FS/payinfo_Mixin.pm18
1 files changed, 18 insertions, 0 deletions
diff --git a/FS/FS/payinfo_Mixin.pm b/FS/FS/payinfo_Mixin.pm
index 6b96bbe..56efbc4 100644
--- a/FS/FS/payinfo_Mixin.pm
+++ b/FS/FS/payinfo_Mixin.pm
@@ -330,6 +330,24 @@ sub display_status {
}
}
+=item paydate_monthyear
+
+Returns a two-element list consisting of the month and year of this customer's
+paydate (credit card expiration date for CARD customers)
+
+=cut
+
+sub paydate_monthyear {
+ my $self = shift;
+ if ( $self->paydate =~ /^(\d{4})-(\d{1,2})-\d{1,2}$/ ) { #Pg date format
+ ( $2, $1 );
+ } elsif ( $self->paydate =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) {
+ ( $1, $3 );
+ } else {
+ ('', '');
+ }
+}
+
=back
=head1 BUGS