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