Skip to content

Commit

Permalink
Fix documentation, add abstracts to all modules.
Browse files Browse the repository at this point in the history
Finish moving to Pod::Weaver.
  • Loading branch information
rustyconover committed Apr 23, 2014
1 parent ea3d1af commit 36a402b
Show file tree
Hide file tree
Showing 16 changed files with 121 additions and 311 deletions.
9 changes: 7 additions & 2 deletions dist.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ copyright_year = 2011
repo = lukec/stripe-perl
[ChangelogFromGit]
[Git::NextVersion]
first_version = 0.09
first_version = 0.10
[ContributorsFromGit]
[PodWeaver]
[PodWeaver]

[ReadmeAnyFromPod / pod.root ]
filename = README.pod
type = pod
location = root
136 changes: 41 additions & 95 deletions lib/Net/Stripe.pm
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ use Net::Stripe::BalanceTransaction;

our $VERSION = '0.09';

=head1 NAME
Net::Stripe - API client for Stripe.com
# ABSTRACT: API client for Stripe.com

=head1 SYNOPSIS
Expand Down Expand Up @@ -57,12 +55,10 @@ This method returns Moose objects for responses from the API.
=head2 API Object
=head3 new PARAMHASH
=method new PARAMHASH
This creates a new stripe api object. The following parameters are accepted:
=over
=item api_key
This is required. You get this from your Stripe Account settings.
Expand All @@ -71,8 +67,10 @@ This is required. You get this from your Stripe Account settings.
You can set this to true to see extra debug info.
=back
=item debug_network
You can set this to true to see the actual network requests.
=cut

has 'debug' => (is => 'rw', isa => 'Bool', default => 0);
Expand All @@ -81,19 +79,14 @@ has 'api_key' => (is => 'ro', isa => 'Str', required => 1);
has 'api_base' => (is => 'ro', isa => 'Str', lazy_build => 1);
has 'ua' => (is => 'ro', isa => 'Object', lazy_build => 1);

=head2 Charges

All methods accept the same arguments as described in the API.
=charge_method post_charge( PARAMHASH | OBJECT )
See https://stripe.com/docs/api for full details.
=charge_method get_charge( CHARGE_ID )
=head3 post_charge( PARAMHASH | OBJECT )
=charge_method refund_charge( CHARGE_ID )
=head3 get_charge( CHARGE_ID )
=head3 refund_charge( CHARGE_ID )
=head3 get_charges( PARAMHASH )
=charge_method get_charges( PARAMHASH )
=cut

Expand Down Expand Up @@ -138,21 +131,16 @@ BalanceTransactions: {
}
}

=head2 Customers
All methods accept the same arguments as described in the API.

See https://stripe.com/docs/api for full details.
=customer_method post_customer( PARAMHASH | OBJECT )
=head3 post_customer( PARAMHASH | OBJECT )
=customer_method get_customer( CUSTOMER_ID )
=head3 get_customer( CUSTOMER_ID )
=customer_method delete_customer( CUSTOMER_ID )
=head3 delete_customer( CUSTOMER_ID )
=customer_method post_customer_subscription( CUSTOMER_ID, PARAMHASH )
=head3 post_customer_subscription( CUSTOMER_ID, PARAMHASH )
=head3 get_customers( PARAMHASH )
=customer_method get_customers( PARAMHASH )
=cut

Expand Down Expand Up @@ -197,21 +185,16 @@ Customers: {
}
}

=head2 Cards
All methods accept the same arguments as described in the API.

See https://stripe.com/docs/api for full details.
=card_method post_card( PARAMHASH )
=head3 post_card( PARAMHASH )
=card_method get_card( customer_id => CUSTOMER_ID, card_id => CARD_ID )
=head3 get_card( customer_id => CUSTOMER_ID, card_id => CARD_ID )
=card_method get_cards( customer_id => CUSTOMER_ID)
=head3 get_cards( customer_id => CUSTOMER_ID)
=card_method update_card( customer_id => CUSTOMER_ID, card_id => CARD_ID)
=head3 update_card( customer_id => CUSTOMER_ID, card_id => CARD_ID)
=head3 delete_card( customer_id => CUSTOMER_ID, card_id => CARD_ID )
=card_method delete_card( customer_id => CUSTOMER_ID, card_id => CARD_ID )
=cut

