line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WebService::Braintree::MerchantAccount; |
2
|
|
|
|
|
|
|
$WebService::Braintree::MerchantAccount::VERSION = '0.94'; |
3
|
20
|
|
|
20
|
|
410
|
use 5.010_001; |
|
20
|
|
|
|
|
61
|
|
4
|
20
|
|
|
20
|
|
106
|
use strictures 1; |
|
20
|
|
|
|
|
129
|
|
|
20
|
|
|
|
|
730
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=head1 NAME |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
WebService::Braintree::MerchantAccount |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 PURPOSE |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
This class creates, updates, deletes, and finds merchant accounts. |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=cut |
15
|
|
|
|
|
|
|
|
16
|
20
|
|
|
20
|
|
6749
|
use WebService::Braintree::MerchantAccount::IndividualDetails; |
|
20
|
|
|
|
|
55
|
|
|
20
|
|
|
|
|
683
|
|
17
|
20
|
|
|
20
|
|
139
|
use WebService::Braintree::MerchantAccount::AddressDetails; |
|
20
|
|
|
|
|
42
|
|
|
20
|
|
|
|
|
359
|
|
18
|
20
|
|
|
20
|
|
6829
|
use WebService::Braintree::MerchantAccount::BusinessDetails; |
|
20
|
|
|
|
|
55
|
|
|
20
|
|
|
|
|
679
|
|
19
|
20
|
|
|
20
|
|
5773
|
use WebService::Braintree::MerchantAccount::FundingDetails; |
|
20
|
|
|
|
|
55
|
|
|
20
|
|
|
|
|
636
|
|
20
|
|
|
|
|
|
|
|
21
|
20
|
|
|
20
|
|
130
|
use Moose; |
|
20
|
|
|
|
|
40
|
|
|
20
|
|
|
|
|
124
|
|
22
|
|
|
|
|
|
|
extends "WebService::Braintree::ResultObject"; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head2 create() |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
This takes a hashref of parameters and returns the merchant account created. |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=cut |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub create { |
31
|
0
|
|
|
0
|
1
|
|
my ($class, $params) = @_; |
32
|
0
|
|
|
|
|
|
$class->gateway->merchant_account->create($params); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head2 find() |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
This takes a merchant_account_id returns the merchant account (if it exists). |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=cut |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub find { |
42
|
0
|
|
|
0
|
1
|
|
my ($class, $merchant_account_id) = @_; |
43
|
0
|
|
|
|
|
|
$class->gateway->merchant_account->find($merchant_account_id); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head2 all() |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
This returns all the merchant accounts. |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=cut |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub all { |
53
|
0
|
|
|
0
|
1
|
|
my $class = shift; |
54
|
0
|
|
|
|
|
|
$class->gateway->merchant_account->all; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head2 update() |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
This takes a merchant_account_id and a hashref of parameters. It will update the |
60
|
|
|
|
|
|
|
corresponding merchant account (if found) and returns the updated merchant |
61
|
|
|
|
|
|
|
account. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=cut |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub update { |
66
|
0
|
|
|
0
|
1
|
|
my ($class, $merchant_account_id, $params) = @_; |
67
|
0
|
|
|
|
|
|
$class->gateway->merchant_account->update($merchant_account_id, $params); |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub gateway { |
71
|
0
|
|
|
0
|
0
|
|
return WebService::Braintree->configuration->gateway; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
{ |
75
|
|
|
|
|
|
|
package WebService::Braintree::MerchantAccount::Status; |
76
|
|
|
|
|
|
|
$WebService::Braintree::MerchantAccount::Status::VERSION = '0.94'; |
77
|
20
|
|
|
20
|
|
115304
|
use 5.010_001; |
|
20
|
|
|
|
|
69
|
|
78
|
20
|
|
|
20
|
|
108
|
use strictures 1; |
|
20
|
|
|
|
|
106
|
|
|
20
|
|
|
|
|
699
|
|
79
|
|
|
|
|
|
|
|
80
|
20
|
|
|
20
|
|
1857
|
use constant Active => "active"; |
|
20
|
|
|
|
|
50
|
|
|
20
|
|
|
|
|
1346
|
|
81
|
20
|
|
|
20
|
|
113
|
use constant Pending => "pending"; |
|
20
|
|
|
|
|
58
|
|
|
20
|
|
|
|
|
909
|
|
82
|
20
|
|
|
20
|
|
108
|
use constant Suspended => "suspended"; |
|
20
|
|
|
|
|
37
|
|
|
20
|
|
|
|
|
1224
|
|
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
{ |
86
|
|
|
|
|
|
|
package WebService::Braintree::MerchantAccount::FundingDestination; |
87
|
|
|
|
|
|
|
$WebService::Braintree::MerchantAccount::FundingDestination::VERSION = '0.94'; |
88
|
20
|
|
|
20
|
|
275
|
use 5.010_001; |
|
20
|
|
|
|
|
71
|
|
89
|
20
|
|
|
20
|
|
183
|
use strictures 1; |
|
20
|
|
|
|
|
92
|
|
|
20
|
|
|
|
|
630
|
|
90
|
|
|
|
|
|
|
|
91
|
20
|
|
|
20
|
|
1490
|
use constant Bank => "bank"; |
|
20
|
|
|
|
|
38
|
|
|
20
|
|
|
|
|
918
|
|
92
|
20
|
|
|
20
|
|
103
|
use constant Email => "email"; |
|
20
|
|
|
|
|
39
|
|
|
20
|
|
|
|
|
914
|
|
93
|
20
|
|
|
20
|
|
103
|
use constant MobilePhone => "mobile_phone"; |
|
20
|
|
|
|
|
30
|
|
|
20
|
|
|
|
|
3491
|
|
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=head1 OBJECT METHODS |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
In addition to the methods provided by the keys returned from Braintree, this |
99
|
|
|
|
|
|
|
class provides the following methods: |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head2 master_merchant_account() |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
This returns the master merchant account (if it exists). It will be a |
104
|
|
|
|
|
|
|
L<WebService::Braintree::MerchantAccount> object. |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=cut |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
has master_merchant_account => (is => 'rw'); |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=head2 individual_details() |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
This returns the individual details of this merchant account (if they exist). It |
113
|
|
|
|
|
|
|
will be a L<WebService::Braintree::MerchantAccount::IndividualDetails> object. |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=cut |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
has individual_details => (is => 'rw'); |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=head2 business_details() |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
This returns the business details of this merchant account (if they exist). It |
122
|
|
|
|
|
|
|
will be a L<WebService::Braintree::MerchantAccount::BusinessDetails> object. |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=cut |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
has business_details => (is => 'rw'); |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=head2 funding_details() |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
This returns the funding details of this merchant account (if they exist). It |
131
|
|
|
|
|
|
|
will be a L<WebService::Braintree::MerchantAccount::FundingDetails> object. |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=cut |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
has funding_details => (is => 'rw'); |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
sub BUILD { |
138
|
0
|
|
|
0
|
0
|
|
my ($self, $attrs) = @_; |
139
|
|
|
|
|
|
|
|
140
|
0
|
|
|
|
|
|
$self->build_sub_object($attrs, |
141
|
|
|
|
|
|
|
method => 'master_merchant_account', |
142
|
|
|
|
|
|
|
class => 'MerchantAccount', |
143
|
|
|
|
|
|
|
key => 'master_merchant_account', |
144
|
|
|
|
|
|
|
); |
145
|
|
|
|
|
|
|
|
146
|
0
|
|
|
|
|
|
$self->build_sub_object($attrs, |
147
|
|
|
|
|
|
|
method => 'individual_details', |
148
|
|
|
|
|
|
|
class => 'MerchantAccount::IndividualDetails', |
149
|
|
|
|
|
|
|
key => 'individual', |
150
|
|
|
|
|
|
|
); |
151
|
|
|
|
|
|
|
|
152
|
0
|
|
|
|
|
|
$self->build_sub_object($attrs, |
153
|
|
|
|
|
|
|
method => 'business_details', |
154
|
|
|
|
|
|
|
class => 'MerchantAccount::BusinessDetails', |
155
|
|
|
|
|
|
|
key => 'business', |
156
|
|
|
|
|
|
|
); |
157
|
|
|
|
|
|
|
|
158
|
0
|
|
|
|
|
|
$self->build_sub_object($attrs, |
159
|
|
|
|
|
|
|
method => 'funding_details', |
160
|
|
|
|
|
|
|
class => 'MerchantAccount::FundingDetails', |
161
|
|
|
|
|
|
|
key => 'funding', |
162
|
|
|
|
|
|
|
); |
163
|
|
|
|
|
|
|
|
164
|
0
|
|
|
|
|
|
$self->set_attributes_from_hash($self, $attrs); |
165
|
|
|
|
|
|
|
} |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
1; |
170
|
|
|
|
|
|
|
__END__ |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
=head1 TODO |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
=over 4 |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
=item Need to document the keys and values that are returned |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
=item Need to document the required and optional input parameters |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
=item Need to document the possible errors/exceptions |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
=back |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
=cut |