initial commit
[Business-BatchPayment.git] / BatchPayment / Transport.pm
1 package Business::BatchPayment::Transport;
2
3 use Moose::Role;
4 with 'Business::BatchPayment::Debug';
5
6 requires 'upload';
7 requires 'download';
8
9 =head1 NAME
10
11 Business::BatchPayment::Transport
12
13 =head1 USAGE
14
15 Business::BatchPayment::Processor classes must have a 'transport' attribute
16 which does the Business::BatchPayment::Transport role (implements 'upload'
17 and 'download').  The B::BP::Processor class can implement 'default_transport'
18 to construct a B::BP::Transport object.
19
20 'upload' must take a scalar argument containing the (correctly formatted)
21 batch for upload.  On success, it may return nothing, or a scalar identifier
22 for the batch (such as a serial number) if the gateway requires one.
23
24 'download' takes the return value from 'upload' (if any) as its argument, 
25 and returns any number of scalars containing batch files.  If there are no 
26 batches available, it should return an empty list.
27
28 Both of these methods should die on error.
29
30 =cut
31
32 1;