Expand Down Expand Up @@ -250,19 +233,11 @@ Cards: {
}


=subscription_method post_subscription( PARAMHASH )
=subscription_method get_subscription( customer_id => CUSTOMER_ID )
=head2 Subscriptions
All methods accept the same arguments as described in the API.
See https://stripe.com/docs/api for full details.
=head3 post_subscription( PARAMHASH )
=head3 get_subscription( customer_id => CUSTOMER_ID )
=head3 delete_subscription( customer_id => CUSTOMER_ID )
=subscription_method delete_subscription( customer_id => CUSTOMER_ID )
=cut

Expand Down Expand Up @@ -298,15 +273,10 @@ Subscriptions: {
}
}

=head2 Tokens
All methods accept the same arguments as described in the API.

See https://stripe.com/docs/api for full details.
=token_method post_token( PARAMHASH )
=head3 post_token( PARAMHASH )
=head3 get_token( TOKEN_ID )
=token_method get_token( TOKEN_ID )
=cut

Expand All @@ -322,19 +292,13 @@ Tokens: {
}
}

=head2 Plans
All methods accept the same arguments as described in the API.
=plan_method post_plan( PARAMHASH )
See https://stripe.com/docs/api for full details.
=plan_method get_plan( PLAN_ID )
=head3 post_plan( PARAMHASH )
=plan_method delete_plan( PLAN_ID )
=head3 get_plan( PLAN_ID )
=head3 delete_plan( PLAN_ID )
=head3 get_plans( PARAMHASH )
=plan_method get_plans( PARAMHASH )
=cut

Expand All @@ -360,19 +324,14 @@ Plans: {
}
}

=head2 Coupons
All methods accept the same arguments as described in the API.

See https://stripe.com/docs/api for full details.
=coupon_method post_coupon( PARAMHASH )
=head3 post_coupon( PARAMHASH )
=coupon_method get_coupon( COUPON_ID )
=head3 get_coupon( COUPON_ID )
=coupon_method delete_coupon( COUPON_ID )
=head3 delete_coupon( COUPON_ID )
=head3 get_coupons( PARAMHASH )
=coupon_method get_coupons( PARAMHASH )
=cut

Expand All @@ -398,19 +357,14 @@ Coupons: {
}
}

=head2 Invoices
All methods accept the same arguments as described in the API.

See https://stripe.com/docs/api for full details.
=invoice_method post_invoice( OBJECT )
=head3 post_invoice( OBJECT )
=invoice_method get_invoice( INVOICE_ID )
=head3 get_invoice( INVOICE_ID )
=invoice_method get_upcominginvoice( COUPON_ID )
=head3 get_upcominginvoice( COUPON_ID )
=head3 get_invoices( PARAMHASH )
=invoice_method get_invoices( PARAMHASH )
=cut

Expand All @@ -435,19 +389,13 @@ Invoices: {
}
}

=head2 InvoiceItems
All methods accept the same arguments as described in the API.
=invoiceitem_method post_invoiceitem( PARAMHASH | OBJECT )
See https://stripe.com/docs/api for full details.
=invoiceitem_method get_invoiceitem( INVOICEITEM_ID )
=head3 post_invoiceitem( PARAMHASH | OBJECT )
=invoiceitem_method delete_invoiceitem( INVOICEITEM_ID )
=head3 get_invoiceitem( INVOICEITEM_ID )
=head3 delete_invoiceitem( INVOICEITEM_ID )
=head3 get_invoiceitems( PARAMHASH )
=invoiceitem_method get_invoiceitems( PARAMHASH )
=cut

