Parse-PayPal-TxDetailReport

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN



0.005   2016-07-21 (PERLANCAR)

	- Initialize transactions to avoid crash when there is no
	  transactions in input.


0.004   2016-07-21 (PERLANCAR)

	- Also handle BOM on strings.


0.003   2016-07-21 (PERLANCAR)

	- Handle Byte Order Mark on files.


0.002   2016-07-21 (PERLANCAR)

        - Also accept strings as inputs as alternative to filenames.

META.json  view on Meta::CPAN

            "Test::Rinci" : "0.01"
         },
         "x_spec" : {
            "Rinci" : "v1.1.0"
         }
      },
      "runtime" : {
         "requires" : {
            "DateTime::Format::Flexible" : "0",
            "Exporter" : "0",
            "File::BOM" : "0",
            "IO::Scalar" : "0",
            "String::BOM" : "0",
            "Text::CSV" : "0",
            "perl" : "5.010001",
            "strict" : "0",
            "warnings" : "0"
         }
      },
      "test" : {
         "requires" : {
            "File::Spec" : "0",
            "IO::Handle" : "0",

META.yml  view on Meta::CPAN

dynamic_config: 0
generated_by: 'Dist::Zilla version 6.008, CPAN::Meta::Converter version 2.150010'
license: perl
meta-spec:
  url: http://module-build.sourceforge.net/META-spec-v1.4.html
  version: '1.4'
name: Parse-PayPal-TxDetailReport
requires:
  DateTime::Format::Flexible: '0'
  Exporter: '0'
  File::BOM: '0'
  IO::Scalar: '0'
  String::BOM: '0'
  Text::CSV: '0'
  perl: '5.010001'
  strict: '0'
  warnings: '0'
resources:
  bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=Parse-PayPal-TxDetailReport
  homepage: https://metacpan.org/release/Parse-PayPal-TxDetailReport
  repository: git://github.com/perlancar/perl-Parse-PayPal-TxDetailReport.git
version: '0.007'
x_Dist_Zilla:

Makefile.PL  view on Meta::CPAN

  "CONFIGURE_REQUIRES" => {
    "ExtUtils::MakeMaker" => 0
  },
  "DISTNAME" => "Parse-PayPal-TxDetailReport",
  "LICENSE" => "perl",
  "MIN_PERL_VERSION" => "5.010001",
  "NAME" => "Parse::PayPal::TxDetailReport",
  "PREREQ_PM" => {
    "DateTime::Format::Flexible" => 0,
    "Exporter" => 0,
    "File::BOM" => 0,
    "IO::Scalar" => 0,
    "String::BOM" => 0,
    "Text::CSV" => 0,
    "strict" => 0,
    "warnings" => 0
  },
  "TEST_REQUIRES" => {
    "File::Spec" => 0,
    "IO::Handle" => 0,
    "IPC::Open3" => 0,
    "Test::More" => 0
  },
  "VERSION" => "0.007",
  "test" => {
    "TESTS" => "t/*.t"
  }
);


my %FallbackPrereqs = (
  "DateTime::Format::Flexible" => 0,
  "Exporter" => 0,
  "File::BOM" => 0,
  "File::Spec" => 0,
  "IO::Handle" => 0,
  "IO::Scalar" => 0,
  "IPC::Open3" => 0,
  "String::BOM" => 0,
  "Test::More" => 0,
  "Text::CSV" => 0,
  "strict" => 0,
  "warnings" => 0
);


unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
  delete $WriteMakefileArgs{TEST_REQUIRES};
  delete $WriteMakefileArgs{BUILD_REQUIRES};

dist.ini  view on Meta::CPAN

:version=0.52

[Prereqs / TestRequires]

[Prereqs]
perl = 5.010001
strict=0
warnings=0
DateTime::Format::Flexible=0
Exporter=0
File::BOM=0
IO::Scalar=0
String::BOM=0
Text::CSV=0

[Acme::CPANLists::Whitelist]
module=Log::Any

[Prereqs / DevelopX_spec]
-phase=develop
-relationship=x_spec
Rinci=1.1.0

lib/Parse/PayPal/TxDetailReport.pm  view on Meta::CPAN

};
sub parse_paypal_txdetail_report {
    my %args = @_;

    my $format = $args{format};

    my @handles;
    my @files;
    if (my $strings = $args{strings}) {
        require IO::Scalar;
        require String::BOM;

        if (!$format) {
            $format = $strings->[0] =~ /\t/ ? 'tsv' : 'csv';
        }
        for my $str0 (@{ $strings }) {
            my $str = String::BOM::strip_bom_from_string($str0);
            my $fh = IO::Scalar->new(\$str);
            push @handles, $fh;
            push @files, "string";
        }
    } elsif (my $files = $args{files}) {
        require File::BOM;

        if (!$format) {
            $format = $files->[0] =~ /\.(csv)\z/i ? 'csv' : 'tsv';
        }
        for my $file (@{ $files }) {
            open my($fh), "<:encoding(utf8):via(File::BOM)", $file
                or return [500, "Can't open file '$file': $!"];

            push @handles, $fh;
            push @files, $file;
        }
    } else {
        return [400, "Please specify files (or strings)"];
    }

    my $res = [200, "OK", {



( run in 0.281 second using v1.01-cache-2.11-cpan-131fc08a04b )