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