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