enable CardFortress in test database, #71513
[freeside.git] / FS / FS / cdr.pm
index d3d62e0..c4e9c47 100644 (file)
@@ -28,10 +28,11 @@ use FS::rate_detail;
 # LRN lookup
 use LWP::UserAgent;
 use HTTP::Request::Common qw(POST);
+use IO::Socket::SSL;
 use Cpanel::JSON::XS qw(decode_json);
 
 @ISA = qw(FS::Record);
-@EXPORT_OK = qw( _cdr_date_parser_maker _cdr_min_parser_maker );
+@EXPORT_OK = qw( _cdr_date_parser_maker _cdr_min_parser_maker _cdr_date_parse );
 
 $DEBUG = 0;
 $me = '[FS::cdr]';
@@ -507,8 +508,9 @@ sub set_status_and_rated_price {
         rated_price => $rated_price,
         status      => $status,
     });
-    $term->rated_seconds($opt{rated_seconds}) if exists($opt{rated_seconds});
-    $term->rated_minutes($opt{rated_minutes}) if exists($opt{rated_minutes});
+    foreach (qw(rated_seconds rated_minutes rated_granularity)) {
+      $term->set($_, $opt{$_}) if exists($opt{$_});
+    }
     $term->svcnum($svcnum) if $svcnum;
     return $term->insert;
 
@@ -1497,7 +1499,13 @@ sub get_lrn {
   my $self = shift;
   my $field = shift;
 
-  my $ua = LWP::UserAgent->new;
+  my $ua = LWP::UserAgent->new(
+             'ssl_opts' => {
+               verify_hostname => 0,
+               SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_NONE,
+             },
+           );
+
   my $url = 'https://ws.freeside.biz/get_lrn';
 
   my %content = ( 'support-key' => $support_key,