Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Makefile.PL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.036.
# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.037.
use strict;
use warnings;

Expand All @@ -22,7 +22,7 @@ my %WriteMakefileArgs = (
"HTTP::Request::Common" => 0,
"Method::Signatures" => 0,
"Moo" => 0,
"WebService::Client" => "0.0300",
"WebService::Client" => "0.0400",
"constant" => 0
},
"TEST_REQUIRES" => {
Expand All @@ -36,7 +36,7 @@ my %WriteMakefileArgs = (
"strict" => 0,
"warnings" => 0
},
"VERSION" => "0.1200",
"VERSION" => "1.0000",
"test" => {
"TESTS" => "t/*.t"
}
Expand All @@ -56,7 +56,7 @@ my %FallbackPrereqs = (
"Moo" => 0,
"Test::Modern" => 0,
"Test::More" => 0,
"WebService::Client" => "0.0300",
"WebService::Client" => "0.0400",
"constant" => 0,
"strict" => 0,
"warnings" => 0
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ WebService::Stripe - Stripe API bindings

# VERSION

version 0.1200
version 1.0000

# SYNOPSIS

Expand Down Expand Up @@ -65,14 +65,14 @@ Example:

## update\_customer

update_customer($id, $data)
update_customer($id, data => $data)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We never call this with a positional $data argument?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We never call this method at all in our api.


Updates a customer.
Returns the updated customer.

Example:

$customer = $stripe->update_customer($id, { description => 'foo' });
$customer = $stripe->update_customer($id, data => { description => 'foo' });

## get\_customers

Expand Down Expand Up @@ -136,7 +136,7 @@ The data param is optional.

## update\_charge

update_charge($id, $data)
update_charge($id, data => $data)

Updates an existing charge object.

Expand Down Expand Up @@ -166,6 +166,10 @@ Adds a new funding source (credit card) to an existing customer.

update_account($id, data => $data)

## get\_platform\_account

get_platform_account($id)

## upload\_identity\_document

Uploads a photo ID to an account.
Expand Down
4 changes: 2 additions & 2 deletions dist.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ license = Perl_5
copyright_holder = Tilt, Inc
copyright_year = 2014

version = 0.1200
version = 1.0000

[@Filter]
-bundle = @Basic
Expand Down Expand Up @@ -34,7 +34,7 @@ repository.web = https://github.com/Crowdtilt/WebService-Stripe
[PodWeaver]

[Prereqs]
WebService::Client = 0.0300
WebService::Client = 0.0400

[ReadmeAnyFromPod]

Expand Down
10 changes: 5 additions & 5 deletions lib/WebService/Stripe.pm
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ method get_customer(Str $id, :$headers) {
return $self->get( "/v1/customers/$id", {}, headers => $headers );
}

method update_customer(Str $id, HashRef $data, :$headers) {
method update_customer(Str $id, HashRef :$data!, :$headers) {
return $self->post( "/v1/customers/$id", $data, headers => $headers );
}

Expand All @@ -78,7 +78,7 @@ method create_charge(HashRef $data, :$headers) {
return $self->post( "/v1/charges", $data, headers => $headers );
}

method update_charge(HashRef|Str $charge, HashRef $data, :$headers) {
method update_charge(HashRef|Str $charge, HashRef :$data!, :$headers) {
$charge = $charge->{id} if ref $charge;
return $self->post( "/v1/charges/$charge", $data, headers => $headers );
}
Expand Down Expand Up @@ -260,14 +260,14 @@ Example:

=head2 update_customer

update_customer($id, $data)
update_customer($id, data => $data)

Updates a customer.
Returns the updated customer.

Example:

$customer = $stripe->update_customer($id, { description => 'foo' });
$customer = $stripe->update_customer($id, data => { description => 'foo' });

=head2 get_customers

Expand Down Expand Up @@ -331,7 +331,7 @@ The data param is optional.

=head2 update_charge

update_charge($id, $data)
update_charge($id, data => $data)

Updates an existing charge object.

Expand Down
3 changes: 2 additions & 1 deletion t/01-customers.t
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ subtest 'basic stuff' => sub {
is $cust->{description}, 'foo',
'... Fetched the created customer';

$cust = stripe->update_customer($cust->{id}, { description => 'bar' });
$cust = stripe->update_customer(
$cust->{id}, data=> { description => 'bar' });
is $cust->{description}, 'bar',
'... Updated the customer';

Expand Down
2 changes: 1 addition & 1 deletion t/02-charges.t
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ subtest 'create charge' => sub {
}),
'... Fetched the charge with expanded "customer" relation';

$charge = stripe->update_charge($charge, {
$charge = stripe->update_charge($charge, data => {
description => 'Foobar',
'metadata[bar]' => 'baz',
});
Expand Down