line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Stripe; |
2
|
|
|
|
|
|
|
$Net::Stripe::VERSION = '0.42'; |
3
|
2
|
|
|
2
|
|
738865
|
use Moose; |
|
2
|
|
|
|
|
966518
|
|
|
2
|
|
|
|
|
13
|
|
4
|
2
|
|
|
2
|
|
15403
|
use Class::Load; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
129
|
|
5
|
2
|
|
|
2
|
|
1824
|
use Type::Tiny 1.008004; |
|
2
|
|
|
|
|
43082
|
|
|
2
|
|
|
|
|
137
|
|
6
|
2
|
|
|
2
|
|
1081
|
use Kavorka; |
|
2
|
|
|
|
|
18872
|
|
|
2
|
|
|
|
|
19
|
|
7
|
2
|
|
|
2
|
|
416653
|
use LWP::UserAgent; |
|
2
|
|
|
|
|
107932
|
|
|
2
|
|
|
|
|
112
|
|
8
|
2
|
|
|
2
|
|
1266
|
use HTTP::Request::Common qw/GET POST DELETE/; |
|
2
|
|
|
|
|
5902
|
|
|
2
|
|
|
|
|
171
|
|
9
|
2
|
|
|
2
|
|
1016
|
use MIME::Base64 qw/encode_base64/; |
|
2
|
|
|
|
|
1623
|
|
|
2
|
|
|
|
|
135
|
|
10
|
2
|
|
|
2
|
|
23
|
use URI::Escape qw/uri_escape/; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
111
|
|
11
|
2
|
|
|
2
|
|
1479
|
use JSON qw/decode_json/; |
|
2
|
|
|
|
|
23852
|
|
|
2
|
|
|
|
|
12
|
|
12
|
2
|
|
|
2
|
|
324
|
use URI qw//; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
43
|
|
13
|
2
|
|
|
2
|
|
955
|
use DateTime qw//; |
|
2
|
|
|
|
|
498673
|
|
|
2
|
|
|
|
|
74
|
|
14
|
2
|
|
|
2
|
|
1026
|
use Net::Stripe::TypeConstraints; |
|
2
|
|
|
|
|
16
|
|
|
2
|
|
|
|
|
115
|
|
15
|
2
|
|
|
2
|
|
1071
|
use Net::Stripe::Constants; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
70
|
|
16
|
2
|
|
|
2
|
|
875
|
use Net::Stripe::Token; |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
121
|
|
17
|
2
|
|
|
2
|
|
1335
|
use Net::Stripe::Invoiceitem; |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
108
|
|
18
|
2
|
|
|
2
|
|
1305
|
use Net::Stripe::Invoice; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
114
|
|
19
|
2
|
|
|
2
|
|
1198
|
use Net::Stripe::Card; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
105
|
|
20
|
2
|
|
|
2
|
|
1297
|
use Net::Stripe::Source; |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
104
|
|
21
|
2
|
|
|
2
|
|
1225
|
use Net::Stripe::Plan; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
96
|
|
22
|
2
|
|
|
2
|
|
1174
|
use Net::Stripe::Product; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
108
|
|
23
|
2
|
|
|
2
|
|
1231
|
use Net::Stripe::Coupon; |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
105
|
|
24
|
2
|
|
|
2
|
|
1280
|
use Net::Stripe::Charge; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
109
|
|
25
|
2
|
|
|
2
|
|
1327
|
use Net::Stripe::Customer; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
225
|
|
26
|
2
|
|
|
2
|
|
19
|
use Net::Stripe::Discount; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
57
|
|
27
|
2
|
|
|
2
|
|
1298
|
use Net::Stripe::Subscription; |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
188
|
|
28
|
2
|
|
|
2
|
|
1273
|
use Net::Stripe::Error; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
87
|
|
29
|
2
|
|
|
2
|
|
1050
|
use Net::Stripe::BalanceTransaction; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
108
|
|
30
|
2
|
|
|
2
|
|
19
|
use Net::Stripe::List; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
57
|
|
31
|
2
|
|
|
2
|
|
1269
|
use Net::Stripe::LineItem; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
111
|
|
32
|
2
|
|
|
2
|
|
1285
|
use Net::Stripe::Refund; |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
109
|
|
33
|
2
|
|
|
2
|
|
1254
|
use Net::Stripe::PaymentMethod; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
107
|
|
34
|
2
|
|
|
2
|
|
1232
|
use Net::Stripe::PaymentIntent; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
373
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
# ABSTRACT: API client for Stripe.com |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
has 'debug' => (is => 'rw', isa => 'Bool', default => 0, documentation => "The debug flag"); |
40
|
|
|
|
|
|
|
has 'debug_network' => (is => 'rw', isa => 'Bool', default => 0, documentation => "The debug network request flag"); |
41
|
|
|
|
|
|
|
has 'api_key' => (is => 'ro', isa => 'Str', required => 1, documentation => "You get this from your Stripe Account settings"); |
42
|
|
|
|
|
|
|
has 'api_base' => (is => 'ro', isa => 'Str', lazy_build => 1, documentation => "This is the base part of the URL for every request made"); |
43
|
|
|
|
|
|
|
has 'ua' => (is => 'ro', isa => 'Object', lazy_build => 1, documentation => "The LWP::UserAgent that is used for requests"); |
44
|
|
|
|
|
|
|
has 'api_version' => (is => 'ro', isa => 'StripeAPIVersion', documentation => "This is the value of the Stripe-Version header you wish to transmit for API calls"); |
45
|
|
|
|
|
|
|
has 'force_api_version' => (is => 'ro', isa => 'Bool', default => 0, documentation => "Set this to true to bypass the safety checks for API version compatibility."); |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub BUILD { |
48
|
1
|
|
|
1
|
0
|
3
|
my ( $self, $args ) = @_; |
49
|
1
|
|
|
|
|
6
|
$self->_validate_api_version_range(); |
50
|
0
|
|
|
|
|
0
|
$self->_validate_api_version_value(); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Charges: { |
55
|
|
|
|
|
|
|
method post_charge(Int :$amount, |
56
|
|
|
|
|
|
|
Str :$currency, |
57
|
|
|
|
|
|
|
StripeCustomerId :$customer?, |
58
|
|
|
|
|
|
|
StripeTokenId|StripeCardId :$card?, |
59
|
|
|
|
|
|
|
StripeTokenId|StripeCardId|StripeSourceId :$source?, |
60
|
|
|
|
|
|
|
Str :$description?, |
61
|
|
|
|
|
|
|
HashRef :$metadata?, |
62
|
|
|
|
|
|
|
Bool :$capture?, |
63
|
|
|
|
|
|
|
Str :$statement_descriptor?, |
64
|
|
|
|
|
|
|
Int :$application_fee?, |
65
|
|
|
|
|
|
|
Str :$receipt_email? |
66
|
2
|
0
|
0
|
2
|
|
53564
|
) { |
|
2
|
0
|
0
|
2
|
|
5
|
|
|
2
|
0
|
0
|
2
|
|
263
|
|
|
2
|
0
|
0
|
2
|
|
14
|
|
|
2
|
0
|
|
2
|
|
5
|
|
|
2
|
0
|
|
2
|
|
92
|
|
|
2
|
0
|
|
2
|
|
11
|
|
|
2
|
0
|
|
2
|
|
5
|
|
|
2
|
0
|
|
2
|
|
17
|
|
|
2
|
0
|
|
2
|
|
263
|
|
|
2
|
0
|
|
2
|
|
3
|
|
|
2
|
0
|
|
2
|
|
894
|
|
|
2
|
0
|
|
0
|
|
16
|
|
|
2
|
0
|
|
|
|
5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id_type->check( $card ) ) { |
71
|
0
|
|
|
|
|
0
|
die Net::Stripe::Error->new( |
72
|
|
|
|
|
|
|
type => "post_charge error", |
73
|
|
|
|
|
|
|
message => sprintf( |
74
|
|
|
|
|
|
|
"Invalid value '%s' passed for parameter 'card'. Charges for an existing customer can only accept a card id.", |
75
|
|
|
|
|
|
|
$card, |
76
|
|
|
|
|
|
|
), |
77
|
|
|
|
|
|
|
); |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
0
|
|
|
|
|
0
|
my $token_id_type = Moose::Util::TypeConstraints::find_type_constraint( 'StripeTokenId' ); |
81
|
0
|
0
|
0
|
|
|
0
|
if ( ! defined( $customer ) && ! $token_id_type->check( $card ) ) { |
82
|
0
|
|
|
|
|
0
|
die Net::Stripe::Error->new( |
83
|
|
|
|
|
|
|
type => "post_charge error", |
84
|
|
|
|
|
|
|
message => sprintf( |
85
|
|
|
|
|
|
|
"Invalid value '%s' passed for parameter 'card'. Charges without an existing customer can only accept a token id.", |
86
|
|
|
|
|
|
|
$card, |
87
|
|
|
|
|
|
|
), |
88
|
|
|
|
|
|
|
); |
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
0
|
0
|
|
|
|
0
|
if ( defined( $source ) ) { |
93
|
0
|
|
|
|
|
0
|
my $card_id_type = Moose::Util::TypeConstraints::find_type_constraint( 'StripeCardId' ); |
94
|
0
|
0
|
0
|
|
|
0
|
if ( defined( $customer ) && ! $card_id_type->check( $source ) ) { |
95
|
0
|
|
|
|
|
0
|
die Net::Stripe::Error->new( |
96
|
|
|
|
|
|
|
type => "post_charge error", |
97
|
|
|
|
|
|
|
message => sprintf( |
98
|
|
|
|
|
|
|
"Invalid value '%s' passed for parameter 'source'. Charges for an existing customer can only accept a card id.", |
99
|
|
|
|
|
|
|
$source, |
100
|
|
|
|
|
|
|
), |
101
|
|
|
|
|
|
|
); |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
|
104
|
0
|
|
|
|
|
0
|
my $token_id_type = Moose::Util::TypeConstraints::find_type_constraint( 'StripeTokenId' ); |
105
|
0
|
|
|
|
|
0
|
my $source_id_type = Moose::Util::TypeConstraints::find_type_constraint( 'StripeSourceId' ); |
106
|
0
|
0
|
0
|
|
|
0
|
if ( ! defined( $customer ) && ! $token_id_type->check( $source ) && ! $source_id_type->check( $source ) ) { |
|
|
|
0
|
|
|
|
|
107
|
0
|
|
|
|
|
0
|
die Net::Stripe::Error->new( |
108
|
|
|
|
|
|
|
type => "post_charge error", |
109
|
|
|
|
|
|
|
message => sprintf( |
110
|
|
|
|
|
|
|
"Invalid value '%s' passed for parameter 'source'. Charges without an existing customer can only accept a token id or source id.", |
111
|
|
|
|
|
|
|
$source, |
112
|
|
|
|
|
|
|
), |
113
|
|
|
|
|
|
|
); |
114
|
|
|
|
|
|
|
} |
115
|
|
|
|
|
|
|
} |
116
|
|
|
|
|
|
|
|
117
|
0
|
|
|
|
|
0
|
my $charge = Net::Stripe::Charge->new(amount => $amount, |
118
|
|
|
|
|
|
|
currency => $currency, |
119
|
|
|
|
|
|
|
customer => $customer, |
120
|
|
|
|
|
|
|
card => $card, |
121
|
|
|
|
|
|
|
source => $source, |
122
|
|
|
|
|
|
|
description => $description, |
123
|
|
|
|
|
|
|
metadata => $metadata, |
124
|
|
|
|
|
|
|
capture => $capture, |
125
|
|
|
|
|
|
|
statement_descriptor => $statement_descriptor, |
126
|
|
|
|
|
|
|
application_fee => $application_fee, |
127
|
|
|
|
|
|
|
receipt_email => $receipt_email |
128
|
|
|
|
|
|
|
); |
129
|
0
|
|
|
|
|
0
|
return $self->_post('charges', $charge); |
130
|
|
|
|
|
|
|
} |
131
|
|
|
|
|
|
|
|
132
|
2
|
0
|
0
|
2
|
|
5385
|
method get_charge(Str :$charge_id) { |
|
2
|
0
|
0
|
2
|
|
5
|
|
|
2
|
0
|
|
2
|
|
230
|
|
|
2
|
0
|
|
2
|
|
33
|
|
|
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
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
762
|
|
|
2
|
|
|
|
|
16
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
314
|
|
|
2
|
|
|
|
|
26
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
481
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
137
|
0
|
0
|
|
|
|
0
|
if (ref($charge)) { |
138
|
0
|
|
|
|
|
0
|
$charge = $charge->id; |
139
|
|
|
|
|
|
|
} |
140
|
|
|
|
|
|
|
|
141
|
0
|
|
|
|
|
0
|
my $refund = Net::Stripe::Refund->new(id => $charge, |
142
|
|
|
|
|
|
|
amount => $amount |
143
|
|
|
|
|
|
|
); |
144
|
0
|
|
|
|
|
0
|
return $self->_post("charges/$charge/refunds", $refund); |
145
|
|
|
|
|
|
|
} |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
method get_charges(HashRef :$created?, |
148
|
|
|
|
|
|
|
Net::Stripe::Customer|Str :$customer?, |
149
|
|
|
|
|
|
|
Str :$ending_before?, |
150
|
|
|
|
|
|
|
Int :$limit?, |
151
|
2
|
0
|
0
|
2
|
|
20888
|
Str :$starting_after?) { |
|
2
|
0
|
0
|
2
|
|
6
|
|
|
2
|
0
|
0
|
2
|
|
215
|
|
|
2
|
0
|
|
2
|
|
16
|
|
|
2
|
0
|
|
2
|
|
4
|
|
|
2
|
0
|
|
2
|
|
106
|
|
|
2
|
0
|
|
2
|
|
14
|
|
|
2
|
0
|
|
2
|
|
5
|
|
|
2
|
0
|
|
2
|
|
8
|
|
|
2
|
0
|
|
0
|
|
213
|
|
|
2
|
0
|
|
|
|
4
|
|
|
2
|
0
|
|
|
|
698
|
|
|
2
|
0
|
|
|
|
16
|
|
|
2
|
0
|
|
|
|
5
|
|
|
2
|
0
|
|
|
|
328
|
|
|
2
|
0
|
|
|
|
18
|
|
|
2
|
0
|
|
|
|
4
|
|
|
2
|
0
|
|
|
|
229
|
|
|
2
|
0
|
|
|
|
13
|
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
239
|
|
|
2
|
|
|
|
|
15
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
369
|
|
|
2
|
|
|
|
|
16
|
|
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
430
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
152
|
0
|
0
|
|
|
|
0
|
if (ref($customer)) { |
153
|
0
|
|
|
|
|
0
|
$customer = $customer->id; |
154
|
|
|
|
|
|
|
} |
155
|
0
|
|
|
|
|
0
|
my %args = ( |
156
|
|
|
|
|
|
|
path => 'charges', |
157
|
|
|
|
|
|
|
created => $created, |
158
|
|
|
|
|
|
|
customer => $customer, |
159
|
|
|
|
|
|
|
ending_before => $ending_before, |
160
|
|
|
|
|
|
|
limit => $limit, |
161
|
|
|
|
|
|
|
starting_after => $starting_after, |
162
|
|
|
|
|
|
|
); |
163
|
0
|
|
|
|
|
0
|
$self->_get_all(%args); |
164
|
|
|
|
|
|
|
} |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
method capture_charge( |
167
|
|
|
|
|
|
|
Net::Stripe::Charge|Str :$charge!, |
168
|
|
|
|
|
|
|
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) { |
171
|
0
|
|
|
|
|
0
|
$charge = $charge->id; |
172
|
|
|
|
|
|
|
} |
173
|
|
|
|
|
|
|
|
174
|
0
|
|
|
|
|
0
|
my %args = ( |
175
|
|
|
|
|
|
|
amount => $amount, |
176
|
|
|
|
|
|
|
); |
177
|
0
|
|
|
|
|
0
|
return $self->_post("charges/$charge/capture", \%args); |
178
|
|
|
|
|
|
|
} |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
} |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
PaymentIntents: { |
184
|
|
|
|
|
|
|
method create_payment_intent( |
185
|
|
|
|
|
|
|
Int :$amount!, |
186
|
|
|
|
|
|
|
Str :$currency!, |
187
|
|
|
|
|
|
|
Int :$application_fee_amount?, |
188
|
|
|
|
|
|
|
StripeCaptureMethod :$capture_method?, |
189
|
|
|
|
|
|
|
Bool :$confirm?, |
190
|
|
|
|
|
|
|
StripeConfirmationMethod :$confirmation_method?, |
191
|
|
|
|
|
|
|
StripeCustomerId :$customer?, |
192
|
|
|
|
|
|
|
Str :$description?, |
193
|
|
|
|
|
|
|
Bool :$error_on_requires_action?, |
194
|
|
|
|
|
|
|
Str :$mandate?, |
195
|
|
|
|
|
|
|
HashRef :$mandate_data?, |
196
|
|
|
|
|
|
|
HashRef[Str] :$metadata?, |
197
|
|
|
|
|
|
|
Bool :$off_session?, |
198
|
|
|
|
|
|
|
Str :$on_behalf_of?, |
199
|
|
|
|
|
|
|
StripePaymentMethodId :$payment_method?, |
200
|
|
|
|
|
|
|
HashRef :$payment_method_options?, |
201
|
|
|
|
|
|
|
ArrayRef[StripePaymentMethodType] :$payment_method_types?, |
202
|
|
|
|
|
|
|
Str :$receipt_email?, |
203
|
|
|
|
|
|
|
Str :$return_url?, |
204
|
|
|
|
|
|
|
Bool :$save_payment_method?, |
205
|
|
|
|
|
|
|
Str :$setup_future_usage?, |
206
|
|
|
|
|
|
|
HashRef :$shipping?, |
207
|
|
|
|
|
|
|
Str :$statement_descriptor?, |
208
|
|
|
|
|
|
|
Str :$statement_descriptor_suffix?, |
209
|
|
|
|
|
|
|
HashRef :$transfer_data?, |
210
|
|
|
|
|
|
|
Str :$transfer_group?, |
211
|
|
|
|
|
|
|
Bool :$use_stripe_sdk?, |
212
|
2
|
0
|
0
|
2
|
|
100197
|
) { |
|
2
|
0
|
0
|
2
|
|
6
|
|
|
2
|
0
|
0
|
2
|
|
215
|
|
|
2
|
0
|
0
|
2
|
|
13
|
|
|
2
|
0
|
|
2
|
|
5
|
|
|
2
|
0
|
|
2
|
|
87
|
|
|
2
|
0
|
|
2
|
|
11
|
|
|
2
|
0
|
|
2
|
|
5
|
|
|
2
|
0
|
|
2
|
|
19
|
|
|
2
|
0
|
|
2
|
|
232
|
|
|
2
|
0
|
|
2
|
|
4
|
|
|
2
|
0
|
|
2
|
|
863
|
|
|
2
|
0
|
|
2
|
|
19
|
|
|
2
|
0
|
|
2
|
|
9
|
|
|
2
|
0
|
|
2
|
|
495
|
|
|
2
|
0
|
|
2
|
|
18
|
|
|
2
|
0
|
|
2
|
|
3
|
|
|
2
|
0
|
|
2
|
|
267
|
|
|
2
|
0
|
|
2
|
|
15
|
|
|
2
|
0
|
|
2
|
|
6
|
|
|
2
|
0
|
|
2
|
|
436
|
|
|
2
|
0
|
|
2
|
|
17
|
|
|
2
|
0
|
|
2
|
|
5
|
|
|
2
|
0
|
|
2
|
|
654
|
|
|
2
|
0
|
|
2
|
|
16
|
|
|
2
|
0
|
|
2
|
|
5
|
|
|
2
|
0
|
|
2
|
|
262
|
|
|
2
|
0
|
|
2
|
|
16
|
|
|
2
|
0
|
|
2
|
|
4
|
|
|
2
|
0
|
|
0
|
|
370
|
|
|
2
|
0
|
|
|
|
15
|
|
|
2
|
0
|
|
|
|
4
|
|
|
2
|
0
|
|
|
|
303
|
|
|
2
|
0
|
|
|
|
14
|
|
|
2
|
0
|
|
|
|
4
|
|
|
2
|
0
|
|
|
|
241
|
|
|
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0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
213
|
0
|
|
|
|
|
0
|
my %args = ( |
214
|
|
|
|
|
|
|
amount => $amount, |
215
|
|
|
|
|
|
|
currency => $currency, |
216
|
|
|
|
|
|
|
application_fee_amount => $application_fee_amount, |
217
|
|
|
|
|
|
|
capture_method => $capture_method, |
218
|
|
|
|
|
|
|
confirm => $confirm, |
219
|
|
|
|
|
|
|
confirmation_method => $confirmation_method, |
220
|
|
|
|
|
|
|
customer => $customer, |
221
|
|
|
|
|
|
|
description => $description, |
222
|
|
|
|
|
|
|
error_on_requires_action => $error_on_requires_action, |
223
|
|
|
|
|
|
|
mandate => $mandate, |
224
|
|
|
|
|
|
|
mandate_data => $mandate_data, |
225
|
|
|
|
|
|
|
metadata => $metadata, |
226
|
|
|
|
|
|
|
off_session => $off_session, |
227
|
|
|
|
|
|
|
on_behalf_of => $on_behalf_of, |
228
|
|
|
|
|
|
|
payment_method => $payment_method, |
229
|
|
|
|
|
|
|
payment_method_options => $payment_method_options, |
230
|
|
|
|
|
|
|
payment_method_types => $payment_method_types, |
231
|
|
|
|
|
|
|
receipt_email => $receipt_email, |
232
|
|
|
|
|
|
|
return_url => $return_url, |
233
|
|
|
|
|
|
|
save_payment_method => $save_payment_method, |
234
|
|
|
|
|
|
|
setup_future_usage => $setup_future_usage, |
235
|
|
|
|
|
|
|
shipping => $shipping, |
236
|
|
|
|
|
|
|
statement_descriptor => $statement_descriptor, |
237
|
|
|
|
|
|
|
statement_descriptor_suffix => $statement_descriptor_suffix, |
238
|
|
|
|
|
|
|
transfer_data => $transfer_data, |
239
|
|
|
|
|
|
|
transfer_group => $transfer_group, |
240
|
|
|
|
|
|
|
use_stripe_sdk => $use_stripe_sdk, |
241
|
|
|
|
|
|
|
); |
242
|
0
|
|
|
|
|
0
|
my $payment_intent_obj = Net::Stripe::PaymentIntent->new( %args ); |
243
|
0
|
|
|
|
|
0
|
return $self->_post("payment_intents", $payment_intent_obj); |
244
|
|
|
|
|
|
|
} |
245
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
method get_payment_intent( |
247
|
|
|
|
|
|
|
StripePaymentIntentId :$payment_intent_id!, |
248
|
|
|
|
|
|
|
Str :$client_secret?, |
249
|
2
|
0
|
0
|
2
|
|
9736
|
) { |
|
2
|
0
|
0
|
2
|
|
4
|
|
|
2
|
0
|
|
2
|
|
197
|
|
|
2
|
0
|
|
2
|
|
14
|
|
|
2
|
0
|
|
2
|
|
4
|
|
|
2
|
0
|
|
0
|
|
89
|
|
|
2
|
0
|
|
|
|
13
|
|
|
2
|
0
|
|
|
|
4
|
|
|
2
|
|
|
|
|
11
|
|
|
2
|
|
|
|
|
207
|
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
822
|
|
|
2
|
|
|
|
|
16
|
|
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
320
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
250
|
0
|
|
|
|
|
0
|
my %args = ( |
251
|
|
|
|
|
|
|
client_secret => $client_secret, |
252
|
|
|
|
|
|
|
); |
253
|
0
|
|
|
|
|
0
|
return $self->_get("payment_intents/$payment_intent_id", \%args); |
254
|
|
|
|
|
|
|
} |
255
|
|
|
|
|
|
|
|
256
|
|
|
|
|
|
|
method update_payment_intent( |
257
|
|
|
|
|
|
|
StripePaymentIntentId :$payment_intent_id!, |
258
|
|
|
|
|
|
|
Int :$amount?, |
259
|
|
|
|
|
|
|
Int :$application_fee_amount?, |
260
|
|
|
|
|
|
|
Str :$currency?, |
261
|
|
|
|
|
|
|
StripeCustomerId :$customer?, |
262
|
|
|
|
|
|
|
Str :$description?, |
263
|
|
|
|
|
|
|
HashRef[Str]|EmptyStr :$metadata?, |
264
|
|
|
|
|
|
|
StripePaymentMethodId :$payment_method?, |
265
|
|
|
|
|
|
|
HashRef :$payment_method_options?, |
266
|
|
|
|
|
|
|
ArrayRef[StripePaymentMethodType] :$payment_method_types?, |
267
|
|
|
|
|
|
|
Str :$receipt_email?, |
268
|
|
|
|
|
|
|
Bool :$save_payment_method?, |
269
|
|
|
|
|
|
|
Str :$setup_future_usage?, |
270
|
|
|
|
|
|
|
HashRef :$shipping?, |
271
|
|
|
|
|
|
|
Str :$statement_descriptor?, |
272
|
|
|
|
|
|
|
Str :$statement_descriptor_suffix?, |
273
|
|
|
|
|
|
|
HashRef :$transfer_data?, |
274
|
|
|
|
|
|
|
Str :$transfer_group?, |
275
|
2
|
0
|
0
|
2
|
|
59285
|
) { |
|
2
|
0
|
0
|
2
|
|
5
|
|
|
2
|
0
|
0
|
2
|
|
186
|
|
|
2
|
0
|
0
|
2
|
|
13
|
|
|
2
|
0
|
|
2
|
|
5
|
|
|
2
|
0
|
|
2
|
|
78
|
|
|
2
|
0
|
|
2
|
|
12
|
|
|
2
|
0
|
|
2
|
|
5
|
|
|
2
|
0
|
|
2
|
|
11
|
|
|
2
|
0
|
|
2
|
|
246
|
|
|
2
|
0
|
|
2
|
|
5
|
|
|
2
|
0
|
|
2
|
|
1073
|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application_fee_amount => $application_fee_amount, |
279
|
|
|
|
|
|
|
currency => $currency, |
280
|
|
|
|
|
|
|
customer => $customer, |
281
|
|
|
|
|
|
|
description => $description, |
282
|
|
|
|
|
|
|
metadata => $metadata, |
283
|
|
|
|
|
|
|
payment_method => $payment_method, |
284
|
|
|
|
|
|
|
payment_method_options => $payment_method_options, |
285
|
|
|
|
|
|
|
payment_method_types => $payment_method_types, |
286
|
|
|
|
|
|
|
receipt_email => $receipt_email, |
287
|
|
|
|
|
|
|
save_payment_method => $save_payment_method, |
288
|
|
|
|
|
|
|
setup_future_usage => $setup_future_usage, |
289
|
|
|
|
|
|
|
shipping => $shipping, |
290
|
|
|
|
|
|
|
statement_descriptor => $statement_descriptor, |
291
|
|
|
|
|
|
|
statement_descriptor_suffix => $statement_descriptor_suffix, |
292
|
|
|
|
|
|
|
transfer_data => $transfer_data, |
293
|
|
|
|
|
|
|
transfer_group => $transfer_group, |
294
|
|
|
|
|
|
|
); |
295
|
0
|
|
|
|
|
0
|
my $payment_intent_obj = Net::Stripe::PaymentIntent->new( %args ); |
296
|
0
|
|
|
|
|
0
|
return $self->_post("payment_intents/$payment_intent_id", $payment_intent_obj); |
297
|
|
|
|
|
|
|
} |
298
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
method confirm_payment_intent( |
300
|
|
|
|
|
|
|
StripePaymentIntentId :$payment_intent_id!, |
301
|
|
|
|
|
|
|
Str :$client_secret?, |
302
|
|
|
|
|
|
|
Bool :$error_on_requires_action?, |
303
|
|
|
|
|
|
|
Str :$mandate?, |
304
|
|
|
|
|
|
|
HashRef :$mandate_data?, |
305
|
|
|
|
|
|
|
Bool :$off_session?, |
306
|
|
|
|
|
|
|
StripePaymentMethodId :$payment_method?, |
307
|
|
|
|
|
|
|
HashRef :$payment_method_options?, |
308
|
|
|
|
|
|
|
ArrayRef[StripePaymentMethodType] :$payment_method_types?, |
309
|
|
|
|
|
|
|
Str :$receipt_email?, |
310
|
|
|
|
|
|
|
Str :$return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( |
317
|
|
|
|
|
|
|
client_secret => $client_secret, |
318
|
|
|
|
|
|
|
error_on_requires_action => $error_on_requires_action, |
319
|
|
|
|
|
|
|
mandate => $mandate, |
320
|
|
|
|
|
|
|
mandate_data => $mandate_data, |
321
|
|
|
|
|
|
|
off_session => $off_session, |
322
|
|
|
|
|
|
|
payment_method => $payment_method, |
323
|
|
|
|
|
|
|
payment_method_options => $payment_method_options, |
324
|
|
|
|
|
|
|
payment_method_types => $payment_method_types, |
325
|
|
|
|
|
|
|
receipt_email => $receipt_email, |
326
|
|
|
|
|
|
|
return_url => $return_url, |
327
|
|
|
|
|
|
|
save_payment_method => $save_payment_method, |
328
|
|
|
|
|
|
|
setup_future_usage => $setup_future_usage, |
329
|
|
|
|
|
|
|
shipping => $shipping, |
330
|
|
|
|
|
|
|
use_stripe_sdk => $use_stripe_sdk, |
331
|
|
|
|
|
|
|
); |
332
|
0
|
|
|
|
|
0
|
return $self->_post("payment_intents/$payment_intent_id/confirm", \%args); |
333
|
|
|
|
|
|
|
} |
334
|
|
|
|
|
|
|
|
335
|
|
|
|
|
|
|
method capture_payment_intent( |
336
|
|
|
|
|
|
|
StripePaymentIntentId :$payment_intent_id!, |
337
|
|
|
|
|
|
|
Int :$amount_to_capture?, |
338
|
|
|
|
|
|
|
Int :$application_fee_amount?, |
339
|
|
|
|
|
|
|
Str :$statement_descriptor?, |
340
|
|
|
|
|
|
|
Str :$statement_descriptor_suffix?, |
341
|
|
|
|
|
|
|
HashRef :$transfer_data?, |
342
|
2
|
0
|
0
|
2
|
|
19997
|
) { |
|
2
|
0
|
0
|
2
|
|
5
|
|
|
2
|
0
|
0
|
2
|
|
212
|
|
|
2
|
0
|
0
|
2
|
|
14
|
|
|
2
|
0
|
|
2
|
|
4
|
|
|
2
|
0
|
|
2
|
|
94
|
|
|
2
|
0
|
|
2
|
|
12
|
|
|
2
|
0
|
|
2
|
|
6
|
|
|
2
|
0
|
|
2
|
|
11
|
|
|
2
|
0
|
|
0
|
|
262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
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
343
|
0
|
|
|
|
|
0
|
my %args = ( |
344
|
|
|
|
|
|
|
amount_to_capture => $amount_to_capture, |
345
|
|
|
|
|
|
|
application_fee_amount => $application_fee_amount, |
346
|
|
|
|
|
|
|
statement_descriptor => $statement_descriptor, |
347
|
|
|
|
|
|
|
statement_descriptor_suffix => $statement_descriptor_suffix, |
348
|
|
|
|
|
|
|
transfer_data => $transfer_data, |
349
|
|
|
|
|
|
|
); |
350
|
0
|
|
|
|
|
0
|
return $self->_post("payment_intents/$payment_intent_id/capture", \%args); |
351
|
|
|
|
|
|
|
} |
352
|
|
|
|
|
|
|
|
353
|
|
|
|
|
|
|
method cancel_payment_intent( |
354
|
|
|
|
|
|
|
StripePaymentIntentId :$payment_intent_id!, |
355
|
|
|
|
|
|
|
StripeCancellationReason :$cancellation_reason?, |
356
|
2
|
0
|
0
|
2
|
|
9413
|
) { |
|
2
|
0
|
0
|
2
|
|
5
|
|
|
2
|
0
|
|
2
|
|
223
|
|
|
2
|
0
|
|
2
|
|
21
|
|
|
2
|
0
|
|
2
|
|
4
|
|
|
2
|
0
|
|
0
|
|
102
|
|
|
2
|
0
|
|
|
|
14
|
|
|
2
|
0
|
|
|
|
6
|
|
|
2
|
|
|
|
|
19
|
|
|
2
|
|
|
|
|
209
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
1255
|
|
|
2
|
|
|
|
|
17
|
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
321
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
357
|
0
|
|
|
|
|
0
|
my %args = ( |
358
|
|
|
|
|
|
|
cancellation_reason => $cancellation_reason, |
359
|
|
|
|
|
|
|
); |
360
|
0
|
|
|
|
|
0
|
return $self->_post("payment_intents/$payment_intent_id/cancel", \%args); |
361
|
|
|
|
|
|
|
} |
362
|
|
|
|
|
|
|
|
363
|
|
|
|
|
|
|
method list_payment_intents( |
364
|
|
|
|
|
|
|
StripeCustomerId :$customer?, |
365
|
|
|
|
|
|
|
HashRef[Int] :$created?, |
366
|
|
|
|
|
|
|
Str :$ending_before?, |
367
|
|
|
|
|
|
|
Int :$limit?, |
368
|
|
|
|
|
|
|
Str :$starting_after?, |
369
|
2
|
0
|
0
|
2
|
|
19060
|
) { |
|
2
|
0
|
0
|
2
|
|
5
|
|
|
2
|
0
|
0
|
2
|
|
205
|
|
|
2
|
0
|
|
2
|
|
15
|
|
|
2
|
0
|
|
2
|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
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
370
|
0
|
|
|
|
|
0
|
my %args = ( |
371
|
|
|
|
|
|
|
customer => $customer, |
372
|
|
|
|
|
|
|
created => $created, |
373
|
|
|
|
|
|
|
ending_before => $ending_before, |
374
|
|
|
|
|
|
|
limit => $limit, |
375
|
|
|
|
|
|
|
starting_after => $starting_after, |
376
|
|
|
|
|
|
|
); |
377
|
0
|
|
|
|
|
0
|
return $self->_get("payment_intents", \%args); |
378
|
|
|
|
|
|
|
} |
379
|
|
|
|
|
|
|
} |
380
|
|
|
|
|
|
|
|
381
|
|
|
|
|
|
|
|
382
|
|
|
|
|
|
|
|
383
|
|
|
|
|
|
|
BalanceTransactions: { |
384
|
2
|
0
|
0
|
2
|
|
5552
|
method get_balance_transaction(Str :$id) { |
|
2
|
0
|
0
|
2
|
|
4
|
|
|
2
|
0
|
|
2
|
|
254
|
|
|
2
|
0
|
|
2
|
|
24
|
|
|
2
|
0
|
|
2
|
|
6
|
|
|
2
|
0
|
|
0
|
|
94
|
|
|
2
|
|
|
|
|
53
|
|
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
332
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
662
|
|
|
2
|
|
|
|
|
16
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
449
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
385
|
0
|
|
|
|
|
0
|
return $self->_get("balance/history/$id"); |
386
|
|
|
|
|
|
|
} |
387
|
|
|
|
|
|
|
} |
388
|
|
|
|
|
|
|
|
389
|
|
|
|
|
|
|
|
390
|
|
|
|
|
|
|
|
391
|
|
|
|
|
|
|
Customers: { |
392
|
|
|
|
|
|
|
method post_customer(Net::Stripe::Customer|StripeCustomerId :$customer?, |
393
|
|
|
|
|
|
|
Int :$account_balance?, |
394
|
|
|
|
|
|
|
Int :$balance?, |
395
|
|
|
|
|
|
|
Net::Stripe::Token|StripeTokenId :$card?, |
396
|
|
|
|
|
|
|
Str :$coupon?, |
397
|
|
|
|
|
|
|
Str :$default_card?, |
398
|
|
|
|
|
|
|
StripeCardId|StripeSourceId :$default_source?, |
399
|
|
|
|
|
|
|
Str :$description?, |
400
|
|
|
|
|
|
|
Str :$email?, |
401
|
|
|
|
|
|
|
HashRef :$metadata?, |
402
|
|
|
|
|
|
|
Str :$plan?, |
403
|
|
|
|
|
|
|
Int :$quantity?, |
404
|
|
|
|
|
|
|
StripeTokenId|StripeSourceId :$source?, |
405
|
2
|
0
|
0
|
2
|
|
51397
|
Int|Str :$trial_end?) { |
|
2
|
0
|
0
|
2
|
|
6
|
|
|
2
|
0
|
0
|
2
|
|
183
|
|
|
2
|
0
|
0
|
2
|
|
14
|
|
|
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|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
406
|
|
|
|
|
|
|
|
407
|
0
|
|
|
|
|
0
|
my $customer_obj; |
408
|
0
|
0
|
|
|
|
0
|
if ( ref( $customer ) ) { |
409
|
0
|
|
|
|
|
0
|
$customer_obj = $customer; |
410
|
|
|
|
|
|
|
} else { |
411
|
0
|
|
|
|
|
0
|
my %args = ( |
412
|
|
|
|
|
|
|
account_balance => $account_balance, |
413
|
|
|
|
|
|
|
balance => $balance, |
414
|
|
|
|
|
|
|
card => $card, |
415
|
|
|
|
|
|
|
coupon => $coupon, |
416
|
|
|
|
|
|
|
default_card => $default_card, |
417
|
|
|
|
|
|
|
default_source => $default_source, |
418
|
|
|
|
|
|
|
email => $email, |
419
|
|
|
|
|
|
|
metadata => $metadata, |
420
|
|
|
|
|
|
|
plan => $plan, |
421
|
|
|
|
|
|
|
quantity => $quantity, |
422
|
|
|
|
|
|
|
source => $source, |
423
|
|
|
|
|
|
|
trial_end => $trial_end, |
424
|
|
|
|
|
|
|
); |
425
|
0
|
0
|
|
|
|
0
|
$args{id} = $customer if defined( $customer ); |
426
|
|
|
|
|
|
|
|
427
|
0
|
|
|
|
|
0
|
$customer_obj = Net::Stripe::Customer->new( %args ); |
428
|
|
|
|
|
|
|
} |
429
|
|
|
|
|
|
|
|
430
|
0
|
0
|
|
|
|
0
|
if ( my $customer_id = $customer_obj->id ) { |
431
|
0
|
|
|
|
|
0
|
return $self->_post("customers/$customer_id", $customer_obj); |
432
|
|
|
|
|
|
|
} else { |
433
|
0
|
|
|
|
|
0
|
return $self->_post('customers', $customer_obj); |
434
|
|
|
|
|
|
|
} |
435
|
|
|
|
|
|
|
} |
436
|
|
|
|
|
|
|
|
437
|
|
|
|
|
|
|
method list_subscriptions(Net::Stripe::Customer|Str :$customer, |
438
|
|
|
|
|
|
|
Str :$ending_before?, |
439
|
|
|
|
|
|
|
Int :$limit?, |
440
|
2
|
0
|
0
|
2
|
|
15816
|
Str :$starting_after?) { |
|
2
|
0
|
0
|
2
|
|
5
|
|
|
2
|
0
|
0
|
2
|
|
173
|
|
|
2
|
0
|
|
2
|
|
22
|
|
|
2
|
0
|
|
2
|
|
8
|
|
|
2
|
0
|
|
2
|
|
111
|
|
|
2
|
0
|
|
2
|
|
14
|
|
|
2
|
0
|
|
2
|
|
4
|
|
|
2
|
0
|
|
0
|
|
11
|
|
|
2
|
0
|
|
|
|
236
|
|
|
2
|
0
|
|
|
|
4
|
|
|
2
|
0
|
|
|
|
702
|
|
|
2
|
0
|
|
|
|
16
|
|
|
2
|
0
|
|
|
|
4
|
|
|
2
|
0
|
|
|
|
340
|
|
|
2
|
0
|
|
|
|
16
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
239
|
|
|
2
|
|
|
|
|
14
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
375
|
|
|
2
|
|
|
|
|
17
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
370
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
441
|
0
|
0
|
|
|
|
0
|
if (ref($customer)) { |
442
|
0
|
|
|
|
|
0
|
$customer = $customer->id; |
443
|
|
|
|
|
|
|
} |
444
|
0
|
|
|
|
|
0
|
my %args = ( |
445
|
|
|
|
|
|
|
path => "customers/$customer/subscriptions", |
446
|
|
|
|
|
|
|
ending_before => $ending_before, |
447
|
|
|
|
|
|
|
limit => $limit, |
448
|
|
|
|
|
|
|
starting_after => $starting_after, |
449
|
|
|
|
|
|
|
); |
450
|
0
|
|
|
|
|
0
|
return $self->_get_all(%args); |
451
|
|
|
|
|
|
|
} |
452
|
|
|
|
|
|
|
|
453
|
2
|
0
|
0
|
2
|
|
5418
|
method get_customer(Str :$customer_id) { |
|
2
|
0
|
0
|
2
|
|
6
|
|
|
2
|
0
|
|
2
|
|
225
|
|
|
2
|
0
|
|
2
|
|
16
|
|
|
2
|
0
|
|
2
|
|
4
|
|
|
2
|
0
|
|
0
|
|
77
|
|
|
2
|
|
|
|
|
22
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
20
|
|
|
2
|
|
|
|
|
213
|
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
668
|
|
|
2
|
|
|
|
|
15
|
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
303
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
454
|
0
|
|
|
|
|
0
|
return $self->_get("customers/$customer_id"); |
455
|
|
|
|
|
|
|
} |
456
|
|
|
|
|
|
|
|
457
|
2
|
0
|
0
|
2
|
|
7250
|
method delete_customer(Net::Stripe::Customer|Str :$customer) { |
|
2
|
0
|
0
|
2
|
|
4
|
|
|
2
|
0
|
|
2
|
|
210
|
|
|
2
|
0
|
|
2
|
|
16
|
|
|
2
|
0
|
|
2
|
|
5
|
|
|
2
|
0
|
|
0
|
|
113
|
|
|
2
|
|
|
|
|
13
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
219
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
651
|
|
|
2
|
|
|
|
|
16
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
387
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
458
|
0
|
0
|
|
|
|
0
|
if (ref($customer)) { |
459
|
0
|
|
|
|
|
0
|
$customer = $customer->id; |
460
|
|
|
|
|
|
|
} |
461
|
0
|
|
|
|
|
0
|
$self->_delete("customers/$customer"); |
462
|
|
|
|
|
|
|
} |
463
|
|
|
|
|
|
|
|
464
|
2
|
0
|
0
|
2
|
|
16649
|
method get_customers(HashRef :$created?, Str :$ending_before?, Int :$limit?, Str :$starting_after?, Str :$email?) { |
|
2
|
0
|
0
|
2
|
|
6
|
|
|
2
|
0
|
0
|
2
|
|
196
|
|
|
2
|
0
|
|
2
|
|
14
|
|
|
2
|
0
|
|
2
|
|
5
|
|
|
2
|
0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
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
465
|
0
|
|
|
|
|
0
|
my %args = ( |
466
|
|
|
|
|
|
|
path => 'customers', |
467
|
|
|
|
|
|
|
created => $created, |
468
|
|
|
|
|
|
|
ending_before => $ending_before, |
469
|
|
|
|
|
|
|
limit => $limit, |
470
|
|
|
|
|
|
|
starting_after => $starting_after, |
471
|
|
|
|
|
|
|
email => $email, |
472
|
|
|
|
|
|
|
); |
473
|
0
|
|
|
|
|
0
|
$self->_get_all(%args); |
474
|
|
|
|
|
|
|
} |
475
|
|
|
|
|
|
|
} |
476
|
|
|
|
|
|
|
|
477
|
|
|
|
|
|
|
|
478
|
|
|
|
|
|
|
Cards: { |
479
|
|
|
|
|
|
|
method get_card(Net::Stripe::Customer|Str :$customer, |
480
|
2
|
0
|
0
|
2
|
|
9853
|
Str :$card_id) { |
|
2
|
0
|
0
|
2
|
|
11
|
|
|
2
|
0
|
|
2
|
|
492
|
|
|
2
|
0
|
|
2
|
|
15
|
|
|
2
|
0
|
|
2
|
|
4
|
|
|
2
|
0
|
|
2
|
|
75
|
|
|
2
|
0
|
|
0
|
|
12
|
|
|
2
|
0
|
|
|
|
6
|
|
|
2
|
0
|
|
|
|
9
|
|
|
2
|
|
|
|
|
223
|
|
|
2
|
|
|
|
|
15
|
|
|
2
|
|
|
|
|
692
|
|
|
2
|
|
|
|
|
216
|
|
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
283
|
|
|
2
|
|
|
|
|
15
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
328
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
481
|
0
|
0
|
|
|
|
0
|
if (ref($customer)) { |
482
|
0
|
|
|
|
|
0
|
$customer = $customer->id; |
483
|
|
|
|
|
|
|
} |
484
|
0
|
|
|
|
|
0
|
return $self->_get("customers/$customer/sources/$card_id"); |
485
|
|
|
|
|
|
|
} |
486
|
|
|
|
|
|
|
|
487
|
|
|
|
|
|
|
method get_cards(Net::Stripe::Customer|Str :$customer, |
488
|
|
|
|
|
|
|
HashRef :$created?, |
489
|
|
|
|
|
|
|
Str :$ending_before?, |
490
|
|
|
|
|
|
|
Int :$limit?, |
491
|
2
|
0
|
0
|
2
|
|
18306
|
Str :$starting_after?) { |
|
2
|
0
|
0
|
2
|
|
4
|
|
|
2
|
0
|
0
|
2
|
|
188
|
|
|
2
|
0
|
|
2
|
|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
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
492
|
0
|
0
|
|
|
|
0
|
if (ref($customer)) { |
493
|
0
|
|
|
|
|
0
|
$customer = $customer->id; |
494
|
|
|
|
|
|
|
} |
495
|
|
|
|
|
|
|
|
496
|
0
|
|
|
|
|
0
|
my %args = ( |
497
|
|
|
|
|
|
|
path => "customers/$customer/sources", |
498
|
|
|
|
|
|
|
object => "card", |
499
|
|
|
|
|
|
|
created => $created, |
500
|
|
|
|
|
|
|
ending_before => $ending_before, |
501
|
|
|
|
|
|
|
limit => $limit, |
502
|
|
|
|
|
|
|
starting_after => $starting_after, |
503
|
|
|
|
|
|
|
); |
504
|
0
|
|
|
|
|
0
|
$self->_get_all(%args); |
505
|
|
|
|
|
|
|
} |
506
|
|
|
|
|
|
|
|
507
|
|
|
|
|
|
|
method post_card( |
508
|
|
|
|
|
|
|
Net::Stripe::Customer|StripeCustomerId :$customer!, |
509
|
|
|
|
|
|
|
Net::Stripe::Token|StripeTokenId :$card?, |
510
|
|
|
|
|
|
|
StripeTokenId :$source?, |
511
|
2
|
0
|
0
|
2
|
|
13601
|
) { |
|
2
|
0
|
0
|
2
|
|
4
|
|
|
2
|
0
|
|
2
|
|
223
|
|
|
2
|
0
|
|
2
|
|
26
|
|
|
2
|
0
|
|
0
|
|
5
|
|
|
2
|
0
|
|
|
|
98
|
|
|
2
|
0
|
|
|
|
13
|
|
|
2
|
0
|
|
|
|
2
|
|
|
2
|
0
|
|
|
|
10
|
|
|
2
|
|
|
|
|
220
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1368
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
512
|
|
|
|
|
|
|
|
513
|
0
|
0
|
0
|
|
|
0
|
die Net::Stripe::Error->new( |
514
|
|
|
|
|
|
|
type => "post_card error", |
515
|
|
|
|
|
|
|
message => "One of parameters 'source' or 'card' is required.", |
516
|
|
|
|
|
|
|
) unless defined( $card ) || defined( $source ); |
517
|
|
|
|
|
|
|
|
518
|
0
|
0
|
|
|
|
0
|
my $customer_id = ref( $customer ) ? $customer->id : $customer; |
519
|
|
|
|
|
|
|
|
520
|
0
|
0
|
|
|
|
0
|
if ( defined( $card ) ) { |
521
|
|
|
|
|
|
|
# card here is either Net::Stripe::Token or StripeTokenId |
522
|
0
|
0
|
|
|
|
0
|
my $token_id = ref( $card ) ? $card->id : $card; |
523
|
0
|
|
|
|
|
0
|
return $self->_post("customers/$customer_id/cards", {card=> $token_id}); |
524
|
|
|
|
|
|
|
} |
525
|
|
|
|
|
|
|
|
526
|
0
|
0
|
|
|
|
0
|
if ( defined( $source ) ) { |
527
|
0
|
|
|
|
|
0
|
return $self->_post("customers/$customer_id/cards", { source=> $source }); |
528
|
|
|
|
|
|
|
} |
529
|
|
|
|
|
|
|
} |
530
|
|
|
|
|
|
|
|
531
|
|
|
|
|
|
|
method update_card(StripeCustomerId :$customer_id!, |
532
|
|
|
|
|
|
|
StripeCardId :$card_id!, |
533
|
2
|
0
|
0
|
2
|
|
9089
|
HashRef :$card!) { |
|
2
|
0
|
0
|
2
|
|
5
|
|
|
2
|
0
|
|
2
|
|
230
|
|
|
2
|
0
|
|
2
|
|
15
|
|
|
2
|
0
|
|
2
|
|
6
|
|
|
2
|
0
|
|
0
|
|
91
|
|
|
2
|
0
|
|
|
|
11
|
|
|
2
|
0
|
|
|
|
15
|
|
|
2
|
0
|
|
|
|
9
|
|
|
2
|
0
|
|
|
|
226
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
1032
|
|
|
2
|
|
|
|
|
16
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
286
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
534
|
0
|
|
|
|
|
0
|
return $self->_post("customers/$customer_id/cards/$card_id", $card); |
535
|
|
|
|
|
|
|
} |
536
|
|
|
|
|
|
|
|
537
|
2
|
0
|
0
|
2
|
|
14718
|
method delete_card(Net::Stripe::Customer|Str :$customer, Net::Stripe::Card|Str :$card) { |
|
2
|
0
|
0
|
2
|
|
4
|
|
|
2
|
0
|
|
2
|
|
226
|
|
|
2
|
0
|
|
2
|
|
17
|
|
|
2
|
0
|
|
2
|
|
3
|
|
|
2
|
0
|
|
2
|
|
101
|
|
|
2
|
0
|
|
0
|
|
17
|
|
|
2
|
0
|
|
|
|
5
|
|
|
2
|
0
|
|
|
|
21
|
|
|
2
|
|
|
|
|
212
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
668
|
|
|
2
|
|
|
|
|
25
|
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
308
|
|
|
2
|
|
|
|
|
15
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
404
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
538
|
0
|
0
|
|
|
|
0
|
if (ref($customer)) { |
539
|
0
|
|
|
|
|
0
|
$customer = $customer->id; |
540
|
|
|
|
|
|
|
} |
541
|
|
|
|
|
|
|
|
542
|
0
|
0
|
|
|
|
0
|
if (ref($card)) { |
543
|
0
|
|
|
|
|
0
|
$card = $card->id; |
544
|
|
|
|
|
|
|
} |
545
|
|
|
|
|
|
|
|
546
|
0
|
|
|
|
|
0
|
return $self->_delete("customers/$customer/sources/$card"); |
547
|
|
|
|
|
|
|
} |
548
|
|
|
|
|
|
|
} |
549
|
|
|
|
|
|
|
|
550
|
|
|
|
|
|
|
|
551
|
|
|
|
|
|
|
Sources: { |
552
|
|
|
|
|
|
|
method create_source( |
553
|
|
|
|
|
|
|
StripeSourceType :$type!, |
554
|
|
|
|
|
|
|
Int :$amount?, |
555
|
|
|
|
|
|
|
Str :$currency?, |
556
|
|
|
|
|
|
|
StripeSourceFlow :$flow?, |
557
|
|
|
|
|
|
|
HashRef :$mandate?, |
558
|
|
|
|
|
|
|
HashRef :$metadata?, |
559
|
|
|
|
|
|
|
HashRef :$owner?, |
560
|
|
|
|
|
|
|
HashRef :$receiver?, |
561
|
|
|
|
|
|
|
HashRef :$redirect?, |
562
|
|
|
|
|
|
|
HashRef :$source_order?, |
563
|
|
|
|
|
|
|
Str :$statement_descriptor?, |
564
|
|
|
|
|
|
|
StripeTokenId :$token?, |
565
|
|
|
|
|
|
|
StripeSourceUsage :$usage?, |
566
|
2
|
0
|
0
|
2
|
|
41706
|
) { |
|
2
|
0
|
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|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
567
|
|
|
|
|
|
|
|
568
|
0
|
0
|
0
|
|
|
0
|
die Net::Stripe::Error->new( |
|
|
|
0
|
|
|
|
|
569
|
|
|
|
|
|
|
type => "create_source error", |
570
|
|
|
|
|
|
|
message => "Parameter 'token' is required for source type 'card'", |
571
|
|
|
|
|
|
|
param => 'token', |
572
|
|
|
|
|
|
|
) if defined( $type ) && $type eq 'card' && ! defined( $token ); |
573
|
|
|
|
|
|
|
|
574
|
0
|
|
|
|
|
0
|
my %args = ( |
575
|
|
|
|
|
|
|
amount => $amount, |
576
|
|
|
|
|
|
|
currency => $currency, |
577
|
|
|
|
|
|
|
flow => $flow, |
578
|
|
|
|
|
|
|
mandate => $mandate, |
579
|
|
|
|
|
|
|
metadata => $metadata, |
580
|
|
|
|
|
|
|
owner => $owner, |
581
|
|
|
|
|
|
|
receiver => $receiver, |
582
|
|
|
|
|
|
|
redirect => $redirect, |
583
|
|
|
|
|
|
|
source_order => $source_order, |
584
|
|
|
|
|
|
|
statement_descriptor => $statement_descriptor, |
585
|
|
|
|
|
|
|
token => $token, |
586
|
|
|
|
|
|
|
type => $type, |
587
|
|
|
|
|
|
|
usage => $usage, |
588
|
|
|
|
|
|
|
); |
589
|
0
|
|
|
|
|
0
|
my $source_obj = Net::Stripe::Source->new( %args ); |
590
|
0
|
|
|
|
|
0
|
return $self->_post("sources", $source_obj); |
591
|
|
|
|
|
|
|
} |
592
|
|
|
|
|
|
|
|
593
|
|
|
|
|
|
|
method get_source( |
594
|
|
|
|
|
|
|
StripeSourceId :$source_id!, |
595
|
|
|
|
|
|
|
Str :$client_secret?, |
596
|
2
|
0
|
0
|
2
|
|
7870
|
) { |
|
2
|
0
|
0
|
2
|
|
5
|
|
|
2
|
0
|
|
2
|
|
206
|
|
|
2
|
0
|
|
2
|
|
14
|
|
|
2
|
0
|
|
2
|
|
3
|
|
|
2
|
0
|
|
0
|
|
88
|
|
|
2
|
0
|
|
|
|
22
|
|
|
2
|
0
|
|
|
|
4
|
|
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
217
|
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
891
|
|
|
2
|
|
|
|
|
16
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
336
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
597
|
0
|
|
|
|
|
0
|
my %args = ( |
598
|
|
|
|
|
|
|
client_secret => $client_secret, |
599
|
|
|
|
|
|
|
); |
600
|
0
|
|
|
|
|
0
|
return $self->_get("sources/$source_id", \%args); |
601
|
|
|
|
|
|
|
} |
602
|
|
|
|
|
|
|
|
603
|
|
|
|
|
|
|
method update_source( |
604
|
|
|
|
|
|
|
StripeSourceId :$source_id!, |
605
|
|
|
|
|
|
|
Int :$amount?, |
606
|
|
|
|
|
|
|
HashRef :$mandate?, |
607
|
|
|
|
|
|
|
HashRef|EmptyStr :$metadata?, |
608
|
|
|
|
|
|
|
HashRef :$owner?, |
609
|
|
|
|
|
|
|
HashRef :$source_order?, |
610
|
2
|
0
|
0
|
2
|
|
20211
|
) { |
|
2
|
0
|
0
|
2
|
|
6
|
|
|
2
|
0
|
0
|
2
|
|
226
|
|
|
2
|
0
|
|
2
|
|
15
|
|
|
2
|
0
|
|
2
|
|
5
|
|
|
2
|
0
|
|
2
|
|
108
|
|
|
2
|
0
|
|
2
|
|
14
|
|
|
2
|
0
|
|
2
|
|
4
|
|
|
2
|
0
|
|
0
|
|
9
|
|
|
2
|
0
|
|
|
|
213
|
|
|
2
|
0
|
|
|
|
5
|
|
|
2
|
0
|
|
|
|
921
|
|
|
2
|
0
|
|
|
|
15
|
|
|
2
|
0
|
|
|
|
6
|
|
|
2
|
0
|
|
|
|
388
|
|
|
2
|
0
|
|
|
|
16
|
|
|
2
|
0
|
|
|
|
4
|
|
|
2
|
0
|
|
|
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|
0
|
|
611
|
0
|
|
|
|
|
0
|
my %args = ( |
612
|
|
|
|
|
|
|
amount => $amount, |
613
|
|
|
|
|
|
|
mandate => $mandate, |
614
|
|
|
|
|
|
|
metadata => $metadata, |
615
|
|
|
|
|
|
|
owner => $owner, |
616
|
|
|
|
|
|
|
source_order => $source_order, |
617
|
|
|
|
|
|
|
); |
618
|
0
|
|
|
|
|
0
|
my $source_obj = Net::Stripe::Source->new( %args ); |
619
|
|
|
|
|
|
|
|
620
|
0
|
|
|
|
|
0
|
my @one_of = qw/ amount mandate metadata owner source_order /; |
621
|
0
|
|
|
|
|
0
|
my @defined = grep { defined( $source_obj->$_ ) } @one_of; |
|
0
|
|
|
|
|
0
|
|
622
|
|
|
|
|
|
|
|
623
|
0
|
0
|
|
|
|
0
|
die Net::Stripe::Error->new( |
624
|
|
|
|
|
|
|
type => "update_source error", |
625
|
|
|
|
|
|
|
message => sprintf( "at least one of: %s is required to update a source", |
626
|
|
|
|
|
|
|
join( ', ', @one_of ), |
627
|
|
|
|
|
|
|
), |
628
|
|
|
|
|
|
|
) if ! @defined; |
629
|
|
|
|
|
|
|
|
630
|
0
|
|
|
|
|
0
|
return $self->_post("sources/$source_id", $source_obj); |
631
|
|
|
|
|
|
|
} |
632
|
|
|
|
|
|
|
|
633
|
|
|
|
|
|
|
method attach_source ( |
634
|
|
|
|
|
|
|
StripeCustomerId :$customer_id!, |
635
|
|
|
|
|
|
|
StripeSourceId :$source_id!, |
636
|
2
|
0
|
0
|
2
|
|
7195
|
) { |
|
2
|
0
|
0
|
2
|
|
5
|
|
|
2
|
0
|
|
2
|
|
206
|
|
|
2
|
0
|
|
2
|
|
15
|
|
|
2
|
0
|
|
0
|
|
4
|
|
|
2
|
0
|
|
|
|
104
|
|
|
2
|
0
|
|
|
|
13
|
|
|
2
|
|
|
|
|
13
|
|
|
2
|
|
|
|
|
12
|
|
|
2
|
|
|
|
|
228
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1088
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
637
|
0
|
|
|
|
|
0
|
my %args = ( |
638
|
|
|
|
|
|
|
source => $source_id, |
639
|
|
|
|
|
|
|
); |
640
|
0
|
|
|
|
|
0
|
return $self->_post("customers/$customer_id/sources", \%args); |
641
|
|
|
|
|
|
|
} |
642
|
|
|
|
|
|
|
|
643
|
|
|
|
|
|
|
method detach_source( |
644
|
|
|
|
|
|
|
StripeCustomerId :$customer_id!, |
645
|
|
|
|
|
|
|
StripeSourceId :$source_id!, |
646
|
2
|
0
|
0
|
2
|
|
7282
|
) { |
|
2
|
0
|
0
|
2
|
|
6
|
|
|
2
|
0
|
|
2
|
|
269
|
|
|
2
|
0
|
|
2
|
|
17
|
|
|
2
|
0
|
|
0
|
|
4
|
|
|
2
|
0
|
|
|
|
114
|
|
|
2
|
0
|
|
|
|
18
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
12
|
|
|
2
|
|
|
|
|
230
|
|
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
1007
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
647
|
0
|
|
|
|
|
0
|
return $self->_delete("customers/$customer_id/sources/$source_id"); |
648
|
|
|
|
|
|
|
} |
649
|
|
|
|
|
|
|
|
650
|
|
|
|
|
|
|
# undocumented API endpoint |
651
|
|
|
|
|
|
|
method list_sources( |
652
|
|
|
|
|
|
|
StripeCustomerId :$customer_id!, |
653
|
|
|
|
|
|
|
Str :$object!, |
654
|
|
|
|
|
|
|
Str :$ending_before?, |
655
|
|
|
|
|
|
|
Int :$limit?, |
656
|
|
|
|
|
|
|
Str :$starting_after?, |
657
|
2
|
0
|
0
|
2
|
|
15958
|
) { |
|
2
|
0
|
0
|
2
|
|
6
|
|
|
2
|
0
|
0
|
2
|
|
210
|
|
|
2
|
0
|
|
2
|
|
24
|
|
|
2
|
0
|
|
2
|
|
5
|
|
|
2
|
0
|
|
2
|
|
81
|
|
|
2
|
0
|
|
2
|
|
11
|
|
|
2
|
0
|
|
2
|
|
3
|
|
|
2
|
0
|
|
0
|
|
10
|
|
|
2
|
0
|
|
|
|
262
|
|
|
2
|
0
|
|
|
|
5
|
|
|
2
|
0
|
|
|
|
951
|
|
|
2
|
0
|
|
|
|
15
|
|
|
2
|
0
|
|
|
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|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
658
|
0
|
|
|
|
|
0
|
my %args = ( |
659
|
|
|
|
|
|
|
ending_before => $ending_before, |
660
|
|
|
|
|
|
|
limit => $limit, |
661
|
|
|
|
|
|
|
object => $object, |
662
|
|
|
|
|
|
|
starting_after => $starting_after, |
663
|
|
|
|
|
|
|
); |
664
|
0
|
|
|
|
|
0
|
return $self->_get("customers/$customer_id/sources", \%args); |
665
|
|
|
|
|
|
|
} |
666
|
|
|
|
|
|
|
} |
667
|
|
|
|
|
|
|
|
668
|
|
|
|
|
|
|
|
669
|
|
|
|
|
|
|
Subscriptions: { |
670
|
2
|
0
|
0
|
2
|
|
7378
|
method get_subscription(Net::Stripe::Customer|Str :$customer) { |
|
2
|
0
|
0
|
2
|
|
5
|
|
|
2
|
0
|
|
2
|
|
222
|
|
|
2
|
0
|
|
2
|
|
15
|
|
|
2
|
0
|
|
2
|
|
5
|
|
|
2
|
0
|
|
0
|
|
91
|
|
|
2
|
|
|
|
|
13
|
|
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
20
|
|
|
2
|
|
|
|
|
225
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
646
|
|
|
2
|
|
|
|
|
16
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
375
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
671
|
0
|
0
|
|
|
|
0
|
if (ref($customer)) { |
672
|
0
|
|
|
|
|
0
|
$customer = $customer->id; |
673
|
|
|
|
|
|
|
} |
674
|
0
|
|
|
|
|
0
|
return $self->_get("customers/$customer/subscription"); |
675
|
|
|
|
|
|
|
} |
676
|
|
|
|
|
|
|
|
677
|
|
|
|
|
|
|
# adds a subscription, keeping any existing subscriptions unmodified |
678
|
|
|
|
|
|
|
method post_subscription(Net::Stripe::Customer|Str :$customer, |
679
|
|
|
|
|
|
|
Net::Stripe::Subscription|Str :$subscription?, |
680
|
|
|
|
|
|
|
Net::Stripe::Plan|Str :$plan?, |
681
|
|
|
|
|
|
|
Str :$coupon?, |
682
|
|
|
|
|
|
|
Int|Str :$trial_end?, |
683
|
|
|
|
|
|
|
Net::Stripe::Card|Net::Stripe::Token|Str :$card?, |
684
|
|
|
|
|
|
|
Net::Stripe::Card|Net::Stripe::Token|Str :$source?, |
685
|
|
|
|
|
|
|
Int :$quantity? where { $_ >= 0 }, |
686
|
|
|
|
|
|
|
Num :$application_fee_percent?, |
687
|
|
|
|
|
|
|
Bool :$prorate? = 1, |
688
|
|
|
|
|
|
|
Bool :$cancel_at_period_end?, |
689
|
2
|
0
|
0
|
2
|
|
55924
|
) { |
|
2
|
0
|
0
|
2
|
|
5
|
|
|
2
|
0
|
0
|
2
|
|
180
|
|
|
2
|
0
|
0
|
2
|
|
14
|
|
|
2
|
0
|
0
|
2
|
|
3
|
|
|
2
|
0
|
|
2
|
|
76
|
|
|
2
|
0
|
|
2
|
|
11
|
|
|
2
|
0
|
|
2
|
|
5
|
|
|
2
|
0
|
|
2
|
|
14
|
|
|
2
|
0
|
|
2
|
|
213
|
|
|
2
|
0
|
|
2
|
|
5
|
|
|
2
|
0
|
|
2
|
|
815
|
|
|
2
|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
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
690
|
0
|
0
|
|
|
|
0
|
if (ref($customer)) { |
691
|
0
|
|
|
|
|
0
|
$customer = $customer->id; |
692
|
|
|
|
|
|
|
} |
693
|
|
|
|
|
|
|
|
694
|
0
|
0
|
|
|
|
0
|
if (ref($plan)) { |
695
|
0
|
|
|
|
|
0
|
$plan = $plan->id; |
696
|
|
|
|
|
|
|
} |
697
|
|
|
|
|
|
|
|
698
|
0
|
0
|
|
|
|
0
|
if (ref($subscription) ne 'Net::Stripe::Subscription') { |
699
|
0
|
|
|
|
|
0
|
my %args = (plan => $plan, |
700
|
|
|
|
|
|
|
coupon => $coupon, |
701
|
|
|
|
|
|
|
trial_end => $trial_end, |
702
|
|
|
|
|
|
|
card => $card, |
703
|
|
|
|
|
|
|
source => $source, |
704
|
|
|
|
|
|
|
prorate => $prorate, |
705
|
|
|
|
|
|
|
quantity => $quantity, |
706
|
|
|
|
|
|
|
application_fee_percent => $application_fee_percent, |
707
|
|
|
|
|
|
|
cancel_at_period_end => $cancel_at_period_end); |
708
|
0
|
0
|
|
|
|
0
|
if (defined($subscription)) { |
709
|
0
|
|
|
|
|
0
|
$args{id} = $subscription; |
710
|
|
|
|
|
|
|
} |
711
|
0
|
|
|
|
|
0
|
$subscription = Net::Stripe::Subscription->new( %args ); |
712
|
|
|
|
|
|
|
} |
713
|
|
|
|
|
|
|
|
714
|
0
|
0
|
|
|
|
0
|
if (defined($subscription->id)) { |
715
|
0
|
|
|
|
|
0
|
return $self->_post("customers/$customer/subscriptions/" . $subscription->id, $subscription); |
716
|
|
|
|
|
|
|
} else { |
717
|
0
|
|
|
|
|
0
|
return $self->_post("customers/$customer/subscriptions", $subscription); |
718
|
|
|
|
|
|
|
} |
719
|
|
|
|
|
|
|
} |
720
|
|
|
|
|
|
|
|
721
|
|
|
|
|
|
|
method delete_subscription(Net::Stripe::Customer|Str :$customer, |
722
|
|
|
|
|
|
|
Net::Stripe::Subscription|Str :$subscription, |
723
|
|
|
|
|
|
|
Bool :$at_period_end? |
724
|
2
|
0
|
0
|
2
|
|
14984
|
) { |
|
2
|
0
|
0
|
2
|
|
10
|
|
|
2
|
0
|
|
2
|
|
202
|
|
|
2
|
0
|
|
2
|
|
15
|
|
|
2
|
0
|
|
2
|
|
4
|
|
|
2
|
0
|
|
2
|
|
106
|
|
|
2
|
0
|
|
2
|
|
13
|
|
|
2
|
0
|
|
0
|
|
5
|
|
|
2
|
0
|
|
|
|
72
|
|
|
2
|
0
|
|
|
|
249
|
|
|
2
|
0
|
|
|
|
5
|
|
|
2
|
0
|
|
|
|
666
|
|
|
2
|
|
|
|
|
26
|
|
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
322
|
|
|
2
|
|
|
|
|
21
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
234
|
|
|
2
|
|
|
|
|
25
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
447
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
725
|
0
|
0
|
|
|
|
0
|
if (ref($customer)) { |
726
|
0
|
|
|
|
|
0
|
$customer = $customer->id; |
727
|
|
|
|
|
|
|
} |
728
|
0
|
0
|
|
|
|
0
|
if (ref($subscription)) { |
729
|
0
|
|
|
|
|
0
|
$subscription = $subscription->id; |
730
|
|
|
|
|
|
|
} |
731
|
|
|
|
|
|
|
|
732
|
0
|
|
|
|
|
0
|
my %args; |
733
|
0
|
0
|
|
|
|
0
|
$args{at_period_end} = 'true' if $at_period_end; |
734
|
0
|
|
|
|
|
0
|
return $self->_delete("customers/$customer/subscriptions/$subscription", \%args); |
735
|
|
|
|
|
|
|
} |
736
|
|
|
|
|
|
|
} |
737
|
|
|
|
|
|
|
|
738
|
|
|
|
|
|
|
|
739
|
|
|
|
|
|
|
PaymentMethods: { |
740
|
|
|
|
|
|
|
method create_payment_method( |
741
|
|
|
|
|
|
|
StripePaymentMethodType :$type!, |
742
|
|
|
|
|
|
|
HashRef :$billing_details?, |
743
|
|
|
|
|
|
|
StripeTokenId :$card?, |
744
|
|
|
|
|
|
|
HashRef :$fpx?, |
745
|
|
|
|
|
|
|
HashRef :$ideal?, |
746
|
|
|
|
|
|
|
HashRef[Str] :$metadata?, |
747
|
|
|
|
|
|
|
StripePaymentMethodId :$payment_method?, |
748
|
|
|
|
|
|
|
HashRef :$sepa_debit?, |
749
|
2
|
0
|
0
|
2
|
|
25793
|
) { |
|
2
|
0
|
0
|
2
|
|
4
|
|
|
2
|
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|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
750
|
0
|
|
|
|
|
0
|
my %args = ( |
751
|
|
|
|
|
|
|
type => $type, |
752
|
|
|
|
|
|
|
billing_details => $billing_details, |
753
|
|
|
|
|
|
|
card => $card, |
754
|
|
|
|
|
|
|
fpx => $fpx, |
755
|
|
|
|
|
|
|
ideal => $ideal, |
756
|
|
|
|
|
|
|
metadata => $metadata, |
757
|
|
|
|
|
|
|
payment_method => $payment_method, |
758
|
|
|
|
|
|
|
sepa_debit => $sepa_debit, |
759
|
|
|
|
|
|
|
); |
760
|
0
|
|
|
|
|
0
|
my $payment_method_obj = Net::Stripe::PaymentMethod->new( %args ); |
761
|
0
|
|
|
|
|
0
|
return $self->_post("payment_methods", $payment_method_obj); |
762
|
|
|
|
|
|
|
} |
763
|
|
|
|
|
|
|
|
764
|
|
|
|
|
|
|
method get_payment_method( |
765
|
|
|
|
|
|
|
StripePaymentMethodId :$payment_method_id!, |
766
|
2
|
0
|
0
|
2
|
|
5020
|
) { |
|
2
|
0
|
0
|
2
|
|
6
|
|
|
2
|
0
|
|
2
|
|
259
|
|
|
2
|
0
|
|
2
|
|
15
|
|
|
2
|
0
|
|
0
|
|
5
|
|
|
2
|
|
|
|
|
81
|
|
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
224
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
877
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
767
|
0
|
|
|
|
|
0
|
return $self->_get("payment_methods/$payment_method_id"); |
768
|
|
|
|
|
|
|
} |
769
|
|
|
|
|
|
|
|
770
|
|
|
|
|
|
|
method update_payment_method( |
771
|
|
|
|
|
|
|
StripePaymentMethodId :$payment_method_id!, |
772
|
|
|
|
|
|
|
HashRef :$billing_details?, |
773
|
|
|
|
|
|
|
HashRef[Int] :$card?, |
774
|
|
|
|
|
|
|
HashRef[Str]|EmptyStr :$metadata?, |
775
|
|
|
|
|
|
|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|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
777
|
0
|
|
|
|
|
0
|
my %args = ( |
778
|
|
|
|
|
|
|
billing_details => $billing_details, |
779
|
|
|
|
|
|
|
card => $card, |
780
|
|
|
|
|
|
|
metadata => $metadata, |
781
|
|
|
|
|
|
|
sepa_debit => $sepa_debit, |
782
|
|
|
|
|
|
|
); |
783
|
0
|
|
|
|
|
0
|
my $payment_method_obj = Net::Stripe::PaymentMethod->new( %args ); |
784
|
0
|
|
|
|
|
0
|
return $self->_post("payment_methods/$payment_method_id", $payment_method_obj); |
785
|
|
|
|
|
|
|
} |
786
|
|
|
|
|
|
|
|
787
|
|
|
|
|
|
|
method list_payment_methods( |
788
|
|
|
|
|
|
|
StripeCustomerId :$customer!, |
789
|
|
|
|
|
|
|
StripePaymentMethodType :$type!, |
790
|
|
|
|
|
|
|
Str :$ending_before?, |
791
|
|
|
|
|
|
|
Int :$limit?, |
792
|
|
|
|
|
|
|
Str :$starting_after?, |
793
|
2
|
0
|
0
|
2
|
|
15874
|
) { |
|
2
|
0
|
0
|
2
|
|
5
|
|
|
2
|
0
|
0
|
2
|
|
223
|
|
|
2
|
0
|
|
2
|
|
16
|
|
|
2
|
0
|
|
2
|
|
5
|
|
|
2
|
0
|
|
2
|
|
106
|
|
|
2
|
0
|
|
2
|
|
15
|
|
|
2
|
0
|
|
2
|
|
3
|
|
|
2
|
0
|
|
0
|
|
10
|
|
|
2
|
0
|
|
|
|
222
|
|
|
2
|
0
|
|
|
|
6
|
|
|
2
|
0
|
|
|
|
1319
|
|
|
2
|
0
|
|
|
|
17
|
|
|
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|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
794
|
0
|
|
|
|
|
0
|
my %args = ( |
795
|
|
|
|
|
|
|
customer => $customer, |
796
|
|
|
|
|
|
|
type => $type, |
797
|
|
|
|
|
|
|
ending_before => $ending_before, |
798
|
|
|
|
|
|
|
limit => $limit, |
799
|
|
|
|
|
|
|
starting_after => $starting_after, |
800
|
|
|
|
|
|
|
); |
801
|
0
|
|
|
|
|
0
|
return $self->_get("payment_methods", \%args); |
802
|
|
|
|
|
|
|
} |
803
|
|
|
|
|
|
|
|
804
|
|
|
|
|
|
|
method attach_payment_method( |
805
|
|
|
|
|
|
|
StripeCustomerId :$customer!, |
806
|
|
|
|
|
|
|
StripePaymentMethodId :$payment_method_id!, |
807
|
2
|
0
|
0
|
2
|
|
7353
|
) { |
|
2
|
0
|
0
|
2
|
|
5
|
|
|
2
|
0
|
|
2
|
|
219
|
|
|
2
|
0
|
|
2
|
|
21
|
|
|
2
|
0
|
|
0
|
|
4
|
|
|
2
|
0
|
|
|
|
75
|
|
|
2
|
0
|
|
|
|
20
|
|
|
2
|
|
|
|
|
15
|
|
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
196
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1162
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
808
|
0
|
|
|
|
|
0
|
my %args = ( |
809
|
|
|
|
|
|
|
customer => $customer, |
810
|
|
|
|
|
|
|
); |
811
|
0
|
|
|
|
|
0
|
return $self->_post("payment_methods/$payment_method_id/attach", \%args); |
812
|
|
|
|
|
|
|
} |
813
|
|
|
|
|
|
|
|
814
|
|
|
|
|
|
|
method detach_payment_method( |
815
|
|
|
|
|
|
|
StripePaymentMethodId :$payment_method_id!, |
816
|
2
|
0
|
0
|
2
|
|
5137
|
) { |
|
2
|
0
|
0
|
2
|
|
5
|
|
|
2
|
0
|
|
2
|
|
218
|
|
|
2
|
0
|
|
2
|
|
15
|
|
|
2
|
0
|
|
0
|
|
4
|
|
|
2
|
|
|
|
|
99
|
|
|
2
|
|
|
|
|
14
|
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
234
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
906
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
817
|
0
|
|
|
|
|
0
|
return $self->_post("payment_methods/$payment_method_id/detach"); |
818
|
|
|
|
|
|
|
} |
819
|
|
|
|
|
|
|
} |
820
|
|
|
|
|
|
|
|
821
|
|
|
|
|
|
|
|
822
|
|
|
|
|
|
|
Tokens: { |
823
|
2
|
0
|
0
|
2
|
|
5284
|
method get_token(Str :$token_id) { |
|
2
|
0
|
0
|
2
|
|
5
|
|
|
2
|
0
|
|
2
|
|
231
|
|
|
2
|
0
|
|
2
|
|
16
|
|
|
2
|
0
|
|
2
|
|
4
|
|
|
2
|
0
|
|
0
|
|
100
|
|
|
2
|
|
|
|
|
22
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
206
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
695
|
|
|
2
|
|
|
|
|
18
|
|
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
325
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
824
|
0
|
|
|
|
|
0
|
return $self->_get("tokens/$token_id"); |
825
|
|
|
|
|
|
|
} |
826
|
|
|
|
|
|
|
} |
827
|
|
|
|
|
|
|
|
828
|
|
|
|
|
|
|
|
829
|
|
|
|
|
|
|
Products: { |
830
|
|
|
|
|
|
|
method create_product( |
831
|
|
|
|
|
|
|
Str :$name!, |
832
|
|
|
|
|
|
|
Bool :$active?, |
833
|
|
|
|
|
|
|
ArrayRef[Str] :$attributes?, |
834
|
|
|
|
|
|
|
Str :$caption?, |
835
|
|
|
|
|
|
|
ArrayRef[Str] :$deactivate_on?, |
836
|
|
|
|
|
|
|
Str :$description?, |
837
|
|
|
|
|
|
|
StripeProductId|Str :$id?, |
838
|
|
|
|
|
|
|
ArrayRef[Str] :$images?, |
839
|
|
|
|
|
|
|
HashRef[Str] :$metadata?, |
840
|
|
|
|
|
|
|
HashRef[Num] :$package_dimensions?, |
841
|
|
|
|
|
|
|
Bool :$shippable?, |
842
|
|
|
|
|
|
|
Str :$statement_descriptor?, |
843
|
|
|
|
|
|
|
StripeProductType :$type?, |
844
|
|
|
|
|
|
|
Str :$unit_label?, |
845
|
|
|
|
|
|
|
Str :$url?, |
846
|
2
|
0
|
0
|
2
|
|
58215
|
) { |
|
2
|
0
|
0
|
2
|
|
5
|
|
|
2
|
0
|
0
|
2
|
|
200
|
|
|
2
|
0
|
0
|
2
|
|
14
|
|
|
2
|
0
|
|
2
|
|
5
|
|
|
2
|
0
|
|
2
|
|
96
|
|
|
2
|
0
|
|
2
|
|
12
|
|
|
2
|
0
|
|
2
|
|
4
|
|
|
2
|
0
|
|
2
|
|
14
|
|
|
2
|
0
|
|
2
|
|
214
|
|
|
2
|
0
|
|
2
|
|
6
|
|
|
2
|
0
|
|
2
|
|
917
|
|
|
2
|
0
|
|
2
|
|
21
|
|
|
2
|
0
|
|
2
|
|
4
|
|
|
2
|
0
|
|
2
|
|
256
|
|
|
2
|
0
|
|
2
|
|
17
|
|
|
2
|
0
|
|
2
|
|
4
|
|
|
2
|
0
|
|
2
|
|
267
|
|
|
2
|
0
|
|
0
|
|
16
|
|
|
2
|
0
|
|
|
|
4
|
|
|
2
|
0
|
|
|
|
254
|
|
|
2
|
0
|
|
|
|
22
|
|
|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
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
847
|
0
|
|
|
|
|
0
|
my %args = ( |
848
|
|
|
|
|
|
|
name => $name, |
849
|
|
|
|
|
|
|
active => $active, |
850
|
|
|
|
|
|
|
attributes => $attributes, |
851
|
|
|
|
|
|
|
caption => $caption, |
852
|
|
|
|
|
|
|
deactivate_on => $deactivate_on, |
853
|
|
|
|
|
|
|
description => $description, |
854
|
|
|
|
|
|
|
id => $id, |
855
|
|
|
|
|
|
|
images => $images, |
856
|
|
|
|
|
|
|
metadata => $metadata, |
857
|
|
|
|
|
|
|
package_dimensions => $package_dimensions, |
858
|
|
|
|
|
|
|
shippable => $shippable, |
859
|
|
|
|
|
|
|
statement_descriptor => $statement_descriptor, |
860
|
|
|
|
|
|
|
type => $type, |
861
|
|
|
|
|
|
|
unit_label => $unit_label, |
862
|
|
|
|
|
|
|
url => $url, |
863
|
|
|
|
|
|
|
); |
864
|
0
|
|
|
|
|
0
|
my $product_obj = Net::Stripe::Product->new( %args ); |
865
|
0
|
|
|
|
|
0
|
return $self->_post('products', $product_obj); |
866
|
|
|
|
|
|
|
} |
867
|
|
|
|
|
|
|
|
868
|
|
|
|
|
|
|
method get_product( |
869
|
|
|
|
|
|
|
StripeProductId|Str :$product_id!, |
870
|
2
|
0
|
0
|
2
|
|
6093
|
) { |
|
2
|
0
|
0
|
2
|
|
7
|
|
|
2
|
0
|
|
2
|
|
221
|
|
|
2
|
0
|
|
2
|
|
17
|
|
|
2
|
0
|
|
0
|
|
7
|
|
|
2
|
|
|
|
|
100
|
|
|
2
|
|
|
|
|
14
|
|
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
235
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
895
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
871
|
0
|
|
|
|
|
0
|
return $self->_get("products/$product_id"); |
872
|
|
|
|
|
|
|
} |
873
|
|
|
|
|
|
|
|
874
|
|
|
|
|
|
|
method update_product( |
875
|
|
|
|
|
|
|
StripeProductId|Str :$product_id!, |
876
|
|
|
|
|
|
|
Bool :$active?, |
877
|
|
|
|
|
|
|
ArrayRef[Str] :$attributes?, |
878
|
|
|
|
|
|
|
Str :$caption?, |
879
|
|
|
|
|
|
|
ArrayRef[Str] :$deactivate_on?, |
880
|
|
|
|
|
|
|
Str :$description?, |
881
|
|
|
|
|
|
|
ArrayRef[Str] :$images?, |
882
|
|
|
|
|
|
|
HashRef[Str]|EmptyStr :$metadata?, |
883
|
|
|
|
|
|
|
Str :$name?, |
884
|
|
|
|
|
|
|
HashRef[Num] :$package_dimensions?, |
885
|
|
|
|
|
|
|
Bool :$shippable?, |
886
|
|
|
|
|
|
|
Str :$statement_descriptor?, |
887
|
|
|
|
|
|
|
StripeProductType :$type?, |
888
|
|
|
|
|
|
|
Str :$unit_label?, |
889
|
|
|
|
|
|
|
Str :$url?, |
890
|
2
|
0
|
0
|
2
|
|
52818
|
) { |
|
2
|
0
|
0
|
2
|
|
4
|
|
|
2
|
0
|
0
|
2
|
|
241
|
|
|
2
|
0
|
0
|
2
|
|
14
|
|
|
2
|
0
|
|
2
|
|
5
|
|
|
2
|
0
|
|
2
|
|
89
|
|
|
2
|
0
|
|
2
|
|
26
|
|
|
2
|
0
|
|
2
|
|
5
|
|
|
2
|
0
|
|
2
|
|
13
|
|
|
2
|
0
|
|
2
|
|
260
|
|
|
2
|
0
|
|
2
|
|
4
|
|
|
2
|
0
|
|
2
|
|
1035
|
|
|
2
|
0
|
|
2
|
|
17
|
|
|
2
|
0
|
|
2
|
|
4
|
|
|
2
|
0
|
|
2
|
|
267
|
|
|
2
|
0
|
|
2
|
|
15
|
|
|
2
|
0
|
|
2
|
|
4
|
|
|
2
|
0
|
|
0
|
|
264
|
|
|
2
|
0
|
|
|
|
13
|
|
|
2
|
0
|
|
|
|
4
|
|
|
2
|
0
|
|
|
|
273
|
|
|
2
|
0
|
|
|
|
14
|
|
|
2
|
0
|
|
|
|
3
|
|
|
2
|
0
|
|
|
|
325
|
|
|
2
|
0
|
|
|
|
25
|
|
|
2
|
0
|
|
|
|
6
|
|
|
2
|
0
|
|
|
|
241
|
|
|
2
|
0
|
|
|
|
15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
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
891
|
0
|
|
|
|
|
0
|
my %args = ( |
892
|
|
|
|
|
|
|
active => $active, |
893
|
|
|
|
|
|
|
attributes => $attributes, |
894
|
|
|
|
|
|
|
caption => $caption, |
895
|
|
|
|
|
|
|
deactivate_on => $deactivate_on, |
896
|
|
|
|
|
|
|
description => $description, |
897
|
|
|
|
|
|
|
images => $images, |
898
|
|
|
|
|
|
|
metadata => $metadata, |
899
|
|
|
|
|
|
|
name => $name, |
900
|
|
|
|
|
|
|
package_dimensions => $package_dimensions, |
901
|
|
|
|
|
|
|
shippable => $shippable, |
902
|
|
|
|
|
|
|
statement_descriptor => $statement_descriptor, |
903
|
|
|
|
|
|
|
type => $type, |
904
|
|
|
|
|
|
|
unit_label => $unit_label, |
905
|
|
|
|
|
|
|
url => $url, |
906
|
|
|
|
|
|
|
); |
907
|
0
|
|
|
|
|
0
|
my $product_obj = Net::Stripe::Product->new( %args ); |
908
|
0
|
|
|
|
|
0
|
return $self->_post("products/$product_id", $product_obj); |
909
|
|
|
|
|
|
|
} |
910
|
|
|
|
|
|
|
|
911
|
|
|
|
|
|
|
method list_products( |
912
|
|
|
|
|
|
|
Bool :$active?, |
913
|
|
|
|
|
|
|
ArrayRef[StripeProductId|Str] :$ids, |
914
|
|
|
|
|
|
|
Bool :$shippable?, |
915
|
|
|
|
|
|
|
StripeProductType :$type?, |
916
|
|
|
|
|
|
|
Str :$url?, |
917
|
|
|
|
|
|
|
HashRef[Str] :$created?, |
918
|
|
|
|
|
|
|
Str :$ending_before?, |
919
|
|
|
|
|
|
|
Int :$limit?, |
920
|
|
|
|
|
|
|
Str :$starting_after?, |
921
|
2
|
0
|
0
|
2
|
|
34305
|
) { |
|
2
|
0
|
0
|
2
|
|
5
|
|
|
2
|
0
|
0
|
2
|
|
218
|
|
|
2
|
0
|
|
2
|
|
15
|
|
|
2
|
0
|
|
2
|
|
5
|
|
|
2
|
0
|
|
2
|
|
93
|
|
|
2
|
0
|
|
2
|
|
13
|
|
|
2
|
0
|
|
2
|
|
4
|
|
|
2
|
0
|
|
2
|
|
11
|
|
|
2
|
0
|
|
2
|
|
235
|
|
|
2
|
0
|
|
2
|
|
7
|
|
|
2
|
0
|
|
2
|
|
840
|
|
|
2
|
0
|
|
0
|
|
18
|
|
|
2
|
0
|
|
|
|
5
|
|
|
2
|
0
|
|
|
|
349
|
|
|
2
|
0
|
|
|
|
14
|
|
|
2
|
0
|
|
|
|
6
|
|
|
2
|
0
|
|
|
|
255
|
|
|
2
|
0
|
|
|
|
18
|
|
|
2
|
0
|
|
|
|
5
|
|
|
2
|
0
|
|
|
|
316
|
|
|
2
|
0
|
|
|
|
16
|
|
|
2
|
0
|
|
|
|
5
|
|
|
2
|
0
|
|
|
|
228
|
|
|
2
|
0
|
|
|
|
16
|
|
|
2
|
0
|
|
|
|
4
|
|
|
2
|
0
|
|
|
|
311
|
|
|
2
|
0
|
|
|
|
16
|
|
|
2
|
0
|
|
|
|
14
|
|
|
2
|
0
|
|
|
|
244
|
|
|
2
|
|
|
|
|
14
|
|
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
428
|
|
|
2
|
|
|
|
|
18
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
419
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
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|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
922
|
0
|
|
|
|
|
0
|
my %args = ( |
923
|
|
|
|
|
|
|
path => "products", |
924
|
|
|
|
|
|
|
active => _encode_boolean( $active ), |
925
|
|
|
|
|
|
|
ids => $ids, |
926
|
|
|
|
|
|
|
shippable => _encode_boolean( $shippable ), |
927
|
|
|
|
|
|
|
type => $type, |
928
|
|
|
|
|
|
|
url => $url, |
929
|
|
|
|
|
|
|
created => $created, |
930
|
|
|
|
|
|
|
ending_before => $ending_before, |
931
|
|
|
|
|
|
|
limit => $limit, |
932
|
|
|
|
|
|
|
starting_after => $starting_after, |
933
|
|
|
|
|
|
|
); |
934
|
0
|
|
|
|
|
0
|
return $self->_get_all( %args ); |
935
|
|
|
|
|
|
|
} |
936
|
|
|
|
|
|
|
|
937
|
|
|
|
|
|
|
method delete_product( |
938
|
|
|
|
|
|
|
StripeProductId|Str :$product_id!, |
939
|
2
|
0
|
0
|
2
|
|
6217
|
) { |
|
2
|
0
|
0
|
2
|
|
6
|
|
|
2
|
0
|
|
2
|
|
225
|
|
|
2
|
0
|
|
2
|
|
27
|
|
|
2
|
0
|
|
0
|
|
5
|
|
|
2
|
|
|
|
|
100
|
|
|
2
|
|
|
|
|
11
|
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
18
|
|
|
2
|
|
|
|
|
233
|
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
888
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
940
|
0
|
|
|
|
|
0
|
$self->_delete("products/$product_id"); |
941
|
|
|
|
|
|
|
} |
942
|
|
|
|
|
|
|
} |
943
|
|
|
|
|
|
|
|
944
|
|
|
|
|
|
|
|
945
|
|
|
|
|
|
|
Plans: { |
946
|
|
|
|
|
|
|
method post_plan(Str :$id, |
947
|
|
|
|
|
|
|
Int :$amount, |
948
|
|
|
|
|
|
|
Str :$currency, |
949
|
|
|
|
|
|
|
Str :$interval, |
950
|
|
|
|
|
|
|
Int :$interval_count?, |
951
|
|
|
|
|
|
|
Str :$name, |
952
|
|
|
|
|
|
|
StripeProductId|Str :$product, |
953
|
|
|
|
|
|
|
Int :$trial_period_days?, |
954
|
|
|
|
|
|
|
HashRef :$metadata?, |
955
|
2
|
0
|
0
|
2
|
|
32487
|
Str :$statement_descriptor?) { |
|
2
|
0
|
0
|
2
|
|
5
|
|
|
2
|
0
|
0
|
2
|
|
202
|
|
|
2
|
0
|
0
|
2
|
|
14
|
|
|
2
|
0
|
0
|
2
|
|
5
|
|
|
2
|
0
|
|
2
|
|
101
|
|
|
2
|
0
|
|
2
|
|
12
|
|
|
2
|
0
|
|
2
|
|
6
|
|
|
2
|
0
|
|
2
|
|
11
|
|
|
2
|
0
|
|
2
|
|
262
|
|
|
2
|
0
|
|
2
|
|
5
|
|
|
2
|
0
|
|
2
|
|
919
|
|
|
2
|
0
|
|
2
|
|
18
|
|
|
2
|
0
|
|
0
|
|
5
|
|
|
2
|
0
|
|
|
|
263
|
|
|
2
|
0
|
|
|
|
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
|
|
|
|
|
|
interval_count => $interval_count, |
961
|
|
|
|
|
|
|
name => $name, |
962
|
|
|
|
|
|
|
product => $product, |
963
|
|
|
|
|
|
|
trial_period_days => $trial_period_days, |
964
|
|
|
|
|
|
|
metadata => $metadata, |
965
|
|
|
|
|
|
|
statement_descriptor => $statement_descriptor); |
966
|
0
|
|
|
|
|
0
|
return $self->_post('plans', $plan); |
967
|
|
|
|
|
|
|
} |
968
|
|
|
|
|
|
|
|
969
|
2
|
0
|
0
|
2
|
|
5615
|
method get_plan(Str :$plan_id) { |
|
2
|
0
|
0
|
2
|
|
6
|
|
|
2
|
0
|
|
2
|
|
232
|
|
|
2
|
0
|
|
2
|
|
15
|
|
|
2
|
0
|
|
2
|
|
4
|
|
|
2
|
0
|
|
0
|
|
91
|
|
|
2
|
|
|
|
|
15
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
225
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
670
|
|
|
2
|
|
|
|
|
19
|
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
340
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
970
|
0
|
|
|
|
|
0
|
return $self->_get("plans/" . uri_escape($plan_id)); |
971
|
|
|
|
|
|
|
} |
972
|
|
|
|
|
|
|
|
973
|
2
|
0
|
|
2
|
|
9632
|
method delete_plan(Str|Net::Stripe::Plan $plan) { |
|
2
|
0
|
|
2
|
|
5
|
|
|
2
|
0
|
|
0
|
|
342
|
|
|
2
|
0
|
|
|
|
17
|
|
|
2
|
0
|
|
|
|
4
|
|
|
2
|
|
|
|
|
301
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
974
|
0
|
0
|
|
|
|
0
|
if (ref($plan)) { |
975
|
0
|
|
|
|
|
0
|
$plan = $plan->id; |
976
|
|
|
|
|
|
|
} |
977
|
0
|
|
|
|
|
0
|
$self->_delete("plans/$plan"); |
978
|
|
|
|
|
|
|
} |
979
|
|
|
|
|
|
|
|
980
|
|
|
|
|
|
|
method get_plans( |
981
|
|
|
|
|
|
|
StripeProductId|Str :$product?, |
982
|
|
|
|
|
|
|
Str :$ending_before?, |
983
|
|
|
|
|
|
|
Int :$limit?, |
984
|
|
|
|
|
|
|
Str :$starting_after?, |
985
|
2
|
0
|
0
|
2
|
|
15278
|
) { |
|
2
|
0
|
0
|
2
|
|
4
|
|
|
2
|
0
|
0
|
2
|
|
377
|
|
|
2
|
0
|
|
2
|
|
26
|
|
|
2
|
0
|
|
2
|
|
7
|
|
|
2
|
0
|
|
2
|
|
123
|
|
|
2
|
0
|
|
2
|
|
14
|
|
|
2
|
0
|
|
0
|
|
10
|
|
|
2
|
0
|
|
|
|
12
|
|
|
2
|
0
|
|
|
|
240
|
|
|
2
|
0
|
|
|
|
5
|
|
|
2
|
0
|
|
|
|
908
|
|
|
2
|
0
|
|
|
|
16
|
|
|
2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=> $limit, |
991
|
|
|
|
|
|
|
starting_after => $starting_after, |
992
|
|
|
|
|
|
|
); |
993
|
0
|
|
|
|
|
0
|
$self->_get_all(%args); |
994
|
|
|
|
|
|
|
} |
995
|
|
|
|
|
|
|
} |
996
|
|
|
|
|
|
|
|
997
|
|
|
|
|
|
|
|
998
|
|
|
|
|
|
|
|
999
|
|
|
|
|
|
|
Coupons: { |
1000
|
|
|
|
|
|
|
method post_coupon(Str :$id?, |
1001
|
|
|
|
|
|
|
Str :$duration, |
1002
|
|
|
|
|
|
|
Int :$amount_off?, |
1003
|
|
|
|
|
|
|
Str :$currency?, |
1004
|
|
|
|
|
|
|
Int :$duration_in_months?, |
1005
|
|
|
|
|
|
|
Int :$max_redemptions?, |
1006
|
|
|
|
|
|
|
HashRef :$metadata?, |
1007
|
|
|
|
|
|
|
Int :$percent_off?, |
1008
|
2
|
0
|
0
|
2
|
|
27917
|
Int :$redeem_by?) { |
|
2
|
0
|
0
|
2
|
|
9
|
|
|
2
|
0
|
0
|
2
|
|
201
|
|
|
2
|
0
|
0
|
2
|
|
15
|
|
|
2
|
0
|
0
|
2
|
|
4
|
|
|
2
|
0
|
0
|
2
|
|
95
|
|
|
2
|
0
|
0
|
2
|
|
12
|
|
|
2
|
0
|
|
2
|
|
4
|
|
|
2
|
0
|
|
2
|
|
9
|
|
|
2
|
0
|
|
2
|
|
219
|
|
|
2
|
0
|
|
2
|
|
7
|
|
|
2
|
0
|
|
2
|
|
844
|
|
|
2
|
0
|
|
2
|
|
16
|
|
|
2
|
0
|
|
0
|
|
4
|
|
|
2
|
0
|
|
|
|
312
|
|
|
2
|
0
|
|
|
|
16
|
|
|
2
|
0
|
|
|
|
4
|
|
|
2
|
0
|
|
|
|
270
|
|
|
2
|
0
|
|
|
|
15
|
|
|
2
|
0
|
|
|
|
6
|
|
|
2
|
0
|
|
|
|
344
|
|
|
2
|
0
|
|
|
|
14
|
|
|
2
|
0
|
|
|
|
5
|
|
|
2
|
0
|
|
|
|
281
|
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|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1009
|
0
|
|
|
|
|
0
|
my $coupon = Net::Stripe::Coupon->new(id => $id, |
1010
|
|
|
|
|
|
|
duration => $duration, |
1011
|
|
|
|
|
|
|
amount_off => $amount_off, |
1012
|
|
|
|
|
|
|
currency => $currency, |
1013
|
|
|
|
|
|
|
duration_in_months => $duration_in_months, |
1014
|
|
|
|
|
|
|
max_redemptions => $max_redemptions, |
1015
|
|
|
|
|
|
|
metadata => $metadata, |
1016
|
|
|
|
|
|
|
percent_off => $percent_off, |
1017
|
|
|
|
|
|
|
redeem_by => $redeem_by |
1018
|
|
|
|
|
|
|
); |
1019
|
0
|
|
|
|
|
0
|
return $self->_post('coupons', $coupon); |
1020
|
|
|
|
|
|
|
} |
1021
|
|
|
|
|
|
|
|
1022
|
2
|
0
|
0
|
2
|
|
5370
|
method get_coupon(Str :$coupon_id) { |
|
2
|
0
|
0
|
2
|
|
6
|
|
|
2
|
0
|
|
2
|
|
207
|
|
|
2
|
0
|
|
2
|
|
24
|
|
|
2
|
0
|
|
2
|
|
6
|
|
|
2
|
0
|
|
0
|
|
106
|
|
|
2
|
|
|
|
|
13
|
|
|
2
|
|
|
|
|
14
|
|
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
319
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
671
|
|
|
2
|
|
|
|
|
16
|
|
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
336
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1023
|
0
|
|
|
|
|
0
|
return $self->_get("coupons/" . uri_escape($coupon_id)); |
1024
|
|
|
|
|
|
|
} |
1025
|
|
|
|
|
|
|
|
1026
|
2
|
0
|
|
2
|
|
3314
|
method delete_coupon($id) { |
|
2
|
0
|
|
0
|
|
14
|
|
|
2
|
0
|
|
|
|
357
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1027
|
0
|
0
|
|
|
|
0
|
$id = $id->id if ref($id); |
1028
|
0
|
|
|
|
|
0
|
$self->_delete("coupons/$id"); |
1029
|
|
|
|
|
|
|
} |
1030
|
|
|
|
|
|
|
|
1031
|
2
|
0
|
0
|
2
|
|
11218
|
method get_coupons(Str :$ending_before?, Int :$limit?, Str :$starting_after?) { |
|
2
|
0
|
0
|
2
|
|
4
|
|
|
2
|
0
|
0
|
2
|
|
233
|
|
|
2
|
0
|
|
2
|
|
14
|
|
|
2
|
0
|
|
2
|
|
5
|
|
|
2
|
0
|
|
2
|
|
110
|
|
|
2
|
0
|
|
2
|
|
15
|
|
|
2
|
0
|
|
0
|
|
5
|
|
|
2
|
0
|
|
|
|
9
|
|
|
2
|
0
|
|
|
|
237
|
|
|
2
|
0
|
|
|
|
5
|
|
|
2
|
0
|
|
|
|
701
|
|
|
2
|
0
|
|
|
|
16
|
|
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
362
|
|
|
2
|
|
|
|
|
16
|
|
|
2
|
|
|
|
|
13
|
|
|
2
|
|
|
|
|
379
|
|
|
2
|
|
|
|
|
16
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
300
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1032
|
0
|
|
|
|
|
0
|
my %args = ( |
1033
|
|
|
|
|
|
|
path => 'coupons', |
1034
|
|
|
|
|
|
|
ending_before => $ending_before, |
1035
|
|
|
|
|
|
|
limit => $limit, |
1036
|
|
|
|
|
|
|
starting_after => $starting_after, |
1037
|
|
|
|
|
|
|
); |
1038
|
0
|
|
|
|
|
0
|
$self->_get_all(%args); |
1039
|
|
|
|
|
|
|
} |
1040
|
|
|
|
|
|
|
} |
1041
|
|
|
|
|
|
|
|
1042
|
|
|
|
|
|
|
|
1043
|
|
|
|
|
|
|
Discounts: { |
1044
|
2
|
0
|
0
|
2
|
|
7943
|
method delete_customer_discount(Net::Stripe::Customer|Str :$customer) { |
|
2
|
0
|
0
|
2
|
|
4
|
|
|
2
|
0
|
|
2
|
|
230
|
|
|
2
|
0
|
|
2
|
|
15
|
|
|
2
|
0
|
|
2
|
|
5
|
|
|
2
|
0
|
|
0
|
|
114
|
|
|
2
|
|
|
|
|
14
|
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
239
|
|
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
687
|
|
|
2
|
|
|
|
|
16
|
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
402
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1045
|
0
|
0
|
|
|
|
0
|
if (ref($customer)) { |
1046
|
0
|
|
|
|
|
0
|
$customer = $customer->id; |
1047
|
|
|
|
|
|
|
} |
1048
|
0
|
|
|
|
|
0
|
$self->_delete("customers/$customer/discount"); |
1049
|
|
|
|
|
|
|
} |
1050
|
|
|
|
|
|
|
} |
1051
|
|
|
|
|
|
|
|
1052
|
|
|
|
|
|
|
|
1053
|
|
|
|
|
|
|
|
1054
|
|
|
|
|
|
|
Invoices: { |
1055
|
|
|
|
|
|
|
|
1056
|
|
|
|
|
|
|
method create_invoice(Net::Stripe::Customer|Str :$customer, |
1057
|
|
|
|
|
|
|
Int :$application_fee?, |
1058
|
|
|
|
|
|
|
Str :$description?, |
1059
|
|
|
|
|
|
|
HashRef :$metadata?, |
1060
|
|
|
|
|
|
|
Net::Stripe::Subscription|Str :$subscription?, |
1061
|
2
|
0
|
0
|
2
|
|
23194
|
Bool :$auto_advance?) { |
|
2
|
0
|
0
|
2
|
|
5
|
|
|
2
|
0
|
0
|
2
|
|
187
|
|
|
2
|
0
|
|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
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1062
|
0
|
0
|
|
|
|
0
|
if (ref($customer)) { |
1063
|
0
|
|
|
|
|
0
|
$customer = $customer->id; |
1064
|
|
|
|
|
|
|
} |
1065
|
|
|
|
|
|
|
|
1066
|
0
|
0
|
|
|
|
0
|
if (ref($subscription)) { |
1067
|
0
|
|
|
|
|
0
|
$subscription = $subscription->id; |
1068
|
|
|
|
|
|
|
} |
1069
|
|
|
|
|
|
|
|
1070
|
0
|
|
|
|
|
0
|
return $self->_post("invoices", |
1071
|
|
|
|
|
|
|
{ |
1072
|
|
|
|
|
|
|
customer => $customer, |
1073
|
|
|
|
|
|
|
application_fee => $application_fee, |
1074
|
|
|
|
|
|
|
description => $description, |
1075
|
|
|
|
|
|
|
metadata => $metadata, |
1076
|
|
|
|
|
|
|
subscription => $subscription, |
1077
|
|
|
|
|
|
|
auto_advance => $auto_advance, |
1078
|
|
|
|
|
|
|
}); |
1079
|
|
|
|
|
|
|
} |
1080
|
|
|
|
|
|
|
|
1081
|
|
|
|
|
|
|
|
1082
|
|
|
|
|
|
|
method post_invoice(Net::Stripe::Invoice|Str :$invoice, |
1083
|
|
|
|
|
|
|
Int :$application_fee?, |
1084
|
|
|
|
|
|
|
Bool :$closed?, |
1085
|
|
|
|
|
|
|
Bool :$auto_advance?, |
1086
|
|
|
|
|
|
|
Str :$description?, |
1087
|
2
|
0
|
0
|
2
|
|
24365
|
HashRef :$metadata?) { |
|
2
|
0
|
0
|
2
|
|
5
|
|
|
2
|
0
|
0
|
2
|
|
235
|
|
|
2
|
0
|
|
2
|
|
19
|
|
|
2
|
0
|
|
2
|
|
5
|
|
|
2
|
0
|
|
2
|
|
100
|
|
|
2
|
0
|
|
2
|
|
23
|
|
|
2
|
0
|
|
2
|
|
4
|
|
|
2
|
0
|
|
2
|
|
9
|
|
|
2
|
0
|
|
2
|
|
209
|
|
|
2
|
0
|
|
0
|
|
5
|
|
|
2
|
0
|
|
|
|
763
|
|
|
2
|
0
|
|
|
|
18
|
|
|
2
|
0
|
|
|
|
7
|
|
|
2
|
0
|
|
|
|
301
|
|
|
2
|
0
|
|
|
|
16
|
|
|
2
|
0
|
|
|
|
4
|
|
|
2
|
0
|
|
|
|
448
|
|
|
2
|
0
|
|
|
|
16
|
|
|
2
|
0
|
|
|
|
5
|
|
|
2
|
0
|
|
|
|
272
|
|
|
2
|
0
|
|
|
|
14
|
|
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
246
|
|
|
2
|
|
|
|
|
18
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
283
|
|
|
2
|
|
|
|
|
14
|
|
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
379
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|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|
application_fee => $application_fee, |
1095
|
|
|
|
|
|
|
closed => $closed, |
1096
|
|
|
|
|
|
|
auto_advance => $auto_advance, |
1097
|
|
|
|
|
|
|
description => $description, |
1098
|
|
|
|
|
|
|
metadata => $metadata |
1099
|
|
|
|
|
|
|
}); |
1100
|
|
|
|
|
|
|
} |
1101
|
|
|
|
|
|
|
|
1102
|
2
|
0
|
0
|
2
|
|
5409
|
method get_invoice(Str :$invoice_id) { |
|
2
|
0
|
0
|
2
|
|
5
|
|
|
2
|
0
|
|
2
|
|
245
|
|
|
2
|
0
|
|
2
|
|
15
|
|
|
2
|
0
|
|
2
|
|
4
|
|
|
2
|
0
|
|
0
|
|
78
|
|
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
221
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
751
|
|
|
2
|
|
|
|
|
16
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
316
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1103
|
0
|
|
|
|
|
0
|
return $self->_get("invoices/$invoice_id"); |
1104
|
|
|
|
|
|
|
} |
1105
|
|
|
|
|
|
|
|
1106
|
2
|
0
|
0
|
2
|
|
5412
|
method pay_invoice(Str :$invoice_id) { |
|
2
|
0
|
0
|
2
|
|
4
|
|
|
2
|
0
|
|
2
|
|
207
|
|
|
2
|
0
|
|
2
|
|
18
|
|
|
2
|
0
|
|
2
|
|
42
|
|
|
2
|
0
|
|
0
|
|
129
|
|
|
2
|
|
|
|
|
25
|
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
11
|
|
|
2
|
|
|
|
|
238
|
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
674
|
|
|
2
|
|
|
|
|
16
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
324
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1107
|
0
|
|
|
|
|
0
|
return $self->_post("invoices/$invoice_id/pay"); |
1108
|
|
|
|
|
|
|
} |
1109
|
|
|
|
|
|
|
|
1110
|
|
|
|
|
|
|
method get_invoices(Net::Stripe::Customer|Str :$customer?, |
1111
|
|
|
|
|
|
|
Int|HashRef :$date?, |
1112
|
|
|
|
|
|
|
Str :$ending_before?, |
1113
|
|
|
|
|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|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1115
|
0
|
0
|
|
|
|
0
|
if (ref($customer)) { |
1116
|
0
|
|
|
|
|
0
|
$customer = $customer->id |
1117
|
|
|
|
|
|
|
} |
1118
|
|
|
|
|
|
|
|
1119
|
0
|
|
|
|
|
0
|
my %args = ( |
1120
|
|
|
|
|
|
|
customer => $customer, |
1121
|
|
|
|
|
|
|
date => $date, |
1122
|
|
|
|
|
|
|
ending_before => $ending_before, |
1123
|
|
|
|
|
|
|
limit => $limit, |
1124
|
|
|
|
|
|
|
starting_after => $starting_after, |
1125
|
|
|
|
|
|
|
); |
1126
|
0
|
|
|
|
|
0
|
$self->_get('invoices', \%args); |
1127
|
|
|
|
|
|
|
} |
1128
|
|
|
|
|
|
|
|
1129
|
2
|
0
|
|
2
|
|
6556
|
method get_upcominginvoice(Net::Stripe::Customer|Str $customer) { |
|
2
|
0
|
|
2
|
|
6
|
|
|
2
|
0
|
|
0
|
|
311
|
|
|
2
|
0
|
|
|
|
18
|
|
|
2
|
0
|
|
|
|
5
|
|
|
2
|
|
|
|
|
386
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1130
|
0
|
0
|
|
|
|
0
|
if (ref($customer)) { |
1131
|
0
|
|
|
|
|
0
|
$customer = $customer->id; |
1132
|
|
|
|
|
|
|
} |
1133
|
0
|
|
|
|
|
0
|
my %args = ( |
1134
|
|
|
|
|
|
|
path => 'invoices/upcoming', |
1135
|
|
|
|
|
|
|
customer => $customer, |
1136
|
|
|
|
|
|
|
); |
1137
|
0
|
|
|
|
|
0
|
return $self->_get_all(%args); |
1138
|
|
|
|
|
|
|
} |
1139
|
|
|
|
|
|
|
} |
1140
|
|
|
|
|
|
|
|
1141
|
|
|
|
|
|
|
|
1142
|
|
|
|
|
|
|
InvoiceItems: { |
1143
|
|
|
|
|
|
|
method create_invoiceitem(Net::Stripe::Customer|Str :$customer, |
1144
|
|
|
|
|
|
|
Int :$amount, |
1145
|
|
|
|
|
|
|
Str :$currency, |
1146
|
|
|
|
|
|
|
Net::Stripe::Invoice|Str :$invoice?, |
1147
|
|
|
|
|
|
|
Net::Stripe::Subscription|Str :$subscription?, |
1148
|
|
|
|
|
|
|
Str :$description?, |
1149
|
2
|
0
|
0
|
2
|
|
27904
|
HashRef :$metadata?) { |
|
2
|
0
|
0
|
2
|
|
5
|
|
|
2
|
0
|
0
|
2
|
|
235
|
|
|
2
|
0
|
|
2
|
|
15
|
|
|
2
|
0
|
|
2
|
|
4
|
|
|
2
|
0
|
|
2
|
|
85
|
|
|
2
|
0
|
|
2
|
|
11
|
|
|
2
|
0
|
|
2
|
|
5
|
|
|
2
|
0
|
|
2
|
|
10
|
|
|
2
|
0
|
|
2
|
|
251
|
|
|
2
|
0
|
|
2
|
|
6
|
|
|
2
|
0
|
|
0
|
|
749
|
|
|
2
|
0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
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1150
|
0
|
0
|
|
|
|
0
|
if (ref($customer)) { |
1151
|
0
|
|
|
|
|
0
|
$customer = $customer->id; |
1152
|
|
|
|
|
|
|
} |
1153
|
|
|
|
|
|
|
|
1154
|
0
|
0
|
|
|
|
0
|
if (ref($invoice)) { |
1155
|
0
|
|
|
|
|
0
|
$invoice = $invoice->id; |
1156
|
|
|
|
|
|
|
} |
1157
|
|
|
|
|
|
|
|
1158
|
0
|
0
|
|
|
|
0
|
if (ref($subscription)) { |
1159
|
0
|
|
|
|
|
0
|
$subscription = $subscription->id; |
1160
|
|
|
|
|
|
|
} |
1161
|
|
|
|
|
|
|
|
1162
|
0
|
|
|
|
|
0
|
my $invoiceitem = Net::Stripe::Invoiceitem->new(customer => $customer, |
1163
|
|
|
|
|
|
|
amount => $amount, |
1164
|
|
|
|
|
|
|
currency => $currency, |
1165
|
|
|
|
|
|
|
invoice => $invoice, |
1166
|
|
|
|
|
|
|
subscription => $subscription, |
1167
|
|
|
|
|
|
|
description => $description, |
1168
|
|
|
|
|
|
|
metadata => $metadata); |
1169
|
0
|
|
|
|
|
0
|
return $self->_post('invoiceitems', $invoiceitem); |
1170
|
|
|
|
|
|
|
} |
1171
|
|
|
|
|
|
|
|
1172
|
|
|
|
|
|
|
|
1173
|
|
|
|
|
|
|
method post_invoiceitem(Net::Stripe::Invoiceitem|Str :$invoice_item, |
1174
|
|
|
|
|
|
|
Int :$amount?, |
1175
|
|
|
|
|
|
|
Str :$description?, |
1176
|
2
|
0
|
0
|
2
|
|
18576
|
HashRef :$metadata?) { |
|
2
|
0
|
0
|
2
|
|
7
|
|
|
2
|
0
|
0
|
2
|
|
221
|
|
|
2
|
0
|
|
2
|
|
19
|
|
|
2
|
0
|
|
2
|
|
4
|
|
|
2
|
0
|
|
2
|
|
130
|
|
|
2
|
0
|
|
2
|
|
13
|
|
|
2
|
0
|
|
2
|
|
3
|
|
|
2
|
0
|
|
0
|
|
12
|
|
|
2
|
0
|
|
|
|
231
|
|
|
2
|
0
|
|
|
|
3
|
|
|
2
|
0
|
|
|
|
723
|
|
|
2
|
0
|
|
|
|
17
|
|
|
2
|
0
|
|
|
|
7
|
|
|
2
|
0
|
|
|
|
298
|
|
|
2
|
0
|
|
|
|
15
|
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
375
|
|
|
2
|
|
|
|
|
17
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
240
|
|
|
2
|
|
|
|
|
14
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
585
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1177
|
0
|
0
|
0
|
|
|
0
|
if (!defined($amount) && !defined($description) && !defined($metadata)) { |
|
|
|
0
|
|
|
|
|
1178
|
0
|
|
|
|
|
0
|
my $item = $invoice_item->clone; $item->clear_currency; |
|
0
|
|
|
|
|
0
|
|
1179
|
0
|
|
|
|
|
0
|
return $self->_post("invoiceitems/" . $item->id, $item); |
1180
|
|
|
|
|
|
|
} |
1181
|
|
|
|
|
|
|
|
1182
|
0
|
0
|
|
|
|
0
|
if (ref($invoice_item)) { |
1183
|
0
|
|
|
|
|
0
|
$invoice_item = $invoice_item->id; |
1184
|
|
|
|
|
|
|
} |
1185
|
|
|
|
|
|
|
|
1186
|
0
|
|
|
|
|
0
|
return $self->_post("invoiceitems/" . $invoice_item, |
1187
|
|
|
|
|
|
|
{ |
1188
|
|
|
|
|
|
|
amount => $amount, |
1189
|
|
|
|
|
|
|
description => $description, |
1190
|
|
|
|
|
|
|
metadata => $metadata |
1191
|
|
|
|
|
|
|
}); |
1192
|
|
|
|
|
|
|
} |
1193
|
|
|
|
|
|
|
|
1194
|
2
|
0
|
0
|
2
|
|
6066
|
method get_invoiceitem(Str :$invoice_item) { |
|
2
|
0
|
0
|
2
|
|
4
|
|
|
2
|
0
|
|
2
|
|
236
|
|
|
2
|
0
|
|
2
|
|
14
|
|
|
2
|
0
|
|
2
|
|
5
|
|
|
2
|
0
|
|
0
|
|
81
|
|
|
2
|
|
|
|
|
12
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
19
|
|
|
2
|
|
|
|
|
225
|
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
677
|
|
|
2
|
|
|
|
|
19
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
318
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1195
|
0
|
|
|
|
|
0
|
return $self->_get("invoiceitems/$invoice_item"); |
1196
|
|
|
|
|
|
|
} |
1197
|
|
|
|
|
|
|
|
1198
|
2
|
0
|
0
|
2
|
|
7709
|
method delete_invoiceitem(Net::Stripe::Invoiceitem|Str :$invoice_item) { |
|
2
|
0
|
0
|
2
|
|
7
|
|
|
2
|
0
|
|
2
|
|
227
|
|
|
2
|
0
|
|
2
|
|
16
|
|
|
2
|
0
|
|
2
|
|
4
|
|
|
2
|
0
|
|
0
|
|
108
|
|
|
2
|
|
|
|
|
15
|
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
19
|
|
|
2
|
|
|
|
|
247
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
754
|
|
|
2
|
|
|
|
|
15
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
374
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1199
|
0
|
0
|
|
|
|
0
|
if (ref($invoice_item)) { |
1200
|
0
|
|
|
|
|
0
|
$invoice_item = $invoice_item->id; |
1201
|
|
|
|
|
|
|
} |
1202
|
0
|
|
|
|
|
0
|
$self->_delete("invoiceitems/$invoice_item"); |
1203
|
|
|
|
|
|
|
} |
1204
|
|
|
|
|
|
|
|
1205
|
|
|
|
|
|
|
method get_invoiceitems(HashRef :$created?, |
1206
|
|
|
|
|
|
|
Net::Stripe::Customer|Str :$customer?, |
1207
|
|
|
|
|
|
|
Str :$ending_before?, |
1208
|
|
|
|
|
|
|
Int :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|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1210
|
0
|
0
|
|
|
|
0
|
if (ref($customer)) { |
1211
|
0
|
|
|
|
|
0
|
$customer = $customer->id; |
1212
|
|
|
|
|
|
|
} |
1213
|
0
|
|
|
|
|
0
|
my %args = ( |
1214
|
|
|
|
|
|
|
path => 'invoiceitems', |
1215
|
|
|
|
|
|
|
customer => $customer, |
1216
|
|
|
|
|
|
|
created => $created, |
1217
|
|
|
|
|
|
|
ending_before => $ending_before, |
1218
|
|
|
|
|
|
|
limit => $limit, |
1219
|
|
|
|
|
|
|
starting_after => $starting_after, |
1220
|
|
|
|
|
|
|
); |
1221
|
0
|
|
|
|
|
0
|
$self->_get_all(%args); |
1222
|
|
|
|
|
|
|
} |
1223
|
|
|
|
|
|
|
} |
1224
|
|
|
|
|
|
|
|
1225
|
|
|
|
|
|
|
# Helper methods |
1226
|
|
|
|
|
|
|
|
1227
|
2
|
0
|
|
2
|
|
10368
|
method _get(Str $path!, HashRef|StripeResourceObject $obj?) { |
|
2
|
0
|
|
2
|
|
4
|
|
|
2
|
0
|
|
0
|
|
353
|
|
|
2
|
0
|
|
|
|
16
|
|
|
2
|
0
|
|
|
|
5
|
|
|
2
|
0
|
|
|
|
550
|
|
|
0
|
0
|
|
|
|
0
|
|
|
0
|
0
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1228
|
0
|
|
|
|
|
0
|
my $uri_obj = URI->new( $self->api_base . '/' . $path ); |
1229
|
|
|
|
|
|
|
|
1230
|
0
|
0
|
|
|
|
0
|
if ( $obj ) { |
1231
|
0
|
|
|
|
|
0
|
my %form_fields = %{ convert_to_form_fields( $obj ) }; |
|
0
|
|
|
|
|
0
|
|
1232
|
0
|
0
|
|
|
|
0
|
$uri_obj->query_form( \%form_fields ) if %form_fields; |
1233
|
|
|
|
|
|
|
} |
1234
|
|
|
|
|
|
|
|
1235
|
0
|
|
|
|
|
0
|
my $req = GET $uri_obj->as_string; |
1236
|
0
|
|
|
|
|
0
|
return $self->_make_request($req); |
1237
|
|
|
|
|
|
|
} |
1238
|
|
|
|
|
|
|
|
1239
|
2
|
0
|
|
2
|
|
8387
|
method _delete(Str $path!, HashRef|StripeResourceObject $obj?) { |
|
2
|
0
|
|
2
|
|
17
|
|
|
2
|
0
|
|
0
|
|
320
|
|
|
2
|
0
|
|
|
|
17
|
|
|
2
|
0
|
|
|
|
4
|
|
|
2
|
0
|
|
|
|
1339
|
|
|
0
|
0
|
|
|
|
0
|
|
|
0
|
0
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1240
|
0
|
|
|
|
|
0
|
my $uri_obj = URI->new( $self->api_base . '/' . $path ); |
1241
|
|
|
|
|
|
|
|
1242
|
0
|
0
|
|
|
|
0
|
if ( $obj ) { |
1243
|
0
|
|
|
|
|
0
|
my %form_fields = %{ convert_to_form_fields( $obj ) }; |
|
0
|
|
|
|
|
0
|
|
1244
|
0
|
0
|
|
|
|
0
|
$uri_obj->query_form( \%form_fields ) if %form_fields; |
1245
|
|
|
|
|
|
|
} |
1246
|
|
|
|
|
|
|
|
1247
|
0
|
|
|
|
|
0
|
my $req = DELETE $uri_obj->as_string; |
1248
|
0
|
|
|
|
|
0
|
return $self->_make_request($req); |
1249
|
|
|
|
|
|
|
} |
1250
|
|
|
|
|
|
|
|
1251
|
|
|
|
|
|
|
sub convert_to_form_fields { |
1252
|
4
|
|
|
4
|
1
|
798
|
my $hash = shift; |
1253
|
4
|
|
|
|
|
12
|
my $stripe_resource_object_type = Moose::Util::TypeConstraints::find_type_constraint( 'StripeResourceObject' ); |
1254
|
4
|
100
|
|
|
|
391
|
if (ref($hash) eq 'HASH') { |
|
|
50
|
|
|
|
|
|
1255
|
2
|
|
|
|
|
7
|
my $r = {}; |
1256
|
2
|
|
|
|
|
8
|
foreach my $key (grep { defined($hash->{$_}) }keys %$hash) { |
|
4
|
|
|
|
|
12
|
|
1257
|
4
|
100
|
|
|
|
17
|
if ( $stripe_resource_object_type->check( $hash->{$key} ) ) { |
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
1258
|
2
|
|
|
|
|
14
|
%{$r} = ( %{$r}, %{ convert_to_form_fields($hash->{$key}) } ); |
|
2
|
|
|
|
|
12
|
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
8
|
|
1259
|
|
|
|
|
|
|
} elsif (ref($hash->{$key}) eq 'HASH') { |
1260
|
0
|
|
|
|
|
0
|
foreach my $fn (keys %{$hash->{$key}}) { |
|
0
|
|
|
|
|
0
|
|
1261
|
0
|
|
|
|
|
0
|
$r->{$key . '[' . $fn . ']'} = $hash->{$key}->{$fn}; |
1262
|
|
|
|
|
|
|
} |
1263
|
|
|
|
|
|
|
} elsif (ref($hash->{$key}) eq 'ARRAY') { |
1264
|
1
|
|
|
|
|
94
|
$r->{$key . '[]'} = $hash->{$key}; |
1265
|
|
|
|
|
|
|
} else { |
1266
|
1
|
|
|
|
|
68
|
$r->{$key} = $hash->{$key}; |
1267
|
|
|
|
|
|
|
} |
1268
|
|
|
|
|
|
|
} |
1269
|
2
|
|
|
|
|
10
|
return $r; |
1270
|
|
|
|
|
|
|
} elsif ($stripe_resource_object_type->check($hash)) { |
1271
|
2
|
|
|
|
|
16
|
return { $hash->form_fields }; |
1272
|
|
|
|
|
|
|
} |
1273
|
0
|
|
|
|
|
0
|
return $hash; |
1274
|
|
|
|
|
|
|
} |
1275
|
|
|
|
|
|
|
|
1276
|
2
|
0
|
|
2
|
|
8407
|
method _post(Str $path!, HashRef|StripeResourceObject $obj?) { |
|
2
|
0
|
|
2
|
|
8
|
|
|
2
|
0
|
|
0
|
|
354
|
|
|
2
|
0
|
|
|
|
18
|
|
|
2
|
0
|
|
|
|
9
|
|
|
2
|
0
|
|
|
|
563
|
|
|
0
|
0
|
|
|
|
0
|
|
|
0
|
0
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1277
|
0
|
|
|
|
|
0
|
my %headers; |
1278
|
0
|
0
|
|
|
|
0
|
if ( $obj ) { |
1279
|
0
|
|
|
|
|
0
|
my %form_fields = %{ convert_to_form_fields( $obj ) }; |
|
0
|
|
|
|
|
0
|
|
1280
|
0
|
0
|
|
|
|
0
|
$headers{Content} = [ %form_fields ] if %form_fields; |
1281
|
|
|
|
|
|
|
} |
1282
|
|
|
|
|
|
|
|
1283
|
0
|
|
|
|
|
0
|
my $req = POST $self->api_base . '/' . $path, %headers; |
1284
|
0
|
|
|
|
|
0
|
return $self->_make_request($req); |
1285
|
|
|
|
|
|
|
} |
1286
|
|
|
|
|
|
|
|
1287
|
|
|
|
|
|
|
method _get_response( |
1288
|
|
|
|
|
|
|
HTTP::Request :$req!, |
1289
|
|
|
|
|
|
|
Bool :$suppress_api_version? = 0, |
1290
|
2
|
0
|
0
|
2
|
|
9120
|
) { |
|
2
|
0
|
0
|
2
|
|
5
|
|
|
2
|
0
|
|
2
|
|
345
|
|
|
2
|
0
|
|
2
|
|
17
|
|
|
2
|
0
|
|
2
|
|
4
|
|
|
2
|
0
|
|
2
|
|
88
|
|
|
2
|
0
|
|
0
|
|
14
|
|
|
2
|
0
|
|
|
|
4
|
|
|
2
|
|
|
|
|
22
|
|
|
2
|
|
|
|
|
232
|
|
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
704
|
|
|
2
|
|
|
|
|
19
|
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
282
|
|
|
2
|
|
|
|
|
13
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1044
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1291
|
0
|
|
|
|
|
0
|
$req->header( Authorization => |
1292
|
|
|
|
|
|
|
"Basic " . encode_base64($self->api_key . ':')); |
1293
|
|
|
|
|
|
|
|
1294
|
0
|
0
|
0
|
|
|
0
|
if ($self->api_version && ! $suppress_api_version) { |
1295
|
0
|
|
|
|
|
0
|
$req->header( 'Stripe-Version' => $self->api_version ); |
1296
|
|
|
|
|
|
|
} |
1297
|
|
|
|
|
|
|
|
1298
|
0
|
0
|
|
|
|
0
|
if ($self->debug_network) { |
1299
|
0
|
|
|
|
|
0
|
print STDERR "Sending to Stripe:\n------\n" . $req->as_string() . "------\n"; |
1300
|
|
|
|
|
|
|
|
1301
|
|
|
|
|
|
|
} |
1302
|
0
|
|
|
|
|
0
|
my $resp = $self->ua->request($req); |
1303
|
|
|
|
|
|
|
|
1304
|
0
|
0
|
|
|
|
0
|
if ($self->debug_network) { |
1305
|
0
|
|
|
|
|
0
|
print STDERR "Received from Stripe:\n------\n" . $resp->as_string() . "------\n"; |
1306
|
|
|
|
|
|
|
} |
1307
|
|
|
|
|
|
|
|
1308
|
0
|
0
|
|
|
|
0
|
if ($resp->code == 200) { |
|
|
0
|
|
|
|
|
|
1309
|
0
|
|
|
|
|
0
|
return $resp; |
1310
|
|
|
|
|
|
|
} elsif ($resp->code == 500) { |
1311
|
0
|
|
|
|
|
0
|
die Net::Stripe::Error->new( |
1312
|
|
|
|
|
|
|
type => "HTTP request error", |
1313
|
|
|
|
|
|
|
code => $resp->code, |
1314
|
|
|
|
|
|
|
message => $resp->status_line . " - " . $resp->content, |
1315
|
|
|
|
|
|
|
); |
1316
|
|
|
|
|
|
|
} |
1317
|
|
|
|
|
|
|
|
1318
|
0
|
|
|
|
|
0
|
my $e = eval { |
1319
|
0
|
|
|
|
|
0
|
my $hash = decode_json($resp->content); |
1320
|
|
|
|
|
|
|
Net::Stripe::Error->new($hash->{error}) |
1321
|
0
|
|
|
|
|
0
|
}; |
1322
|
0
|
0
|
|
|
|
0
|
if ($@) { |
1323
|
0
|
|
|
|
|
0
|
Net::Stripe::Error->new( |
1324
|
|
|
|
|
|
|
type => "Could not decode HTTP response: $@", |
1325
|
|
|
|
|
|
|
message => $resp->status_line . " - " . $resp->content, |
1326
|
|
|
|
|
|
|
); |
1327
|
|
|
|
|
|
|
}; |
1328
|
|
|
|
|
|
|
|
1329
|
0
|
0
|
|
|
|
0
|
warn "$e\n" if $self->debug; |
1330
|
0
|
|
|
|
|
0
|
die $e; |
1331
|
|
|
|
|
|
|
} |
1332
|
|
|
|
|
|
|
|
1333
|
2
|
0
|
|
2
|
|
5302
|
method _make_request(HTTP::Request $req!) { |
|
2
|
0
|
|
2
|
|
5
|
|
|
2
|
0
|
|
0
|
|
411
|
|
|
2
|
0
|
|
|
|
15
|
|
|
2
|
0
|
|
|
|
4
|
|
|
2
|
|
|
|
|
5269
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1334
|
0
|
|
|
|
|
0
|
my $resp = $self->_get_response( |
1335
|
|
|
|
|
|
|
req => $req, |
1336
|
|
|
|
|
|
|
); |
1337
|
0
|
|
|
|
|
0
|
my $ref = decode_json( $resp->content ); |
1338
|
0
|
0
|
|
|
|
0
|
if ( ref( $ref ) eq 'ARRAY' ) { |
|
|
0
|
|
|
|
|
|
1339
|
|
|
|
|
|
|
# some list-type data structures are arrayrefs in API versions 2012-09-24 and earlier. |
1340
|
|
|
|
|
|
|
# if those data structures are at the top level, such as when |
1341
|
|
|
|
|
|
|
# we request 'GET /charges/cus_.../', we need to coerce that |
1342
|
|
|
|
|
|
|
# arrayref into the form that Net::Stripe::List expects. |
1343
|
0
|
|
|
|
|
0
|
return _array_to_object( $ref, $req->uri ); |
1344
|
|
|
|
|
|
|
} elsif ( ref( $ref ) eq 'HASH' ) { |
1345
|
|
|
|
|
|
|
# all top-level data structures are hashes in API versions 2012-10-26 and later |
1346
|
0
|
|
|
|
|
0
|
return _hash_to_object( $ref ); |
1347
|
|
|
|
|
|
|
} else { |
1348
|
0
|
|
0
|
|
|
0
|
die Net::Stripe::Error->new( |
1349
|
|
|
|
|
|
|
type => "HTTP request error", |
1350
|
|
|
|
|
|
|
message => sprintf( |
1351
|
|
|
|
|
|
|
"Invalid object type returned: '%s'", |
1352
|
|
|
|
|
|
|
ref( $ref ) || 'NONREF', |
1353
|
|
|
|
|
|
|
), |
1354
|
|
|
|
|
|
|
); |
1355
|
|
|
|
|
|
|
} |
1356
|
|
|
|
|
|
|
} |
1357
|
|
|
|
|
|
|
|
1358
|
|
|
|
|
|
|
sub _hash_to_object { |
1359
|
3
|
|
|
3
|
|
703
|
my $hash = shift; |
1360
|
|
|
|
|
|
|
|
1361
|
3
|
0
|
33
|
|
|
10
|
if ( exists( $hash->{deleted} ) && exists( $hash->{object} ) && $hash->{object} ne 'customer' ) { |
|
|
|
0
|
|
|
|
|
1362
|
0
|
|
|
|
|
0
|
delete( $hash->{object} ); |
1363
|
|
|
|
|
|
|
} |
1364
|
|
|
|
|
|
|
|
1365
|
|
|
|
|
|
|
# coerce pre-2011-08-01 API arrayref list format into a hashref |
1366
|
|
|
|
|
|
|
# compatible with Net::Stripe::List |
1367
|
3
|
|
|
|
|
9
|
$hash = _pre_2011_08_01_processing( $hash ); |
1368
|
|
|
|
|
|
|
|
1369
|
|
|
|
|
|
|
# coerce pre-2012-10-26 API invoice lines format into a hashref |
1370
|
|
|
|
|
|
|
# compatible with Net::Stripe::List |
1371
|
3
|
|
|
|
|
10
|
$hash = _pre_2012_10_26_processing( $hash ); |
1372
|
|
|
|
|
|
|
|
1373
|
|
|
|
|
|
|
# coerce post-2015-02-18 source-type args to to card-type args |
1374
|
3
|
|
|
|
|
6
|
$hash = _post_2015_02_18_processing( $hash ); |
1375
|
|
|
|
|
|
|
|
1376
|
|
|
|
|
|
|
# coerce post-2019-10-17 balance to account_balance |
1377
|
3
|
|
|
|
|
6
|
$hash = _post_2019_10_17_processing( $hash ); |
1378
|
|
|
|
|
|
|
|
1379
|
3
|
|
|
|
|
16
|
foreach my $k (grep { ref($hash->{$_}) } keys %$hash) { |
|
36
|
|
|
|
|
58
|
|
1380
|
5
|
|
|
|
|
30
|
my $v = $hash->{$k}; |
1381
|
5
|
100
|
100
|
|
|
34
|
if (ref($v) eq 'HASH' && defined($v->{object})) { |
|
|
100
|
|
|
|
|
|
1382
|
2
|
|
|
|
|
10
|
$hash->{$k} = _hash_to_object($v); |
1383
|
|
|
|
|
|
|
} elsif (ref($v) =~ /^(JSON::XS::Boolean|JSON::PP::Boolean)$/) { |
1384
|
2
|
50
|
|
|
|
51
|
$hash->{$k} = $v ? 1 : 0; |
1385
|
|
|
|
|
|
|
} |
1386
|
|
|
|
|
|
|
} |
1387
|
|
|
|
|
|
|
|
1388
|
3
|
50
|
|
|
|
13
|
if (defined($hash->{object})) { |
1389
|
3
|
50
|
|
|
|
8
|
if ($hash->{object} eq 'list') { |
1390
|
0
|
|
|
|
|
0
|
$hash->{data} = [map { _hash_to_object($_) } @{$hash->{data}}]; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1391
|
0
|
|
|
|
|
0
|
return Net::Stripe::List->new($hash); |
1392
|
|
|
|
|
|
|
} |
1393
|
3
|
|
|
|
|
10
|
my @words = map { ucfirst($_) } split('_', $hash->{object}); |
|
4
|
|
|
|
|
15
|
|
1394
|
3
|
|
|
|
|
9
|
my $object = join('', @words); |
1395
|
3
|
|
|
|
|
9
|
my $class = 'Net::Stripe::' . $object; |
1396
|
3
|
100
|
|
|
|
25
|
if (Class::Load::is_class_loaded($class)) { |
1397
|
2
|
|
|
|
|
76
|
return $class->new($hash); |
1398
|
|
|
|
|
|
|
} |
1399
|
|
|
|
|
|
|
} |
1400
|
1
|
|
|
|
|
5
|
return $hash; |
1401
|
|
|
|
|
|
|
} |
1402
|
|
|
|
|
|
|
|
1403
|
|
|
|
|
|
|
sub _array_to_object { |
1404
|
0
|
|
|
0
|
|
0
|
my ( $array, $uri ) = @_; |
1405
|
0
|
|
|
|
|
0
|
my $list = _array_to_list( $array ); |
1406
|
|
|
|
|
|
|
# strip the protocol, domain and query args in order to mimic the |
1407
|
|
|
|
|
|
|
# url returned with Stripe lists in API versions 2012-10-26 and later |
1408
|
0
|
|
|
|
|
0
|
$uri =~ s#\?.*$##; |
1409
|
0
|
|
|
|
|
0
|
$uri =~ s#^https://[^/]+##; |
1410
|
0
|
|
|
|
|
0
|
$list->{url} = $uri; |
1411
|
0
|
|
|
|
|
0
|
return _hash_to_object( $list ); |
1412
|
|
|
|
|
|
|
} |
1413
|
|
|
|
|
|
|
|
1414
|
|
|
|
|
|
|
sub _array_to_list { |
1415
|
0
|
|
|
0
|
|
0
|
my $array = shift; |
1416
|
0
|
|
|
|
|
0
|
my $count = scalar( @$array ); |
1417
|
0
|
|
|
|
|
0
|
my $list = { |
1418
|
|
|
|
|
|
|
object => 'list', |
1419
|
|
|
|
|
|
|
count => $count, |
1420
|
|
|
|
|
|
|
has_more => 0, |
1421
|
|
|
|
|
|
|
data => $array, |
1422
|
|
|
|
|
|
|
total_count => $count, |
1423
|
|
|
|
|
|
|
}; |
1424
|
0
|
|
|
|
|
0
|
return $list; |
1425
|
|
|
|
|
|
|
} |
1426
|
|
|
|
|
|
|
|
1427
|
|
|
|
|
|
|
# coerce pre-2011-08-01 API arrayref list format into a hashref |
1428
|
|
|
|
|
|
|
# compatible with Net::Stripe::List |
1429
|
|
|
|
|
|
|
sub _pre_2011_08_01_processing { |
1430
|
3
|
|
|
3
|
|
29
|
my $hash = shift; |
1431
|
3
|
|
|
|
|
7
|
foreach my $type ( qw/ cards sources subscriptions / ) { |
1432
|
9
|
50
|
33
|
|
|
23
|
if ( exists( $hash->{$type} ) && ref( $hash->{$type} ) eq 'ARRAY' ) { |
1433
|
0
|
|
|
|
|
0
|
$hash->{$type} = _array_to_list( delete( $hash->{$type} ) ); |
1434
|
0
|
|
|
|
|
0
|
my $customer_id; |
1435
|
0
|
0
|
0
|
|
|
0
|
if ( exists( $hash->{object} ) && $hash->{object} eq 'customer' && exists( $hash->{id} ) ) { |
|
|
0
|
0
|
|
|
|
|
1436
|
0
|
|
|
|
|
0
|
$customer_id = $hash->{id}; |
1437
|
|
|
|
|
|
|
} elsif ( exists( $hash->{customer} ) ) { |
1438
|
0
|
|
|
|
|
0
|
$customer_id = $hash->{customer}; |
1439
|
|
|
|
|
|
|
} |
1440
|
|
|
|
|
|
|
# Net::Stripe::List->new() will fail without url, but we |
1441
|
|
|
|
|
|
|
# can make debugging easier by providing a message here |
1442
|
0
|
0
|
|
|
|
0
|
die Net::Stripe::Error->new( |
1443
|
|
|
|
|
|
|
type => "object coercion error", |
1444
|
|
|
|
|
|
|
message => sprintf( |
1445
|
|
|
|
|
|
|
"Could not determine customer id while coercing %s list into Net::Stripe::List.", |
1446
|
|
|
|
|
|
|
$type, |
1447
|
|
|
|
|
|
|
), |
1448
|
|
|
|
|
|
|
) unless $customer_id; |
1449
|
|
|
|
|
|
|
|
1450
|
|
|
|
|
|
|
# mimic the url sent with standard Stripe lists |
1451
|
0
|
|
|
|
|
0
|
$hash->{$type}->{url} = "/v1/customers/$customer_id/$type"; |
1452
|
|
|
|
|
|
|
} |
1453
|
|
|
|
|
|
|
} |
1454
|
|
|
|
|
|
|
|
1455
|
3
|
|
|
|
|
7
|
foreach my $type ( qw/ refunds / ) { |
1456
|
3
|
50
|
33
|
|
|
9
|
if ( exists( $hash->{$type} ) && ref( $hash->{$type} ) eq 'ARRAY' ) { |
1457
|
0
|
|
|
|
|
0
|
$hash->{$type} = _array_to_list( delete( $hash->{$type} ) ); |
1458
|
0
|
|
|
|
|
0
|
my $charge_id; |
1459
|
0
|
0
|
0
|
|
|
0
|
if ( exists( $hash->{object} ) && $hash->{object} eq 'charge' && exists( $hash->{id} ) ) { |
|
|
|
0
|
|
|
|
|
1460
|
0
|
|
|
|
|
0
|
$charge_id = $hash->{id}; |
1461
|
|
|
|
|
|
|
} |
1462
|
|
|
|
|
|
|
# Net::Stripe::List->new() will fail without url, but we |
1463
|
|
|
|
|
|
|
# can make debugging easier by providing a message here |
1464
|
0
|
0
|
|
|
|
0
|
die Net::Stripe::Error->new( |
1465
|
|
|
|
|
|
|
type => "object coercion error", |
1466
|
|
|
|
|
|
|
message => sprintf( |
1467
|
|
|
|
|
|
|
"Could not determine charge id while coercing %s list into Net::Stripe::List.", |
1468
|
|
|
|
|
|
|
$type, |
1469
|
|
|
|
|
|
|
), |
1470
|
|
|
|
|
|
|
) unless $charge_id; |
1471
|
|
|
|
|
|
|
# mimic the url sent with standard Stripe lists |
1472
|
0
|
|
|
|
|
0
|
$hash->{$type}->{url} = "/v1/charges/$charge_id/$type"; |
1473
|
|
|
|
|
|
|
} |
1474
|
|
|
|
|
|
|
} |
1475
|
|
|
|
|
|
|
|
1476
|
3
|
|
|
|
|
7
|
foreach my $type ( qw/ charges / ) { |
1477
|
3
|
50
|
33
|
|
|
9
|
if ( exists( $hash->{$type} ) && ref( $hash->{$type} ) eq 'ARRAY' ) { |
1478
|
0
|
|
|
|
|
0
|
$hash->{$type} = _array_to_list( delete( $hash->{$type} ) ); |
1479
|
0
|
|
|
|
|
0
|
my $payment_intent_id; |
1480
|
0
|
0
|
0
|
|
|
0
|
if ( exists( $hash->{object} ) && $hash->{object} eq 'payment_intent' && exists( $hash->{id} ) ) { |
|
|
0
|
0
|
|
|
|
|
1481
|
0
|
|
|
|
|
0
|
$payment_intent_id = $hash->{id}; |
1482
|
|
|
|
|
|
|
} elsif ( exists( $hash->{payment_intent} ) ) { |
1483
|
0
|
|
|
|
|
0
|
$payment_intent_id = $hash->{payment_intent}; |
1484
|
|
|
|
|
|
|
} |
1485
|
|
|
|
|
|
|
# Net::Stripe::List->new() will fail without url, but we |
1486
|
|
|
|
|
|
|
# can make debugging easier by providing a message here |
1487
|
0
|
0
|
|
|
|
0
|
die Net::Stripe::Error->new( |
1488
|
|
|
|
|
|
|
type => "object coercion error", |
1489
|
|
|
|
|
|
|
message => sprintf( |
1490
|
|
|
|
|
|
|
"Could not determine payment_intent id while coercing %s list into Net::Stripe::List.", |
1491
|
|
|
|
|
|
|
$type, |
1492
|
|
|
|
|
|
|
), |
1493
|
|
|
|
|
|
|
) unless $payment_intent_id; |
1494
|
|
|
|
|
|
|
|
1495
|
|
|
|
|
|
|
# mimic the url sent with standard Stripe lists |
1496
|
0
|
|
|
|
|
0
|
$hash->{$type}->{url} = "/v1/charges?payment_intent=$payment_intent_id"; |
1497
|
|
|
|
|
|
|
} |
1498
|
|
|
|
|
|
|
} |
1499
|
|
|
|
|
|
|
|
1500
|
3
|
|
|
|
|
7
|
return $hash; |
1501
|
|
|
|
|
|
|
} |
1502
|
|
|
|
|
|
|
|
1503
|
|
|
|
|
|
|
# coerce pre-2012-10-26 API invoice lines format into a hashref |
1504
|
|
|
|
|
|
|
# compatible with Net::Stripe::List |
1505
|
|
|
|
|
|
|
sub _pre_2012_10_26_processing { |
1506
|
3
|
|
|
3
|
|
5
|
my $hash = shift; |
1507
|
3
|
0
|
33
|
|
|
15
|
if ( |
|
|
|
33
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
1508
|
|
|
|
|
|
|
exists( $hash->{object} ) && $hash->{object} eq 'invoice' && |
1509
|
|
|
|
|
|
|
exists( $hash->{lines} ) && ref( $hash->{lines} ) eq 'HASH' && |
1510
|
|
|
|
|
|
|
! exists( $hash->{lines}->{object} ) |
1511
|
|
|
|
|
|
|
) { |
1512
|
0
|
|
|
|
|
0
|
my $data = []; |
1513
|
0
|
|
|
|
|
0
|
my $lines = delete( $hash->{lines} ); |
1514
|
0
|
|
|
|
|
0
|
foreach my $key ( sort( keys( %$lines ) ) ) { |
1515
|
0
|
|
|
|
|
0
|
my $ref = $lines->{$key}; |
1516
|
0
|
0
|
|
|
|
0
|
unless ( ref( $ref ) eq 'ARRAY' ) { |
1517
|
0
|
|
|
|
|
0
|
die Net::Stripe::Error->new( |
1518
|
|
|
|
|
|
|
type => "object coercion error", |
1519
|
|
|
|
|
|
|
message => sprintf( |
1520
|
|
|
|
|
|
|
"Found invalid subkey type '%s' while coercing invoice lines into a Net::Stripe::List.", |
1521
|
|
|
|
|
|
|
ref( $ref ), |
1522
|
|
|
|
|
|
|
), |
1523
|
|
|
|
|
|
|
); |
1524
|
|
|
|
|
|
|
} |
1525
|
0
|
|
|
|
|
0
|
foreach my $item ( @$ref ) { |
1526
|
0
|
|
|
|
|
0
|
push @$data, $item; |
1527
|
|
|
|
|
|
|
} |
1528
|
|
|
|
|
|
|
} |
1529
|
0
|
|
|
|
|
0
|
$hash->{lines} = _array_to_list( $data ); |
1530
|
|
|
|
|
|
|
|
1531
|
0
|
|
|
|
|
0
|
my $customer_id; |
1532
|
0
|
0
|
|
|
|
0
|
if ( exists( $hash->{customer} ) ) { |
1533
|
0
|
|
|
|
|
0
|
$customer_id = $hash->{customer}; |
1534
|
|
|
|
|
|
|
} |
1535
|
|
|
|
|
|
|
# Net::Stripe::List->new() will fail without url, but we |
1536
|
|
|
|
|
|
|
# can make debugging easier by providing a message here |
1537
|
0
|
0
|
|
|
|
0
|
die Net::Stripe::Error->new( |
1538
|
|
|
|
|
|
|
type => "object coercion error", |
1539
|
|
|
|
|
|
|
message => "Could not determine customer id while coercing invoice lines into Net::Stripe::List.", |
1540
|
|
|
|
|
|
|
) unless $customer_id; |
1541
|
|
|
|
|
|
|
|
1542
|
|
|
|
|
|
|
# mimic the url sent with standard Stripe lists |
1543
|
0
|
|
|
|
|
0
|
$hash->{lines}->{url} = "/v1/invoices/upcoming/lines?customer=$customer_id"; |
1544
|
|
|
|
|
|
|
} |
1545
|
3
|
|
|
|
|
7
|
return $hash; |
1546
|
|
|
|
|
|
|
} |
1547
|
|
|
|
|
|
|
|
1548
|
|
|
|
|
|
|
# coerce post-2015-02-18 source-type args to to card-type args |
1549
|
|
|
|
|
|
|
sub _post_2015_02_18_processing { |
1550
|
3
|
|
|
3
|
|
8
|
my $hash = shift; |
1551
|
|
|
|
|
|
|
|
1552
|
3
|
50
|
33
|
|
|
18
|
if ( |
|
|
|
33
|
|
|
|
|
1553
|
|
|
|
|
|
|
exists( $hash->{object} ) && |
1554
|
|
|
|
|
|
|
( $hash->{object} eq 'charge' || $hash->{object} eq 'customer' ) |
1555
|
|
|
|
|
|
|
) { |
1556
|
0
|
0
|
0
|
|
|
0
|
if ( |
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
1557
|
|
|
|
|
|
|
! exists( $hash->{card} ) && |
1558
|
|
|
|
|
|
|
exists( $hash->{source} ) && ref( $hash->{source} ) eq 'HASH' && |
1559
|
|
|
|
|
|
|
exists( $hash->{source}->{object} ) && $hash->{source}->{object} eq 'card' |
1560
|
|
|
|
|
|
|
) { |
1561
|
0
|
|
|
|
|
0
|
$hash->{card} = Storable::dclone( $hash->{source} ); |
1562
|
|
|
|
|
|
|
} |
1563
|
|
|
|
|
|
|
|
1564
|
0
|
0
|
0
|
|
|
0
|
if ( |
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
1565
|
|
|
|
|
|
|
! exists( $hash->{cards} ) && |
1566
|
|
|
|
|
|
|
exists( $hash->{sources} ) && ref( $hash->{sources} ) eq 'HASH' && |
1567
|
|
|
|
|
|
|
exists( $hash->{sources}->{object} ) && $hash->{sources}->{object} eq 'list' |
1568
|
|
|
|
|
|
|
) { |
1569
|
0
|
|
|
|
|
0
|
$hash->{cards} = Storable::dclone( $hash->{sources} ); |
1570
|
|
|
|
|
|
|
} |
1571
|
|
|
|
|
|
|
|
1572
|
0
|
|
|
|
|
0
|
my $card_id_type = Moose::Util::TypeConstraints::find_type_constraint( 'StripeCardId' ); |
1573
|
0
|
0
|
0
|
|
|
0
|
if ( |
|
|
|
0
|
|
|
|
|
1574
|
|
|
|
|
|
|
! exists( $hash->{default_card} ) && |
1575
|
|
|
|
|
|
|
exists( $hash->{default_source} ) && |
1576
|
|
|
|
|
|
|
$card_id_type->check( $hash->{default_source} ) |
1577
|
|
|
|
|
|
|
) { |
1578
|
0
|
|
|
|
|
0
|
$hash->{default_card} = $hash->{default_source}; |
1579
|
|
|
|
|
|
|
} |
1580
|
|
|
|
|
|
|
} |
1581
|
3
|
|
|
|
|
6
|
return $hash; |
1582
|
|
|
|
|
|
|
} |
1583
|
|
|
|
|
|
|
|
1584
|
|
|
|
|
|
|
# coerce post-2019-10-17 balance to account_balance |
1585
|
|
|
|
|
|
|
fun _post_2019_10_17_processing( |
1586
|
|
|
|
|
|
|
HashRef $hash, |
1587
|
2
|
50
|
|
2
|
|
4653
|
) { |
|
2
|
50
|
|
2
|
|
5
|
|
|
2
|
50
|
|
3
|
|
257
|
|
|
2
|
50
|
|
|
|
16
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
395
|
|
|
3
|
|
|
|
|
10
|
|
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
4
|
|
1588
|
3
|
50
|
33
|
|
|
13
|
if ( exists( $hash->{object} ) && $hash->{object} eq 'customer' ) { |
1589
|
0
|
0
|
0
|
|
|
0
|
if ( ! exists( $hash->{account_balance} ) && exists( $hash->{balance} ) ) { |
1590
|
0
|
|
|
|
|
0
|
$hash->{account_balance} = $hash->{balance}; |
1591
|
|
|
|
|
|
|
} |
1592
|
|
|
|
|
|
|
} |
1593
|
3
|
|
|
|
|
5
|
return $hash; |
1594
|
|
|
|
|
|
|
} |
1595
|
|
|
|
|
|
|
|
1596
|
|
|
|
|
|
|
method _get_all( |
1597
|
|
|
|
|
|
|
Str :$path!, |
1598
|
|
|
|
|
|
|
Maybe[Str] :$ending_before?, |
1599
|
|
|
|
|
|
|
Maybe[Int] :$limit?, |
1600
|
|
|
|
|
|
|
Maybe[Str] :$starting_after?, |
1601
|
|
|
|
|
|
|
%object_filters, |
1602
|
2
|
0
|
0
|
2
|
|
18427
|
) { |
|
2
|
0
|
0
|
2
|
|
6
|
|
|
2
|
0
|
|
2
|
|
256
|
|
|
2
|
0
|
|
2
|
|
17
|
|
|
2
|
0
|
|
2
|
|
4
|
|
|
2
|
0
|
|
2
|
|
100
|
|
|
2
|
0
|
|
2
|
|
24
|
|
|
2
|
0
|
|
2
|
|
5
|
|
|
2
|
0
|
|
2
|
|
11
|
|
|
2
|
0
|
|
0
|
|
226
|
|
|
2
|
0
|
|
|
|
6
|
|
|
2
|
0
|
|
|
|
603
|
|
|
2
|
0
|
|
|
|
15
|
|
|
2
|
0
|
|
|
|
6
|
|
|
2
|
0
|
|
|
|
318
|
|
|
2
|
0
|
|
|
|
15
|
|
|
2
|
0
|
|
|
|
5
|
|
|
2
|
|
|
|
|
318
|
|
|
2
|
|
|
|
|
15
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
249
|
|
|
2
|
|
|
|
|
25
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
191
|
|
|
2
|
|
|
|
|
14
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
1010
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1603
|
|
|
|
|
|
|
|
1604
|
|
|
|
|
|
|
# minimize the number of API calls by retrieving as many results as |
1605
|
|
|
|
|
|
|
# possible per call. the API currently returns a maximum of 100 results. |
1606
|
0
|
|
|
|
|
0
|
my $API_PAGE_SIZE = 100; |
1607
|
0
|
|
|
|
|
0
|
my $PAGE_SIZE = $limit; |
1608
|
0
|
|
|
|
|
0
|
my $GET_MORE; |
1609
|
0
|
0
|
0
|
|
|
0
|
if ( defined( $limit ) && ( $limit eq '0' || $limit > $API_PAGE_SIZE ) ) { |
|
|
|
0
|
|
|
|
|
1610
|
0
|
|
|
|
|
0
|
$PAGE_SIZE = $API_PAGE_SIZE; |
1611
|
0
|
|
|
|
|
0
|
$GET_MORE = 1; |
1612
|
|
|
|
|
|
|
} |
1613
|
|
|
|
|
|
|
|
1614
|
0
|
|
|
|
|
0
|
my %args = ( |
1615
|
|
|
|
|
|
|
%object_filters, |
1616
|
|
|
|
|
|
|
ending_before => $ending_before, |
1617
|
|
|
|
|
|
|
limit => $PAGE_SIZE, |
1618
|
|
|
|
|
|
|
starting_after => $starting_after, |
1619
|
|
|
|
|
|
|
); |
1620
|
0
|
|
|
|
|
0
|
my $list = $self->_get($path, \%args); |
1621
|
|
|
|
|
|
|
|
1622
|
0
|
0
|
0
|
|
|
0
|
if ( $GET_MORE && $list->elements() > 0 ) { |
1623
|
|
|
|
|
|
|
# passing 'ending_before' causes the API to start with the oldest |
1624
|
|
|
|
|
|
|
# records. so in order to always provide records in reverse-chronological |
1625
|
|
|
|
|
|
|
# order, we must prepend these to the existing records. |
1626
|
0
|
|
0
|
|
|
0
|
my $REVERSE = defined( $ending_before ) && ! defined( $starting_after ); |
1627
|
0
|
0
|
|
|
|
0
|
my $MAX_COUNT = $limit eq '0' ? undef : $limit; |
1628
|
0
|
|
|
|
|
0
|
while ( 1 ) { |
1629
|
0
|
|
|
|
|
0
|
my $PAGE_SIZE = $API_PAGE_SIZE; |
1630
|
0
|
0
|
|
|
|
0
|
if ( defined( $MAX_COUNT ) ) { |
1631
|
0
|
|
|
|
|
0
|
my $TO_FETCH = $MAX_COUNT - scalar( $list->elements ); |
1632
|
0
|
0
|
|
|
|
0
|
last if $TO_FETCH <= 0; |
1633
|
0
|
0
|
|
|
|
0
|
$PAGE_SIZE = $TO_FETCH if $TO_FETCH < $PAGE_SIZE; |
1634
|
|
|
|
|
|
|
} |
1635
|
|
|
|
|
|
|
|
1636
|
0
|
0
|
|
|
|
0
|
my %args = ( |
1637
|
|
|
|
|
|
|
%object_filters, |
1638
|
|
|
|
|
|
|
limit => $PAGE_SIZE, |
1639
|
|
|
|
|
|
|
( $REVERSE ? $list->_previous_page_args() : $list->_next_page_args() ), |
1640
|
|
|
|
|
|
|
); |
1641
|
0
|
|
|
|
|
0
|
my $page = $self->_get($path, \%args); |
1642
|
|
|
|
|
|
|
|
1643
|
0
|
0
|
|
|
|
0
|
last if $page->is_empty; |
1644
|
|
|
|
|
|
|
|
1645
|
0
|
0
|
|
|
|
0
|
$list = Net::Stripe::List::_merge_lists( |
1646
|
|
|
|
|
|
|
lists => [ $REVERSE ? |
1647
|
|
|
|
|
|
|
( $page, $list ) : |
1648
|
|
|
|
|
|
|
( $list, $page ) |
1649
|
|
|
|
|
|
|
], |
1650
|
|
|
|
|
|
|
); |
1651
|
|
|
|
|
|
|
} |
1652
|
|
|
|
|
|
|
} |
1653
|
0
|
|
|
|
|
0
|
return $list; |
1654
|
|
|
|
|
|
|
} |
1655
|
|
|
|
|
|
|
|
1656
|
|
|
|
|
|
|
fun _encode_boolean( |
1657
|
|
|
|
|
|
|
Bool $value!, |
1658
|
2
|
50
|
|
2
|
|
3985
|
) { |
|
2
|
50
|
|
2
|
|
4
|
|
|
2
|
50
|
|
3
|
|
265
|
|
|
2
|
50
|
|
|
|
15
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
281
|
|
|
3
|
|
|
|
|
798
|
|
|
3
|
|
|
|
|
14
|
|
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
14
|
|
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
4
|
|
1659
|
|
|
|
|
|
|
# a bare `return` with no arguemnts evaluates to an empty list, resulting |
1660
|
|
|
|
|
|
|
# in 'odd number of elements in hash assignment, so we must return undef |
1661
|
3
|
100
|
|
|
|
13
|
return undef unless defined( $value ); |
1662
|
2
|
100
|
|
|
|
25
|
return $value ? 'true' : 'false'; |
1663
|
|
|
|
|
|
|
} |
1664
|
|
|
|
|
|
|
|
1665
|
2
|
0
|
|
2
|
|
2465
|
method _build_api_base { 'https://api.stripe.com/v1' } |
|
2
|
|
|
0
|
|
5
|
|
|
2
|
|
|
|
|
171
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1666
|
|
|
|
|
|
|
|
1667
|
2
|
0
|
|
2
|
|
2295
|
method _build_ua { |
|
2
|
|
|
0
|
|
5
|
|
|
2
|
|
|
|
|
263
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1668
|
0
|
|
|
|
|
0
|
my $ua = LWP::UserAgent->new(keep_alive => 4); |
1669
|
0
|
|
0
|
|
|
0
|
$ua->agent("Net::Stripe/" . ($Net::Stripe::VERSION || 'dev')); |
1670
|
0
|
|
|
|
|
0
|
return $ua; |
1671
|
|
|
|
|
|
|
} |
1672
|
|
|
|
|
|
|
|
1673
|
|
|
|
|
|
|
# since the Stripe API does not have a ping-like method, we have to perform |
1674
|
|
|
|
|
|
|
# an extraneous request in order to retrieve the Stripe-Version header with |
1675
|
|
|
|
|
|
|
# the response. for now, we will use the 'balance' endpoint because it one of |
1676
|
|
|
|
|
|
|
# the simplest and least-privileged. |
1677
|
|
|
|
|
|
|
method _get_stripe_verison_header( |
1678
|
|
|
|
|
|
|
Bool :$suppress_api_version? = 0, |
1679
|
2
|
0
|
0
|
2
|
|
5863
|
) { |
|
2
|
0
|
0
|
2
|
|
4
|
|
|
2
|
0
|
|
2
|
|
219
|
|
|
2
|
0
|
|
2
|
|
14
|
|
|
2
|
0
|
|
2
|
|
5
|
|
|
2
|
|
|
0
|
|
89
|
|
|
2
|
|
|
|
|
23
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
11
|
|
|
2
|
|
|
|
|
228
|
|
|
2
|
|
|
|
|
20
|
|
|
2
|
|
|
|
|
662
|
|
|
2
|
|
|
|
|
15
|
|
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
583
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1680
|
0
|
|
|
|
|
0
|
my $path = 'balance'; |
1681
|
0
|
|
|
|
|
0
|
my $req = GET $self->api_base . '/' . $path; |
1682
|
|
|
|
|
|
|
|
1683
|
|
|
|
|
|
|
# swallow the possible invalid API version warning |
1684
|
0
|
|
|
0
|
|
0
|
local $SIG{__WARN__} = sub {}; |
1685
|
0
|
|
|
|
|
0
|
my $resp = $self->_get_response( |
1686
|
|
|
|
|
|
|
req => $req, |
1687
|
|
|
|
|
|
|
suppress_api_version => $suppress_api_version, |
1688
|
|
|
|
|
|
|
); |
1689
|
|
|
|
|
|
|
|
1690
|
0
|
|
|
|
|
0
|
my $stripe_version = $resp->header( 'Stripe-Version' ); |
1691
|
0
|
|
|
|
|
0
|
my $stripe_api_version_type = Moose::Util::TypeConstraints::find_type_constraint( 'StripeAPIVersion' ); |
1692
|
0
|
0
|
0
|
|
|
0
|
die Net::Stripe::Error->new( |
|
|
0
|
|
|
|
|
|
1693
|
|
|
|
|
|
|
type => "API version validation error", |
1694
|
|
|
|
|
|
|
message => sprintf( "Failed to retrieve the Stripe-Version header: '%s'", |
1695
|
|
|
|
|
|
|
defined( $stripe_version ) ? $stripe_version : 'undefined', |
1696
|
|
|
|
|
|
|
), |
1697
|
|
|
|
|
|
|
) unless defined( $stripe_version ) && $stripe_api_version_type->check( $stripe_version ); |
1698
|
|
|
|
|
|
|
|
1699
|
0
|
|
|
|
|
0
|
return $stripe_version; |
1700
|
|
|
|
|
|
|
} |
1701
|
|
|
|
|
|
|
|
1702
|
2
|
0
|
|
2
|
|
2534
|
method _get_account_api_version { |
|
2
|
|
|
0
|
|
15
|
|
|
2
|
|
|
|
|
233
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1703
|
0
|
|
|
|
|
0
|
my $stripe_version = $self->_get_stripe_verison_header( |
1704
|
|
|
|
|
|
|
suppress_api_version => 1, |
1705
|
|
|
|
|
|
|
); |
1706
|
0
|
|
|
|
|
0
|
return $stripe_version; |
1707
|
|
|
|
|
|
|
} |
1708
|
|
|
|
|
|
|
|
1709
|
|
|
|
|
|
|
# if we have set an explicit API version, confirm that it is valid. if |
1710
|
|
|
|
|
|
|
# it is invalid, _get_response() dies with an invalid_request_error. |
1711
|
2
|
0
|
|
2
|
|
2707
|
method _validate_api_version_value { |
|
2
|
|
|
0
|
|
6
|
|
|
2
|
|
|
|
|
370
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1712
|
0
|
0
|
|
|
|
0
|
return unless defined( $self->api_version ); |
1713
|
|
|
|
|
|
|
|
1714
|
0
|
|
|
|
|
0
|
my $stripe_version = $self->_get_stripe_verison_header(); |
1715
|
0
|
0
|
|
|
|
0
|
die Net::Stripe::Error->new( |
1716
|
|
|
|
|
|
|
type => "API version validation error", |
1717
|
|
|
|
|
|
|
message => sprintf( "Stripe API version mismatch. Sent: '%s'. Received: '%s'.", |
1718
|
|
|
|
|
|
|
$self->api_version, |
1719
|
|
|
|
|
|
|
$stripe_version, |
1720
|
|
|
|
|
|
|
), |
1721
|
|
|
|
|
|
|
) unless $stripe_version eq $self->api_version; |
1722
|
|
|
|
|
|
|
|
1723
|
0
|
|
|
|
|
0
|
return 1; |
1724
|
|
|
|
|
|
|
} |
1725
|
|
|
|
|
|
|
|
1726
|
|
|
|
|
|
|
# if we have set an explicit API version, confirm that it is within the |
1727
|
|
|
|
|
|
|
# appropriate range. otherwise, retrieve the default value for this |
1728
|
|
|
|
|
|
|
# account and confirm that it is within the appropriate range. |
1729
|
2
|
50
|
|
2
|
|
2596
|
method _validate_api_version_range { |
|
2
|
|
|
1
|
|
5
|
|
|
2
|
|
|
|
|
1224
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
3
|
|
1730
|
1
|
50
|
|
|
|
33
|
if ( $self->force_api_version ) { |
1731
|
0
|
0
|
|
|
|
0
|
warn "bypassing API version range safety check" if $self->debug; |
1732
|
0
|
|
|
|
|
0
|
return 1; |
1733
|
|
|
|
|
|
|
} |
1734
|
|
|
|
|
|
|
|
1735
|
1
|
50
|
|
|
|
27
|
my $api_version = defined( $self->api_version ) ? $self->api_version : $self->_get_account_api_version(); |
1736
|
|
|
|
|
|
|
|
1737
|
1
|
|
|
|
|
7
|
my @api_version = split( '-', $api_version ); |
1738
|
1
|
|
|
|
|
2
|
my $api_version_dt; |
1739
|
1
|
|
|
|
|
3
|
eval { |
1740
|
1
|
|
|
|
|
13
|
$api_version_dt = DateTime->new( |
1741
|
|
|
|
|
|
|
year => $api_version[0], |
1742
|
|
|
|
|
|
|
month => $api_version[1], |
1743
|
|
|
|
|
|
|
day => $api_version[2], |
1744
|
|
|
|
|
|
|
time_zone => 'UTC', |
1745
|
|
|
|
|
|
|
); |
1746
|
|
|
|
|
|
|
}; |
1747
|
1
|
50
|
|
|
|
1145
|
if ( my $error = $@ ) { |
1748
|
1
|
|
|
|
|
2424
|
die Net::Stripe::Error->new( |
1749
|
|
|
|
|
|
|
type => "API version validation error", |
1750
|
|
|
|
|
|
|
message => sprintf( "Invalid date string '%s' provided for api_version: %s", |
1751
|
|
|
|
|
|
|
$api_version, |
1752
|
|
|
|
|
|
|
$error, |
1753
|
|
|
|
|
|
|
), |
1754
|
|
|
|
|
|
|
); |
1755
|
|
|
|
|
|
|
} |
1756
|
|
|
|
|
|
|
|
1757
|
0
|
|
|
|
|
|
my @min_api_version = split( '-', Net::Stripe::Constants::MIN_API_VERSION ); |
1758
|
0
|
|
|
|
|
|
my $min_api_version_dt = DateTime->new( |
1759
|
|
|
|
|
|
|
year => $min_api_version[0], |
1760
|
|
|
|
|
|
|
month => $min_api_version[1], |
1761
|
|
|
|
|
|
|
day => $min_api_version[2], |
1762
|
|
|
|
|
|
|
time_zone => 'UTC', |
1763
|
|
|
|
|
|
|
); |
1764
|
|
|
|
|
|
|
|
1765
|
0
|
|
|
|
|
|
my @max_api_version = split( '-', Net::Stripe::Constants::MAX_API_VERSION ); |
1766
|
0
|
|
|
|
|
|
my $max_api_version_dt = DateTime->new( |
1767
|
|
|
|
|
|
|
year => $max_api_version[0], |
1768
|
|
|
|
|
|
|
month => $max_api_version[1], |
1769
|
|
|
|
|
|
|
day => $max_api_version[2], |
1770
|
|
|
|
|
|
|
time_zone => 'UTC', |
1771
|
|
|
|
|
|
|
); |
1772
|
|
|
|
|
|
|
|
1773
|
0
|
|
|
|
|
|
my $format = "Stripe API version %s is not supported by this version of Net::Stripe. " . |
1774
|
|
|
|
|
|
|
"This version of Net::Stripe only supports Stripe API versions from %s to %s. " . |
1775
|
|
|
|
|
|
|
"Please check for a version-appropriate branch at https://github.com/lukec/stripe-perl/branches."; |
1776
|
0
|
|
|
|
|
|
my $message = sprintf( $format, |
1777
|
|
|
|
|
|
|
$api_version, |
1778
|
|
|
|
|
|
|
Net::Stripe::Constants::MIN_API_VERSION, |
1779
|
|
|
|
|
|
|
Net::Stripe::Constants::MAX_API_VERSION, |
1780
|
|
|
|
|
|
|
); |
1781
|
0
|
0
|
0
|
|
|
|
die Net::Stripe::Error->new( |
1782
|
|
|
|
|
|
|
type => "API version validation error", |
1783
|
|
|
|
|
|
|
message => $message, |
1784
|
|
|
|
|
|
|
) unless $min_api_version_dt <= $api_version_dt && $api_version_dt <= $max_api_version_dt; |
1785
|
|
|
|
|
|
|
|
1786
|
0
|
|
|
|
|
|
return 1; |
1787
|
|
|
|
|
|
|
} |
1788
|
|
|
|
|
|
|
|
1789
|
|
|
|
|
|
|
|
1790
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
1791
|
|
|
|
|
|
|
1; |
1792
|
|
|
|
|
|
|
|
1793
|
|
|
|
|
|
|
__END__ |
1794
|
|
|
|
|
|
|
|
1795
|
|
|
|
|
|
|
=pod |
1796
|
|
|
|
|
|
|
|
1797
|
|
|
|
|
|
|
=head1 NAME |
1798
|
|
|
|
|
|
|
|
1799
|
|
|
|
|
|
|
Net::Stripe - API client for Stripe.com |
1800
|
|
|
|
|
|
|
|
1801
|
|
|
|
|
|
|
=head1 VERSION |
1802
|
|
|
|
|
|
|
|
1803
|
|
|
|
|
|
|
version 0.42 |
1804
|
|
|
|
|
|
|
|
1805
|
|
|
|
|
|
|
=head1 SYNOPSIS |
1806
|
|
|
|
|
|
|
|
1807
|
|
|
|
|
|
|
my $stripe = Net::Stripe->new(api_key => $API_KEY); |
1808
|
|
|
|
|
|
|
my $card_token = 'a token'; |
1809
|
|
|
|
|
|
|
my $charge = $stripe->post_charge( # Net::Stripe::Charge |
1810
|
|
|
|
|
|
|
amount => 12500, |
1811
|
|
|
|
|
|
|
currency => 'usd', |
1812
|
|
|
|
|
|
|
source => $card_token, |
1813
|
|
|
|
|
|
|
description => 'YAPC Registration', |
1814
|
|
|
|
|
|
|
); |
1815
|
|
|
|
|
|
|
print "Charge was not paid!\n" unless $charge->paid; |
1816
|
|
|
|
|
|
|
my $card = $charge->card; # Net::Stripe::Card |
1817
|
|
|
|
|
|
|
|
1818
|
|
|
|
|
|
|
# look up a charge by id |
1819
|
|
|
|
|
|
|
my $same_charge = $stripe->get_charge(charge_id => $charge->id); |
1820
|
|
|
|
|
|
|
|
1821
|
|
|
|
|
|
|
# ... and the API mirrors https://stripe.com/docs/api |
1822
|
|
|
|
|
|
|
# Charges: post_charge() get_charge() refund_charge() get_charges() |
1823
|
|
|
|
|
|
|
# Customer: post_customer() |
1824
|
|
|
|
|
|
|
|
1825
|
|
|
|
|
|
|
=head1 DESCRIPTION |
1826
|
|
|
|
|
|
|
|
1827
|
|
|
|
|
|
|
This module is a wrapper around the Stripe.com HTTP API. Methods are |
1828
|
|
|
|
|
|
|
generally named after the HTTP method and the object name. |
1829
|
|
|
|
|
|
|
|
1830
|
|
|
|
|
|
|
This method returns Moose objects for responses from the API. |
1831
|
|
|
|
|
|
|
|
1832
|
|
|
|
|
|
|
=head2 VERSIONING |
1833
|
|
|
|
|
|
|
|
1834
|
|
|
|
|
|
|
Because of occasional non-backward-compatible changes in the Stripe API, a |
1835
|
|
|
|
|
|
|
given version of the SDK is only guaranteed to support Stripe API versions |
1836
|
|
|
|
|
|
|
within the range defined by C<Net::Stripe::Constants::MIN_API_VERSION> and |
1837
|
|
|
|
|
|
|
C<Net::Stripe::Constants::MAX_API_VERSION>. |
1838
|
|
|
|
|
|
|
|
1839
|
|
|
|
|
|
|
If you need a version of the SDK supporting a specific older Stripe API |
1840
|
|
|
|
|
|
|
version, you can check for available versions at |
1841
|
|
|
|
|
|
|
L<https://github.com/lukec/stripe-perl/branches>, or by cloning this |
1842
|
|
|
|
|
|
|
repository, located at <https://github.com/lukec/stripe-perl> and using |
1843
|
|
|
|
|
|
|
<git branch> to view available version-specific branches. |
1844
|
|
|
|
|
|
|
|
1845
|
|
|
|
|
|
|
=head3 DEFAULT VERSIONING |
1846
|
|
|
|
|
|
|
|
1847
|
|
|
|
|
|
|
If you do not set the Stripe API version on object instantiation, API |
1848
|
|
|
|
|
|
|
calls will default to the API version setting for your Stripe account. |
1849
|
|
|
|
|
|
|
|
1850
|
|
|
|
|
|
|
=head3 SPECIFIC VERSIONING |
1851
|
|
|
|
|
|
|
|
1852
|
|
|
|
|
|
|
If you set the Stripe API version on object instantiation you are telling |
1853
|
|
|
|
|
|
|
Stripe to use that version of the API instead of the default for your account, |
1854
|
|
|
|
|
|
|
and therefore the available API request and response parameters, the names of |
1855
|
|
|
|
|
|
|
those parameters and the structure of the format of the returned data will all |
1856
|
|
|
|
|
|
|
be dictated by the version that you specify. You can read more about the |
1857
|
|
|
|
|
|
|
details of specific API versions at |
1858
|
|
|
|
|
|
|
<https://stripe.com/docs/upgrades#api-changelog>. |
1859
|
|
|
|
|
|
|
|
1860
|
|
|
|
|
|
|
=head3 OUT OF SCOPE VERSIONING |
1861
|
|
|
|
|
|
|
|
1862
|
|
|
|
|
|
|
If you are wearing a cowboy hat and think - although your specified account |
1863
|
|
|
|
|
|
|
version is outside the range defined in C<Net::Stripe::Constants> - that your |
1864
|
|
|
|
|
|
|
use case is simple enough that it should "just work", you can create your |
1865
|
|
|
|
|
|
|
object instance with C<force_api_version =E<gt> 1>, but don't say we didn't |
1866
|
|
|
|
|
|
|
warn you! |
1867
|
|
|
|
|
|
|
|
1868
|
|
|
|
|
|
|
=head1 METHODS |
1869
|
|
|
|
|
|
|
|
1870
|
|
|
|
|
|
|
=head2 new PARAMHASH |
1871
|
|
|
|
|
|
|
|
1872
|
|
|
|
|
|
|
This creates a new stripe API object. The following parameters are accepted: |
1873
|
|
|
|
|
|
|
|
1874
|
|
|
|
|
|
|
=over |
1875
|
|
|
|
|
|
|
|
1876
|
|
|
|
|
|
|
=item api_key |
1877
|
|
|
|
|
|
|
|
1878
|
|
|
|
|
|
|
This is required. You get this from your Stripe Account settings. |
1879
|
|
|
|
|
|
|
|
1880
|
|
|
|
|
|
|
=item api_version |
1881
|
|
|
|
|
|
|
|
1882
|
|
|
|
|
|
|
This is the value of the Stripe-Version header <https://stripe.com/docs/api/versioning> |
1883
|
|
|
|
|
|
|
you wish to transmit for API calls. |
1884
|
|
|
|
|
|
|
|
1885
|
|
|
|
|
|
|
=item force_api_version |
1886
|
|
|
|
|
|
|
|
1887
|
|
|
|
|
|
|
Set this to true to bypass the safety checks for API version compatibility with |
1888
|
|
|
|
|
|
|
a given version of the SDK. Please see the warnings above, and remember that |
1889
|
|
|
|
|
|
|
you are handling the financial data of your users. Use with extreme caution! |
1890
|
|
|
|
|
|
|
|
1891
|
|
|
|
|
|
|
=item debug |
1892
|
|
|
|
|
|
|
|
1893
|
|
|
|
|
|
|
You can set this to true to see extra debug info. |
1894
|
|
|
|
|
|
|
|
1895
|
|
|
|
|
|
|
=item debug_network |
1896
|
|
|
|
|
|
|
|
1897
|
|
|
|
|
|
|
You can set this to true to see the actual network requests. |
1898
|
|
|
|
|
|
|
|
1899
|
|
|
|
|
|
|
=back |
1900
|
|
|
|
|
|
|
|
1901
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
1902
|
|
|
|
|
|
|
|
1903
|
|
|
|
|
|
|
=head2 api_base |
1904
|
|
|
|
|
|
|
|
1905
|
|
|
|
|
|
|
Reader: api_base |
1906
|
|
|
|
|
|
|
|
1907
|
|
|
|
|
|
|
Type: Str |
1908
|
|
|
|
|
|
|
|
1909
|
|
|
|
|
|
|
Additional documentation: This is the base part of the URL for every request made |
1910
|
|
|
|
|
|
|
|
1911
|
|
|
|
|
|
|
=head2 api_key |
1912
|
|
|
|
|
|
|
|
1913
|
|
|
|
|
|
|
Reader: api_key |
1914
|
|
|
|
|
|
|
|
1915
|
|
|
|
|
|
|
Type: Str |
1916
|
|
|
|
|
|
|
|
1917
|
|
|
|
|
|
|
This attribute is required. |
1918
|
|
|
|
|
|
|
|
1919
|
|
|
|
|
|
|
Additional documentation: You get this from your Stripe Account settings |
1920
|
|
|
|
|
|
|
|
1921
|
|
|
|
|
|
|
=head2 api_version |
1922
|
|
|
|
|
|
|
|
1923
|
|
|
|
|
|
|
Reader: api_version |
1924
|
|
|
|
|
|
|
|
1925
|
|
|
|
|
|
|
Type: StripeAPIVersion |
1926
|
|
|
|
|
|
|
|
1927
|
|
|
|
|
|
|
Additional documentation: This is the value of the Stripe-Version header you wish to transmit for API calls |
1928
|
|
|
|
|
|
|
|
1929
|
|
|
|
|
|
|
=head2 debug |
1930
|
|
|
|
|
|
|
|
1931
|
|
|
|
|
|
|
Reader: debug |
1932
|
|
|
|
|
|
|
|
1933
|
|
|
|
|
|
|
Writer: debug |
1934
|
|
|
|
|
|
|
|
1935
|
|
|
|
|
|
|
Type: Bool |
1936
|
|
|
|
|
|
|
|
1937
|
|
|
|
|
|
|
Additional documentation: The debug flag |
1938
|
|
|
|
|
|
|
|
1939
|
|
|
|
|
|
|
=head2 debug_network |
1940
|
|
|
|
|
|
|
|
1941
|
|
|
|
|
|
|
Reader: debug_network |
1942
|
|
|
|
|
|
|
|
1943
|
|
|
|
|
|
|
Writer: debug_network |
1944
|
|
|
|
|
|
|
|
1945
|
|
|
|
|
|
|
Type: Bool |
1946
|
|
|
|
|
|
|
|
1947
|
|
|
|
|
|
|
Additional documentation: The debug network request flag |
1948
|
|
|
|
|
|
|
|
1949
|
|
|
|
|
|
|
=head2 force_api_version |
1950
|
|
|
|
|
|
|
|
1951
|
|
|
|
|
|
|
Reader: force_api_version |
1952
|
|
|
|
|
|
|
|
1953
|
|
|
|
|
|
|
Type: Bool |
1954
|
|
|
|
|
|
|
|
1955
|
|
|
|
|
|
|
Additional documentation: Set this to true to bypass the safety checks for API version compatibility. |
1956
|
|
|
|
|
|
|
|
1957
|
|
|
|
|
|
|
=head2 ua |
1958
|
|
|
|
|
|
|
|
1959
|
|
|
|
|
|
|
Reader: ua |
1960
|
|
|
|
|
|
|
|
1961
|
|
|
|
|
|
|
Type: Object |
1962
|
|
|
|
|
|
|
|
1963
|
|
|
|
|
|
|
Additional documentation: The LWP::UserAgent that is used for requests |
1964
|
|
|
|
|
|
|
|
1965
|
|
|
|
|
|
|
=head1 Balance Transaction Methods |
1966
|
|
|
|
|
|
|
|
1967
|
|
|
|
|
|
|
=head2 get_balance_transaction |
1968
|
|
|
|
|
|
|
|
1969
|
|
|
|
|
|
|
Retrieve a balance transaction. |
1970
|
|
|
|
|
|
|
|
1971
|
|
|
|
|
|
|
L<https://stripe.com/docs/api#retrieve_balance_transaction> |
1972
|
|
|
|
|
|
|
|
1973
|
|
|
|
|
|
|
=over |
1974
|
|
|
|
|
|
|
|
1975
|
|
|
|
|
|
|
=item * id - Str - balance transaction ID to retrieve. |
1976
|
|
|
|
|
|
|
|
1977
|
|
|
|
|
|
|
=back |
1978
|
|
|
|
|
|
|
|
1979
|
|
|
|
|
|
|
Returns a L<Net::Stripe::BalanceTransaction>. |
1980
|
|
|
|
|
|
|
|
1981
|
|
|
|
|
|
|
$stripe->get_balance_transaction(id => 'id'); |
1982
|
|
|
|
|
|
|
|
1983
|
|
|
|
|
|
|
=head1 Charge Methods |
1984
|
|
|
|
|
|
|
|
1985
|
|
|
|
|
|
|
=head2 post_charge |
1986
|
|
|
|
|
|
|
|
1987
|
|
|
|
|
|
|
Create a new charge. |
1988
|
|
|
|
|
|
|
|
1989
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/charges/create#create_charge> |
1990
|
|
|
|
|
|
|
|
1991
|
|
|
|
|
|
|
=over |
1992
|
|
|
|
|
|
|
|
1993
|
|
|
|
|
|
|
=item * amount - Int - amount to charge |
1994
|
|
|
|
|
|
|
|
1995
|
|
|
|
|
|
|
=item * currency - Str - currency for charge |
1996
|
|
|
|
|
|
|
|
1997
|
|
|
|
|
|
|
=item * customer - StripeCustomerId - customer to charge - optional |
1998
|
|
|
|
|
|
|
|
1999
|
|
|
|
|
|
|
=item * card - StripeTokenId or StripeCardId - card to use - optional |
2000
|
|
|
|
|
|
|
|
2001
|
|
|
|
|
|
|
=item * source - StripeTokenId or StripeCardId - source to use - optional |
2002
|
|
|
|
|
|
|
|
2003
|
|
|
|
|
|
|
=item * description - Str - description for the charge - optional |
2004
|
|
|
|
|
|
|
|
2005
|
|
|
|
|
|
|
=item * metadata - HashRef - metadata for the charge - optional |
2006
|
|
|
|
|
|
|
|
2007
|
|
|
|
|
|
|
=item * capture - Bool - optional |
2008
|
|
|
|
|
|
|
|
2009
|
|
|
|
|
|
|
=item * statement_descriptor - Str - descriptor for statement - optional |
2010
|
|
|
|
|
|
|
|
2011
|
|
|
|
|
|
|
=item * application_fee - Int - optional |
2012
|
|
|
|
|
|
|
|
2013
|
|
|
|
|
|
|
=item * receipt_email - Str - The email address to send this charge's receipt to - optional |
2014
|
|
|
|
|
|
|
|
2015
|
|
|
|
|
|
|
=back |
2016
|
|
|
|
|
|
|
|
2017
|
|
|
|
|
|
|
Returns L<Net::Stripe::Charge>. |
2018
|
|
|
|
|
|
|
|
2019
|
|
|
|
|
|
|
$stripe->post_charge(currency => 'USD', amount => 500, customer => 'testcustomer'); |
2020
|
|
|
|
|
|
|
|
2021
|
|
|
|
|
|
|
=head2 get_charge |
2022
|
|
|
|
|
|
|
|
2023
|
|
|
|
|
|
|
Retrieve a charge. |
2024
|
|
|
|
|
|
|
|
2025
|
|
|
|
|
|
|
L<https://stripe.com/docs/api#retrieve_charge> |
2026
|
|
|
|
|
|
|
|
2027
|
|
|
|
|
|
|
=over |
2028
|
|
|
|
|
|
|
|
2029
|
|
|
|
|
|
|
=item * charge_id - Str - charge id to retrieve |
2030
|
|
|
|
|
|
|
|
2031
|
|
|
|
|
|
|
=back |
2032
|
|
|
|
|
|
|
|
2033
|
|
|
|
|
|
|
Returns L<Net::Stripe::Charge>. |
2034
|
|
|
|
|
|
|
|
2035
|
|
|
|
|
|
|
$stripe->get_charge(charge_id => 'chargeid'); |
2036
|
|
|
|
|
|
|
|
2037
|
|
|
|
|
|
|
=head2 refund_charge |
2038
|
|
|
|
|
|
|
|
2039
|
|
|
|
|
|
|
Refunds a charge. |
2040
|
|
|
|
|
|
|
|
2041
|
|
|
|
|
|
|
L<https://stripe.com/docs/api#create_refund> |
2042
|
|
|
|
|
|
|
|
2043
|
|
|
|
|
|
|
=over |
2044
|
|
|
|
|
|
|
|
2045
|
|
|
|
|
|
|
=item * charge - L<Net::Stripe::Charge> or Str - charge or charge_id to refund |
2046
|
|
|
|
|
|
|
|
2047
|
|
|
|
|
|
|
=item * amount - Int - amount to refund in cents, optional |
2048
|
|
|
|
|
|
|
|
2049
|
|
|
|
|
|
|
=back |
2050
|
|
|
|
|
|
|
|
2051
|
|
|
|
|
|
|
Returns a new L<Net::Stripe::Refund>. |
2052
|
|
|
|
|
|
|
|
2053
|
|
|
|
|
|
|
$stripe->refund_charge(charge => $charge, amount => 500); |
2054
|
|
|
|
|
|
|
|
2055
|
|
|
|
|
|
|
=head2 get_charges |
2056
|
|
|
|
|
|
|
|
2057
|
|
|
|
|
|
|
Returns a L<Net::Stripe::List> object containing L<Net::Stripe::Charge> objects. |
2058
|
|
|
|
|
|
|
|
2059
|
|
|
|
|
|
|
L<https://stripe.com/docs/api#list_charges> |
2060
|
|
|
|
|
|
|
|
2061
|
|
|
|
|
|
|
=over |
2062
|
|
|
|
|
|
|
|
2063
|
|
|
|
|
|
|
=item * created - HashRef - created conditions to match, optional |
2064
|
|
|
|
|
|
|
|
2065
|
|
|
|
|
|
|
=item * customer - L<Net::Stripe::Customer> or Str - customer to match |
2066
|
|
|
|
|
|
|
|
2067
|
|
|
|
|
|
|
=item * ending_before - Str - ending before condition, optional |
2068
|
|
|
|
|
|
|
|
2069
|
|
|
|
|
|
|
=item * limit - Int - maximum number of charges to return, optional |
2070
|
|
|
|
|
|
|
|
2071
|
|
|
|
|
|
|
=item * starting_after - Str - starting after condition, optional |
2072
|
|
|
|
|
|
|
|
2073
|
|
|
|
|
|
|
=back |
2074
|
|
|
|
|
|
|
|
2075
|
|
|
|
|
|
|
Returns a list of L<Net::Stripe::Charge> objects. |
2076
|
|
|
|
|
|
|
|
2077
|
|
|
|
|
|
|
$stripe->get_charges(customer => $customer, limit => 5); |
2078
|
|
|
|
|
|
|
|
2079
|
|
|
|
|
|
|
=head2 capture_charge |
2080
|
|
|
|
|
|
|
|
2081
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/charges/capture#capture_charge> |
2082
|
|
|
|
|
|
|
|
2083
|
|
|
|
|
|
|
=over |
2084
|
|
|
|
|
|
|
|
2085
|
|
|
|
|
|
|
=item * charge - L<Net::Stripe::Charge> or Str - charge to capture |
2086
|
|
|
|
|
|
|
|
2087
|
|
|
|
|
|
|
=item * amount - Int - amount to capture |
2088
|
|
|
|
|
|
|
|
2089
|
|
|
|
|
|
|
=back |
2090
|
|
|
|
|
|
|
|
2091
|
|
|
|
|
|
|
Returns a L<Net::Stripe::Charge>. |
2092
|
|
|
|
|
|
|
|
2093
|
|
|
|
|
|
|
$stripe->capture_charge(charge => $charge_id); |
2094
|
|
|
|
|
|
|
|
2095
|
|
|
|
|
|
|
=head1 Customer Methods |
2096
|
|
|
|
|
|
|
|
2097
|
|
|
|
|
|
|
=head2 post_customer |
2098
|
|
|
|
|
|
|
|
2099
|
|
|
|
|
|
|
Create or update a customer. |
2100
|
|
|
|
|
|
|
|
2101
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/customers/create#create_customer> |
2102
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/customers/update#update_customer> |
2103
|
|
|
|
|
|
|
|
2104
|
|
|
|
|
|
|
=over |
2105
|
|
|
|
|
|
|
|
2106
|
|
|
|
|
|
|
=item * customer - L<Net::Stripe::Customer> or StripeCustomerId - existing customer to update, optional |
2107
|
|
|
|
|
|
|
|
2108
|
|
|
|
|
|
|
=item * account_balance - Int, optional |
2109
|
|
|
|
|
|
|
|
2110
|
|
|
|
|
|
|
=item * balance - Int, optional |
2111
|
|
|
|
|
|
|
|
2112
|
|
|
|
|
|
|
=item * card - L<Net::Stripe::Token> or StripeTokenId, default card for the customer, optional |
2113
|
|
|
|
|
|
|
|
2114
|
|
|
|
|
|
|
=item * source - StripeTokenId or StripeSourceId, source for the customer, optional |
2115
|
|
|
|
|
|
|
|
2116
|
|
|
|
|
|
|
=item * coupon - Str, optional |
2117
|
|
|
|
|
|
|
|
2118
|
|
|
|
|
|
|
=item * default_card - L<Net::Stripe::Token>, L<Net::Stripe::Card>, Str or HashRef, default card for the customer, optional |
2119
|
|
|
|
|
|
|
|
2120
|
|
|
|
|
|
|
=item * default_source - StripeCardId or StripeSourceId, default source for the customer, optional |
2121
|
|
|
|
|
|
|
|
2122
|
|
|
|
|
|
|
=item * description - Str, optional |
2123
|
|
|
|
|
|
|
|
2124
|
|
|
|
|
|
|
=item * email - Str, optional |
2125
|
|
|
|
|
|
|
|
2126
|
|
|
|
|
|
|
=item * metadata - HashRef, optional |
2127
|
|
|
|
|
|
|
|
2128
|
|
|
|
|
|
|
=item * plan - Str, optional |
2129
|
|
|
|
|
|
|
|
2130
|
|
|
|
|
|
|
=item * quantity - Int, optional |
2131
|
|
|
|
|
|
|
|
2132
|
|
|
|
|
|
|
=item * trial_end - Int or Str, optional |
2133
|
|
|
|
|
|
|
|
2134
|
|
|
|
|
|
|
=back |
2135
|
|
|
|
|
|
|
|
2136
|
|
|
|
|
|
|
Returns a L<Net::Stripe::Customer> object. |
2137
|
|
|
|
|
|
|
|
2138
|
|
|
|
|
|
|
my $customer = $stripe->post_customer( |
2139
|
|
|
|
|
|
|
source => $token_id, |
2140
|
|
|
|
|
|
|
email => 'stripe@example.com', |
2141
|
|
|
|
|
|
|
description => 'Test for Net::Stripe', |
2142
|
|
|
|
|
|
|
); |
2143
|
|
|
|
|
|
|
|
2144
|
|
|
|
|
|
|
=head2 list_subscriptions |
2145
|
|
|
|
|
|
|
|
2146
|
|
|
|
|
|
|
Returns the subscriptions for a customer. |
2147
|
|
|
|
|
|
|
|
2148
|
|
|
|
|
|
|
L<https://stripe.com/docs/api#list_subscriptions> |
2149
|
|
|
|
|
|
|
|
2150
|
|
|
|
|
|
|
=over |
2151
|
|
|
|
|
|
|
|
2152
|
|
|
|
|
|
|
=item * customer - L<Net::Stripe::Customer> or Str |
2153
|
|
|
|
|
|
|
|
2154
|
|
|
|
|
|
|
=item * ending_before - Str, optional |
2155
|
|
|
|
|
|
|
|
2156
|
|
|
|
|
|
|
=item * limit - Int, optional |
2157
|
|
|
|
|
|
|
|
2158
|
|
|
|
|
|
|
=item * starting_after - Str, optional |
2159
|
|
|
|
|
|
|
|
2160
|
|
|
|
|
|
|
=back |
2161
|
|
|
|
|
|
|
|
2162
|
|
|
|
|
|
|
Returns a list of L<Net::Stripe::Subscription> objects. |
2163
|
|
|
|
|
|
|
|
2164
|
|
|
|
|
|
|
=head2 get_customer |
2165
|
|
|
|
|
|
|
|
2166
|
|
|
|
|
|
|
Retrieve a customer. |
2167
|
|
|
|
|
|
|
|
2168
|
|
|
|
|
|
|
L<https://stripe.com/docs/api#retrieve_customer> |
2169
|
|
|
|
|
|
|
|
2170
|
|
|
|
|
|
|
=over |
2171
|
|
|
|
|
|
|
|
2172
|
|
|
|
|
|
|
=item * customer_id - Str - the customer id to retrieve |
2173
|
|
|
|
|
|
|
|
2174
|
|
|
|
|
|
|
=back |
2175
|
|
|
|
|
|
|
|
2176
|
|
|
|
|
|
|
Returns a L<Net::Stripe::List> object containing L<Net::Stripe::Customer> objects. |
2177
|
|
|
|
|
|
|
|
2178
|
|
|
|
|
|
|
$stripe->get_customer(customer_id => $id); |
2179
|
|
|
|
|
|
|
|
2180
|
|
|
|
|
|
|
=head2 delete_customer |
2181
|
|
|
|
|
|
|
|
2182
|
|
|
|
|
|
|
Delete a customer. |
2183
|
|
|
|
|
|
|
|
2184
|
|
|
|
|
|
|
L<https://stripe.com/docs/api#delete_customer> |
2185
|
|
|
|
|
|
|
|
2186
|
|
|
|
|
|
|
=over |
2187
|
|
|
|
|
|
|
|
2188
|
|
|
|
|
|
|
=item * customer - L<Net::Stripe::Customer> or Str - the customer to delete |
2189
|
|
|
|
|
|
|
|
2190
|
|
|
|
|
|
|
=back |
2191
|
|
|
|
|
|
|
|
2192
|
|
|
|
|
|
|
Returns a L<Net::Stripe::Customer> object. |
2193
|
|
|
|
|
|
|
|
2194
|
|
|
|
|
|
|
$stripe->delete_customer(customer => $customer); |
2195
|
|
|
|
|
|
|
|
2196
|
|
|
|
|
|
|
=head2 get_customers |
2197
|
|
|
|
|
|
|
|
2198
|
|
|
|
|
|
|
Returns a list of customers. |
2199
|
|
|
|
|
|
|
|
2200
|
|
|
|
|
|
|
L<https://stripe.com/docs/api#list_customers> |
2201
|
|
|
|
|
|
|
|
2202
|
|
|
|
|
|
|
=over |
2203
|
|
|
|
|
|
|
|
2204
|
|
|
|
|
|
|
=item * created - HashRef - created conditions, optional |
2205
|
|
|
|
|
|
|
|
2206
|
|
|
|
|
|
|
=item * ending_before - Str, optional |
2207
|
|
|
|
|
|
|
|
2208
|
|
|
|
|
|
|
=item * limit - Int, optional |
2209
|
|
|
|
|
|
|
|
2210
|
|
|
|
|
|
|
=item * starting_after - Str, optional |
2211
|
|
|
|
|
|
|
|
2212
|
|
|
|
|
|
|
=back |
2213
|
|
|
|
|
|
|
|
2214
|
|
|
|
|
|
|
Returns a L<Net::Stripe::List> object containing L<Net::Stripe::Customer> objects. |
2215
|
|
|
|
|
|
|
|
2216
|
|
|
|
|
|
|
$stripe->get_customers(limit => 7); |
2217
|
|
|
|
|
|
|
|
2218
|
|
|
|
|
|
|
=head1 Card Methods |
2219
|
|
|
|
|
|
|
|
2220
|
|
|
|
|
|
|
=head2 get_card |
2221
|
|
|
|
|
|
|
|
2222
|
|
|
|
|
|
|
Retrieve information about a customer's card. |
2223
|
|
|
|
|
|
|
|
2224
|
|
|
|
|
|
|
L<https://stripe.com/docs/api#retrieve_card> |
2225
|
|
|
|
|
|
|
|
2226
|
|
|
|
|
|
|
=over |
2227
|
|
|
|
|
|
|
|
2228
|
|
|
|
|
|
|
=item * customer - L<Net::Stripe::Customer> or Str - the customer |
2229
|
|
|
|
|
|
|
|
2230
|
|
|
|
|
|
|
=item * card_id - Str - the card ID to retrieve |
2231
|
|
|
|
|
|
|
|
2232
|
|
|
|
|
|
|
=back |
2233
|
|
|
|
|
|
|
|
2234
|
|
|
|
|
|
|
Returns a L<Net::Stripe::Card>. |
2235
|
|
|
|
|
|
|
|
2236
|
|
|
|
|
|
|
$stripe->get_card(customer => 'customer_id', card_id => 'abcdef'); |
2237
|
|
|
|
|
|
|
|
2238
|
|
|
|
|
|
|
=head2 post_card |
2239
|
|
|
|
|
|
|
|
2240
|
|
|
|
|
|
|
Create a card. |
2241
|
|
|
|
|
|
|
|
2242
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/cards/create#create_card> |
2243
|
|
|
|
|
|
|
|
2244
|
|
|
|
|
|
|
=over |
2245
|
|
|
|
|
|
|
|
2246
|
|
|
|
|
|
|
=item * customer - L<Net::Stripe::Customer> or StripeCustomerId |
2247
|
|
|
|
|
|
|
|
2248
|
|
|
|
|
|
|
=item * card - L<Net::Stripe::Token> or StripeTokenId |
2249
|
|
|
|
|
|
|
|
2250
|
|
|
|
|
|
|
=item * source - StripeTokenId |
2251
|
|
|
|
|
|
|
|
2252
|
|
|
|
|
|
|
=back |
2253
|
|
|
|
|
|
|
|
2254
|
|
|
|
|
|
|
Returns a L<Net::Stripe::Card>. |
2255
|
|
|
|
|
|
|
|
2256
|
|
|
|
|
|
|
$stripe->post_card(customer => $customer, source => $token_id); |
2257
|
|
|
|
|
|
|
|
2258
|
|
|
|
|
|
|
=head2 update_card |
2259
|
|
|
|
|
|
|
|
2260
|
|
|
|
|
|
|
Update a card. |
2261
|
|
|
|
|
|
|
|
2262
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/cards/update#update_card> |
2263
|
|
|
|
|
|
|
|
2264
|
|
|
|
|
|
|
=over |
2265
|
|
|
|
|
|
|
|
2266
|
|
|
|
|
|
|
=item * customer_id - StripeCustomerId |
2267
|
|
|
|
|
|
|
|
2268
|
|
|
|
|
|
|
=item * card_id - StripeCardId |
2269
|
|
|
|
|
|
|
|
2270
|
|
|
|
|
|
|
=item * card - HashRef |
2271
|
|
|
|
|
|
|
|
2272
|
|
|
|
|
|
|
=back |
2273
|
|
|
|
|
|
|
|
2274
|
|
|
|
|
|
|
Returns a L<Net::Stripe::Card>. |
2275
|
|
|
|
|
|
|
|
2276
|
|
|
|
|
|
|
$stripe->update_card( |
2277
|
|
|
|
|
|
|
customer_id => $customer_id, |
2278
|
|
|
|
|
|
|
card_id => $card_id, |
2279
|
|
|
|
|
|
|
card => { |
2280
|
|
|
|
|
|
|
name => $new_name, |
2281
|
|
|
|
|
|
|
metadata => { |
2282
|
|
|
|
|
|
|
'account-number' => $new_account_nunmber, |
2283
|
|
|
|
|
|
|
}, |
2284
|
|
|
|
|
|
|
}, |
2285
|
|
|
|
|
|
|
); |
2286
|
|
|
|
|
|
|
|
2287
|
|
|
|
|
|
|
=head2 get_cards |
2288
|
|
|
|
|
|
|
|
2289
|
|
|
|
|
|
|
Returns a list of cards. |
2290
|
|
|
|
|
|
|
|
2291
|
|
|
|
|
|
|
L<https://stripe.com/docs/api#list_cards> |
2292
|
|
|
|
|
|
|
|
2293
|
|
|
|
|
|
|
=over |
2294
|
|
|
|
|
|
|
|
2295
|
|
|
|
|
|
|
=item * customer - L<Net::Stripe::Customer> or Str |
2296
|
|
|
|
|
|
|
|
2297
|
|
|
|
|
|
|
=item * ending_before - Str, optional |
2298
|
|
|
|
|
|
|
|
2299
|
|
|
|
|
|
|
=item * limit - Int, optional |
2300
|
|
|
|
|
|
|
|
2301
|
|
|
|
|
|
|
=item * starting_after - Str, optional |
2302
|
|
|
|
|
|
|
|
2303
|
|
|
|
|
|
|
=back |
2304
|
|
|
|
|
|
|
|
2305
|
|
|
|
|
|
|
Returns a L<Net::Stripe::List> object containing L<Net::Stripe::Card> objects. |
2306
|
|
|
|
|
|
|
|
2307
|
|
|
|
|
|
|
$stripe->list_cards(customer => 'abcdec', limit => 10); |
2308
|
|
|
|
|
|
|
|
2309
|
|
|
|
|
|
|
=head2 delete_card |
2310
|
|
|
|
|
|
|
|
2311
|
|
|
|
|
|
|
Delete a card. |
2312
|
|
|
|
|
|
|
|
2313
|
|
|
|
|
|
|
L<https://stripe.com/docs/api#delete_card> |
2314
|
|
|
|
|
|
|
|
2315
|
|
|
|
|
|
|
=over |
2316
|
|
|
|
|
|
|
|
2317
|
|
|
|
|
|
|
=item * customer - L<Net::Stripe::Customer> or Str |
2318
|
|
|
|
|
|
|
|
2319
|
|
|
|
|
|
|
=item * card - L<Net::Stripe::Card> or Str |
2320
|
|
|
|
|
|
|
|
2321
|
|
|
|
|
|
|
=back |
2322
|
|
|
|
|
|
|
|
2323
|
|
|
|
|
|
|
Returns a L<Net::Stripe::Card>. |
2324
|
|
|
|
|
|
|
|
2325
|
|
|
|
|
|
|
$stripe->delete_card(customer => $customer, card => $card); |
2326
|
|
|
|
|
|
|
|
2327
|
|
|
|
|
|
|
=head1 Source Methods |
2328
|
|
|
|
|
|
|
|
2329
|
|
|
|
|
|
|
=head2 create_source |
2330
|
|
|
|
|
|
|
|
2331
|
|
|
|
|
|
|
Create a new source object |
2332
|
|
|
|
|
|
|
|
2333
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/sources/create#create_source> |
2334
|
|
|
|
|
|
|
|
2335
|
|
|
|
|
|
|
=over |
2336
|
|
|
|
|
|
|
|
2337
|
|
|
|
|
|
|
=item * amount - Int - amount associated with the source |
2338
|
|
|
|
|
|
|
|
2339
|
|
|
|
|
|
|
=item * currency - Str - currency associated with the source |
2340
|
|
|
|
|
|
|
|
2341
|
|
|
|
|
|
|
=item * flow - StripeSourceFlow - authentication flow for the source |
2342
|
|
|
|
|
|
|
|
2343
|
|
|
|
|
|
|
=item * mandate - HashRef - information about a mandate attached to the source |
2344
|
|
|
|
|
|
|
|
2345
|
|
|
|
|
|
|
=item * metadata - HashRef - metadata for the source |
2346
|
|
|
|
|
|
|
|
2347
|
|
|
|
|
|
|
=item * owner - HashRef - information about the owner of the payment instrument |
2348
|
|
|
|
|
|
|
|
2349
|
|
|
|
|
|
|
=item * receiver - HashRef - parameters for the receiver flow |
2350
|
|
|
|
|
|
|
|
2351
|
|
|
|
|
|
|
=item * redirect - HashRef - parameters required for the redirect flow |
2352
|
|
|
|
|
|
|
|
2353
|
|
|
|
|
|
|
=item * source_order - HashRef - information about the items and shipping associated with the source |
2354
|
|
|
|
|
|
|
|
2355
|
|
|
|
|
|
|
=item * statement_descriptor - Str - descriptor for statement |
2356
|
|
|
|
|
|
|
|
2357
|
|
|
|
|
|
|
=item * token - StripeTokenId - token used to create the source |
2358
|
|
|
|
|
|
|
|
2359
|
|
|
|
|
|
|
=item * type - StripeSourceType - type of source to create - required |
2360
|
|
|
|
|
|
|
|
2361
|
|
|
|
|
|
|
=item * usage - StripeSourceUsage - whether the source should be reusable or not |
2362
|
|
|
|
|
|
|
|
2363
|
|
|
|
|
|
|
=back |
2364
|
|
|
|
|
|
|
|
2365
|
|
|
|
|
|
|
Returns a L<Net::Stripe::Source> |
2366
|
|
|
|
|
|
|
|
2367
|
|
|
|
|
|
|
$stripe->create_source( |
2368
|
|
|
|
|
|
|
type => 'card', |
2369
|
|
|
|
|
|
|
token => $token_id, |
2370
|
|
|
|
|
|
|
); |
2371
|
|
|
|
|
|
|
|
2372
|
|
|
|
|
|
|
=head2 get_source |
2373
|
|
|
|
|
|
|
|
2374
|
|
|
|
|
|
|
Retrieve an existing source object |
2375
|
|
|
|
|
|
|
|
2376
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/sources/retrieve#retrieve_source> |
2377
|
|
|
|
|
|
|
|
2378
|
|
|
|
|
|
|
=over |
2379
|
|
|
|
|
|
|
|
2380
|
|
|
|
|
|
|
=item * source_id - StripeSourceId - id of source to retrieve - required |
2381
|
|
|
|
|
|
|
|
2382
|
|
|
|
|
|
|
=item * client_secret - Str - client secret of the source |
2383
|
|
|
|
|
|
|
|
2384
|
|
|
|
|
|
|
=back |
2385
|
|
|
|
|
|
|
|
2386
|
|
|
|
|
|
|
Returns a L<Net::Stripe::Source> |
2387
|
|
|
|
|
|
|
|
2388
|
|
|
|
|
|
|
$stripe->get_source( |
2389
|
|
|
|
|
|
|
source_id => $source_id, |
2390
|
|
|
|
|
|
|
); |
2391
|
|
|
|
|
|
|
|
2392
|
|
|
|
|
|
|
=head2 update_source |
2393
|
|
|
|
|
|
|
|
2394
|
|
|
|
|
|
|
Update the specified source by setting the values of the parameters passed |
2395
|
|
|
|
|
|
|
|
2396
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/sources/update#update_source> |
2397
|
|
|
|
|
|
|
|
2398
|
|
|
|
|
|
|
=over |
2399
|
|
|
|
|
|
|
|
2400
|
|
|
|
|
|
|
=item * source_id - StripeSourceId - id of source to update - required |
2401
|
|
|
|
|
|
|
|
2402
|
|
|
|
|
|
|
=item * amount - Int - amount associated with the source |
2403
|
|
|
|
|
|
|
|
2404
|
|
|
|
|
|
|
=item * metadata - HashRef - metadata for the source |
2405
|
|
|
|
|
|
|
|
2406
|
|
|
|
|
|
|
=item * mandate - HashRef - information about a mandate attached to the source |
2407
|
|
|
|
|
|
|
|
2408
|
|
|
|
|
|
|
=item * owner - HashRef - information about the owner of the payment instrument |
2409
|
|
|
|
|
|
|
|
2410
|
|
|
|
|
|
|
=item * source_order - HashRef - information about the items and shipping associated with the source |
2411
|
|
|
|
|
|
|
|
2412
|
|
|
|
|
|
|
=back |
2413
|
|
|
|
|
|
|
|
2414
|
|
|
|
|
|
|
Returns a L<Net::Stripe::Source> |
2415
|
|
|
|
|
|
|
|
2416
|
|
|
|
|
|
|
$stripe->update_source( |
2417
|
|
|
|
|
|
|
source_id => $source_id, |
2418
|
|
|
|
|
|
|
owner => { |
2419
|
|
|
|
|
|
|
email => $new_email, |
2420
|
|
|
|
|
|
|
phone => $new_phone, |
2421
|
|
|
|
|
|
|
}, |
2422
|
|
|
|
|
|
|
); |
2423
|
|
|
|
|
|
|
|
2424
|
|
|
|
|
|
|
=head2 attach_source |
2425
|
|
|
|
|
|
|
|
2426
|
|
|
|
|
|
|
Attaches a Source object to a Customer |
2427
|
|
|
|
|
|
|
|
2428
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/sources/attach#attach_source> |
2429
|
|
|
|
|
|
|
|
2430
|
|
|
|
|
|
|
=over |
2431
|
|
|
|
|
|
|
|
2432
|
|
|
|
|
|
|
=item * source_id - StripeSourceId - id of source to be attached - required |
2433
|
|
|
|
|
|
|
|
2434
|
|
|
|
|
|
|
=item * customer_id - StripeCustomerId - id of customer to which source should be attached - required |
2435
|
|
|
|
|
|
|
|
2436
|
|
|
|
|
|
|
=back |
2437
|
|
|
|
|
|
|
|
2438
|
|
|
|
|
|
|
Returns a L<Net::Stripe::Source> |
2439
|
|
|
|
|
|
|
|
2440
|
|
|
|
|
|
|
$stripe->attach_source( |
2441
|
|
|
|
|
|
|
customer_id => $customer_id, |
2442
|
|
|
|
|
|
|
source_id => $source->id, |
2443
|
|
|
|
|
|
|
); |
2444
|
|
|
|
|
|
|
|
2445
|
|
|
|
|
|
|
=head2 detach_source |
2446
|
|
|
|
|
|
|
|
2447
|
|
|
|
|
|
|
Detaches a Source object from a Customer |
2448
|
|
|
|
|
|
|
|
2449
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/sources/detach#detach_source> |
2450
|
|
|
|
|
|
|
|
2451
|
|
|
|
|
|
|
=over |
2452
|
|
|
|
|
|
|
|
2453
|
|
|
|
|
|
|
=item * source_id - StripeSourceId - id of source to be detached - required |
2454
|
|
|
|
|
|
|
|
2455
|
|
|
|
|
|
|
=item * customer_id - StripeCustomerId - id of customer from which source should be detached - required |
2456
|
|
|
|
|
|
|
|
2457
|
|
|
|
|
|
|
=back |
2458
|
|
|
|
|
|
|
|
2459
|
|
|
|
|
|
|
Returns a L<Net::Stripe::Source> |
2460
|
|
|
|
|
|
|
|
2461
|
|
|
|
|
|
|
$stripe->detach_source( |
2462
|
|
|
|
|
|
|
customer_id => $customer_id, |
2463
|
|
|
|
|
|
|
source_id => $source->id, |
2464
|
|
|
|
|
|
|
); |
2465
|
|
|
|
|
|
|
|
2466
|
|
|
|
|
|
|
=head2 list_sources |
2467
|
|
|
|
|
|
|
|
2468
|
|
|
|
|
|
|
List all sources belonging to a Customer |
2469
|
|
|
|
|
|
|
|
2470
|
|
|
|
|
|
|
=over |
2471
|
|
|
|
|
|
|
|
2472
|
|
|
|
|
|
|
=item * customer_id - StripeCustomerId - id of customer for which source to list sources - required |
2473
|
|
|
|
|
|
|
|
2474
|
|
|
|
|
|
|
=item * object - Str - object type - required |
2475
|
|
|
|
|
|
|
|
2476
|
|
|
|
|
|
|
=item * ending_before - Str - ending before condition |
2477
|
|
|
|
|
|
|
|
2478
|
|
|
|
|
|
|
=item * limit - Int - maximum number of charges to return |
2479
|
|
|
|
|
|
|
|
2480
|
|
|
|
|
|
|
=item * starting_after - Str - starting after condition |
2481
|
|
|
|
|
|
|
|
2482
|
|
|
|
|
|
|
=back |
2483
|
|
|
|
|
|
|
|
2484
|
|
|
|
|
|
|
Returns a L<Net::Stripe::List> object containing objects of the requested type |
2485
|
|
|
|
|
|
|
|
2486
|
|
|
|
|
|
|
$stripe->list_sources( |
2487
|
|
|
|
|
|
|
customer_id => $customer_id, |
2488
|
|
|
|
|
|
|
object => 'card', |
2489
|
|
|
|
|
|
|
limit => 10, |
2490
|
|
|
|
|
|
|
); |
2491
|
|
|
|
|
|
|
|
2492
|
|
|
|
|
|
|
=head1 Subscription Methods |
2493
|
|
|
|
|
|
|
|
2494
|
|
|
|
|
|
|
=head2 post_subscription |
2495
|
|
|
|
|
|
|
|
2496
|
|
|
|
|
|
|
Adds or updates a subscription for a customer. |
2497
|
|
|
|
|
|
|
|
2498
|
|
|
|
|
|
|
L<https://stripe.com/docs/api#create_subscription> |
2499
|
|
|
|
|
|
|
|
2500
|
|
|
|
|
|
|
=over |
2501
|
|
|
|
|
|
|
|
2502
|
|
|
|
|
|
|
=item * customer - L<Net::Stripe::Customer> |
2503
|
|
|
|
|
|
|
|
2504
|
|
|
|
|
|
|
=item * subscription - L<Net::Stripe::Subscription> or Str |
2505
|
|
|
|
|
|
|
|
2506
|
|
|
|
|
|
|
=item * card - L<Net::Stripe::Card>, L<Net::Stripe::Token> or Str, default card for the customer, optional |
2507
|
|
|
|
|
|
|
|
2508
|
|
|
|
|
|
|
=item * coupon - Str, optional |
2509
|
|
|
|
|
|
|
|
2510
|
|
|
|
|
|
|
=item * description - Str, optional |
2511
|
|
|
|
|
|
|
|
2512
|
|
|
|
|
|
|
=item * plan - Str, optional |
2513
|
|
|
|
|
|
|
|
2514
|
|
|
|
|
|
|
=item * quantity - Int, optional |
2515
|
|
|
|
|
|
|
|
2516
|
|
|
|
|
|
|
=item * trial_end - Int, or Str optional |
2517
|
|
|
|
|
|
|
|
2518
|
|
|
|
|
|
|
=item * application_fee_percent - Int, optional |
2519
|
|
|
|
|
|
|
|
2520
|
|
|
|
|
|
|
=item * prorate - Bool, optional |
2521
|
|
|
|
|
|
|
|
2522
|
|
|
|
|
|
|
=item * cancel_at_period_end - Bool, optional |
2523
|
|
|
|
|
|
|
|
2524
|
|
|
|
|
|
|
=back |
2525
|
|
|
|
|
|
|
|
2526
|
|
|
|
|
|
|
Returns a L<Net::Stripe::Subscription> object. |
2527
|
|
|
|
|
|
|
|
2528
|
|
|
|
|
|
|
$stripe->post_subscription(customer => $customer, plan => 'testplan'); |
2529
|
|
|
|
|
|
|
|
2530
|
|
|
|
|
|
|
=head2 get_subscription |
2531
|
|
|
|
|
|
|
|
2532
|
|
|
|
|
|
|
Returns a customer's subscription. |
2533
|
|
|
|
|
|
|
|
2534
|
|
|
|
|
|
|
=over |
2535
|
|
|
|
|
|
|
|
2536
|
|
|
|
|
|
|
=item * customer - L<Net::Stripe::Customer> or Str |
2537
|
|
|
|
|
|
|
|
2538
|
|
|
|
|
|
|
=back |
2539
|
|
|
|
|
|
|
|
2540
|
|
|
|
|
|
|
Returns a L<Net::Stripe::Subscription>. |
2541
|
|
|
|
|
|
|
|
2542
|
|
|
|
|
|
|
$stripe->get_subscription(customer => 'test123'); |
2543
|
|
|
|
|
|
|
|
2544
|
|
|
|
|
|
|
=head2 delete_subscription |
2545
|
|
|
|
|
|
|
|
2546
|
|
|
|
|
|
|
Cancel a customer's subscription. |
2547
|
|
|
|
|
|
|
|
2548
|
|
|
|
|
|
|
L<https://stripe.com/docs/api#cancel_subscription> |
2549
|
|
|
|
|
|
|
|
2550
|
|
|
|
|
|
|
=over |
2551
|
|
|
|
|
|
|
|
2552
|
|
|
|
|
|
|
=item * customer - L<Net::Stripe::Customer> or Str |
2553
|
|
|
|
|
|
|
|
2554
|
|
|
|
|
|
|
=item * subscription - L<Net::Stripe::Subscription> or Str |
2555
|
|
|
|
|
|
|
|
2556
|
|
|
|
|
|
|
=item * at_period_end - Bool, optional |
2557
|
|
|
|
|
|
|
|
2558
|
|
|
|
|
|
|
=back |
2559
|
|
|
|
|
|
|
|
2560
|
|
|
|
|
|
|
Returns a L<Net::Stripe::Subscription> object. |
2561
|
|
|
|
|
|
|
|
2562
|
|
|
|
|
|
|
$stripe->delete_subscription(customer => $customer, subscription => $subscription); |
2563
|
|
|
|
|
|
|
|
2564
|
|
|
|
|
|
|
=head1 Token Methods |
2565
|
|
|
|
|
|
|
|
2566
|
|
|
|
|
|
|
=head2 get_token |
2567
|
|
|
|
|
|
|
|
2568
|
|
|
|
|
|
|
Retrieves an existing token. |
2569
|
|
|
|
|
|
|
|
2570
|
|
|
|
|
|
|
L<https://stripe.com/docs/api#retrieve_token> |
2571
|
|
|
|
|
|
|
|
2572
|
|
|
|
|
|
|
=over |
2573
|
|
|
|
|
|
|
|
2574
|
|
|
|
|
|
|
=item * token_id - Str |
2575
|
|
|
|
|
|
|
|
2576
|
|
|
|
|
|
|
=back |
2577
|
|
|
|
|
|
|
|
2578
|
|
|
|
|
|
|
Returns a L<Net::Stripe::Token>. |
2579
|
|
|
|
|
|
|
|
2580
|
|
|
|
|
|
|
$stripe->get_token(token_id => 'testtokenid'); |
2581
|
|
|
|
|
|
|
|
2582
|
|
|
|
|
|
|
=head1 Product Methods |
2583
|
|
|
|
|
|
|
|
2584
|
|
|
|
|
|
|
=head2 create_product |
2585
|
|
|
|
|
|
|
|
2586
|
|
|
|
|
|
|
Create a new Product |
2587
|
|
|
|
|
|
|
|
2588
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/products/create#create_product> |
2589
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/service_products/create#create_service_product> |
2590
|
|
|
|
|
|
|
|
2591
|
|
|
|
|
|
|
=over |
2592
|
|
|
|
|
|
|
|
2593
|
|
|
|
|
|
|
=item * name - Str - name of the product - required |
2594
|
|
|
|
|
|
|
|
2595
|
|
|
|
|
|
|
=item * active - Bool - whether the product is currently available for purchase |
2596
|
|
|
|
|
|
|
|
2597
|
|
|
|
|
|
|
=item * attributes - ArrayRef[Str] - a list of attributes that each sku can provide values for |
2598
|
|
|
|
|
|
|
|
2599
|
|
|
|
|
|
|
=item * caption - Str - a short description |
2600
|
|
|
|
|
|
|
|
2601
|
|
|
|
|
|
|
=item * deactivate_on - ArrayRef[Str] - an list of connect application identifiers that cannot purchase this product |
2602
|
|
|
|
|
|
|
|
2603
|
|
|
|
|
|
|
=item * description - Str - description |
2604
|
|
|
|
|
|
|
|
2605
|
|
|
|
|
|
|
=item * id - Str - unique identifier |
2606
|
|
|
|
|
|
|
|
2607
|
|
|
|
|
|
|
=item * images - ArrayRef[Str] - a list of image URLs |
2608
|
|
|
|
|
|
|
|
2609
|
|
|
|
|
|
|
=item * metadata - HashRef[Str] - metadata |
2610
|
|
|
|
|
|
|
|
2611
|
|
|
|
|
|
|
=item * package_dimensions - HashRef - package dimensions for shipping |
2612
|
|
|
|
|
|
|
|
2613
|
|
|
|
|
|
|
=item * shippable - Bool - whether the product is a shipped good |
2614
|
|
|
|
|
|
|
|
2615
|
|
|
|
|
|
|
=item * statement_descriptor - Str - descriptor for statement |
2616
|
|
|
|
|
|
|
|
2617
|
|
|
|
|
|
|
=item * type - StripeProductType - the type of the product |
2618
|
|
|
|
|
|
|
|
2619
|
|
|
|
|
|
|
=item * unit_label - Str - label that represents units of the product |
2620
|
|
|
|
|
|
|
|
2621
|
|
|
|
|
|
|
=item * url - Str - URL of a publicly-accessible web page for the product |
2622
|
|
|
|
|
|
|
|
2623
|
|
|
|
|
|
|
=back |
2624
|
|
|
|
|
|
|
|
2625
|
|
|
|
|
|
|
Returns a L<Net::Stripe::Product> |
2626
|
|
|
|
|
|
|
|
2627
|
|
|
|
|
|
|
$stripe->create_product( |
2628
|
|
|
|
|
|
|
name => $product_name, |
2629
|
|
|
|
|
|
|
type => 'good', |
2630
|
|
|
|
|
|
|
); |
2631
|
|
|
|
|
|
|
|
2632
|
|
|
|
|
|
|
=head2 get_product |
2633
|
|
|
|
|
|
|
|
2634
|
|
|
|
|
|
|
Retrieve an existing Product |
2635
|
|
|
|
|
|
|
|
2636
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/products/retrieve#retrieve_product> |
2637
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/service_products/retrieve#retrieve_service_product> |
2638
|
|
|
|
|
|
|
|
2639
|
|
|
|
|
|
|
=over |
2640
|
|
|
|
|
|
|
|
2641
|
|
|
|
|
|
|
=item * product_id - StripeProductId|Str - id of product to retrieve - required |
2642
|
|
|
|
|
|
|
|
2643
|
|
|
|
|
|
|
=back |
2644
|
|
|
|
|
|
|
|
2645
|
|
|
|
|
|
|
Returns a L<Net::Stripe::Product> |
2646
|
|
|
|
|
|
|
|
2647
|
|
|
|
|
|
|
$stripe->get_product( |
2648
|
|
|
|
|
|
|
product_id => $product_id, |
2649
|
|
|
|
|
|
|
); |
2650
|
|
|
|
|
|
|
|
2651
|
|
|
|
|
|
|
=head2 update_product |
2652
|
|
|
|
|
|
|
|
2653
|
|
|
|
|
|
|
Update an existing Product |
2654
|
|
|
|
|
|
|
|
2655
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/products/update#update_product> |
2656
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/service_products/update#update_service_product> |
2657
|
|
|
|
|
|
|
|
2658
|
|
|
|
|
|
|
=over |
2659
|
|
|
|
|
|
|
|
2660
|
|
|
|
|
|
|
=item * product_id - StripeProductId|Str - id of product to retrieve - required |
2661
|
|
|
|
|
|
|
|
2662
|
|
|
|
|
|
|
=item * active - Bool - whether the product is currently available for purchase |
2663
|
|
|
|
|
|
|
|
2664
|
|
|
|
|
|
|
=item * attributes - ArrayRef[Str] - a list of attributes that each sku can provide values for |
2665
|
|
|
|
|
|
|
|
2666
|
|
|
|
|
|
|
=item * caption - Str - a short description |
2667
|
|
|
|
|
|
|
|
2668
|
|
|
|
|
|
|
=item * deactivate_on - ArrayRef[Str] - an list of connect application identifiers that cannot purchase this product |
2669
|
|
|
|
|
|
|
|
2670
|
|
|
|
|
|
|
=item * description - Str - description |
2671
|
|
|
|
|
|
|
|
2672
|
|
|
|
|
|
|
=item * images - ArrayRef[Str] - a list of image URLs |
2673
|
|
|
|
|
|
|
|
2674
|
|
|
|
|
|
|
=item * metadata - HashRef[Str] - metadata |
2675
|
|
|
|
|
|
|
|
2676
|
|
|
|
|
|
|
=item * name - Str - name of the product |
2677
|
|
|
|
|
|
|
|
2678
|
|
|
|
|
|
|
=item * package_dimensions - HashRef - package dimensions for shipping |
2679
|
|
|
|
|
|
|
|
2680
|
|
|
|
|
|
|
=item * shippable - Bool - whether the product is a shipped good |
2681
|
|
|
|
|
|
|
|
2682
|
|
|
|
|
|
|
=item * statement_descriptor - Str - descriptor for statement |
2683
|
|
|
|
|
|
|
|
2684
|
|
|
|
|
|
|
=item * type - StripeProductType - the type of the product |
2685
|
|
|
|
|
|
|
|
2686
|
|
|
|
|
|
|
=item * unit_label - Str - label that represents units of the product |
2687
|
|
|
|
|
|
|
|
2688
|
|
|
|
|
|
|
=item * url - Str - URL of a publicly-accessible web page for the product |
2689
|
|
|
|
|
|
|
|
2690
|
|
|
|
|
|
|
=back |
2691
|
|
|
|
|
|
|
|
2692
|
|
|
|
|
|
|
Returns a L<Net::Stripe::Product> |
2693
|
|
|
|
|
|
|
|
2694
|
|
|
|
|
|
|
$stripe->update_product( |
2695
|
|
|
|
|
|
|
product_id => $product_id, |
2696
|
|
|
|
|
|
|
name => $new_name, |
2697
|
|
|
|
|
|
|
); |
2698
|
|
|
|
|
|
|
|
2699
|
|
|
|
|
|
|
=head2 list_products |
2700
|
|
|
|
|
|
|
|
2701
|
|
|
|
|
|
|
Retrieve a list of Products |
2702
|
|
|
|
|
|
|
|
2703
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/products/list#list_products> |
2704
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/service_products/list#list_service_products> |
2705
|
|
|
|
|
|
|
|
2706
|
|
|
|
|
|
|
=over |
2707
|
|
|
|
|
|
|
|
2708
|
|
|
|
|
|
|
=item * active - Bool - only return products that are active or inactive |
2709
|
|
|
|
|
|
|
|
2710
|
|
|
|
|
|
|
=item * ids - StripeProductId|Str - only return products with the given ids |
2711
|
|
|
|
|
|
|
|
2712
|
|
|
|
|
|
|
=item * shippable - Bool - only return products that can or cannot be shipped |
2713
|
|
|
|
|
|
|
|
2714
|
|
|
|
|
|
|
=item * url - Str - only return products with the given url |
2715
|
|
|
|
|
|
|
|
2716
|
|
|
|
|
|
|
=item * type - StripeProductType - only return products of this type |
2717
|
|
|
|
|
|
|
|
2718
|
|
|
|
|
|
|
=item * created - HashRef[Str] - created conditions to match |
2719
|
|
|
|
|
|
|
|
2720
|
|
|
|
|
|
|
=item * ending_before - Str - ending before condition |
2721
|
|
|
|
|
|
|
|
2722
|
|
|
|
|
|
|
=item * limit - Int - maximum number of objects to return |
2723
|
|
|
|
|
|
|
|
2724
|
|
|
|
|
|
|
=item * starting_after - Str - starting after condition |
2725
|
|
|
|
|
|
|
|
2726
|
|
|
|
|
|
|
=back |
2727
|
|
|
|
|
|
|
|
2728
|
|
|
|
|
|
|
Returns a L<Net::Stripe::List> object containing L<Net::Stripe::Product> objects. |
2729
|
|
|
|
|
|
|
|
2730
|
|
|
|
|
|
|
$stripe->list_products( |
2731
|
|
|
|
|
|
|
limit => 5, |
2732
|
|
|
|
|
|
|
); |
2733
|
|
|
|
|
|
|
|
2734
|
|
|
|
|
|
|
=head2 delete_product |
2735
|
|
|
|
|
|
|
|
2736
|
|
|
|
|
|
|
Delete an existing Product |
2737
|
|
|
|
|
|
|
|
2738
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/products/delete#delete_product> |
2739
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/service_products/delete#delete_service_product> |
2740
|
|
|
|
|
|
|
|
2741
|
|
|
|
|
|
|
=over |
2742
|
|
|
|
|
|
|
|
2743
|
|
|
|
|
|
|
=item * product_id - StripeProductId|Str - id of product to delete - required |
2744
|
|
|
|
|
|
|
|
2745
|
|
|
|
|
|
|
=back |
2746
|
|
|
|
|
|
|
|
2747
|
|
|
|
|
|
|
Returns hashref of the form |
2748
|
|
|
|
|
|
|
|
2749
|
|
|
|
|
|
|
{ |
2750
|
|
|
|
|
|
|
deleted => <bool>, |
2751
|
|
|
|
|
|
|
id => <product_id>, |
2752
|
|
|
|
|
|
|
} |
2753
|
|
|
|
|
|
|
|
2754
|
|
|
|
|
|
|
$stripe->delete_product( |
2755
|
|
|
|
|
|
|
product_id => $product_id, |
2756
|
|
|
|
|
|
|
); |
2757
|
|
|
|
|
|
|
|
2758
|
|
|
|
|
|
|
=head1 Plan Methods |
2759
|
|
|
|
|
|
|
|
2760
|
|
|
|
|
|
|
=head2 post_plan |
2761
|
|
|
|
|
|
|
|
2762
|
|
|
|
|
|
|
Create a new plan. |
2763
|
|
|
|
|
|
|
|
2764
|
|
|
|
|
|
|
L<https://stripe.com/docs/api#create_plan> |
2765
|
|
|
|
|
|
|
|
2766
|
|
|
|
|
|
|
=over |
2767
|
|
|
|
|
|
|
|
2768
|
|
|
|
|
|
|
=item * id - Str - identifier of the plan |
2769
|
|
|
|
|
|
|
|
2770
|
|
|
|
|
|
|
=item * amount - Int - cost of the plan in cents |
2771
|
|
|
|
|
|
|
|
2772
|
|
|
|
|
|
|
=item * currency - Str |
2773
|
|
|
|
|
|
|
|
2774
|
|
|
|
|
|
|
=item * interval - Str |
2775
|
|
|
|
|
|
|
|
2776
|
|
|
|
|
|
|
=item * interval_count - Int - optional |
2777
|
|
|
|
|
|
|
|
2778
|
|
|
|
|
|
|
=item * name - Str - name of the plan |
2779
|
|
|
|
|
|
|
|
2780
|
|
|
|
|
|
|
=item * trial_period_days - Int - optional |
2781
|
|
|
|
|
|
|
|
2782
|
|
|
|
|
|
|
=item * statement_descriptor - Str - optional |
2783
|
|
|
|
|
|
|
|
2784
|
|
|
|
|
|
|
=item * metadata - HashRef - optional |
2785
|
|
|
|
|
|
|
|
2786
|
|
|
|
|
|
|
=back |
2787
|
|
|
|
|
|
|
|
2788
|
|
|
|
|
|
|
Returns a L<Net::Stripe::Plan> object. |
2789
|
|
|
|
|
|
|
|
2790
|
|
|
|
|
|
|
$stripe->post_plan( |
2791
|
|
|
|
|
|
|
id => "free-$future_ymdhms", |
2792
|
|
|
|
|
|
|
amount => 0, |
2793
|
|
|
|
|
|
|
currency => 'usd', |
2794
|
|
|
|
|
|
|
interval => 'year', |
2795
|
|
|
|
|
|
|
name => "Freeplan $future_ymdhms", |
2796
|
|
|
|
|
|
|
); |
2797
|
|
|
|
|
|
|
|
2798
|
|
|
|
|
|
|
=head2 get_plan |
2799
|
|
|
|
|
|
|
|
2800
|
|
|
|
|
|
|
Retrieves a plan. |
2801
|
|
|
|
|
|
|
|
2802
|
|
|
|
|
|
|
=over |
2803
|
|
|
|
|
|
|
|
2804
|
|
|
|
|
|
|
=item * plan_id - Str |
2805
|
|
|
|
|
|
|
|
2806
|
|
|
|
|
|
|
=back |
2807
|
|
|
|
|
|
|
|
2808
|
|
|
|
|
|
|
Returns a L<Net::Stripe::Plan>. |
2809
|
|
|
|
|
|
|
|
2810
|
|
|
|
|
|
|
$stripe->get_plan(plan_id => 'plan123'); |
2811
|
|
|
|
|
|
|
|
2812
|
|
|
|
|
|
|
=head2 delete_plan |
2813
|
|
|
|
|
|
|
|
2814
|
|
|
|
|
|
|
Delete a plan. |
2815
|
|
|
|
|
|
|
|
2816
|
|
|
|
|
|
|
L<https://stripe.com/docs/api#delete_plan> |
2817
|
|
|
|
|
|
|
|
2818
|
|
|
|
|
|
|
=over |
2819
|
|
|
|
|
|
|
|
2820
|
|
|
|
|
|
|
=item * plan_id - L<Net::Stripe::Plan> or Str |
2821
|
|
|
|
|
|
|
|
2822
|
|
|
|
|
|
|
=back |
2823
|
|
|
|
|
|
|
|
2824
|
|
|
|
|
|
|
Returns a L<Net::Stripe::Plan> object. |
2825
|
|
|
|
|
|
|
|
2826
|
|
|
|
|
|
|
$stripe->delete_plan(plan_id => $plan); |
2827
|
|
|
|
|
|
|
|
2828
|
|
|
|
|
|
|
=head2 get_plans |
2829
|
|
|
|
|
|
|
|
2830
|
|
|
|
|
|
|
Return a list of plans. |
2831
|
|
|
|
|
|
|
|
2832
|
|
|
|
|
|
|
L<https://stripe.com/docs/api#list_plans> |
2833
|
|
|
|
|
|
|
|
2834
|
|
|
|
|
|
|
=over |
2835
|
|
|
|
|
|
|
|
2836
|
|
|
|
|
|
|
=item * product - StripeProductId|Str - only return plans for the given product |
2837
|
|
|
|
|
|
|
|
2838
|
|
|
|
|
|
|
=item * ending_before - Str, optional |
2839
|
|
|
|
|
|
|
|
2840
|
|
|
|
|
|
|
=item * limit - Int, optional |
2841
|
|
|
|
|
|
|
|
2842
|
|
|
|
|
|
|
=item * starting_after - Str, optional |
2843
|
|
|
|
|
|
|
|
2844
|
|
|
|
|
|
|
=back |
2845
|
|
|
|
|
|
|
|
2846
|
|
|
|
|
|
|
Returns a L<Net::Stripe::List> object containing L<Net::Stripe::Plan> objects. |
2847
|
|
|
|
|
|
|
|
2848
|
|
|
|
|
|
|
$stripe->get_plans(limit => 10); |
2849
|
|
|
|
|
|
|
|
2850
|
|
|
|
|
|
|
=head1 Coupon Methods |
2851
|
|
|
|
|
|
|
|
2852
|
|
|
|
|
|
|
=head2 post_coupon |
2853
|
|
|
|
|
|
|
|
2854
|
|
|
|
|
|
|
Create or update a coupon. |
2855
|
|
|
|
|
|
|
|
2856
|
|
|
|
|
|
|
L<https://stripe.com/docs/api#create_coupon> |
2857
|
|
|
|
|
|
|
|
2858
|
|
|
|
|
|
|
=over |
2859
|
|
|
|
|
|
|
|
2860
|
|
|
|
|
|
|
=item * id - Str, optional |
2861
|
|
|
|
|
|
|
|
2862
|
|
|
|
|
|
|
=item * duration - Str |
2863
|
|
|
|
|
|
|
|
2864
|
|
|
|
|
|
|
=item * amount_offset - Int, optional |
2865
|
|
|
|
|
|
|
|
2866
|
|
|
|
|
|
|
=item * currency - Str, optional |
2867
|
|
|
|
|
|
|
|
2868
|
|
|
|
|
|
|
=item * duration_in_months - Int, optional |
2869
|
|
|
|
|
|
|
|
2870
|
|
|
|
|
|
|
=item * max_redemptions - Int, optional |
2871
|
|
|
|
|
|
|
|
2872
|
|
|
|
|
|
|
=item * metadata - HashRef, optional |
2873
|
|
|
|
|
|
|
|
2874
|
|
|
|
|
|
|
=item * percent_off - Int, optional |
2875
|
|
|
|
|
|
|
|
2876
|
|
|
|
|
|
|
=item * redeem_by - Int, optional |
2877
|
|
|
|
|
|
|
|
2878
|
|
|
|
|
|
|
=back |
2879
|
|
|
|
|
|
|
|
2880
|
|
|
|
|
|
|
Returns a L<Net::Stripe::Coupon> object. |
2881
|
|
|
|
|
|
|
|
2882
|
|
|
|
|
|
|
$stripe->post_coupon( |
2883
|
|
|
|
|
|
|
id => $coupon_id, |
2884
|
|
|
|
|
|
|
percent_off => 100, |
2885
|
|
|
|
|
|
|
duration => 'once', |
2886
|
|
|
|
|
|
|
max_redemptions => 1, |
2887
|
|
|
|
|
|
|
redeem_by => time() + 100, |
2888
|
|
|
|
|
|
|
); |
2889
|
|
|
|
|
|
|
|
2890
|
|
|
|
|
|
|
=head2 get_coupon |
2891
|
|
|
|
|
|
|
|
2892
|
|
|
|
|
|
|
Retrieve a coupon. |
2893
|
|
|
|
|
|
|
|
2894
|
|
|
|
|
|
|
L<https://stripe.com/docs/api#retrieve_coupon> |
2895
|
|
|
|
|
|
|
|
2896
|
|
|
|
|
|
|
=over |
2897
|
|
|
|
|
|
|
|
2898
|
|
|
|
|
|
|
=item * coupon_id - Str |
2899
|
|
|
|
|
|
|
|
2900
|
|
|
|
|
|
|
=back |
2901
|
|
|
|
|
|
|
|
2902
|
|
|
|
|
|
|
Returns a L<Net::Stripe::Coupon> object. |
2903
|
|
|
|
|
|
|
|
2904
|
|
|
|
|
|
|
$stripe->get_coupon(coupon_id => 'id'); |
2905
|
|
|
|
|
|
|
|
2906
|
|
|
|
|
|
|
=head2 delete_coupon |
2907
|
|
|
|
|
|
|
|
2908
|
|
|
|
|
|
|
Delete a coupon. |
2909
|
|
|
|
|
|
|
|
2910
|
|
|
|
|
|
|
L<https://stripe.com/docs/api#delete_coupon> |
2911
|
|
|
|
|
|
|
|
2912
|
|
|
|
|
|
|
=over |
2913
|
|
|
|
|
|
|
|
2914
|
|
|
|
|
|
|
=item * coupon_id - Str |
2915
|
|
|
|
|
|
|
|
2916
|
|
|
|
|
|
|
=back |
2917
|
|
|
|
|
|
|
|
2918
|
|
|
|
|
|
|
Returns a L<Net::Stripe::Coupon>. |
2919
|
|
|
|
|
|
|
|
2920
|
|
|
|
|
|
|
$stripe->delete_coupon(coupon_id => 'coupon123'); |
2921
|
|
|
|
|
|
|
|
2922
|
|
|
|
|
|
|
=head2 get_coupons |
2923
|
|
|
|
|
|
|
|
2924
|
|
|
|
|
|
|
=over |
2925
|
|
|
|
|
|
|
|
2926
|
|
|
|
|
|
|
=item * ending_before - Str, optional |
2927
|
|
|
|
|
|
|
|
2928
|
|
|
|
|
|
|
=item * limit - Int, optional |
2929
|
|
|
|
|
|
|
|
2930
|
|
|
|
|
|
|
=item * starting_after - Str, optional |
2931
|
|
|
|
|
|
|
|
2932
|
|
|
|
|
|
|
=back |
2933
|
|
|
|
|
|
|
|
2934
|
|
|
|
|
|
|
Returns a L<Net::Stripe::List> object containing L<Net::Stripe::Coupon> objects. |
2935
|
|
|
|
|
|
|
|
2936
|
|
|
|
|
|
|
$stripe->get_coupons(limit => 15); |
2937
|
|
|
|
|
|
|
|
2938
|
|
|
|
|
|
|
=head1 Invoice Methods |
2939
|
|
|
|
|
|
|
|
2940
|
|
|
|
|
|
|
=head2 post_invoice |
2941
|
|
|
|
|
|
|
|
2942
|
|
|
|
|
|
|
Update an invoice. |
2943
|
|
|
|
|
|
|
|
2944
|
|
|
|
|
|
|
=over |
2945
|
|
|
|
|
|
|
|
2946
|
|
|
|
|
|
|
=item * invoice - L<Net::Stripe::Invoice>, Str |
2947
|
|
|
|
|
|
|
|
2948
|
|
|
|
|
|
|
=item * application_fee - Int - optional |
2949
|
|
|
|
|
|
|
|
2950
|
|
|
|
|
|
|
=item * closed - Bool - optional |
2951
|
|
|
|
|
|
|
|
2952
|
|
|
|
|
|
|
=item * description - Str - optional |
2953
|
|
|
|
|
|
|
|
2954
|
|
|
|
|
|
|
=item * metadata - HashRef - optional |
2955
|
|
|
|
|
|
|
|
2956
|
|
|
|
|
|
|
=back |
2957
|
|
|
|
|
|
|
|
2958
|
|
|
|
|
|
|
Returns a L<Net::Stripe::Invoice>. |
2959
|
|
|
|
|
|
|
|
2960
|
|
|
|
|
|
|
$stripe->post_invoice(invoice => $invoice, closed => 1) |
2961
|
|
|
|
|
|
|
|
2962
|
|
|
|
|
|
|
=head2 get_invoice |
2963
|
|
|
|
|
|
|
|
2964
|
|
|
|
|
|
|
=over |
2965
|
|
|
|
|
|
|
|
2966
|
|
|
|
|
|
|
=item * invoice_id - Str |
2967
|
|
|
|
|
|
|
|
2968
|
|
|
|
|
|
|
=back |
2969
|
|
|
|
|
|
|
|
2970
|
|
|
|
|
|
|
Returns a L<Net::Stripe::Invoice>. |
2971
|
|
|
|
|
|
|
|
2972
|
|
|
|
|
|
|
$stripe->get_invoice(invoice_id => 'testinvoice'); |
2973
|
|
|
|
|
|
|
|
2974
|
|
|
|
|
|
|
=head2 pay_invoice |
2975
|
|
|
|
|
|
|
|
2976
|
|
|
|
|
|
|
=over |
2977
|
|
|
|
|
|
|
|
2978
|
|
|
|
|
|
|
=item * invoice_id - Str |
2979
|
|
|
|
|
|
|
|
2980
|
|
|
|
|
|
|
=back |
2981
|
|
|
|
|
|
|
|
2982
|
|
|
|
|
|
|
Returns a L<Net::Stripe::Invoice>. |
2983
|
|
|
|
|
|
|
|
2984
|
|
|
|
|
|
|
$stripe->pay_invoice(invoice_id => 'testinvoice'); |
2985
|
|
|
|
|
|
|
|
2986
|
|
|
|
|
|
|
=head2 get_invoices |
2987
|
|
|
|
|
|
|
|
2988
|
|
|
|
|
|
|
Returns a list of invoices. |
2989
|
|
|
|
|
|
|
|
2990
|
|
|
|
|
|
|
L<https://stripe.com/docs/api#list_customer_invoices> |
2991
|
|
|
|
|
|
|
|
2992
|
|
|
|
|
|
|
=over |
2993
|
|
|
|
|
|
|
|
2994
|
|
|
|
|
|
|
=item * customer - L<Net::Stripe::Customer> or Str, optional |
2995
|
|
|
|
|
|
|
|
2996
|
|
|
|
|
|
|
=item * date - Int or HashRef, optional |
2997
|
|
|
|
|
|
|
|
2998
|
|
|
|
|
|
|
=item * ending_before - Str, optional |
2999
|
|
|
|
|
|
|
|
3000
|
|
|
|
|
|
|
=item * limit - Int, optional |
3001
|
|
|
|
|
|
|
|
3002
|
|
|
|
|
|
|
=item * starting_after - Str, optional |
3003
|
|
|
|
|
|
|
|
3004
|
|
|
|
|
|
|
=back |
3005
|
|
|
|
|
|
|
|
3006
|
|
|
|
|
|
|
Returns a L<Net::Stripe::List> object containing L<Net::Stripe::Invoice> objects. |
3007
|
|
|
|
|
|
|
|
3008
|
|
|
|
|
|
|
$stripe->get_invoices(limit => 10); |
3009
|
|
|
|
|
|
|
|
3010
|
|
|
|
|
|
|
=head2 create_invoice |
3011
|
|
|
|
|
|
|
|
3012
|
|
|
|
|
|
|
Create a new invoice. |
3013
|
|
|
|
|
|
|
|
3014
|
|
|
|
|
|
|
L<https://stripe.com/docs/api#create_invoice> |
3015
|
|
|
|
|
|
|
|
3016
|
|
|
|
|
|
|
=over |
3017
|
|
|
|
|
|
|
|
3018
|
|
|
|
|
|
|
=item * customer - L<Net::Stripe::Customer>, Str |
3019
|
|
|
|
|
|
|
|
3020
|
|
|
|
|
|
|
=item * application_fee - Int - optional |
3021
|
|
|
|
|
|
|
|
3022
|
|
|
|
|
|
|
=item * description - Str - optional |
3023
|
|
|
|
|
|
|
|
3024
|
|
|
|
|
|
|
=item * metadata - HashRef - optional |
3025
|
|
|
|
|
|
|
|
3026
|
|
|
|
|
|
|
=item * subscription - L<Net::Stripe::Subscription> or Str, optional |
3027
|
|
|
|
|
|
|
|
3028
|
|
|
|
|
|
|
=back |
3029
|
|
|
|
|
|
|
|
3030
|
|
|
|
|
|
|
Returns a L<Net::Stripe::Invoice>. |
3031
|
|
|
|
|
|
|
|
3032
|
|
|
|
|
|
|
$stripe->create_invoice(customer => 'custid', description => 'test'); |
3033
|
|
|
|
|
|
|
|
3034
|
|
|
|
|
|
|
=head2 get_invoice |
3035
|
|
|
|
|
|
|
|
3036
|
|
|
|
|
|
|
=over |
3037
|
|
|
|
|
|
|
|
3038
|
|
|
|
|
|
|
=item * invoice_id - Str |
3039
|
|
|
|
|
|
|
|
3040
|
|
|
|
|
|
|
=back |
3041
|
|
|
|
|
|
|
|
3042
|
|
|
|
|
|
|
Returns a L<Net::Stripe::Invoice>. |
3043
|
|
|
|
|
|
|
|
3044
|
|
|
|
|
|
|
$stripe->get_invoice(invoice_id => 'test'); |
3045
|
|
|
|
|
|
|
|
3046
|
|
|
|
|
|
|
=head2 get_upcominginvoice |
3047
|
|
|
|
|
|
|
|
3048
|
|
|
|
|
|
|
=over |
3049
|
|
|
|
|
|
|
|
3050
|
|
|
|
|
|
|
=item * customer, L<Net::Stripe::Customer> or Str |
3051
|
|
|
|
|
|
|
|
3052
|
|
|
|
|
|
|
=back |
3053
|
|
|
|
|
|
|
|
3054
|
|
|
|
|
|
|
Returns a L<Net::Stripe::Invoice>. |
3055
|
|
|
|
|
|
|
|
3056
|
|
|
|
|
|
|
$stripe->get_upcominginvoice(customer => $customer); |
3057
|
|
|
|
|
|
|
|
3058
|
|
|
|
|
|
|
=head1 Invoice Item Methods |
3059
|
|
|
|
|
|
|
|
3060
|
|
|
|
|
|
|
=head2 create_invoiceitem |
3061
|
|
|
|
|
|
|
|
3062
|
|
|
|
|
|
|
Create an invoice item. |
3063
|
|
|
|
|
|
|
|
3064
|
|
|
|
|
|
|
L<https://stripe.com/docs/api#create_invoiceitem> |
3065
|
|
|
|
|
|
|
|
3066
|
|
|
|
|
|
|
=over |
3067
|
|
|
|
|
|
|
|
3068
|
|
|
|
|
|
|
=item * customer - L<Net::Stripe::Customer> or Str |
3069
|
|
|
|
|
|
|
|
3070
|
|
|
|
|
|
|
=item * amount - Int |
3071
|
|
|
|
|
|
|
|
3072
|
|
|
|
|
|
|
=item * currency - Str |
3073
|
|
|
|
|
|
|
|
3074
|
|
|
|
|
|
|
=item * invoice - L<Net::Stripe::Invoice> or Str, optional |
3075
|
|
|
|
|
|
|
|
3076
|
|
|
|
|
|
|
=item * subscription - L<Net::Stripe::Subscription> or Str, optional |
3077
|
|
|
|
|
|
|
|
3078
|
|
|
|
|
|
|
=item * description - Str, optional |
3079
|
|
|
|
|
|
|
|
3080
|
|
|
|
|
|
|
=item * metadata - HashRef, optional |
3081
|
|
|
|
|
|
|
|
3082
|
|
|
|
|
|
|
=back |
3083
|
|
|
|
|
|
|
|
3084
|
|
|
|
|
|
|
Returns a L<Net::Stripe::Invoiceitem> object. |
3085
|
|
|
|
|
|
|
|
3086
|
|
|
|
|
|
|
$stripe->create_invoiceitem(customer => 'test', amount => 500, currency => 'USD'); |
3087
|
|
|
|
|
|
|
|
3088
|
|
|
|
|
|
|
=head2 post_invoiceitem |
3089
|
|
|
|
|
|
|
|
3090
|
|
|
|
|
|
|
Update an invoice item. |
3091
|
|
|
|
|
|
|
|
3092
|
|
|
|
|
|
|
L<https://stripe.com/docs/api#create_invoiceitem> |
3093
|
|
|
|
|
|
|
|
3094
|
|
|
|
|
|
|
=over |
3095
|
|
|
|
|
|
|
|
3096
|
|
|
|
|
|
|
=item * invoice_item - L<Net::Stripe::Invoiceitem> or Str |
3097
|
|
|
|
|
|
|
|
3098
|
|
|
|
|
|
|
=item * amount - Int, optional |
3099
|
|
|
|
|
|
|
|
3100
|
|
|
|
|
|
|
=item * description - Str, optional |
3101
|
|
|
|
|
|
|
|
3102
|
|
|
|
|
|
|
=item * metadata - HashRef, optional |
3103
|
|
|
|
|
|
|
|
3104
|
|
|
|
|
|
|
=back |
3105
|
|
|
|
|
|
|
|
3106
|
|
|
|
|
|
|
Returns a L<Net::Stripe::Invoiceitem>. |
3107
|
|
|
|
|
|
|
|
3108
|
|
|
|
|
|
|
$stripe->post_invoiceitem(invoice_item => 'itemid', amount => 750); |
3109
|
|
|
|
|
|
|
|
3110
|
|
|
|
|
|
|
=head2 get_invoiceitem |
3111
|
|
|
|
|
|
|
|
3112
|
|
|
|
|
|
|
Retrieve an invoice item. |
3113
|
|
|
|
|
|
|
|
3114
|
|
|
|
|
|
|
=over |
3115
|
|
|
|
|
|
|
|
3116
|
|
|
|
|
|
|
=item * invoice_item - Str |
3117
|
|
|
|
|
|
|
|
3118
|
|
|
|
|
|
|
=back |
3119
|
|
|
|
|
|
|
|
3120
|
|
|
|
|
|
|
Returns a L<Net::Stripe::Invoiceitem>. |
3121
|
|
|
|
|
|
|
|
3122
|
|
|
|
|
|
|
$stripe->get_invoiceitem(invoice_item => 'testitemid'); |
3123
|
|
|
|
|
|
|
|
3124
|
|
|
|
|
|
|
=head2 delete_invoiceitem |
3125
|
|
|
|
|
|
|
|
3126
|
|
|
|
|
|
|
Delete an invoice item. |
3127
|
|
|
|
|
|
|
|
3128
|
|
|
|
|
|
|
=over |
3129
|
|
|
|
|
|
|
|
3130
|
|
|
|
|
|
|
=item * invoice_item - L<Net::Stripe::Invoiceitem> or Str |
3131
|
|
|
|
|
|
|
|
3132
|
|
|
|
|
|
|
=back |
3133
|
|
|
|
|
|
|
|
3134
|
|
|
|
|
|
|
Returns a L<Net::Stripe::Invoiceitem>. |
3135
|
|
|
|
|
|
|
|
3136
|
|
|
|
|
|
|
$stripe->delete_invoiceitem(invoice_item => $invoice_item); |
3137
|
|
|
|
|
|
|
|
3138
|
|
|
|
|
|
|
=head2 get_invoiceitems |
3139
|
|
|
|
|
|
|
|
3140
|
|
|
|
|
|
|
=over |
3141
|
|
|
|
|
|
|
|
3142
|
|
|
|
|
|
|
=item * customer - L<Net::Stripe::Customer> or Str, optional |
3143
|
|
|
|
|
|
|
|
3144
|
|
|
|
|
|
|
=item * date - Int or HashRef, optional |
3145
|
|
|
|
|
|
|
|
3146
|
|
|
|
|
|
|
=item * ending_before - Str, optional |
3147
|
|
|
|
|
|
|
|
3148
|
|
|
|
|
|
|
=item * limit - Int, optional |
3149
|
|
|
|
|
|
|
|
3150
|
|
|
|
|
|
|
=item * starting_after - Str, optional |
3151
|
|
|
|
|
|
|
|
3152
|
|
|
|
|
|
|
=back |
3153
|
|
|
|
|
|
|
|
3154
|
|
|
|
|
|
|
Returns a L<Net::Stripe::List> object containing L<Net::Stripe::Invoiceitem> objects. |
3155
|
|
|
|
|
|
|
|
3156
|
|
|
|
|
|
|
$stripe->get_invoiceitems(customer => 'test', limit => 30); |
3157
|
|
|
|
|
|
|
|
3158
|
|
|
|
|
|
|
=head1 Discount Methods |
3159
|
|
|
|
|
|
|
|
3160
|
|
|
|
|
|
|
=head2 delete_customer_discount |
3161
|
|
|
|
|
|
|
|
3162
|
|
|
|
|
|
|
Deletes a customer-wide discount. |
3163
|
|
|
|
|
|
|
|
3164
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/curl#delete_discount> |
3165
|
|
|
|
|
|
|
|
3166
|
|
|
|
|
|
|
=over |
3167
|
|
|
|
|
|
|
|
3168
|
|
|
|
|
|
|
=item * customer - L<Net::Stripe::Customer> or Str - the customer with a discount to delete |
3169
|
|
|
|
|
|
|
|
3170
|
|
|
|
|
|
|
=back |
3171
|
|
|
|
|
|
|
|
3172
|
|
|
|
|
|
|
$stripe->delete_customer_discount(customer => $customer); |
3173
|
|
|
|
|
|
|
|
3174
|
|
|
|
|
|
|
Returns hashref of the form |
3175
|
|
|
|
|
|
|
|
3176
|
|
|
|
|
|
|
{ |
3177
|
|
|
|
|
|
|
deleted => <bool> |
3178
|
|
|
|
|
|
|
} |
3179
|
|
|
|
|
|
|
|
3180
|
|
|
|
|
|
|
=head1 Payment Method Methods |
3181
|
|
|
|
|
|
|
|
3182
|
|
|
|
|
|
|
=head2 create_payment_method |
3183
|
|
|
|
|
|
|
|
3184
|
|
|
|
|
|
|
Create a PaymentMethod |
3185
|
|
|
|
|
|
|
|
3186
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/payment_methods/create#create_payment_method> |
3187
|
|
|
|
|
|
|
|
3188
|
|
|
|
|
|
|
=over |
3189
|
|
|
|
|
|
|
|
3190
|
|
|
|
|
|
|
=item * type - StripePaymentMethodType - type of PaymentMethod - required |
3191
|
|
|
|
|
|
|
|
3192
|
|
|
|
|
|
|
=item * card - StripeTokenId - Token id for card associated with the PaymentMethod |
3193
|
|
|
|
|
|
|
|
3194
|
|
|
|
|
|
|
=item * billing_details - HashRef - billing information associated with the PaymentMethod |
3195
|
|
|
|
|
|
|
|
3196
|
|
|
|
|
|
|
=item * fpx - HashRef - details about the FPX payment method |
3197
|
|
|
|
|
|
|
|
3198
|
|
|
|
|
|
|
=item * ideal - HashRef - details about the iDEAL payment method |
3199
|
|
|
|
|
|
|
|
3200
|
|
|
|
|
|
|
=item * metadata - HashRef[Str] - metadata |
3201
|
|
|
|
|
|
|
|
3202
|
|
|
|
|
|
|
=item * sepa_debit - HashRef - details about the SEPA debit bank account |
3203
|
|
|
|
|
|
|
|
3204
|
|
|
|
|
|
|
=back |
3205
|
|
|
|
|
|
|
|
3206
|
|
|
|
|
|
|
Returns a L<Net::Stripe::PaymentMethod>. |
3207
|
|
|
|
|
|
|
|
3208
|
|
|
|
|
|
|
$stripe->create_payment_method( |
3209
|
|
|
|
|
|
|
type => 'card', |
3210
|
|
|
|
|
|
|
card => $token_id, |
3211
|
|
|
|
|
|
|
); |
3212
|
|
|
|
|
|
|
|
3213
|
|
|
|
|
|
|
=head2 get_payment_method |
3214
|
|
|
|
|
|
|
|
3215
|
|
|
|
|
|
|
Retrieve an existing PaymentMethod |
3216
|
|
|
|
|
|
|
|
3217
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/payment_methods/retrieve#retrieve_payment_method> |
3218
|
|
|
|
|
|
|
|
3219
|
|
|
|
|
|
|
=over |
3220
|
|
|
|
|
|
|
|
3221
|
|
|
|
|
|
|
=item * payment_method_id - StripePaymentMethodId - id of PaymentMethod to retrieve - required |
3222
|
|
|
|
|
|
|
|
3223
|
|
|
|
|
|
|
=back |
3224
|
|
|
|
|
|
|
|
3225
|
|
|
|
|
|
|
Returns a L<Net::Stripe::PaymentMethod> |
3226
|
|
|
|
|
|
|
|
3227
|
|
|
|
|
|
|
$stripe->get_payment_method( |
3228
|
|
|
|
|
|
|
payment_method_id => $payment_method_id, |
3229
|
|
|
|
|
|
|
); |
3230
|
|
|
|
|
|
|
|
3231
|
|
|
|
|
|
|
=head2 update_payment_method |
3232
|
|
|
|
|
|
|
|
3233
|
|
|
|
|
|
|
Update a PaymentMethod |
3234
|
|
|
|
|
|
|
|
3235
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/payment_methods/update#update_payment_method> |
3236
|
|
|
|
|
|
|
|
3237
|
|
|
|
|
|
|
=over |
3238
|
|
|
|
|
|
|
|
3239
|
|
|
|
|
|
|
=item * payment_method_id - StripePaymentMethodId - id of PaymentMethod to update - required |
3240
|
|
|
|
|
|
|
|
3241
|
|
|
|
|
|
|
=item * billing_details - HashRef - billing information associated with the PaymentMethod |
3242
|
|
|
|
|
|
|
|
3243
|
|
|
|
|
|
|
=item * card - HashRef[Int] - card details to update |
3244
|
|
|
|
|
|
|
|
3245
|
|
|
|
|
|
|
=item * metadata - HashRef[Str] - metadata |
3246
|
|
|
|
|
|
|
|
3247
|
|
|
|
|
|
|
=item * sepa_debit - HashRef - details about the SEPA debit bank account |
3248
|
|
|
|
|
|
|
|
3249
|
|
|
|
|
|
|
=back |
3250
|
|
|
|
|
|
|
|
3251
|
|
|
|
|
|
|
Returns a L<Net::Stripe::PaymentMethod> |
3252
|
|
|
|
|
|
|
|
3253
|
|
|
|
|
|
|
$stripe->update_payment_method( |
3254
|
|
|
|
|
|
|
payment_method_id => $payment_method_id, |
3255
|
|
|
|
|
|
|
metadata => $metadata, |
3256
|
|
|
|
|
|
|
); |
3257
|
|
|
|
|
|
|
|
3258
|
|
|
|
|
|
|
=head2 list_payment_methods |
3259
|
|
|
|
|
|
|
|
3260
|
|
|
|
|
|
|
Retrieve a list of PaymentMethods |
3261
|
|
|
|
|
|
|
|
3262
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/payment_methods/list#list_payment_methods> |
3263
|
|
|
|
|
|
|
|
3264
|
|
|
|
|
|
|
=over |
3265
|
|
|
|
|
|
|
|
3266
|
|
|
|
|
|
|
=item * customer - StripeCustomerId - return only PaymentMethods for the specified Customer id - required |
3267
|
|
|
|
|
|
|
|
3268
|
|
|
|
|
|
|
=item * type - Str - filter by type - required |
3269
|
|
|
|
|
|
|
|
3270
|
|
|
|
|
|
|
=item * ending_before - Str - ending before condition |
3271
|
|
|
|
|
|
|
|
3272
|
|
|
|
|
|
|
=item * limit - Int - maximum number of objects to return |
3273
|
|
|
|
|
|
|
|
3274
|
|
|
|
|
|
|
=item * starting_after - Str - starting after condition |
3275
|
|
|
|
|
|
|
|
3276
|
|
|
|
|
|
|
=back |
3277
|
|
|
|
|
|
|
|
3278
|
|
|
|
|
|
|
Returns a L<Net::Stripe::List> object containing L<Net::Stripe::PaymentMethod> objects |
3279
|
|
|
|
|
|
|
|
3280
|
|
|
|
|
|
|
$stripe->list_payment_methods( |
3281
|
|
|
|
|
|
|
customer => $customer_id, |
3282
|
|
|
|
|
|
|
type => 'card', |
3283
|
|
|
|
|
|
|
limit => 10, |
3284
|
|
|
|
|
|
|
); |
3285
|
|
|
|
|
|
|
|
3286
|
|
|
|
|
|
|
=head2 attach_payment_method |
3287
|
|
|
|
|
|
|
|
3288
|
|
|
|
|
|
|
Attach a PaymentMethod to a Customer |
3289
|
|
|
|
|
|
|
|
3290
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/payment_methods/attach#customer_attach_payment_method> |
3291
|
|
|
|
|
|
|
|
3292
|
|
|
|
|
|
|
=over |
3293
|
|
|
|
|
|
|
|
3294
|
|
|
|
|
|
|
=item * payment_method_id - StripePaymentMethodId - id of PaymentMethod to attach - required |
3295
|
|
|
|
|
|
|
|
3296
|
|
|
|
|
|
|
=item * customer - StripeCustomerId - id of Customer to which to attach the PaymentMethod - required |
3297
|
|
|
|
|
|
|
|
3298
|
|
|
|
|
|
|
=back |
3299
|
|
|
|
|
|
|
|
3300
|
|
|
|
|
|
|
Returns a L<Net::Stripe::PaymentMethod> |
3301
|
|
|
|
|
|
|
|
3302
|
|
|
|
|
|
|
$stripe->attach_payment_method( |
3303
|
|
|
|
|
|
|
payment_method_id => $payment_method_id, |
3304
|
|
|
|
|
|
|
customer => $customer, |
3305
|
|
|
|
|
|
|
); |
3306
|
|
|
|
|
|
|
|
3307
|
|
|
|
|
|
|
=head2 detach_payment_method |
3308
|
|
|
|
|
|
|
|
3309
|
|
|
|
|
|
|
Detach a PaymentMethod from a Customer |
3310
|
|
|
|
|
|
|
|
3311
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/payment_methods/detach#customer_detach_payment_method> |
3312
|
|
|
|
|
|
|
|
3313
|
|
|
|
|
|
|
=over |
3314
|
|
|
|
|
|
|
|
3315
|
|
|
|
|
|
|
=item * payment_method_id - StripePaymentMethodId - id of PaymentMethod to detach - required |
3316
|
|
|
|
|
|
|
|
3317
|
|
|
|
|
|
|
=back |
3318
|
|
|
|
|
|
|
|
3319
|
|
|
|
|
|
|
Returns a L<Net::Stripe::PaymentMethod>. |
3320
|
|
|
|
|
|
|
|
3321
|
|
|
|
|
|
|
$stripe->detach_payment_method( |
3322
|
|
|
|
|
|
|
payment_method_id => $payment_method_id, |
3323
|
|
|
|
|
|
|
); |
3324
|
|
|
|
|
|
|
|
3325
|
|
|
|
|
|
|
=head1 Payment Intent Methods |
3326
|
|
|
|
|
|
|
|
3327
|
|
|
|
|
|
|
=head2 create_payment_intent |
3328
|
|
|
|
|
|
|
|
3329
|
|
|
|
|
|
|
Create a PaymentIntent object |
3330
|
|
|
|
|
|
|
|
3331
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/payment_intents/create#create_payment_intent> |
3332
|
|
|
|
|
|
|
|
3333
|
|
|
|
|
|
|
=over |
3334
|
|
|
|
|
|
|
|
3335
|
|
|
|
|
|
|
=item * amount - Int - amount intended to be collected by this PaymentIntent - required |
3336
|
|
|
|
|
|
|
|
3337
|
|
|
|
|
|
|
=item * currency - Str - currency - required |
3338
|
|
|
|
|
|
|
|
3339
|
|
|
|
|
|
|
=item * application_fee_amount - Int - the amount of the application fee |
3340
|
|
|
|
|
|
|
|
3341
|
|
|
|
|
|
|
=item * capture_method - StripeCaptureMethod - capture method |
3342
|
|
|
|
|
|
|
|
3343
|
|
|
|
|
|
|
=item * confirm - Bool - attempt to confirm this PaymentIntent immediately |
3344
|
|
|
|
|
|
|
|
3345
|
|
|
|
|
|
|
=item * confirmation_method - StripeConfirmationMethod - confirmation method |
3346
|
|
|
|
|
|
|
|
3347
|
|
|
|
|
|
|
=item * customer - StripeCustomerId - id of Customer this PaymentIntent belongs to |
3348
|
|
|
|
|
|
|
|
3349
|
|
|
|
|
|
|
=item * description - Str - description |
3350
|
|
|
|
|
|
|
|
3351
|
|
|
|
|
|
|
=item * error_on_requires_action - Bool - fail the payment attempt if the PaymentIntent transitions into `requires_action` |
3352
|
|
|
|
|
|
|
|
3353
|
|
|
|
|
|
|
=item * mandate - Str - id of the mandate to be used for this payment |
3354
|
|
|
|
|
|
|
|
3355
|
|
|
|
|
|
|
=item * mandate_data - HashRef - details about the Mandate to create |
3356
|
|
|
|
|
|
|
|
3357
|
|
|
|
|
|
|
=item * metadata - HashRef[Str] - metadata |
3358
|
|
|
|
|
|
|
|
3359
|
|
|
|
|
|
|
=item * off_session - Bool - indicate that the customer is not in your checkout flow |
3360
|
|
|
|
|
|
|
|
3361
|
|
|
|
|
|
|
=item * on_behalf_of - Str - Stripe account ID for which these funds are intended |
3362
|
|
|
|
|
|
|
|
3363
|
|
|
|
|
|
|
=item * payment_method - StripePaymentMethodId - id of PaymentMethod to attach to this PaymentIntent |
3364
|
|
|
|
|
|
|
|
3365
|
|
|
|
|
|
|
=item * payment_method_options - HashRef - PaymentMethod-specific configuration for this PaymentIntent |
3366
|
|
|
|
|
|
|
|
3367
|
|
|
|
|
|
|
=item * payment_method_types - ArrayRef[StripePaymentMethodType] - list of PaymentMethod types that this PaymentIntent is allowed to use |
3368
|
|
|
|
|
|
|
|
3369
|
|
|
|
|
|
|
=item * receipt_email - Str - email address to send the receipt to |
3370
|
|
|
|
|
|
|
|
3371
|
|
|
|
|
|
|
=item * return_url - Str - URL to redirect your customer back to |
3372
|
|
|
|
|
|
|
|
3373
|
|
|
|
|
|
|
=item * save_payment_method - Bool - save the payment method to the customer |
3374
|
|
|
|
|
|
|
|
3375
|
|
|
|
|
|
|
=item * setup_future_usage - Str - allow future payments with this PaymentIntent's PaymentMethod |
3376
|
|
|
|
|
|
|
|
3377
|
|
|
|
|
|
|
=item * shipping - HashRef - shipping information for this PaymentIntent |
3378
|
|
|
|
|
|
|
|
3379
|
|
|
|
|
|
|
=item * statement_descriptor - Str - descriptor for statement |
3380
|
|
|
|
|
|
|
|
3381
|
|
|
|
|
|
|
=item * statement_descriptor_suffix - Str - suffix to be concatenated with the statement descriptor |
3382
|
|
|
|
|
|
|
|
3383
|
|
|
|
|
|
|
=item * transfer_data - HashRef - parameters used to automatically create a Transfer when the payment succeeds |
3384
|
|
|
|
|
|
|
|
3385
|
|
|
|
|
|
|
=item * transfer_group - Str - identifies the resulting payment as part of a group |
3386
|
|
|
|
|
|
|
|
3387
|
|
|
|
|
|
|
=item * use_stripe_sdk - Bool - use manual confirmation and the iOS or Android SDKs to handle additional authentication steps |
3388
|
|
|
|
|
|
|
|
3389
|
|
|
|
|
|
|
=back |
3390
|
|
|
|
|
|
|
|
3391
|
|
|
|
|
|
|
Returns a L<Net::Stripe::PaymentIntent> |
3392
|
|
|
|
|
|
|
|
3393
|
|
|
|
|
|
|
$stripe->create_payment_intent( |
3394
|
|
|
|
|
|
|
amount => 3300, |
3395
|
|
|
|
|
|
|
currency => 'usd', |
3396
|
|
|
|
|
|
|
); |
3397
|
|
|
|
|
|
|
|
3398
|
|
|
|
|
|
|
=head2 get_payment_intent |
3399
|
|
|
|
|
|
|
|
3400
|
|
|
|
|
|
|
Retrieve an existing PaymentIntent |
3401
|
|
|
|
|
|
|
|
3402
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/payment_intents/retrieve#retrieve_payment_intent> |
3403
|
|
|
|
|
|
|
|
3404
|
|
|
|
|
|
|
=over |
3405
|
|
|
|
|
|
|
|
3406
|
|
|
|
|
|
|
=item * payment_intent_id - StripePaymentIntentId - id of PaymentIntent to retrieve - required |
3407
|
|
|
|
|
|
|
|
3408
|
|
|
|
|
|
|
=item * client_secret - Str - client secret of the PaymentIntent to retrieve |
3409
|
|
|
|
|
|
|
|
3410
|
|
|
|
|
|
|
=back |
3411
|
|
|
|
|
|
|
|
3412
|
|
|
|
|
|
|
Returns a L<Net::Stripe::PaymentIntent> |
3413
|
|
|
|
|
|
|
|
3414
|
|
|
|
|
|
|
$stripe->get_payment_intent( |
3415
|
|
|
|
|
|
|
payment_intent_id => $payment_intent_id, |
3416
|
|
|
|
|
|
|
); |
3417
|
|
|
|
|
|
|
|
3418
|
|
|
|
|
|
|
=head2 update_payment_intent |
3419
|
|
|
|
|
|
|
|
3420
|
|
|
|
|
|
|
Update an existing PaymentIntent |
3421
|
|
|
|
|
|
|
|
3422
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/payment_intents/update#update_payment_intent> |
3423
|
|
|
|
|
|
|
|
3424
|
|
|
|
|
|
|
=over |
3425
|
|
|
|
|
|
|
|
3426
|
|
|
|
|
|
|
=item * payment_intent_id - StripePaymentIntentId - id of PaymentIntent to update - required |
3427
|
|
|
|
|
|
|
|
3428
|
|
|
|
|
|
|
=item * amount - Int - amount intended to be collected by this PaymentIntent - required |
3429
|
|
|
|
|
|
|
|
3430
|
|
|
|
|
|
|
=item * application_fee_amount - Int - the amount of the application fee |
3431
|
|
|
|
|
|
|
|
3432
|
|
|
|
|
|
|
=item * currency - Str - currency - required |
3433
|
|
|
|
|
|
|
|
3434
|
|
|
|
|
|
|
=item * customer - StripeCustomerId - id of Customer this PaymentIntent belongs to |
3435
|
|
|
|
|
|
|
|
3436
|
|
|
|
|
|
|
=item * description - Str - description |
3437
|
|
|
|
|
|
|
|
3438
|
|
|
|
|
|
|
=item * metadata - HashRef[Str] - metadata |
3439
|
|
|
|
|
|
|
|
3440
|
|
|
|
|
|
|
=item * payment_method - StripePaymentMethodId - id of PaymentMethod to attach to this PaymentIntent |
3441
|
|
|
|
|
|
|
|
3442
|
|
|
|
|
|
|
=item * payment_method_options - HashRef - PaymentMethod-specific configuration for this PaymentIntent |
3443
|
|
|
|
|
|
|
|
3444
|
|
|
|
|
|
|
=item * payment_method_types - ArrayRef[StripePaymentMethodType] - list of PaymentMethod types that this PaymentIntent is allowed to use |
3445
|
|
|
|
|
|
|
|
3446
|
|
|
|
|
|
|
=item * receipt_email - Str - email address to send the receipt to |
3447
|
|
|
|
|
|
|
|
3448
|
|
|
|
|
|
|
=item * save_payment_method - Bool - save the payment method to the customer |
3449
|
|
|
|
|
|
|
|
3450
|
|
|
|
|
|
|
=item * setup_future_usage - Str - allow future payments with this PaymentIntent's PaymentMethod |
3451
|
|
|
|
|
|
|
|
3452
|
|
|
|
|
|
|
=item * shipping - HashRef - shipping information for this PaymentIntent |
3453
|
|
|
|
|
|
|
|
3454
|
|
|
|
|
|
|
=item * statement_descriptor - Str - descriptor for statement |
3455
|
|
|
|
|
|
|
|
3456
|
|
|
|
|
|
|
=item * statement_descriptor_suffix - Str - suffix to be concatenated with the statement descriptor |
3457
|
|
|
|
|
|
|
|
3458
|
|
|
|
|
|
|
=item * transfer_data - HashRef - parameters used to automatically create a Transfer when the payment succeeds |
3459
|
|
|
|
|
|
|
|
3460
|
|
|
|
|
|
|
=item * transfer_group - Str - identifies the resulting payment as part of a group |
3461
|
|
|
|
|
|
|
|
3462
|
|
|
|
|
|
|
=back |
3463
|
|
|
|
|
|
|
|
3464
|
|
|
|
|
|
|
Returns a L<Net::Stripe::PaymentIntent> |
3465
|
|
|
|
|
|
|
|
3466
|
|
|
|
|
|
|
$stripe->update_payment_intent( |
3467
|
|
|
|
|
|
|
payment_intent_id => $payment_intent_id, |
3468
|
|
|
|
|
|
|
description => 'Updated Description', |
3469
|
|
|
|
|
|
|
); |
3470
|
|
|
|
|
|
|
|
3471
|
|
|
|
|
|
|
=head2 confirm_payment_intent |
3472
|
|
|
|
|
|
|
|
3473
|
|
|
|
|
|
|
Confirm that customer intends to pay with provided PaymentMethod |
3474
|
|
|
|
|
|
|
|
3475
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/payment_intents/confirm#confirm_payment_intent> |
3476
|
|
|
|
|
|
|
|
3477
|
|
|
|
|
|
|
=over |
3478
|
|
|
|
|
|
|
|
3479
|
|
|
|
|
|
|
=item * payment_intent_id - StripePaymentIntentId - id of PaymentIntent to confirm - required |
3480
|
|
|
|
|
|
|
|
3481
|
|
|
|
|
|
|
=item * client_secret - Str - client secret of the PaymentIntent |
3482
|
|
|
|
|
|
|
|
3483
|
|
|
|
|
|
|
=item * error_on_requires_action - Bool - fail the payment attempt if the PaymentIntent transitions into `requires_action` |
3484
|
|
|
|
|
|
|
|
3485
|
|
|
|
|
|
|
=item * mandate - Str - id of the mandate to be used for this payment |
3486
|
|
|
|
|
|
|
|
3487
|
|
|
|
|
|
|
=item * mandate_data - HashRef - details about the Mandate to create |
3488
|
|
|
|
|
|
|
|
3489
|
|
|
|
|
|
|
=item * off_session - Bool - indicate that the customer is not in your checkout flow |
3490
|
|
|
|
|
|
|
|
3491
|
|
|
|
|
|
|
=item * payment_method - StripePaymentMethodId - id of PaymentMethod to attach to this PaymentIntent |
3492
|
|
|
|
|
|
|
|
3493
|
|
|
|
|
|
|
=item * payment_method_options - HashRef - PaymentMethod-specific configuration for this PaymentIntent |
3494
|
|
|
|
|
|
|
|
3495
|
|
|
|
|
|
|
=item * payment_method_types - ArrayRef[StripePaymentMethodType] - list of PaymentMethod types that this PaymentIntent is allowed to use |
3496
|
|
|
|
|
|
|
|
3497
|
|
|
|
|
|
|
=item * receipt_email - Str - email address to send the receipt to |
3498
|
|
|
|
|
|
|
|
3499
|
|
|
|
|
|
|
=item * return_url - Str - URL to redirect your customer back to |
3500
|
|
|
|
|
|
|
|
3501
|
|
|
|
|
|
|
=item * save_payment_method - Bool - save the payment method to the customer |
3502
|
|
|
|
|
|
|
|
3503
|
|
|
|
|
|
|
=item * setup_future_usage - Str - allow future payments with this PaymentIntent's PaymentMethod |
3504
|
|
|
|
|
|
|
|
3505
|
|
|
|
|
|
|
=item * shipping - HashRef - shipping information for this PaymentIntent |
3506
|
|
|
|
|
|
|
|
3507
|
|
|
|
|
|
|
=item * use_stripe_sdk - Bool - use manual confirmation and the iOS or Android SDKs to handle additional authentication steps |
3508
|
|
|
|
|
|
|
|
3509
|
|
|
|
|
|
|
=back |
3510
|
|
|
|
|
|
|
|
3511
|
|
|
|
|
|
|
Returns a L<Net::Stripe::PaymentIntent> |
3512
|
|
|
|
|
|
|
|
3513
|
|
|
|
|
|
|
$stripe->confirm_payment_intent( |
3514
|
|
|
|
|
|
|
payment_intent_id => $payment_intent_id, |
3515
|
|
|
|
|
|
|
); |
3516
|
|
|
|
|
|
|
|
3517
|
|
|
|
|
|
|
=head2 capture_payment_intent |
3518
|
|
|
|
|
|
|
|
3519
|
|
|
|
|
|
|
Capture the funds for the PaymentIntent |
3520
|
|
|
|
|
|
|
|
3521
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/payment_intents/capture#capture_payment_intent> |
3522
|
|
|
|
|
|
|
|
3523
|
|
|
|
|
|
|
=over |
3524
|
|
|
|
|
|
|
|
3525
|
|
|
|
|
|
|
=item * payment_intent_id - StripePaymentIntentId - id of PaymentIntent to capture - required |
3526
|
|
|
|
|
|
|
|
3527
|
|
|
|
|
|
|
=item * amount_to_capture - Int - amount to capture from the PaymentIntent |
3528
|
|
|
|
|
|
|
|
3529
|
|
|
|
|
|
|
=item * application_fee_amount - Int - application fee amount |
3530
|
|
|
|
|
|
|
|
3531
|
|
|
|
|
|
|
=item * statement_descriptor - Str - descriptor for statement |
3532
|
|
|
|
|
|
|
|
3533
|
|
|
|
|
|
|
=item * statement_descriptor_suffix - Str - suffix to be concatenated with the statement descriptor |
3534
|
|
|
|
|
|
|
|
3535
|
|
|
|
|
|
|
=item * transfer_data - HashRef - parameters used to automatically create a Transfer when the payment succeeds |
3536
|
|
|
|
|
|
|
|
3537
|
|
|
|
|
|
|
=back |
3538
|
|
|
|
|
|
|
|
3539
|
|
|
|
|
|
|
Returns a L<Net::Stripe::PaymentIntent> |
3540
|
|
|
|
|
|
|
|
3541
|
|
|
|
|
|
|
$stripe->capture_payment_intent( |
3542
|
|
|
|
|
|
|
payment_intent_id => $payment_intent_id, |
3543
|
|
|
|
|
|
|
); |
3544
|
|
|
|
|
|
|
|
3545
|
|
|
|
|
|
|
=head2 cancel_payment_intent |
3546
|
|
|
|
|
|
|
|
3547
|
|
|
|
|
|
|
Cancel the PaymentIntent |
3548
|
|
|
|
|
|
|
|
3549
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/payment_intents/cancel#cancel_payment_intent> |
3550
|
|
|
|
|
|
|
|
3551
|
|
|
|
|
|
|
=over |
3552
|
|
|
|
|
|
|
|
3553
|
|
|
|
|
|
|
=item * payment_intent_id - StripePaymentIntentId - id of PaymentIntent to cancel - required |
3554
|
|
|
|
|
|
|
|
3555
|
|
|
|
|
|
|
=item * cancellation_reason - StripeCancellationReason - reason for cancellation |
3556
|
|
|
|
|
|
|
|
3557
|
|
|
|
|
|
|
=back |
3558
|
|
|
|
|
|
|
|
3559
|
|
|
|
|
|
|
Returns a L<Net::Stripe::PaymentIntent> |
3560
|
|
|
|
|
|
|
|
3561
|
|
|
|
|
|
|
$stripe->cancel_payment_intent( |
3562
|
|
|
|
|
|
|
payment_intent_id => $payment_intent_id, |
3563
|
|
|
|
|
|
|
cancellation_reason => 'requested_by_customer', |
3564
|
|
|
|
|
|
|
); |
3565
|
|
|
|
|
|
|
|
3566
|
|
|
|
|
|
|
=head2 list_payment_intents |
3567
|
|
|
|
|
|
|
|
3568
|
|
|
|
|
|
|
Retrieve a list of PaymentIntents |
3569
|
|
|
|
|
|
|
|
3570
|
|
|
|
|
|
|
L<https://stripe.com/docs/api/payment_intents/list#list_payment_intents> |
3571
|
|
|
|
|
|
|
|
3572
|
|
|
|
|
|
|
=over |
3573
|
|
|
|
|
|
|
|
3574
|
|
|
|
|
|
|
=item * customer - StripeCustomerId - return only PaymentIntents for the specified Customer id |
3575
|
|
|
|
|
|
|
|
3576
|
|
|
|
|
|
|
=item * created - HashRef[Int] - created conditions to match |
3577
|
|
|
|
|
|
|
|
3578
|
|
|
|
|
|
|
=item * ending_before - Str - ending before condition |
3579
|
|
|
|
|
|
|
|
3580
|
|
|
|
|
|
|
=item * limit - Int - maximum number of objects to return |
3581
|
|
|
|
|
|
|
|
3582
|
|
|
|
|
|
|
=item * starting_after - Str - starting after condition |
3583
|
|
|
|
|
|
|
|
3584
|
|
|
|
|
|
|
=back |
3585
|
|
|
|
|
|
|
|
3586
|
|
|
|
|
|
|
Returns a L<Net::Stripe::List> object containing L<Net::Stripe::PaymentIntent> objects. |
3587
|
|
|
|
|
|
|
|
3588
|
|
|
|
|
|
|
$stripe->list_payment_intents( |
3589
|
|
|
|
|
|
|
customer => $customer_id, |
3590
|
|
|
|
|
|
|
type => 'card', |
3591
|
|
|
|
|
|
|
limit => 10, |
3592
|
|
|
|
|
|
|
); |
3593
|
|
|
|
|
|
|
|
3594
|
|
|
|
|
|
|
=head1 RELEASE NOTES |
3595
|
|
|
|
|
|
|
|
3596
|
|
|
|
|
|
|
=head2 Version 0.40 |
3597
|
|
|
|
|
|
|
|
3598
|
|
|
|
|
|
|
=head3 BREAKING CHANGES |
3599
|
|
|
|
|
|
|
|
3600
|
|
|
|
|
|
|
=over |
3601
|
|
|
|
|
|
|
|
3602
|
|
|
|
|
|
|
=item deprecate direct handling of PANs |
3603
|
|
|
|
|
|
|
|
3604
|
|
|
|
|
|
|
Stripe strongly discourages direct handling of PANs (primary account numbers), |
3605
|
|
|
|
|
|
|
even in test mode, and returns invalid_request_error when passing PANs to the |
3606
|
|
|
|
|
|
|
API from accounts that were created after October 2017. In live mode, all |
3607
|
|
|
|
|
|
|
tokenization should be performed via client-side libraries because direct |
3608
|
|
|
|
|
|
|
handling of PANs violates PCI compliance. So we have removed the methods and |
3609
|
|
|
|
|
|
|
parameter constraints that allow direct handling of PANs and updated the |
3610
|
|
|
|
|
|
|
unit tests appropriately. |
3611
|
|
|
|
|
|
|
|
3612
|
|
|
|
|
|
|
=item updating customer card by passing Customer object to post_customer() |
3613
|
|
|
|
|
|
|
|
3614
|
|
|
|
|
|
|
If you have code that updates a customer card by updating the internal values |
3615
|
|
|
|
|
|
|
for an existing customer object and then posting that object: |
3616
|
|
|
|
|
|
|
|
3617
|
|
|
|
|
|
|
my $customer_obj = $stripe->get_customer( |
3618
|
|
|
|
|
|
|
customer_id => $customer_id, |
3619
|
|
|
|
|
|
|
); |
3620
|
|
|
|
|
|
|
$customer_obj->card( $new_card ); |
3621
|
|
|
|
|
|
|
$stripe->post_customer( customer => $customer_obj ); |
3622
|
|
|
|
|
|
|
|
3623
|
|
|
|
|
|
|
you must unset the default_card attribute in the existing object before |
3624
|
|
|
|
|
|
|
posting the customer object. |
3625
|
|
|
|
|
|
|
|
3626
|
|
|
|
|
|
|
$customer_obj->default_card( undef ); |
3627
|
|
|
|
|
|
|
|
3628
|
|
|
|
|
|
|
Otherwise there is a conflict, since the old default_card attribute in the |
3629
|
|
|
|
|
|
|
object is serialized in the POST stream, and it appears that you are requesting |
3630
|
|
|
|
|
|
|
to set default_card to the id of a card that no longer exists, but rather |
3631
|
|
|
|
|
|
|
is being replaced by the new value of the card attribute in the object. |
3632
|
|
|
|
|
|
|
|
3633
|
|
|
|
|
|
|
=item Plan objects now linked to Product objects |
3634
|
|
|
|
|
|
|
|
3635
|
|
|
|
|
|
|
For Stripe API versions after 2018-02-15 L<https://stripe.com/docs/upgrades#2018-02-05> |
3636
|
|
|
|
|
|
|
each Plan object is linked to a Product object with type=service. The |
3637
|
|
|
|
|
|
|
Plan object 'name' and 'statement_descriptor' attributes have been moved to |
3638
|
|
|
|
|
|
|
Product objects. |
3639
|
|
|
|
|
|
|
|
3640
|
|
|
|
|
|
|
=back |
3641
|
|
|
|
|
|
|
|
3642
|
|
|
|
|
|
|
=head3 DEPRECATION WARNING |
3643
|
|
|
|
|
|
|
|
3644
|
|
|
|
|
|
|
=over |
3645
|
|
|
|
|
|
|
|
3646
|
|
|
|
|
|
|
=item update 'card' to 'source' for Charge and Customer |
3647
|
|
|
|
|
|
|
|
3648
|
|
|
|
|
|
|
While the API returns both card-related and source-related values for earlier |
3649
|
|
|
|
|
|
|
versions, making the update mostly backwards-compatible, Stripe API versions |
3650
|
|
|
|
|
|
|
after 2015-02-18 L<https://stripe.com/docs/upgrades#2015-02-18> will no longer |
3651
|
|
|
|
|
|
|
return the card-related values, so you should update your code where necessary |
3652
|
|
|
|
|
|
|
to use the 'source' argument and method for Charge objects, and the 'source', |
3653
|
|
|
|
|
|
|
'sources' and 'default_source' arguments and methods for Customer, in |
3654
|
|
|
|
|
|
|
preparation for the eventual deprecation of the card-related arguments. |
3655
|
|
|
|
|
|
|
|
3656
|
|
|
|
|
|
|
=item update 'account_balance' to 'balance' for Customer |
3657
|
|
|
|
|
|
|
|
3658
|
|
|
|
|
|
|
While the API returns both 'account_balance' and 'balance' for earlier |
3659
|
|
|
|
|
|
|
versions, making the update backwards-compatible, Stripe API versions |
3660
|
|
|
|
|
|
|
after 2019-10-17 L<https://stripe.com/docs/upgrades#2019-10-17> do not |
3661
|
|
|
|
|
|
|
accept or return 'account_balance', so you should update your code where |
3662
|
|
|
|
|
|
|
necessary to use the 'balance' argument and method for Customer objects in |
3663
|
|
|
|
|
|
|
preparation for the eventual deprecation of the 'account_balance' argument. |
3664
|
|
|
|
|
|
|
|
3665
|
|
|
|
|
|
|
=item use 'cancel_at_period_end' instead of 'at_period_end' for canceling Subscriptions |
3666
|
|
|
|
|
|
|
|
3667
|
|
|
|
|
|
|
For Stripe API versions after 2018-08-23 |
3668
|
|
|
|
|
|
|
L<https://stripe.com/docs/upgrades#2018-08-23>, you can no longer use |
3669
|
|
|
|
|
|
|
'at_period_end' in delete_subscription(). The delete_subscription() method |
3670
|
|
|
|
|
|
|
is reserved for immediate canceling going forward. You should update your |
3671
|
|
|
|
|
|
|
code to use 'cancel_at_period_end in update_subscription() instead. |
3672
|
|
|
|
|
|
|
|
3673
|
|
|
|
|
|
|
=item update 'date' to 'created' for Invoice |
3674
|
|
|
|
|
|
|
|
3675
|
|
|
|
|
|
|
While the API returns both 'date' and 'created' for earlier versions, making |
3676
|
|
|
|
|
|
|
the update backwards-compatible, Stripe API versions after 2019-03-14 |
3677
|
|
|
|
|
|
|
L<https://stripe.com/docs/upgrades#2019-03-14> only return 'created', so you |
3678
|
|
|
|
|
|
|
should update your code where necessary to use the 'created' method for |
3679
|
|
|
|
|
|
|
Invoice objects in preparation for the eventual deprecation of the 'date' |
3680
|
|
|
|
|
|
|
argument. |
3681
|
|
|
|
|
|
|
|
3682
|
|
|
|
|
|
|
=item use 'auto_advance' instead of 'closed' for Invoice |
3683
|
|
|
|
|
|
|
|
3684
|
|
|
|
|
|
|
The 'closed' attribute for the Invoice object controls automatic collection, |
3685
|
|
|
|
|
|
|
and has been deprecated in favor of the more specific 'auto_advance' attribute. |
3686
|
|
|
|
|
|
|
Where you might have set closed=true on Invoices in the past, set |
3687
|
|
|
|
|
|
|
auto_advance=false. While the API returns both 'closed' and 'auto_advance' |
3688
|
|
|
|
|
|
|
for earlier versions, making the update backwards-compatible, Stripe API |
3689
|
|
|
|
|
|
|
versions after 2018-11-08 L<https://stripe.com/docs/upgrades#2018-11-08> |
3690
|
|
|
|
|
|
|
only return 'auto_advance', so you should update your code where necessary to |
3691
|
|
|
|
|
|
|
use the 'auto_advance' argument and method for Invoice objects in preparation |
3692
|
|
|
|
|
|
|
for the eventual deprecation of the 'closed' argument. |
3693
|
|
|
|
|
|
|
|
3694
|
|
|
|
|
|
|
=back |
3695
|
|
|
|
|
|
|
|
3696
|
|
|
|
|
|
|
=head3 BUG FIXES |
3697
|
|
|
|
|
|
|
|
3698
|
|
|
|
|
|
|
=over |
3699
|
|
|
|
|
|
|
|
3700
|
|
|
|
|
|
|
=item fix post_charge() arguments |
3701
|
|
|
|
|
|
|
|
3702
|
|
|
|
|
|
|
Some argument types for `customer` and `card` were non-functional in the |
3703
|
|
|
|
|
|
|
current code and have been removed from the Kavorka method signature. We |
3704
|
|
|
|
|
|
|
removed `Net::Stripe::Customer` and `HashRef` for `customer` and we removed |
3705
|
|
|
|
|
|
|
`Net::Stripe::Card` and `Net::Stripe::Token` for `card`, as none of these |
3706
|
|
|
|
|
|
|
forms were being serialized correctly for passing to the API call. We must |
3707
|
|
|
|
|
|
|
retain `Net::Stripe::Card` for the `card` attribute in `Net::Stripe::Charge` |
3708
|
|
|
|
|
|
|
because the `card` value returned from the API call is objectified into |
3709
|
|
|
|
|
|
|
a card object. We have also added TypeConstraints for the string arguments |
3710
|
|
|
|
|
|
|
passed and added in-method validation to ensure that the passed argument |
3711
|
|
|
|
|
|
|
values make sense in the context of one another. |
3712
|
|
|
|
|
|
|
|
3713
|
|
|
|
|
|
|
=item cleanup post_card() |
3714
|
|
|
|
|
|
|
|
3715
|
|
|
|
|
|
|
Some argument types for `card` are not legitimate, or are being deprecated |
3716
|
|
|
|
|
|
|
and have been removed from the Kavorka method signature. We removed |
3717
|
|
|
|
|
|
|
`Net::Stripe::Card` and updated the string validation to disallow card id |
3718
|
|
|
|
|
|
|
for `card`, as neither of these are legitimate when creating or updating a |
3719
|
|
|
|
|
|
|
card L<https://github.com/lukec/stripe-perl/issues/138>, and the code path |
3720
|
|
|
|
|
|
|
that appeared to be handling `Net::Stripe::Card` was actually unreachable |
3721
|
|
|
|
|
|
|
L<https://github.com/lukec/stripe-perl/issues/100>. We removed the dead code |
3722
|
|
|
|
|
|
|
paths and made the conditional structure more explicit, per discussion in |
3723
|
|
|
|
|
|
|
L<https://github.com/lukec/stripe-perl/pull/133>. We also added unit tests |
3724
|
|
|
|
|
|
|
for all calling forms, per L<https://github.com/lukec/stripe-perl/issues/139>. |
3725
|
|
|
|
|
|
|
|
3726
|
|
|
|
|
|
|
=item fix post_customer() arguments |
3727
|
|
|
|
|
|
|
|
3728
|
|
|
|
|
|
|
Some argument types for `card` are not legitimate and have been removed from |
3729
|
|
|
|
|
|
|
the Kavorka method signature. We removed `Net::Stripe::Card` and updated the |
3730
|
|
|
|
|
|
|
string validation to disallow card id for `card`, as neither of these are |
3731
|
|
|
|
|
|
|
legitimate when creating or updating a customer L<https://github.com/lukec/stripe-perl/issues/138>. |
3732
|
|
|
|
|
|
|
We have also updated the structure of the method so that we always create a |
3733
|
|
|
|
|
|
|
Net::Stripe::Customer object before posting L<https://github.com/lukec/stripe-perl/issues/148> |
3734
|
|
|
|
|
|
|
and cleaned up and centralized Net::Stripe:Token coercion code. |
3735
|
|
|
|
|
|
|
|
3736
|
|
|
|
|
|
|
=item default_card not updating in post_customer() |
3737
|
|
|
|
|
|
|
|
3738
|
|
|
|
|
|
|
Prior to ff84dd7, we were passing %args directly to _post(), and therefore |
3739
|
|
|
|
|
|
|
default_card would have been included in the POST stream. Now we are creating |
3740
|
|
|
|
|
|
|
a L<Net::Stripe::Customer> object and posting it, so the posted parameters |
3741
|
|
|
|
|
|
|
rely on the explicit list in $customer_obj->form_fields(), which was lacking |
3742
|
|
|
|
|
|
|
default_card. See also BREAKING CHANGES. |
3743
|
|
|
|
|
|
|
|
3744
|
|
|
|
|
|
|
=back |
3745
|
|
|
|
|
|
|
|
3746
|
|
|
|
|
|
|
=head3 ENHANCEMENTS |
3747
|
|
|
|
|
|
|
|
3748
|
|
|
|
|
|
|
=over |
3749
|
|
|
|
|
|
|
|
3750
|
|
|
|
|
|
|
=item coerce old lists |
3751
|
|
|
|
|
|
|
|
3752
|
|
|
|
|
|
|
In older Stripe API versions, some list-type data structures were returned |
3753
|
|
|
|
|
|
|
as arrayrefs. We now coerce those old-style lists and collections into the |
3754
|
|
|
|
|
|
|
hashref format that newer versions of the API return, with metadata stored |
3755
|
|
|
|
|
|
|
top-level keys and the list elements in an arrayref with the key 'data', |
3756
|
|
|
|
|
|
|
which is the format that C<Net::Stripe::List> expects. This makes the SDK |
3757
|
|
|
|
|
|
|
compatible with the Stripe API back to the earliest documented API version |
3758
|
|
|
|
|
|
|
L<https://stripe.com/docs/upgrades#2011-06-21>. |
3759
|
|
|
|
|
|
|
|
3760
|
|
|
|
|
|
|
=item encode card metdata in convert_to_form_fields() |
3761
|
|
|
|
|
|
|
|
3762
|
|
|
|
|
|
|
When passing a hashref with a nested metadata hashref to _post(), that |
3763
|
|
|
|
|
|
|
metadata must be encoded properly before being passed to the Stripe API. |
3764
|
|
|
|
|
|
|
There is now a dedicated block in convert_to_form_fields for this operation. |
3765
|
|
|
|
|
|
|
This update was necessary because of the addition of update_card(), which |
3766
|
|
|
|
|
|
|
accepts a card hashref, which may include metadata. |
3767
|
|
|
|
|
|
|
|
3768
|
|
|
|
|
|
|
=item encode objects in convert_to_form_fields() |
3769
|
|
|
|
|
|
|
|
3770
|
|
|
|
|
|
|
We removed the nested tertiary operator in _post() and updated |
3771
|
|
|
|
|
|
|
convert_to_form_fields() so that it now handles encoding of objects, both |
3772
|
|
|
|
|
|
|
top-level and nested. This streamlines the hashref vs object serailizing |
3773
|
|
|
|
|
|
|
code, making it easy to adapt to other methods. |
3774
|
|
|
|
|
|
|
|
3775
|
|
|
|
|
|
|
=item remove manual serialization in _get_collections() and _get_with_args() |
3776
|
|
|
|
|
|
|
|
3777
|
|
|
|
|
|
|
We were using string contatenation to both serilize the individual query args, |
3778
|
|
|
|
|
|
|
in _get_collections(), and to join the individual query args together, in |
3779
|
|
|
|
|
|
|
_get_with_args(). This also involved some unnecessary duplication of the |
3780
|
|
|
|
|
|
|
logic that convert_to_form_fields() was already capable of handling. We now |
3781
|
|
|
|
|
|
|
use convert_to_form_fields() to process the passed data, and L<URI> to |
3782
|
|
|
|
|
|
|
encode and serialize the query string. Along with other updates to |
3783
|
|
|
|
|
|
|
convert_to_form_fields(), _get() can now easily handle the same calling |
3784
|
|
|
|
|
|
|
form as _post(), eliminating the need for _get_collections() and |
3785
|
|
|
|
|
|
|
_get_with_args(). We have also updated _delete() accordingly. |
3786
|
|
|
|
|
|
|
|
3787
|
|
|
|
|
|
|
=item add _get_all() |
3788
|
|
|
|
|
|
|
|
3789
|
|
|
|
|
|
|
Similar to methods provided by other SDKs, calls using this method will allow |
3790
|
|
|
|
|
|
|
access to all records for a given object type without having to manually |
3791
|
|
|
|
|
|
|
paginate through the results. It is not intended to be used directly, but |
3792
|
|
|
|
|
|
|
will be accessed through new and existing list-retrieval methods. In order to |
3793
|
|
|
|
|
|
|
maintain backwards-compatibility with existing list retrieval behavior, this |
3794
|
|
|
|
|
|
|
method supports passing a value of 0 for 'limit' in order to retrieve all |
3795
|
|
|
|
|
|
|
records. Any other positive integer value for 'limit' will attempt to retrieve |
3796
|
|
|
|
|
|
|
that number of records up to the maximum available. As before, not passing a |
3797
|
|
|
|
|
|
|
value for 'limit', or explicitly passing an undefined value, retrieves whatever |
3798
|
|
|
|
|
|
|
number of records the API returns by default. |
3799
|
|
|
|
|
|
|
|
3800
|
|
|
|
|
|
|
=back |
3801
|
|
|
|
|
|
|
|
3802
|
|
|
|
|
|
|
=head3 UPDATES |
3803
|
|
|
|
|
|
|
|
3804
|
|
|
|
|
|
|
=over |
3805
|
|
|
|
|
|
|
|
3806
|
|
|
|
|
|
|
=item update statement_description to statement_descriptor |
3807
|
|
|
|
|
|
|
|
3808
|
|
|
|
|
|
|
The statement_description attribute is now statement_descriptor for |
3809
|
|
|
|
|
|
|
L<Net::Stripe::Charge> and L<Net::Stripe::Plan>. The API docs |
3810
|
|
|
|
|
|
|
L<https://stripe.com/docs/upgrades#2014-12-17> indicate that this change |
3811
|
|
|
|
|
|
|
is backwards-compatible. You must update your code to reflect this change |
3812
|
|
|
|
|
|
|
for parameters passed to these objects and methods called on these objects. |
3813
|
|
|
|
|
|
|
|
3814
|
|
|
|
|
|
|
=item update unit tests for Charge->status |
3815
|
|
|
|
|
|
|
|
3816
|
|
|
|
|
|
|
For Stripe API versions after 2015-02-18 L<https://stripe.com/docs/upgrades#2015-02-18>, |
3817
|
|
|
|
|
|
|
the status property on the Charge object has a value of 'succeeded' for |
3818
|
|
|
|
|
|
|
successful charges. Previously, the status property would be 'paid' for |
3819
|
|
|
|
|
|
|
successful charges. This change does not affect the API calls themselves, but |
3820
|
|
|
|
|
|
|
if your account is using Stripe API version 2015-02-18 or later, you should |
3821
|
|
|
|
|
|
|
update any code that relies on strict checking of the return value of |
3822
|
|
|
|
|
|
|
Charge->status. |
3823
|
|
|
|
|
|
|
|
3824
|
|
|
|
|
|
|
=item add update_card() |
3825
|
|
|
|
|
|
|
|
3826
|
|
|
|
|
|
|
This method allows updates to card address, expiration, metadata, etc for |
3827
|
|
|
|
|
|
|
existing customer cards. |
3828
|
|
|
|
|
|
|
|
3829
|
|
|
|
|
|
|
=item update Token attributes |
3830
|
|
|
|
|
|
|
|
3831
|
|
|
|
|
|
|
Added type and client_ip attributes for L<Net::Stripe::Token>. |
3832
|
|
|
|
|
|
|
|
3833
|
|
|
|
|
|
|
=item allow capture of partial charge |
3834
|
|
|
|
|
|
|
|
3835
|
|
|
|
|
|
|
Passing 'amount' to capture_charge() allows capture of a partial charge. |
3836
|
|
|
|
|
|
|
Per the API, any remaining amount is immediately refunded. The charge object |
3837
|
|
|
|
|
|
|
now also has a 'refunds' attribute, representing a L<Net::Stripe::List> |
3838
|
|
|
|
|
|
|
of L<Net::Stripe::Refund> objects for the charge. |
3839
|
|
|
|
|
|
|
|
3840
|
|
|
|
|
|
|
=item add Source |
3841
|
|
|
|
|
|
|
|
3842
|
|
|
|
|
|
|
Added a Source object. Also added 'source' attribute and argument for Charge |
3843
|
|
|
|
|
|
|
objects and methods, and added 'source', 'sources' and 'default_source' |
3844
|
|
|
|
|
|
|
attributes and arguments for Customer objects and methods. |
3845
|
|
|
|
|
|
|
|
3846
|
|
|
|
|
|
|
=item add balance for Customer |
3847
|
|
|
|
|
|
|
|
3848
|
|
|
|
|
|
|
Added 'balance' attribute and arguments for Customer objects and methods. |
3849
|
|
|
|
|
|
|
|
3850
|
|
|
|
|
|
|
=item add cancel_at_period_end for update_subscription() |
3851
|
|
|
|
|
|
|
|
3852
|
|
|
|
|
|
|
Added 'cancel_at_period_end' argument update_subscription() and added |
3853
|
|
|
|
|
|
|
'cancel_at_period_end' to the POST stream for Subscription objects. |
3854
|
|
|
|
|
|
|
|
3855
|
|
|
|
|
|
|
=item update Invoice |
3856
|
|
|
|
|
|
|
|
3857
|
|
|
|
|
|
|
Added 'created' attribute for Invoice objects, and removed the required |
3858
|
|
|
|
|
|
|
constraint for the deprecated 'date' attribute. Also added the 'auto_advance' |
3859
|
|
|
|
|
|
|
attribute and removed the required constraint for the deprecated 'closed' |
3860
|
|
|
|
|
|
|
attribute. |
3861
|
|
|
|
|
|
|
|
3862
|
|
|
|
|
|
|
=item add Product |
3863
|
|
|
|
|
|
|
|
3864
|
|
|
|
|
|
|
Added a Product object. Also added 'product' attribute and argument for Plan |
3865
|
|
|
|
|
|
|
objects and methods. |
3866
|
|
|
|
|
|
|
|
3867
|
|
|
|
|
|
|
=item add PaymentMethod and PaymentIntent |
3868
|
|
|
|
|
|
|
|
3869
|
|
|
|
|
|
|
Added PaymentMethod and PaymentIntent objects and methods. |
3870
|
|
|
|
|
|
|
|
3871
|
|
|
|
|
|
|
=back |
3872
|
|
|
|
|
|
|
|
3873
|
|
|
|
|
|
|
=head1 SEE ALSO |
3874
|
|
|
|
|
|
|
|
3875
|
|
|
|
|
|
|
L<https://stripe.com>, L<https://stripe.com/docs/api> |
3876
|
|
|
|
|
|
|
|
3877
|
|
|
|
|
|
|
=encoding UTF-8 |
3878
|
|
|
|
|
|
|
|
3879
|
|
|
|
|
|
|
=head1 AUTHORS |
3880
|
|
|
|
|
|
|
|
3881
|
|
|
|
|
|
|
=over 4 |
3882
|
|
|
|
|
|
|
|
3883
|
|
|
|
|
|
|
=item * |
3884
|
|
|
|
|
|
|
|
3885
|
|
|
|
|
|
|
Luke Closs |
3886
|
|
|
|
|
|
|
|
3887
|
|
|
|
|
|
|
=item * |
3888
|
|
|
|
|
|
|
|
3889
|
|
|
|
|
|
|
Rusty Conover |
3890
|
|
|
|
|
|
|
|
3891
|
|
|
|
|
|
|
=back |
3892
|
|
|
|
|
|
|
|
3893
|
|
|
|
|
|
|
=head1 CONTRIBUTORS |
3894
|
|
|
|
|
|
|
|
3895
|
|
|
|
|
|
|
=for stopwords Andrew Solomon Brian Collins Devin M. Certas Dimitar Petrov Dylan Reinhold E. Choroba Florian Heyer Hermann Calabria Jonathan "Duke" Leto Luke Closs Mohammad S Anwar Olaf Alders Paul Cochrane Peter Scott Rusty Conover Sachin Sebastian Sherrard Burton Slobodan MiÅ¡koviÄ Tom Eliaz |
3896
|
|
|
|
|
|
|
|
3897
|
|
|
|
|
|
|
=over 4 |
3898
|
|
|
|
|
|
|
|
3899
|
|
|
|
|
|
|
=item * |
3900
|
|
|
|
|
|
|
|
3901
|
|
|
|
|
|
|
Andrew Solomon <andrew@geekuni.com> |
3902
|
|
|
|
|
|
|
|
3903
|
|
|
|
|
|
|
=item * |
3904
|
|
|
|
|
|
|
|
3905
|
|
|
|
|
|
|
Andrew Solomon <andrew@illywhacker.net> |
3906
|
|
|
|
|
|
|
|
3907
|
|
|
|
|
|
|
=item * |
3908
|
|
|
|
|
|
|
|
3909
|
|
|
|
|
|
|
Brian Collins <bricollins@gmail.com> |
3910
|
|
|
|
|
|
|
|
3911
|
|
|
|
|
|
|
=item * |
3912
|
|
|
|
|
|
|
|
3913
|
|
|
|
|
|
|
Devin M. Certas <devin@nacredata.com> |
3914
|
|
|
|
|
|
|
|
3915
|
|
|
|
|
|
|
=item * |
3916
|
|
|
|
|
|
|
|
3917
|
|
|
|
|
|
|
Dimitar Petrov <mitakaa@gmail.com> |
3918
|
|
|
|
|
|
|
|
3919
|
|
|
|
|
|
|
=item * |
3920
|
|
|
|
|
|
|
|
3921
|
|
|
|
|
|
|
Dylan Reinhold <dylan@gasdasoftware.com> |
3922
|
|
|
|
|
|
|
|
3923
|
|
|
|
|
|
|
=item * |
3924
|
|
|
|
|
|
|
|
3925
|
|
|
|
|
|
|
E. Choroba <choroba@matfyz.cz> |
3926
|
|
|
|
|
|
|
|
3927
|
|
|
|
|
|
|
=item * |
3928
|
|
|
|
|
|
|
|
3929
|
|
|
|
|
|
|
Florian Heyer <info@heyer-it.de> |
3930
|
|
|
|
|
|
|
|
3931
|
|
|
|
|
|
|
=item * |
3932
|
|
|
|
|
|
|
|
3933
|
|
|
|
|
|
|
Hermann Calabria <hermann@ivouch.com> |
3934
|
|
|
|
|
|
|
|
3935
|
|
|
|
|
|
|
=item * |
3936
|
|
|
|
|
|
|
|
3937
|
|
|
|
|
|
|
Jonathan "Duke" Leto <jonathan@leto.net> |
3938
|
|
|
|
|
|
|
|
3939
|
|
|
|
|
|
|
=item * |
3940
|
|
|
|
|
|
|
|
3941
|
|
|
|
|
|
|
Luke Closs <lukec@users.noreply.github.com> |
3942
|
|
|
|
|
|
|
|
3943
|
|
|
|
|
|
|
=item * |
3944
|
|
|
|
|
|
|
|
3945
|
|
|
|
|
|
|
Luke Closs <me@luk.ec> |
3946
|
|
|
|
|
|
|
|
3947
|
|
|
|
|
|
|
=item * |
3948
|
|
|
|
|
|
|
|
3949
|
|
|
|
|
|
|
Mohammad S Anwar <mohammad.anwar@yahoo.com> |
3950
|
|
|
|
|
|
|
|
3951
|
|
|
|
|
|
|
=item * |
3952
|
|
|
|
|
|
|
|
3953
|
|
|
|
|
|
|
Olaf Alders <olaf@wundersolutions.com> |
3954
|
|
|
|
|
|
|
|
3955
|
|
|
|
|
|
|
=item * |
3956
|
|
|
|
|
|
|
|
3957
|
|
|
|
|
|
|
Paul Cochrane <paul@liekut.de> |
3958
|
|
|
|
|
|
|
|
3959
|
|
|
|
|
|
|
=item * |
3960
|
|
|
|
|
|
|
|
3961
|
|
|
|
|
|
|
Peter Scott <peter@shotgundriver.com> |
3962
|
|
|
|
|
|
|
|
3963
|
|
|
|
|
|
|
=item * |
3964
|
|
|
|
|
|
|
|
3965
|
|
|
|
|
|
|
Rusty Conover <rusty@luckydinosaur.com> |
3966
|
|
|
|
|
|
|
|
3967
|
|
|
|
|
|
|
=item * |
3968
|
|
|
|
|
|
|
|
3969
|
|
|
|
|
|
|
Sachin Sebastian <sachinjsk@users.noreply.github.com> |
3970
|
|
|
|
|
|
|
|
3971
|
|
|
|
|
|
|
=item * |
3972
|
|
|
|
|
|
|
|
3973
|
|
|
|
|
|
|
Sherrard Burton <32931314+sherrardb@users.noreply.github.com> |
3974
|
|
|
|
|
|
|
|
3975
|
|
|
|
|
|
|
=item * |
3976
|
|
|
|
|
|
|
|
3977
|
|
|
|
|
|
|
Sherrard Burton <sburton@allafrica.com> |
3978
|
|
|
|
|
|
|
|
3979
|
|
|
|
|
|
|
=item * |
3980
|
|
|
|
|
|
|
|
3981
|
|
|
|
|
|
|
Slobodan MiÅ¡koviÄ <slobodan@miskovic.ca> |
3982
|
|
|
|
|
|
|
|
3983
|
|
|
|
|
|
|
=item * |
3984
|
|
|
|
|
|
|
|
3985
|
|
|
|
|
|
|
Tom Eliaz <tom@tomeliaz.com> |
3986
|
|
|
|
|
|
|
|
3987
|
|
|
|
|
|
|
=back |
3988
|
|
|
|
|
|
|
|
3989
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
3990
|
|
|
|
|
|
|
|
3991
|
|
|
|
|
|
|
This software is copyright (c) 2015 by Prime Radiant, Inc., (c) copyright 2014 Lucky Dinosaur LLC. |
3992
|
|
|
|
|
|
|
|
3993
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
3994
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
3995
|
|
|
|
|
|
|
|
3996
|
|
|
|
|
|
|
=cut |