line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Business::CPI::Role::Gateway::Base; |
2
|
|
|
|
|
|
|
# ABSTRACT: Basic role for all gateway drivers |
3
|
6
|
|
|
6
|
|
42306
|
use Moo::Role; |
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
40
|
|
4
|
6
|
|
|
6
|
|
2078
|
use utf8; |
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
54
|
|
5
|
6
|
|
|
6
|
|
2457
|
use Business::CPI::Util; |
|
6
|
|
|
|
|
14
|
|
|
6
|
|
|
|
|
193
|
|
6
|
6
|
|
|
6
|
|
2668
|
use Business::CPI::Util::EmptyLogger; |
|
6
|
|
|
|
|
39
|
|
|
6
|
|
|
|
|
2186
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.923'; # VERSION |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
has driver_name => ( |
11
|
|
|
|
|
|
|
is => 'ro', |
12
|
|
|
|
|
|
|
default => sub { ( split /::/, ref $_[0] )[-1] }, |
13
|
|
|
|
|
|
|
); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has log => ( |
16
|
|
|
|
|
|
|
is => 'ro', |
17
|
|
|
|
|
|
|
default => sub { Business::CPI::Util::EmptyLogger->new }, |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
has item_class => ( |
21
|
|
|
|
|
|
|
is => 'lazy', |
22
|
|
|
|
|
|
|
default => sub { shift->_load_class('Item') }, |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
has cart_class => ( |
26
|
|
|
|
|
|
|
is => 'lazy', |
27
|
|
|
|
|
|
|
default => sub { shift->_load_class('Cart') }, |
28
|
|
|
|
|
|
|
); |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
has buyer_class => ( |
31
|
|
|
|
|
|
|
is => 'lazy', |
32
|
|
|
|
|
|
|
default => sub { shift->_load_class('Buyer') }, |
33
|
|
|
|
|
|
|
); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
has receiver_class => ( |
36
|
|
|
|
|
|
|
is => 'lazy', |
37
|
|
|
|
|
|
|
default => sub { shift->_load_class('Receiver') }, |
38
|
|
|
|
|
|
|
); |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
has account_class => ( |
41
|
|
|
|
|
|
|
is => 'lazy', |
42
|
|
|
|
|
|
|
default => sub { shift->_load_class('Account') }, |
43
|
|
|
|
|
|
|
); |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
has account_address_class => ( |
46
|
|
|
|
|
|
|
is => 'lazy', |
47
|
|
|
|
|
|
|
default => sub { shift->_load_class('Account::Address') }, |
48
|
|
|
|
|
|
|
); |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
has account_business_class => ( |
51
|
|
|
|
|
|
|
is => 'lazy', |
52
|
|
|
|
|
|
|
default => sub { shift->_load_class('Account::Business') }, |
53
|
|
|
|
|
|
|
); |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub _load_class { |
56
|
15
|
|
|
15
|
|
174
|
Business::CPI::Util::load_class(shift->driver_name, @_); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
__END__ |