lib/WebService/Braintree/_/Customer.pm

filter: Statementstmt 85.7% 42 / 49 Branchbran n/a Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 62.5% 5 / 8 Podpod 100% 2 / 2 totaltotal 79.0% 49 / 62 CC 2 SCAR 8.5
CC
2
Cov
82%
payment_methods
6.0
__ANON__
2.0
payment_types
2.0
CRAP 2.3
« lib/WebService/Braintree/_/Disbursement.pm ↑ Summary lib/WebService/Braintree/_/Transaction/DisbursementDetail.pm »
1 # vim: sw=4 ts=4 ft=perl
2  
3 package WebService::Braintree::_::Customer;
4 22 $WebService::Braintree::_::Customer::VERSION = '1.7';
5 22 ▶use 5.010_001;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 22 ▶use strictures 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 =head1 NAME
9  
10 WebService::Braintree::_::Customer
11  
12 =head1 PURPOSE
13  
14 This class represents a customer.
15  
16 This class will only be created as part of a L<response|WebService::Braintree::Result> or L<error response|WebService::Braintree::ErrorResult>.
17  
18 =cut
19  
20 22 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 22 extends 'WebService::Braintree::_';
23  
24 22 ▶use Types::Standard qw(ArrayRef);
Subroutine BEGIN: called CC=1 SCAR=0.0
25 22 ▶use WebService::Braintree::Types qw(
Subroutine BEGIN: called CC=1 SCAR=0.0
26 Address
27 AmexExpressCheckoutCard
28 AndroidPayCard
29 ApplePayCard
30 CoinbaseAccount
31 CreditCard
32 EuropeBankAccount
33 MasterpassCard
34 PayPalAccount
35 UsBankAccount
36 VenmoAccount
37 VisaCheckoutCard
38 22 );
39  
40 =head1 ATTRIBUTES
41  
42 =cut
43  
44 =head2 addresses()
45  
46 This returns the customer's addresses. This will be an arrayref of
47 L<WebService::Braintree::_::Address/>.
48  
49 =cut
50  
51 22 has addresses => (
52 is => 'ro',
53 isa => ArrayRef[Address],
54 coerce => 1,
55 );
56  
57 =head2 amex_express_checkout_cards()
58  
59 This returns the customer's Amex Express Checkout cards. This will be an arrayref of
60 L<WebService::Braintree::_::AmexExpressCheckoutCard/>.
61  
62 =cut
63  
64 22 has amex_express_checkout_cards => (
65 is => 'ro',
66 isa => ArrayRef[AmexExpressCheckoutCard],
67 coerce => 1,
68 );
69  
70 =head2 android_pay_cards()
71  
72 This returns the customer's AndroidPay cards. This will be an arrayref of
73 L<WebService::Braintree::_::AndroidPayCard/>.
74  
75 =cut
76  
77 22 has android_pay_cards => (
78 is => 'ro',
79 isa => ArrayRef[AndroidPayCard],
80 coerce => 1,
81 );
82  
83 =head2 apple_pay_cards()
84  
85 This returns the customer's ApplePay cards. This will be an arrayref of
86 L<WebService::Braintree::_::ApplePayCard/>.
87  
88 =cut
89  
90 22 has apple_pay_cards => (
91 is => 'ro',
92 isa => ArrayRef[ApplePayCard],
93 coerce => 1,
94 );
95  
96 =head2 coinbase_accounts()
97  
98 This returns the customer's Coinbase accounts. This will be an arrayref of
99 L<WebService::Braintree::_::CoinbaseAccount/>.
100  
101 =cut
102  
103 22 has coinbase_accounts => (
104 is => 'ro',
105 isa => ArrayRef[CoinbaseAccount],
106 coerce => 1,
107 );
108  
109 =head2 company()
110  
111 This is the company for this customer.
112  
113 =cut
114  
115 22 has company => (
116 is => 'ro',
117 );
118  
119 =head2 created_at()
120  
121 This returns when this customer was created.
122  
123 =cut
124  
125 22 has created_at => (
126 is => 'ro',
127 );
128  
129 =head2 credit_cards()
130  
131 This returns the customer's credit cards. This will be an arrayref of
132 L<WebService::Braintree::_::CreditCard/>.
133  
134 =cut
135  
136 22 has credit_cards => (
137 is => 'ro',
138 isa => ArrayRef[CreditCard],
139 coerce => 1,
140 );
141  
142 =head2 custom_fields()
143  
144 This is the custom fields for this customer.
145  
146 This will default to C<< {} >>
147  
148 =cut
149  
150 has custom_fields => (
151 is => 'ro',
152 0 ▶ default => sub { {} },
Subroutine __ANON__: not called CC=1 SCAR=6.9
153 22 );
154  
155 =head2 email()
156  
157 This is the email for this customer.
158  
159 =cut
160  
161 22 has email => (
162 is => 'ro',
163 );
164  
165 =head2 europe_banks_accounts()
166  
167 This returns the customer's Europe bank accounts. This will be an arrayref of
168 L<WebService::Braintree::_::EuropeBankAccount/>.
169  
170 =cut
171  
172 22 has europe_bank_accounts => (
173 is => 'ro',
174 isa => ArrayRef[EuropeBankAccount],
175 coerce => 1,
176 );
177  
178 =head2 fax()
179  
180 This is the fax for this customer.
181  
182 =cut
183  
184 22 has fax => (
185 is => 'ro',
186 );
187  
188 =head2 first_name()
189  
190 This is the first name for this customer.
191  
192 =cut
193  
194 22 has first_name => (
195 is => 'ro',
196 );
197  
198 =head2 id()
199  
200 This is the ID for this customer.
201  
202 =cut
203  
204 22 has id => (
205 is => 'ro',
206 );
207  
208 =head2 last_name()
209  
210 This is the last name for this customer.
211  
212 =cut
213  
214 22 has last_name => (
215 is => 'ro',
216 );
217  
218 =head2 masterpass_cards()
219  
220 This returns the customer's Masterpass cards. This will be an arrayref of
221 L<WebService::Braintree::_::MasterpassCard/>.
222  
223 =cut
224  
225 22 has masterpass_cards => (
226 is => 'ro',
227 isa => ArrayRef[MasterpassCard],
228 coerce => 1,
229 );
230  
231 =head2 merchant_id()
232  
233 This is the merchant ID for this customer.
234  
235 =cut
236  
237 22 has merchant_id => (
238 is => 'ro',
239 );
240  
241 =head2 paypal_accounts()
242  
243 This returns the customer's PayPal accounts. This will be an arrayref of
244 L<WebService::Braintree::_::PayPalAccount/>.
245  
246 =cut
247  
248 22 has paypal_accounts => (
249 is => 'ro',
250 isa => ArrayRef[PayPalAccount],
251 coerce => 1,
252 );
253  
254 =head2 phone()
255  
256 This is the phone for this customer.
257  
258 =cut
259  
260 22 has phone => (
261 is => 'ro',
262 );
263  
264 =head2 updated_at()
265  
266 This returns when this customer was last updated.
267  
268 =cut
269  
270 22 has updated_at => (
271 is => 'ro',
272 );
273  
274 =head2 us_bank_accounts()
275  
276 This returns the customer's US bank accounts. This will be an arrayref of
277 L<WebService::Braintree::_::UsBankAccount/>.
278  
279 =cut
280  
281 22 has us_bank_accounts => (
282 is => 'ro',
283 isa => ArrayRef[UsBankAccount],
284 coerce => 1,
285 );
286  
287 =head2 venmo_accounts()
288  
289 This returns the customer's Venmo accounts. This will be an arrayref of
290 L<WebService::Braintree::_::VenmoAccount/>.
291  
292 =cut
293  
294 22 has venmo_accounts => (
295 is => 'ro',
296 isa => ArrayRef[VenmoAccount],
297 coerce => 1,
298 );
299  
300 =head2 visa_checkout_cards()
301  
302 This returns the customer's VisaCheckout cards. This will be an arrayref of
303 L<WebService::Braintree::_::VisaCheckoutCard/>.
304  
305 =cut
306  
307 22 has visa_checkout_cards => (
308 is => 'ro',
309 isa => ArrayRef[VisaCheckoutCard],
310 coerce => 1,
311 );
312  
313 =head2 website()
314  
315 This is the website for this customer.
316  
317 =cut
318  
319 22 has website => (
320 is => 'ro',
321 );
322  
323 =head1 METHODS
324  
325 =head2 payment_types()
326  
327 This returns a list of all the payment types supported by this class.
328  
329 =cut
330  
331 0 ▶sub payment_types {
Subroutine payment_types: not called CC=1 SCAR=6.9
Pod documented
332 0 return qw(
333 amex_express_checkout_cards
334 android_pay_cards
335 apple_pay_cards
336 coinbase_accounts
337 credit_cards
338 europe_bank_accounts
339 masterpass_cards
340 paypal_accounts
341 us_bank_accounts
342 venmo_accounts
343 visa_checkout_cards
344 );
345 }
346  
347 =head2 payment_methods()
348  
349 This returns an arrayref of all available payment methods across all types. The
350 return value will be in the order specified in L</payment_types()>
351  
352 =cut
353  
354 0 ▶sub payment_methods {
Subroutine payment_methods: not called CC=2 SCAR=17.9
Pod documented
355 0 my $self = shift;
356  
357 my @methods = map {
358 0 ▶ @{$self->$_ // []}
Condition0%0/2
$self->$_ // []
l!l
00
MC/DC0%0/1
$self->$_ // []
$self->$_
Truth table0%0/2
A
A= $self->$_
Aresult
11
00
359 } $self->payment_types;
360  
361 0 return \@methods;
362 }
363  
364 22 __PACKAGE__->meta->make_immutable;
365  
366 22 1;
367 __END__
« lib/WebService/Braintree/_/Disbursement.pm ↑ Summary lib/WebService/Braintree/_/Transaction/DisbursementDetail.pm »