Subject: | true/false should be string 'true'/'false' for capture=> in charge:create |
Net::Stripe::Simple::false() returns JSON::false, which is '0' (zero).
But, using
$stripe->charges(create => {...capture => false,...});
Stripe returns the following error:
charge : Error: invalid_request_error - Invalid boolean: 0 On parameter: capture
Changing to
capture=>'false'
works.
Presumably this bug can be fixed by changing the documentation.
Querystring constructed by Net::Stripe::Simple::_post() is
currency=usd&card=tok_14xmCx2eZvKYlo2Cqf9p3NTW&amount=999&capture=0&description=...
Note 'capture=0'
Code:
# JSON version 2.90, perl v5.14.2
use Net::Stripe::Simple;
my $stripe = Net::Stripe::Simple->new('sk_test_BQokikJOvBiI2HlWgH4olfQ2', '2014-01-31');
my $charge = eval {
$stripe->charges(
create => {
amount => 999,
currency => 'usd',
card => $token,
capture => false,
description => "blah blah blah",
}
);
};
warn "STRIPE: charge $charge: $@";