File Coverage

lib/Net/API/Stripe/Customer/Card.pm
Criterion Covered Total %
statement 19 20 95.0
branch n/a
condition n/a
subroutine 7 8 87.5
pod 1 1 100.0
total 27 29 93.1


line stmt bran cond sub pod time code
1             ##----------------------------------------------------------------------------
2             ## Stripe API - ~/lib/Net/API/Stripe/Customer/Card.pm
3             ## Version v0.2.0
4             ## Copyright(c) 2019 DEGUEST Pte. Ltd.
5             ## Author: Jacques Deguest <jack@deguest.jp>
6             ## Created 2022/09/30
7             ## Modified 2022/10/29
8             ##
9             ##----------------------------------------------------------------------------
10             ## https://stripe.com/docs/api/customer_bank_accounts
11             package Net::API::Stripe::Customer::Card;
12             BEGIN
13             {
14 2     2   21641606 use strict;
  2         28  
  2         67  
15 2     2   11 use warnings;
  2         4  
  2         68  
16 2     2   10 use parent qw( Net::API::Stripe::Connect::ExternalAccount::Card );
  2         3  
  2         12  
17 2     2   160 use vars qw( $VERSION );
  2         16  
  2         120  
18 2     2   37 our( $VERSION ) = 'v0.2.0';
19             };
20              
21 2     2   11 use strict;
  2         4  
  2         37  
22 2     2   10 use warnings;
  2         4  
  2         131  
23              
24 0     0 1   sub mandate { return( shift->_set_get_scalar( 'mandate', @_ ) ); }
25              
26             1;
27              
28             __END__
29              
30             =encoding utf8
31              
32             =head1 NAME
33              
34             Net::API::Stripe::Customer::Card - A Stripe Customer Card Object
35              
36             =head1 SYNOPSIS
37              
38             my $card = $stripe->customer_card({
39             account => 'acct_fake123456789',
40             # Or you can also simply pass a Net::API::Stripe::Address object
41             # address => $address_object
42             address_line1 => '1-2-3 Kudan-Minami, Chiyoda-ku',
43             address_line2 => 'Big bldg. 12F',
44             address_city => 'Tokyo',
45             address_zip => '123-4567',
46             address_country => 'jp',
47             brand => 'visa',
48             country => 'jp',
49             currency => 'jpy',
50             customer => $customer_object,
51             cvc => 123,
52             # Boolean
53             default_for_currency => 1,
54             exp_month => 12,
55             exp_year => 2030,
56             funding => 'debit',
57             metadata => { transaction_id => 123, customer_id => 456 },
58             name => 'John Doe',
59             });
60              
61             See documentation in L<Net::API::Stripe> for example to make api calls to Stripe to create those objects.
62              
63             =head1 VERSION
64              
65             v0.2.0
66              
67             =head1 DESCRIPTION
68              
69             This class represents a customer card. It is almost the same as the L<external account|Net::API::Stripe::Connect::ExternalAccount::Card>, and it actually inherits all of its methods from it.
70              
71             =head1 API SAMPLE
72              
73             {
74             "id": "card_1LnbQv2eZvKYlo2ClaAC0Zy9",
75             "object": "card",
76             "address_city": null,
77             "address_country": null,
78             "address_line1": null,
79             "address_line1_check": null,
80             "address_line2": null,
81             "address_state": null,
82             "address_zip": null,
83             "address_zip_check": null,
84             "brand": "Visa",
85             "country": "US",
86             "customer": null,
87             "cvc_check": "pass",
88             "dynamic_last4": null,
89             "exp_month": 8,
90             "exp_year": 2023,
91             "fingerprint": "Xt5EWLLDS7FJjR1c",
92             "funding": "credit",
93             "last4": "4242",
94             "metadata": {},
95             "name": null,
96             "redaction": null,
97             "tokenization_method": null
98             }
99              
100             =head1 HISTORY
101              
102             =head2 v0.1.0
103              
104             Initial version
105              
106             =head1 AUTHOR
107              
108             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
109              
110             =head1 SEE ALSO
111              
112             Stripe API documentation:
113              
114             L<https://stripe.com/docs/api/cards>, L<https://stripe.com/docs/sources/cards>
115              
116             =head1 COPYRIGHT & LICENSE
117              
118             Copyright (c) 2022 DEGUEST Pte. Ltd.
119              
120             You can use, copy, modify and redistribute this package and associated
121             files under the same terms as Perl itself.
122              
123             =cut