Expand Down Expand Up @@ -611,8 +559,6 @@ method _build_ua {
L<https://stripe.com>, L<https://stripe.com/docs/api>
=head1 AUTHORS
=head1 CONTRIBUTORS
=cut
Expand Down
4 changes: 3 additions & 1 deletion lib/Net/Stripe/BalanceTransaction.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ use Moose::Util::TypeConstraints;
use methods;
extends 'Net::Stripe::Resource';

# ABSTRACT: represent a BalanceTransaction object from Stripe

subtype 'TransactionType',
as 'Str',
where { $_ =~ /^(?:charge|refund|adjustment|application_fee(?:_refund)?|transfer_?(?:cancelfailure)?)$/ },
Expand All @@ -25,4 +27,4 @@ has 'status' => (is => 'ro', isa => 'StatusType');
has 'fee' => (is => 'ro', isa => 'Int');
has 'fee_details' => (is => 'ro', isa => 'Maybe[ArrayRef]');
has 'source' => (is => 'ro', isa => 'Str');
has 'description' => (is => 'ro', isa => 'Maybe[Str]');
has 'description' => (is => 'ro', isa => 'Maybe[Str]');
21 changes: 2 additions & 19 deletions lib/Net/Stripe/Card.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ use Moose;
use Moose::Util::TypeConstraints;
use methods;

# ABSTRACT: represent a Card object from Stripe

union 'StripeCard', ['Str', 'Net::Stripe::Card', 'Net::Stripe::Token'];

# Input fields
Expand Down Expand Up @@ -37,24 +39,5 @@ method form_fields {
);
}

=head1 NAME
Net::Stripe::Card
=head1 SEE ALSO
L<https://stripe.com>, L<https://stripe.com/docs/api>
=head1 AUTHORS
Luke Closs
=head1 LICENSE
Net-Stripe is Copyright 2011 Prime Radiant, Inc.
Net-Stripe is distributed under the same terms as Perl itself.
=cut

__PACKAGE__->meta->make_immutable;
1;
22 changes: 2 additions & 20 deletions lib/Net/Stripe/Charge.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ use Moose;
use methods;
extends 'Net::Stripe::Resource';

# ABSTRACT: represent an Charge object from Stripe

has 'id' => (is => 'ro', isa => 'Maybe[Str]');
has 'created' => (is => 'ro', isa => 'Maybe[Int]');
has 'amount' => (is => 'ro', isa => 'Maybe[Int]', required => 1);
Expand All @@ -29,25 +31,5 @@ method form_fields {
);
}

=head1 NAME
Net::Stripe::Charge
=head1 SEE ALSO
L<https://stripe.com>, L<https://stripe.com/docs/api>
=head1 AUTHORS
Luke Closs
=head1 LICENSE
Net-Stripe is Copyright 2011 Prime Radiant, Inc.
Net-Stripe is distributed under the same terms as Perl itself.
=cut


__PACKAGE__->meta->make_immutable;
1;
21 changes: 2 additions & 19 deletions lib/Net/Stripe/Coupon.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ use Moose::Util::TypeConstraints;
use methods;
extends 'Net::Stripe::Resource';

# ABSTRACT: represent a Coupon object from Stripe

union 'StripeCoupon', ['Str', 'Net::Stripe::Coupon'];

has 'id' => (is => 'rw', isa => 'Maybe[Str]');
Expand All @@ -22,24 +24,5 @@ method form_fields {
);
}

=head1 NAME
Net::Stripe::Coupon
=head1 SEE ALSO
L<https://stripe.com>, L<https://stripe.com/docs/api>
=head1 AUTHORS
Luke Closs
=head1 LICENSE
Net-Stripe is Copyright 2011 Prime Radiant, Inc.
Net-Stripe is distributed under the same terms as Perl itself.
=cut

__PACKAGE__->meta->make_immutable;
1;

0 comments on commit 36a402b

Please sign in to comment.