X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpayinfo_Mixin.pm;h=ef260cf2c90a14ae0e78a9577b044e20cf16a67d;hb=b198322c5f3c1d26674ff12f93abf0d55e09f731;hp=66c1e590dbe0bbcf2254fdc5e8a8456bee99e414;hpb=d5fa12d1022afb592e80803971e90d18eac414e0;p=freeside.git diff --git a/FS/FS/payinfo_Mixin.pm b/FS/FS/payinfo_Mixin.pm index 66c1e590d..ef260cf2c 100644 --- a/FS/FS/payinfo_Mixin.pm +++ b/FS/FS/payinfo_Mixin.pm @@ -76,20 +76,16 @@ Card Verification Value, "CVV2" (also known as CVC2 or CID), the 3 or 4 digit nu =cut +#this prevents encrypting empty values on insert? sub paycvv { my($self,$paycvv) = @_; - # This is only allowed in cust_main... Even then it really shouldn't be stored... - if ($self->table eq 'cust_main') { - if ( defined($paycvv) ) { - $self->setfield('paycvv', $paycvv); # This is okay since we are the 'setter' - } else { - $paycvv = $self->getfield('paycvv'); # This is okay since we are the 'getter' - return $paycvv; - } + # This is only allowed in cust_payby (formerly cust_main) + # It shouldn't be stored longer than necessary to run the first transaction + if ( defined($paycvv) ) { + $self->setfield('paycvv', $paycvv); } else { -# warn "This doesn't work for other tables besides cust_main - ''; - } + $self->getfield('paycvv'); + } } =item paymask