initial commit
[Business-BatchPayment.git] / BatchPayment / Batch.pm
1 =head1 NAME
2
3 Business::BatchPayment::Batch
4
5 =head1 DESCRIPTION
6
7 A Business::BatchPayment::Batch object represents a group of payment 
8 requests or confirmations (L<Business::BatchPayment::Item>) submitted
9 to a bank (or returned from a bank) as a batch.
10
11 =head1 ATTRIBUTES
12
13 =over 4
14
15 =item batch_id - Batch identifier.  The format is processor-specific
16 but usually must be a positive integer, if it's used at all.
17
18 Processor modules may include C<batch_id> in a reply batch ONLY if 
19 it is guaranteed to match the batch_id of a request batch AND all 
20 the items in the reply batch come from that request batch.  Otherwise, 
21 C<batch_id> must be null.  It must always be null when using one-way
22 (receive-only) workflow, since there are no request batches.
23
24 =item items - An arrayref of L<Business::BatchPayment::Item> objects
25 included in the batch.
26
27 =back
28
29 =cut
30
31 package Business::BatchPayment::Batch;
32
33 use Moose;
34
35 has batch_id => (
36   is => 'rw',
37   isa => 'Str',
38   default => '',
39 );
40
41 has items => (
42   traits => ['Array'],
43   is => 'rw',
44   isa => 'ArrayRef[Business::BatchPayment::Item]',
45   handles =>  {
46     count     => 'count',
47     elements  => 'elements',
48     push      => 'push',
49   },
50 );
51
52 1;