summaryrefslogtreecommitdiff
path: root/FS/FS/payinfo_Mixin.pm
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2013-10-23 15:17:51 -0700
committerMark Wells <mark@freeside.biz>2013-10-23 15:17:51 -0700
commit68de99533d0612144562b0ecf8e95b3d89aa9a18 (patch)
tree0f7ba48f3f85ce195e3ac8ec0f679fb73775430c /FS/FS/payinfo_Mixin.pm
parent609c2568d272a99c659381789acce954294e41f3 (diff)
localization hook for payinfo descriptions, #24850
Diffstat (limited to 'FS/FS/payinfo_Mixin.pm')
-rw-r--r--FS/FS/payinfo_Mixin.pm21
1 files changed, 12 insertions, 9 deletions
diff --git a/FS/FS/payinfo_Mixin.pm b/FS/FS/payinfo_Mixin.pm
index ef260cf..6d58a3d 100644
--- a/FS/FS/payinfo_Mixin.pm
+++ b/FS/FS/payinfo_Mixin.pm
@@ -226,7 +226,7 @@ sub payinfo_check {
}
-=item payby_payinfo_pretty
+=item payby_payinfo_pretty [ LOCALE ]
Returns payment method and information (suitably masked, if applicable) as
a human-readable string, such as:
@@ -241,22 +241,25 @@ or
sub payby_payinfo_pretty {
my $self = shift;
+ my $locale = shift;
+ my $lh = FS::L10N->get_handle($locale);
if ( $self->payby eq 'CARD' ) {
- 'Card #'. $self->paymask;
+ $lh->maketext('Card #') . $self->paymask;
} elsif ( $self->payby eq 'CHEK' ) {
- 'E-check acct#'. $self->payinfo;
+ $lh->maketext('E-check acct#') . $self->payinfo;
} elsif ( $self->payby eq 'BILL' ) {
- 'Check #'. $self->payinfo;
+ $lh->maketext('Check #') . $self->payinfo;
} elsif ( $self->payby eq 'PREP' ) {
- 'Prepaid card #'. $self->payinfo;
+ $lh->maketext('Prepaid card #') . $self->payinfo;
} elsif ( $self->payby eq 'CASH' ) {
- 'Cash '. $self->payinfo;
+ $lh->maketext('Cash') . ' ' . $self->payinfo;
} elsif ( $self->payby eq 'WEST' ) {
- 'Western Union'; #. $self->payinfo;
+ # does Western Union localize their name?
+ $lh->maketext('Western Union');
} elsif ( $self->payby eq 'MCRD' ) {
- 'Manual credit card'; #. $self->payinfo;
+ $lh->maketext('Manual credit card');
} elsif ( $self->payby eq 'PPAL' ) {
- 'PayPal transaction#' . $self->order_number;
+ $lh->maketext('PayPal transaction#') . $self->order_number;
} else {
$self->payby. ' '. $self->payinfo;
}