NAME

Net::API::Stripe::List - Stripe List Object

SYNOPSIS

my $stripe = Net::API::Stripe->new( conf_file => 'settings.json' ) || die( Net::API::Stripe->error );
my $list = $stripe->customers( 'list' ) || die( $stripe->error );
printf( "%d total customer(s) found\n", $list->count );
while( my $cust = $list->next )
{
    printf( "Customer %s with e-mail has a balance of %s\n", $cust->name, $cust->email, $cust->balance->format_money( 0, '¥' ) );
}

VERSION

v0.200.3

DESCRIPTION

This is a package with a set of useful methods to be inherited by various Stripe package, such as bellow packages. It can also be used directly in a generic way and this will find out which list of objects this is. This is the case for example when getting the list of customer tax ids in Net::API::Stripe::tax_id_list().

Net::API::Stripe::Billing::Invoice::Lines
Net::API::Stripe::Billing::Subscription::Items
Net::API::Stripe::Charge::Refunds
Net::API::Stripe::Connect::Account::ExternalAccounts
Net::API::Stripe::Connect::ApplicationFee::Refunds
Net::API::Stripe::Connect::Transfer::Reversals
Net::API::Stripe::Customer::List
Net::API::Stripe::Customer::Sources
Net::API::Stripe::Customer::Subscription
Net::API::Stripe::Customer::TaxIds
Net::API::Stripe::Order::Return
Net::API::Stripe::Payment::Intent::Charges

CONSTRUCTOR

new( %ARG )

Creates a new Net::API::Stripe::List object. It may also take an hash like arguments, that also are method of the same name.

METHODS

object string

This is the string identifier of the type of data. Usually it is "list"

data array

This is an array of data, usually objects, but it could vary, which is why this method should be overriden by package inheriting from this one.

has_more boolean

This is a boolean value to indicate whether the data is buffered

url URI

This is uri to be used to access the next or previous set of data

total_count integer

Total size of the array i.e. number of elements

get offset

Retrieves the data at the offset specified

length integer

The size of the array

next

Moves to the next entry in the array

prev

Moves to the previous entry in the array

API SAMPLE

{
  "object": "list",
  "url": "/v1/refunds",
  "has_more": false,
  "data": [
    {
      "id": "re_fake123456789",
      "object": "refund",
      "amount": 30200,
      "balance_transaction": "txn_fake123456789",
      "charge": "ch_fake123456789",
      "created": 1540736617,
      "currency": "jpy",
      "metadata": {},
      "reason": null,
      "receipt_number": null,
      "source_transfer_reversal": null,
      "status": "succeeded",
      "transfer_reversal": null
    },
    {...},
    {...}
  ]
}

HISTORY

v0.1

Initial version

v0.200

Change in version numbering

AUTHOR

Jacques Deguest <jack@deguest.jp>

SEE ALSO

Stripe API documentation:

https://stripe.com/docs/api

COPYRIGHT & LICENSE

Copyright (c) 2020-2020 DEGUEST Pte. Ltd.

You can use, copy, modify and redistribute this package and associated files under the same terms as Perl itself.