Net-Stripe

 view release on metacpan or  search on metacpan

CHANGES  view on Meta::CPAN

==================================================
Changes from 2019-03-16 00:00:00 +0000 to present.
==================================================

-----------------------------------------
version 0.42 at 2020-03-15 19:54:24 +0000
-----------------------------------------

  Change: 423fbd9166eb4450a52363dcd4abde53f97f2770
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-03-12 12:26:41 +0000

    Merge pull request #201 from sherrardb/fix-get-invoiceitems

    get_invoiceitems() not passing customer id 

  Change: 5d82542a3cf2c66aa041b72402e732c715ec2883
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-03-12 16:13:13 +0000

    get_invoiceitems() not passing customer id

    * pass customer id in get_invoiceitems()

    * add failing unit tests

    * closes <https://github.com/lukec/stripe-perl/issues/187> 

  Change: fc95fe52ac5c0db1fed00bd67522b2bb8b517e26
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-03-12 11:18:56 +0000

    Merge pull request #199 from
    sherrardb/add-payment-methods-and-payment-intents

    add PaymentMethod and PaymentIntent 

  Change: a16aad24ebd925f811a7b34745adfe1440f22671
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-03-12 12:58:21 +0000

    add PaymentMethod and PaymentIntent

    * added PaymentMethod object, methods and unit tests

    * added PaymentIntent object, methods and unit tests

    * updated POD

    * closes <https://github.com/lukec/stripe-perl/issues/115> 

  Change: b82aa508ee70a02a3731b86c4b3e1888355d05e5
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-03-11 14:39:58 +0000

    fix oversight in _get_all()

    * _get_all() throws an error attempting to get the next/prev page if
    the first page of results is empty

    * ensure that we only process the looping code if there are results
    in the first page 

  Change: 1cec4304ea1aa77b1b303ebb82dad6a732c8ded1
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-03-07 00:35:56 +0000

    fix typo in test data structures 

  Change: fb96be8f2da633395249eba9d5ee5d2146b9cf6f
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-03-06 14:25:28 +0000

    Merge pull request #197 from sherrardb/re-add-customer-to-invoice

    re-add customer to Invoice 

  Change: 1c8c2ac6d089a4c413986943249c1944e9143228
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-03-06 19:23:53 +0000

    re-add customer to Invoice

    * re-add customer attribute accidentally removed during 30a702b

    * update unit tests to detect this regression

    * closes <https://github.com/lukec/stripe-perl/issues/196> 

  Change: 28507b715bc5a171a1ced6bbdad9606fc8b6f596
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-03-05 18:44:25 +0000

    Merge pull request #130 from sherrardb/f-make-api-versionable

    allow API pinning for Net::Stripe object 

  Change: 4fcbca20cdbf1e2e6f61ad16ded3cfcbe0c31b6a
  Author: Sherrard Burton <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-03-05 23:38:56 +0000

    allow API pinning for Net::Stripe object

    * allow users to specify the API version when creating a new
    Net::Stripe object, per
    <https://stripe.com/docs/api/versioning#versioning>

    * add api_version argument and method for Net::Stripe object

    * add force_api_version argument and method for Net::Stripe object

    * update POD

    * closes <https://github.com/lukec/stripe-perl/issues/80> and
    <https://github.com/lukec/stripe-perl/pull/127> 

  Change: 6c462e9d08cc9f4d609e55885ae5631b6b2e369c
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-03-04 20:12:38 +0000

    Merge pull request #191 from sherrardb/add-product

    add Product 

  Change: 735ecee1b1552342ad714b73c314749d1fd8c5c6
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-03-05 01:05:12 +0000

    add Product

    * add Product object, methods and unit tests

    * update Plan object and tests to be compatible post 2018-02-05
    <https://stripe.com/docs/upgrades#2018-02-05>

    * update POD 

  Change: 8cff90fae49e915691fea4073a26f063aa9d3536
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-03-04 09:43:05 +0000

    Merge pull request #192 from sherrardb/add-get-all

    add _get_all() 

  Change: da68023152a983c711b34160fbf01db0b768d823
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-03-04 14:41:15 +0000

    add _get_all()

    * allow for retrieval of all objects of a given type without local
    pagination code

    * add unit tests for related utility methods

    * update existing list-retrieval methods

    * update POD 

  Change: 2789400ef18bd462729c7abb541b2b777cea5ba0
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-28 18:45:13 +0000

    Merge pull request #195 from sherrardb/update-invoice

    update Invoice 

  Change: 30a702b758465231ef06176fdbf92c1a361ab0d3
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-28 23:16:47 +0000

    update Invoice

    * add backwards-compatible 'auto_advance' attribute, per
    <https://stripe.com/docs/upgrades#2018-11-08>

    * add backwards-compatible 'created' attribute, per
    <https://stripe.com/docs/upgrades#2019-03-14>

    * remove required constraints for 'closed' and 'date' attributes

    * update POD 

  Change: 908b5e997da68ce5fd7b612b1ded6575c3fababb
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-28 16:12:22 +0000

    Merge pull request #194 from
    sherrardb/add-subscription-cancel-at-period-end-argument

    update post_subscription() 

  Change: 291e8c175d4fc548095a7a87ba9f927222f9d0f1
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-28 21:10:58 +0000

    update post_subscription()

    * add 'cancel_at_period_end' to post_subscription()

    * add 'cancel_at_period_end' to form_fields() for Subscription object

    * update unit tests to use 'cancel_at_period_end' for pending
    cancelations

    * update POD 

  Change: c989d301006e3099a6f5fc25948ad78bd3d9ede4
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-28 10:36:50 +0000

    Merge pull request #193 from
    sherrardb/update-customer-balance-attribute

    add balance for Customer 

  Change: c312a62e4aefea3b8158124c0ff079a475c88882
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-28 15:35:18 +0000

    add balance for Customer

    * add backwards-compatible 'balance' attribute for Customer objects

    * add 'balance' argument for post_customer()

    * add unit tests

    * update POD

    * addresses API update 2019-10-17
    <https://stripe.com/docs/upgrades#2019-10-17> 

  Change: 3779df9d82f154ebe3db428d9d3c4976cdcb4f61
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-28 15:28:18 +0000

    fix typo in README.pod 

  Change: 03cd1edc635c2dc2aab75fdafde7d225f1768a36
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-25 04:23:34 +0000

    update t/local.t

    * remove temporary naming for static encoding tests, per
    <https://github.com/lukec/stripe-perl/issues/189>

    * add hashref tests for convert_to_form_fields()

    * label object tests for convert_to_form_fields() 

  Change: b7063845610a8abcdf87856bfe50c7504391edc6
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-25 01:13:31 +0000

    update README.pod

    * move update_card() documentation to more-appropriate section

    * add documentation for Source changes in `1370e49` 

  Change: 38e68b348af077e9a549ce484e59dac320d45994
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-22 17:57:41 +0000

    update fake metadata keys to reflect their generic usage 

  Change: eaded860861a380ea972a8377aa51d19eb06ef47
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-18 22:03:01 +0000

    Merge pull request #188 from
    sherrardb/add-source-to-charge-and-customer

    Add source to charge and customer 

  Change: 1370e4966d85d0d4f12f1fb7555379fe34651dc9
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-19 03:00:07 +0000

    add source for Charge and Customer

    * add Source object, methods and unit tests

    * add backward-compatible source attributes and parameters for Charge
    and Customer

    * update unit tests to pass 'source' instead of 'card' where the
    calling form is not germane to the test

    * update POD 

  Change: 23a5ae5b827ee61baf009c3da1bbef88b39572a5
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-18 21:57:51 +0000

    Merge pull request #175 from sherrardb/remove-manual-serialization

    remove manual serialization in _get_collections() and
    _get_with_args() 

  Change: 8b3b33d67b9dc9a8b7316dab65670bf4fc113f09
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-19 02:20:38 +0000

    remove manual serialization in _get_collections() and
    _get_with_args()

    * update convert_to_form_fields() to handle objects

    * use convert_to_form_fields() for processing passed data and URI for
    encoding, elminating _get_collections() and _get_with_args()

    * remove manual serialization in _delete()

    * add unit tests for code path to be deprecated later

    * closes <https://github.com/lukec/stripe-perl/issues/167> 

  Change: ddcf010cb824b65a92f3254a4084df2641db4f09
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-17 04:39:49 +0000

    move static unit tests to t/local.t 

  Change: 079e182a206cfe8ac2b0959ef5bc5359c96c168a
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-14 04:33:05 +0000

    fix typo in TypeConstraint unit tests 

  Change: 8a64af05dada7c6daf484d17e587ddf7a65fbcff
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-13 22:51:23 +0000

    Merge pull request #185 from sherrardb/add-coupon-metadata

    add metadata for Coupon 

  Change: cb271ac345633e48bf30266fff82e655a9955af2
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-14 03:50:18 +0000

    add metadata for Coupon

    * clean up and augment unit tests

    * update POD 

  Change: df4b926311b45b7ca6c7e9768f2c829ceeff2389
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-13 22:29:53 +0000

    Merge pull request #184 from sherrardb/add-plan-metadata

    add metadata for Plan 

  Change: 9f922f9175dc6783da87836e68cb2c1b5cbe7af2
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-14 03:17:45 +0000

    add metadata for Plan

    * clean up and augment unit tests

    * update POD

    * closes <https://github.com/lukec/stripe-perl/issues/70> 

  Change: f3f67224ded02d14d3cf8654a6d39cf748586a43
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-11 22:45:48 +0000

    Merge pull request #182 from
    sherrardb/unit-tests-for-type-constraints

    add unit tests for TypeConstraints 

  Change: eb71d321bbc85493a714fa1e6ac24220b94e97c6
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-12 03:42:50 +0000

    add unit tests for TypeConstraints 

  Change: 793b4663e10b1ecae5074afd83459e826bc2e5ad
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-11 16:33:38 +0000

    Merge pull request #181 from sherrardb/update-default-card

    default_card not updating in post_customer() 

  Change: 8d01f02787e08a7b1086b2ccfb933b267d498be5
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-11 17:35:33 +0000

    default_card not updating in post_customer()

    * add default_card to form_fields()

    * update attribute to 'rw'

    * update unit tests

    * update POD

    * closes <https://github.com/lukec/stripe-perl/issues/158> 

  Change: 00c6a02e6457a81f72e5c11e36faebd98020a05b
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-11 10:46:42 +0000

    Merge pull request #180 from
    sherrardb/remove-unnecessary-token-creation

    remove unnecessary token object creation 

  Change: 8fea47428017d5128b4dceecc1860cdeee04864c
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-11 15:44:59 +0000

    remove unnecessary token object creation

    * pass the test token directly where there is no further
    introspection of $token

    * remove cases where introspection of $token is not germane to the
    current unit test

    * leave cases where we are expressly testing passing of a token
    object or where $token is needed for other reasons

    * closes <https://github.com/lukec/stripe-perl/issues/172> 

  Change: e8b157b372e98209be4e9b3079d7791e1374efed
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-11 09:38:42 +0000

    Merge pull request #179 from sherrardb/capture-partial-charge

    capture partial charge 

  Change: 6e931cad976d3eb5f087a17b146bb04814000be9
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-11 14:36:53 +0000

    capture partial charge

    * update capture_charge() to allow for partial capture

    * add refunds attribute to charge object

    * add unit tests for partial capture

    * closes <https://github.com/lukec/stripe-perl/issues/144> 

  Change: 49d450f1a61d642a10500e6deb57b3acdf0548c2
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-10 16:10:30 +0000

    Merge pull request #178 from sherrardb/test-delete-card

    add unit tests for delete_card() 

  Change: 560b30021aac51708d9fbb012e9e207d01e89933
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-10 21:08:05 +0000

    add unit tests for delete_card() 

  Change: 64957919b3bc4cee94154a7ecdffe6c674142992
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-10 15:44:38 +0000

    Merge pull request #177 from
    sherrardb/remove-duplicate-post-charge-tests

    remove duplicate post_charge() tests 

  Change: fa3594db56ba4b3a1279b02dc36c760ac3affec3
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-10 20:38:50 +0000

    remove duplicate post_charge() tests

    * closes <https://github.com/lukec/stripe-perl/issues/169> 

  Change: 3683687ac812912f4e7d82cc140307b1681e2555
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-10 15:26:38 +0000

    Merge pull request #176 from sherrardb/update-token-attributes

    update Token attributes 

  Change: 79ab847529e4fd4698f0eb418d214c14943404cb
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-10 20:25:37 +0000

    update Token attributes

    * add type attribute and add test

    * add client_ip attribute

    * fix typo in token retrieval test

    * closes <https://github.com/lukec/stripe-perl/issues/170> and
    <https://github.com/lukec/stripe-perl/issues/174> 

  Change: 678ed9f28bd48524c4a408fad505891d781d59ae
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-06 04:36:25 +0000

    fix pod 

  Change: 0e0cd19ce71526528892615e21a9a1fdb3a05cba
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-05 23:26:42 +0000

    Merge pull request #164 from sherrardb/fix-pan-deprecation-oversight

    remove card hash handling code in post_card() 

  Change: 116198f7a8accecddf5e2a2a7bc8c0c1d9c47ff2
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-06 04:22:15 +0000

    remove card hash handling code in post_card()

    * fix oversight from `5ad870c`

    * this conditional is not needed since `card` no longer accepts
    HashRef

    * closes <https://github.com/lukec/stripe-perl/issues/163> 

  Change: 53b3b0c166a9ba9b7d16e8b878044107d14bea74
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-04 13:00:23 +0000

    Merge pull request #161 from sherrardb/deprecate-pan-handling-wip

    deprecate direct handling of PANs 

  Change: 5ad870c499e24f82882a99c44f74d862e0ac5f70
  Author: Sherrard Burton <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-02-04 17:59:44 +0000

    deprecate direct handling of PANs:

    * Stripe strongly discourages direct handling of PANs (primary
    account numbers), even in test mode

    * accounts created after October 2017 return an invalid_request_error
    when passing PANs

    * removed the methods and parameter constraints that allow direct
    handling of PANs and their associated unit tests

    * updated the unit tests to use test tokens instead of card numbers 

  Change: ae52948f225920492aadb8cd396d9c1e7b000481
  Author: Sherrard Burton <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-01-31 02:39:43 +0000

    fix typo in Net::Stripe::Resource::form_fields_for_hashref()

    * correct incomplete transition of method name after copying code

    * add trivial unit test as a placeholder

    * closes <https://github.com/lukec/stripe-perl/issues/162> 

  Change: b19eb742b77061578195483a71912b3d0c76eb80
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-01-30 22:19:40 +0000

    create release notes sub-sections in README.pod 

  Change: 265846a491f0bedb6c7f120fe0f1bb0599ed7b0a
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-01-28 08:29:00 +0000

    Merge pull request #160 from
    sherrardb/consolidate-form-serialization-wip

    consolidate logic for serializing form fields 

  Change: b5fb6f5725e1226d903c6c772b95e943bf2e195c
  Author: Sherrard Burton <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-01-28 03:25:22 +0000

    consolidate logic for serializing form fields 

  Change: 61db3862ade431b7a7b46b9641edfa3b43d717e6
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-01-27 21:23:44 +0000

    Merge pull request #159 from sherrardb/update-charge-status

    update unit tests for Charge->status 

  Change: 4ee0872e9be3ae04b1bc51497102e7071644c3d8
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-01-28 02:22:49 +0000

    update unit tests for Charge->status:

    * check for either of the valid succesful values, 'paid' for Stripe
    API versions before 2015-02-18 or 'succeeded' for versions after
    <https://stripe.com/docs/upgrades#2015-02-18> 

  Change: 43da122fa129d3a096c816e45c9742027797912d
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-01-26 02:57:58 +0000

    update dist.ini:

    * generate META.json
    <https://cpants.cpanauthors.org/kwalitee/has_meta_json> 

  Change: 3151556f52b21465c547862f740fa6f21ff25743
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-01-21 21:32:33 +0000

    Merge pull request #153 from sherrardb/fix-post-customer-args

    fix post_customer() arguments 

  Change: ff84dd7143f0374cacced7215a276cdb1278ba6c
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-01-22 01:59:59 +0000

    fix post_customer() arguments:

    * updated Kavorka signature to remove non-functional or illegitimate
    argument types

    * removed Net::Stripe::Card and disallowed card id for card, as
    neither form is valid conceptually
    <https://github.com/lukec/stripe-perl/issues/138>

    * always create a Net::Stripe::Customer object before _post() to take
    advantage of argument coercion during objectification
    <https://github.com/lukec/stripe-perl/issues/148>

    * include omitted arguments in object creation

    * clean up and centralize Net::Stripe:Token coercion code, since we
    always need the token id

    * added unit tests to exercise all allowed argument forms for
    customer creation and customer update
    <https://github.com/lukec/stripe-perl/issues/139>

    * closes <https://github.com/lukec/stripe-perl/issues/138> 

  Change: e0d2a992da492406c23bcd8afc45b393aac80822
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-01-21 20:15:18 +0000

    Merge pull request #151 from sherrardb/fix-post-card-args

    cleanup post_card() 

  Change: ec48dd338c3fd60a2bbfb0af0a473ef449d6f411
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-01-22 01:11:22 +0000

    cleanup post_card():

    * remove invalid argument types from post_card(), per
    <https://github.com/lukec/stripe-perl/issues/138>

    * remove dead code paths from post_card() and make conditional
    structure more explicit, per discussion in
    <https://github.com/lukec/stripe-perl/pull/133>

    * add unit tests for all calling forms, per
    <https://github.com/lukec/stripe-perl/issues/139>

    * update the POD 

  Change: 1c242e98e43ec61b96c5d2f50d2a769f23c01691
  Author: Sherrard Burton <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-01-21 21:54:08 +0000

    Update README.pod

    * remove the hyperlink formatting markers from our custom Moose
    TypeConstraints

    * regenerate README.pod 

  Change: a341c803a8dc29a522f2243a599c1c392500ac70
  Author: Sherrard Burton <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-01-21 21:33:44 +0000

    Update README.pod

    * add capture_charge()

    * regenerate README.pod 

  Change: 11b29bda97f3ce2517195005c3b8ffcd06998af7
  Author: Sherrard Burton <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-01-21 19:08:31 +0000

    Update README.pod

    * update POD oversights from fd8e79e0

    * regenerate README.pod 

  Change: b9f0d4adedea6bef4a7622a9cfa378077a6e8b23
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-01-21 13:01:18 +0000

    Merge pull request #150 from sherrardb/f-cannot-update-existing-card

    allow updates to existing cards 

  Change: 7ff3208c56c5b388c36fc2a4b719942917bf8085
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-01-21 17:58:54 +0000

    allow updates to existing cards:

    * add update_card() method to allow updates to card address,
    expiration, metadata, etc for existing customer cards

    * update convert_to_form_fields() to handle customer card metadata

    * add unit tests to confirm card metdata update

    * correct errant 'rw' on metadata attribute in `Net::Stripe::Card` 

  Change: 646861d829729d6d2c649ae1b426618d50f84914
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-01-18 14:45:17 +0000

    Merge pull request #147 from sherrardb/fix-post-charge-args

    fix post_charge() arguments 

  Change: fd8e79e031839a094a37b4b9976da2e0e2df745e
  Author: Sherrard Burton <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-01-18 19:44:25 +0000

    fix post_charge() arguments:

    * updated Kavorka signature to remove non-functional argument types

    * removed Net::Stripe::Customer and HashRef for customer, as neither
    form was being serialized correctly for passing to the API call

    * removed Net::Stripe::Card and Net::Stripe::Token for card, as
    neither form was being serialized correctly for passing to the API
    call

    * added in-method validation and unit tests for the different
    combinations of the allowed argument types

    * updated and reorganized failing unit tests

    * closes <https://github.com/lukec/stripe-perl/issues/94> and
    <https://github.com/lukec/stripe-perl/issues/137> 

  Change: b3ffb02692aa4259351f3512837ca64b2820b96e
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-01-16 22:26:56 +0000

    Merge pull request #143 from sherrardb/defined-arguments-unnecessary

    _defined_arguments() is unnecessary 

  Change: eb386908918bf0e14418647b6f3d405c8d9f29cb
  Author: Sherrard Burton <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-01-17 03:23:03 +0000

    _defined_arguments() is unnecessary:

    * only called in post_customer() for hashref argument to _post()

    * _post() calls convert_to_form_fields() for hashrefs

    * convert_to_form_fields() skips hashref keys with undefined values

    * closes <https://github.com/lukec/stripe-perl/issues/136> 

  Change: a297a1aa2606ebb89f6abcab1ba22f960ad1ff9c
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-01-16 22:17:49 +0000

    Merge pull request #142 from sherrardb/remove-redundant-token-tests

    remove redundant Token tests 

  Change: 2d0022d58ac3ee5d726ad900ae6e67214d5fef98
  Author: Sherrard Burton <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-01-17 03:16:51 +0000

    remove redundant Token tests: The tests on `$no_amount` became
    redundant when the Token tests were reworked in `8ca8bcc` to remove
    `amount` and `currency`, and should have been removed at that time.
    Closes <https://github.com/lukec/stripe-perl/issues/126>. 

  Change: dffa55624020f119dbff28fd4bb068a4d0049b01
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-01-16 22:09:40 +0000

    Merge pull request #131 from sherrardb/coerce-old-lists

    make Net::Stripe compatible with API back to 2011-06-21 

  Change: 3d76661d362011b77e3057009348185f74a810b4
  Author: Sherrard Burton <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-01-17 03:06:44 +0000

    coerce old-style lists and collections into Net::Stripe::List format:
    In older Stripe API versions, some list-type data structures were
    returned as arrayrefs. We now coerce those old-style lists and
    collections into the hashref format that newer versions of the API
    return, with metadata stored top-level keys and the list elements in
    an arrayref with the key `data`, which is the format that
    Net::Stripe::List expects. This makes the SDK compatible with the
    Stripe API back to the earliest documented API version
    https://stripe.com/docs/upgrades#2011-06-21. 

  Change: b765c69195966a05c0b24dcdd275821c7755690f
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-01-16 21:45:20 +0000

    Merge pull request #132 from sherrardb/update-statement-description

    update statement_description to statement_descriptor 

  Change: 71c4e9fa15c73f2f4dbe48e125c728e16f477612
  Author: Sherrard Burton <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-01-17 02:40:41 +0000

    update statement_description to statement_descriptor:

    * add failing test to detect ignored attribute `statement_descriptor`
    in Net::Stripe::Charge

    * add missing `statement_descriptor` attribute in Net::Stripe::Charge

    * update `statement_description` to `statement_descriptor`
    Net::Stripe::Plan

    * API docs <https://stripe.com/docs/upgrades#2014-12-17> indicate
    that this change is backwards-compatible 

  Change: 76f96f3c0b193ae1391a20cb90fb3145b7ddd0b9
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-01-17 02:33:37 +0000

    Merge pull request #141 from sherrardb/add-release-notes

    add RELEASE NOTES section to POD 

  Change: f4c00a86fad00c6f8c6bf60223f3a23e0020f583
  Author: Sherrard Burton <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-01-17 02:33:21 +0000

    add RELEASE NOTES section to POD. any breaking changes,
    non-backwards-compatible changes or other 'gotchas' should be
    documented in this section, with additional details in the commit
    message and code if necessary. 

  Change: 2d417c804b8ae0456453a29877de0d3285cd9897
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-01-17 02:33:06 +0000

    Merge pull request #140 from sherrardb/fix-pod-oversights

    fix POD oversights 

  Change: ecb906029486cdfb714a5c20075b7ae20363f90f
  Author: Sherrard Burton <32931314+sherrardb@users.noreply.github.com>
  Date : 2020-01-17 02:32:52 +0000

    update POD, dist.ini and weaver.ini:

    * add encoding declaration to POD to fix unsafe character warning.
    this was fixed directly in README.pod during a previous commit, but
    was overwritten during the dzil regeneration of README.pod.

    * add missing section for Discount methods in weaver.ini

    * remove trailing period from copyright_holder in dist.ini.
    apparently dzil adds a period when regenerating README.pod.

    * regenerate README.pod 

  Change: b091f06825bdef4c895383c990c9e1187849331a
  Author: Luke Closs <lukec@users.noreply.github.com>
  Date : 2019-12-14 11:22:30 +0000

    Create CODE_OF_CONDUCT.md 

  Change: 5a5483dc0bf2a777327860265132e3d3d4fb5a5e
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2019-12-12 11:42:36 +0000

    Update README.pod 

  Change: 29fec4341f75e5aa8b866c9ea49bed7f964bec29
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2019-12-01 14:07:25 +0000

    Centralise boolean post parameter generation - Sherrard Burton 

  Change: 2ea471d951914950f02adc211d981378e0a3c52b
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2019-07-15 22:41:18 +0000

    Update README.pod 

  Change: cfe23170652ee8738e5cfcace84a1882836eff35
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2019-07-15 22:32:47 +0000

    Update README.pod 

  Change: afebdb66f181c51f872452d8b951ff08c23e0a1a
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2019-07-15 11:55:10 +0000

    fix pod 

  Change: 6dfef08471a1bdfb0151cb46458a0e6049a94957
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2019-07-14 13:29:26 +0000

    Update README.pod 

  Change: f00893a56ddaf7084782affa14325a5c365be61c
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2019-07-14 13:16:30 +0000

    Merge pull request #116 from andrewsolomon/master

    Fix unit test and add warning re: Stripe API versioning 

  Change: 440bd87e632424a30eb511b262ecde94dfb30a1c
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2019-07-14 13:12:33 +0000

    update pod 

  Change: 49f3b6c7499769c1602af354bd24080b6cc48316
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2019-07-14 13:07:00 +0000

    add WARNING to pod 

  Change: 8cf92ad14199eacad19053bd409cea9c6e065ff6
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2019-07-14 12:28:03 +0000

    changed error message in unit test 

  Change: 75a9019d5f704113f5e314766bb249212423437b
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2018-12-16 07:46:10 +0000

    Merge pull request #113 from pscott-au/master

    UTF8 Encoding POD 

  Change: 79867259b4b4e72ca4729ac90b92452e5b3fece0
  Author: Peter Scott <peter@shotgundriver.com>
  Date : 2018-12-16 13:28:04 +0000

    UTF8 Encoding POD

    Attempt to fix POD errors rendered on Github 

  Change: ee2f20df3df3479e716eb7843c7fc439e2013435
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2018-07-15 07:17:13 +0000

    Merge pull request #111 from sherrardb/f_allow_auth_then_capture

    allow auth-only charge with capture later 

  Change: 0b7d9057cc025556e9c1888c0a8b585524babcb2
  Author: Sherrard Burton <sburton@allafrica.com>
  Date : 2018-07-14 20:32:52 +0000

    allow auth-only charge with capture later 

  Change: 42c629b8d2c149aedfd876b08ea8b743834a52ca
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2018-07-14 22:10:28 +0000

    Merge pull request #108 from sherrardb/add_charge_status

    add status field for charge object 

  Change: 29d1d4b8bfeea3a4e606759d003262375b357b64
  Author: Sherrard Burton <sburton@allafrica.com>
  Date : 2018-07-14 09:45:36 +0000

    add status field for charge object 

  Change: 93bddc5e125ef3c7b6b08bef236d73d25fdf053e
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2018-07-14 09:22:41 +0000

    Version 0.36 docs 

  Change: 96dd910d23d6b144b0cce9f64824c05fb62dbdb0
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2018-07-14 07:26:55 +0000

    Merge pull request #107 from sherrardb/fix_deleted_objects

    avoid objectification for deleted objects 

  Change: 01d385d00a6445148aaccf3b364ea4314fd9d169
  Author: Sherrard Burton <sburton@allafrica.com>
  Date : 2018-07-13 14:01:36 +0000

    avoid objectification for deleted objects stripe now seems to be
    passing back the object type for deleted objects. when we objectify
    them in _hash_to_object() the deleted field is dropped since most
    objects do not define that field explicitly. by manually deleteing
    the object type from the returned hash, we can follow the previous
    code path. 

  Change: f6886edba269dbefd72d0b4b2e3aa7547c8708e9
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2018-07-06 23:07:15 +0000

    Version 0.35 docs 

  Change: 11c2e0c5ce4fc612f6d84bd33ca91f97ecb803e2
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2018-07-06 22:54:31 +0000

    release notes 

  Change: 95b5a622d795a001de4cd69220cc6f7ea2eeff31
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2018-07-06 22:47:00 +0000

    Merge pull request #103 from sherrardb/retrieve_customer_by_email

    add email argument to get_customers 

  Change: d9e8ea17d070f5fdb76f42fd9da97fc48e23cb70
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2018-07-06 22:36:01 +0000

    Merge pull request #102 from sherrardb/add_ending_before

    add ending_before and tests for pagination arguments 

  Change: 0fa8fcaf4652857707df4cd2a121348bec9e57be
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2018-07-06 22:29:04 +0000

    Merge pull request #101 from sherrardb/add_customer_card_via_token

    allow addition of new card to customer via passing of an existing
    token 

  Change: 56f14d0f85f49d66de4e69bac997bf0e348f1ea1
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2018-07-06 22:16:27 +0000

    Merge branch 'sherrardb-add_address_city' 

  Change: a6f426b6d2effb81fcc1c997e6096f8ff6468ac4
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2018-07-06 22:15:51 +0000

    sherrardb-add_address_city fix merge conflict 

  Change: e6c424407ba2d9ae4f652bc902f23cb2e30a4f5e
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2018-07-06 22:09:16 +0000

    Merge pull request #98 from sherrardb/add_card_metadata

    add metadata field for Net::Stripe::Card 

  Change: 4763fb1f60c078d64892d2f9a4a83f657d7929cb
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2018-07-06 21:57:57 +0000

    Merge pull request #97 from sherrardb/consistent_type_constraints

    use consistent syntax for use Moose::Util::TypeConstraints 

  Change: 0a1cf93bfca588302d1065bbb7c1c0caf6e7a463
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2018-07-06 21:47:48 +0000

    Merge pull request #96 from sherrardb/extraneous_type_constraints

    remove extraneous use Moose::Util::TypeConstraints 

  Change: dca8c7cda603d05b98824bba2a51ba2b16287d22
  Author: sherrardb <32931314+sherrardb@users.noreply.github.com>
  Date : 2018-07-06 21:40:12 +0000

    Charge receipt email (#95)

    * Adds support for the `receipt_email` parameter on Charge objects

    The `receipt_email` parameter is the email address to send this
    charge's receipt to. The receipt will not be sent until the charge is
    paid. If this charge is for a customer, the email address specified
    here will override the customer's email address.

    Receipts will not be sent for test mode charges.

    If `receipt_email` is specified for a charge in live mode, a receipt
    will be sent regardless of your email settings.

    Signed-off-by: Zach Wick <zwick@stripe.com>

    * cherry-pick updates to _hash_to_object because unit tests fail on
    SubscriptionItem

    * add receipt_email to form_fields for Net::Stripe::Charge

    * add unit tests for receipt_email 

  Change: 0abf9a23594386bdbc390b1a6aa462cd0b86caed
  Author: Sherrard Burton <sburton@allafrica.com>
  Date : 2018-04-17 14:37:40 +0000

    remove debugging oversight 

  Change: 5bc1eccc06c51feb0c29f965e1bec29de5a710ae
  Author: Sherrard Burton <sburton@allafrica.com>
  Date : 2018-04-09 22:22:34 +0000

    add email argument to get_customers 

  Change: 8430f694e2e68d205d653301d708223e0be6ffdb
  Author: Sherrard Burton <sburton@allafrica.com>
  Date : 2018-04-07 23:13:12 +0000

    add ending_before and tests for pagination arguments 

  Change: 31878a01ae8c9f5acc5636a15587d07c323dae91
  Author: Sherrard Burton <sburton@allafrica.com>
  Date : 2018-04-07 21:54:22 +0000

    allow addition of new card to customer via passing of an existing
    token 

  Change: 3a88f821aabf8f43448b6dda2d962f3f1a7e58f4
  Author: Sherrard Burton <sburton@allafrica.com>
  Date : 2018-04-05 02:54:25 +0000

    add address_city field for Net::Stripe::Card 

  Change: 267f0b6462926b06644cc3505bef080528a83d50
  Author: Sherrard Burton <sburton@allafrica.com>
  Date : 2018-04-05 02:32:00 +0000

    add metadata field for Net::Stripe::Card 

  Change: f641063318d1263b3515db18b911d2efff9117e0
  Author: Sherrard Burton <sburton@allafrica.com>
  Date : 2018-04-03 23:02:59 +0000

    use consistent syntax for use Moose::Util::TypeConstraints 

  Change: 4b64aa87ff7cc48cdfa742fd5ae48dfa616f81f4
  Author: Sherrard Burton <sburton@allafrica.com>
  Date : 2018-04-03 22:44:36 +0000

    remove extraneous use Moose::Util::TypeConstraints 

  Change: 56541b71e642bd871cf592fbfbd17cfc68b1a1f2
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2018-02-10 11:43:39 +0000

    Version 0.34 docs 

  Change: f56016c41df7a2f773608aa836038acb1ef6742b
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2018-02-10 11:23:03 +0000

    Merge pull request #93 from slobo/patch-1

    Fix `starting_after` not passed properly 

  Change: 4c845ea45a1e48d3e8933ea2f70ef1987b2509c7
  Author: Slobodan Mišković <slobodan@miskovic.ca>
  Date : 2018-02-09 15:18:27 +0000

    Fix `starting_after` not passed properly 

  Change: 623a897b06c391d0f836abe36d2796e2f97c5638
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2017-11-04 21:57:16 +0000

    Merge pull request #86 from sherrardb/address_check_typo

    Fix typo for output field address_line1_check 

  Change: 49c5a6e0514b97b5de59cb63cb7ebeb0f67e244c
  Author: Sherrard Burton <32931314+sherrardb@users.noreply.github.com>
  Date : 2017-11-04 20:55:44 +0000

    remove extraneous "my" 

  Change: 7fa533ceca535fe25876a86c4d640011577e956a
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2017-11-04 20:27:54 +0000

    Merge pull request #91 from sherrardb/use_get_card_w

    replace _get() with get_card in unit tests 

  Change: 4ca67fb14fc335432c6ab5273e94225a4aac9d8f
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2017-11-04 18:59:21 +0000

    issue #90 - prevent testing against live data 

  Change: db64f01c9bac8ecf0deba00282cec33bb0c15a7b
  Author: Sherrard Burton <32931314+sherrardb@users.noreply.github.com>
  Date : 2017-10-30 22:11:08 +0000

    replace _get() with get_card in unit tests

    instead of manually constructing paths and calling _get() directly,
    use the more-robust get_card() 

  Change: 0c6764b61e2027316f4227c378b12b4329e47c08
  Author: Sherrard Burton <32931314+sherrardb@users.noreply.github.com>
  Date : 2017-10-27 17:52:08 +0000

    Fix typo for output field address_line1_check

    Fix typo for output field address_line1_check 

  Change: 137d64a27a6f6c8ffd1076aaba26f200e90165fd
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2017-10-27 00:32:29 +0000

    Merge pull request #87 from sherrardb/missing_test_names

    Fix missing test names 

  Change: 05d1965a0fe30857cec1254e5d14d27e059d91c1
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2017-10-27 00:30:34 +0000

    Merge pull request #88 from sherrardb/set_dev_ua_string

    Set user agent string for dev environment 

  Change: c70a2d52cd4e45df2f527b5219a20d4f382f9fdc
  Author: Sherrard Burton <32931314+sherrardb@users.noreply.github.com>
  Date : 2017-10-26 09:26:54 +0000

    Set user agent string for dev environment

    set user agent string to Net::Stripe/dev when $Net::Stripe::VERSION
    is unset 

  Change: 5c6d9370981d9fe61852ffa366a18c0d85bfdfff
  Author: Sherrard Burton <32931314+sherrardb@users.noreply.github.com>
  Date : 2017-10-26 00:48:20 +0000

    Fix missing test names 

  Change: 6091e5f3a372b2ab04b27043a8c2c24430c8d63f
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2017-05-11 22:34:35 +0000

    Version 0.33 docs 

  Change: 523cf60d3d4f53a9b49180a86c18f7e4fc674354
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2017-05-02 23:25:52 +0000

    Merge pull request #81 from fheyer/fix_refund

    Refund: removed description, added status attr 

  Change: 546c906b7e00c2a964ca382e594c503ece256658
  Author: Florian Heyer <info@heyer-it.de>
  Date : 2017-05-02 12:29:19 +0000

    added deprecation warning for attr description 

  Change: af246bf4579b8dad25b6de258eaec1e0c7e7d0d3
  Author: Florian Heyer <info@heyer-it.de>
  Date : 2017-05-02 11:19:09 +0000

    added test 

  Change: e484f0311c2c1a863d1aefce5b7248f669644b80
  Author: Florian Heyer <info@heyer-it.de>
  Date : 2017-05-02 11:10:59 +0000

    Merge branch 'master' of https://github.com/lukec/stripe-perl into
    fix_refund 

  Change: 5d7fa8b059ca147a0529978cbb3312287b3e291e
  Author: Florian Heyer <info@heyer-it.de>
  Date : 2017-04-30 13:16:45 +0000

    Refund: removed description, added status attr

    field description does not exist in Stripe API doc, status was
    missing see https://stripe.com/docs/api#refunds for reference 

  Change: b977c4f4f805ff0642ea11e07b4111481115195e
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2017-04-29 22:54:24 +0000

    Merge pull request #67 from choroba/master

    Fail a test if the invalid currency isn't reported 

  Change: 3b9ffb7f4e2fba2e49a09e3631ba2ee0888de389
  Author: E. Choroba <choroba@matfyz.cz>
  Date : 2017-04-29 23:28:28 +0000

    Fail a test if the invalid currency isn't reported 

  Change: df6b654759e4ec7943466223cfeaae105f69e9c6
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2017-04-29 14:57:34 +0000

    documentation updated by dzil 

  Change: a1f7081e23537a8e0bb69522cf353ee15fba2b14
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2017-04-29 14:49:41 +0000

    Merge pull request #79 from andrewsolomon/master

    Issue #78 - fix get_cards 

  Change: b83a71f8e868ae011b8cac02a1459c7a4d7a2233
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2017-04-29 12:36:07 +0000

    Issue #78 - fix get_cards 

  Change: 48626a2575f2d2b775051f074d2e65c32a6609dc
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2017-04-23 14:56:08 +0000

    fix versioning in dist.ini 

  Change: 2e9069db1b22cd1ac96b655321a2df240857ba69
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2017-04-23 14:09:27 +0000

    Merge pull request #66 from manwar/manwar-github-pr-challenge

    Manwar GitHub pr challenge 

  Change: 0f06ebc0b58ea4ff779d40a54f397c14722756e4
  Author: Andrew Solomon <andrew@geekuni.com>
  Date : 2017-04-23 14:03:06 +0000

    Merge pull request #61 from paultcochrane/pr/doc_fixups

    Doc fixups 

  Change: aa28e7d377537ddc04b527c77a51b22970dcd0d4
  Author: Rusty Conover <rustyconover@users.noreply.github.com>
  Date : 2017-01-27 21:25:46 +0000

    Merge pull request #77 from andrewsolomon/geekuni-master

    fix Problem with get_customer #76 

  Change: fba00b688a02688473bd6a33fc1d660a7f83cf60
  Author: Andrew Solomon <andrew@illywhacker.net>
  Date : 2017-01-27 18:40:17 +0000

    fix Problem with get_customer #76 

  Change: aaaf27b06fb5049a7f64974884a9db5b08d7dac4
  Author: Mohammad S Anwar <mohammad.anwar@yahoo.com>
  Date : 2015-11-25 14:33:21 +0000

    - Updated pod document for Net::Stripe with regard to the method
    refund_charge

    as the link to API is broken. It is actually called create_refund.

    https://stripe.com/docs/api#create_refund 

  Change: d40c390ee9fa499e3134d8e101f6c2989b3fcea7
  Author: Mohammad S Anwar <mohammad.anwar@yahoo.com>
  Date : 2015-11-25 14:21:09 +0000

    - Changed permission mode from 755 to 644 for the following packages:

    - Net::Stripe

    - Net::Stripe::Card

    - Net::Stripe::Refund 

  Change: a2ff005af41f01c26a1a90432e08e7b32d88d059
  Author: Paul Cochrane <paul@liekut.de>
  Date : 2015-04-27 15:07:43 +0000

    Use full-stops at the ends of sentences 

  Change: 212834a0aeca7d851630f74136b6e16c2a5b1225
  Author: Paul Cochrane <paul@liekut.de>
  Date : 2015-04-27 15:02:55 +0000

    Make method description consistent with rest of docs

    - use lower case letters

    - use the active voice; not the present continuous form 

  Change: 4394902136dff763fab17fcb859ccdbdfd3cf2b5
  Author: Paul Cochrane <paul@liekut.de>
  Date : 2015-04-27 15:01:02 +0000

    Correct a genitive. 

  Change: fcec7171eb29243696ea86c6d2ad99e1903ea5e6
  Author: Paul Cochrane <paul@liekut.de>
  Date : 2015-04-27 14:55:08 +0000

    Consistently capitalise "API" 

  Change: eb6fc48e65a9124c0b210b9aa7edb9240e7df1e9
  Author: Paul Cochrane <paul@liekut.de>
  Date : 2015-04-27 14:54:03 +0000

    Correct minor capitalisation issue 

  Change: 7822692d9a0546a7faba9db0046fec2df8673b4a
  Author: Paul Cochrane <paul@liekut.de>
  Date : 2015-04-27 14:52:42 +0000

    Correct spelling of "retrieve" 

  Change: eaaf378701416d5e30f03b6609da9abb1df32fe6
  Author: Rusty Conover <rustyconover@users.noreply.github.com>
  Date : 2015-04-26 00:30:29 +0000

    Merge pull request #59 from paultcochrane/pr/bump_version_number

    Update version number 

  Change: b55b9fba2bb9394cdffd13800a2fc4eebd18f1e7
  Author: Rusty Conover <rustyconover@users.noreply.github.com>
  Date : 2015-04-26 00:30:20 +0000

    Merge pull request #58 from paultcochrane/pr/add_travis_config

    Add Travis-CI configuration 

  Change: c4d760ff4649d75e1ced58d797a5c948b63ae116
  Author: Paul Cochrane <paul@liekut.de>
  Date : 2015-04-12 23:19:48 +0000

    Update version number

    This now matches that displayed on MetaCPAN 

  Change: c8c1865c502f6ee2bcf90d39a15b54bb644b70ea
  Author: Paul Cochrane <paul@liekut.de>
  Date : 2015-04-12 23:17:51 +0000

    Add Travis-CI configuration

    This builds and tests successfully for the given Perl versions. Perl
    versions 5.12 and lower seem to have issues with installing some of
    the dependencies, hence these are not tested here. 

  Change: b64c828425aa34916653a4d2307b14b73d170454
  Author: Rusty Conover <rustyconover@users.noreply.github.com>
  Date : 2015-04-12 16:55:04 +0000

    Merge pull request #57 from paultcochrane/pr/update_dist_ini

    Update dist ini 

  Change: d48559aa8fd02558eca5882c3317137014638dbc
  Author: Paul Cochrane <paul@liekut.de>
  Date : 2015-04-12 22:44:42 +0000

    Add Pod::Weaver author deps

    Dist::Zilla can't find and install Pod::Weaver plugins used in
    weaver.ini, thus it is necessary to append these implicit author
    dependencies to dist.ini as (effectively) a comment so that they are
    also installed as part of the `dzil authordeps --missing | cpanm`
    installation step. 

  Change: 0f961f2a7796e843b8ee66ec181f08bd7da101aa
  Author: Paul Cochrane <paul@liekut.de>
  Date : 2015-04-12 22:41:46 +0000

    Update copyright year

    The latest release is from this year, so the copyright year should be
    updated to reflect this. 

  Change: f1fd14cddae098dbb0d362e0da02ca8ca234bac8
  Author: Rusty Conover <rustyconover@users.noreply.github.com>
  Date : 2015-04-11 23:36:42 +0000

    Merge pull request #50 from NacreData/master

    Implement "invoice" property on Charge objects. 

  Change: 4442f8bb4df54adb44ad86efe8d5540552f5adf4
  Author: Rusty Conover <rustyconover@users.noreply.github.com>
  Date : 2015-04-11 23:36:26 +0000

    Merge pull request #52 from
    paultcochrane/pr/remove_trailing_whitespace

    Remove trailing whitespace 

  Change: ecef81bd7a35cf0879b811b7f3f0ae17487d444e
  Author: Rusty Conover <rustyconover@users.noreply.github.com>
  Date : 2015-04-11 23:36:19 +0000

    Merge pull request #51 from paultcochrane/pr/replace_contrib_from_git

    Replace ContributorsFromGit with Git::Contributors 

  Change: e2cafc1f6797a43796cb2d87a50f4ac655e92d3e
  Author: Rusty Conover <rustyconover@users.noreply.github.com>
  Date : 2015-04-11 23:36:08 +0000

    Merge pull request #53 from paultcochrane/pr/dos_to_unix_encoding

    Convert text from dos to unix line endings 

  Change: 0f6badb3114614238d54e5b29256a118134b0ea9
  Author: Rusty Conover <rustyconover@users.noreply.github.com>
  Date : 2015-04-11 23:35:59 +0000

    Merge pull request #54 from paultcochrane/pr/ignore_dot_build

    Ignore dzil-generated .build directory 

  Change: b4d1356b635bf35bbacd7428d1e84b6fbca06c03
  Author: Rusty Conover <rustyconover@users.noreply.github.com>
  Date : 2015-04-11 23:35:30 +0000

    Merge pull request #55 from paultcochrane/pr/add_missing_abstract

    Add missing ABSTRACT 

  Change: e51fba910b3c4630f1726133c0b3e35e34b34ea0
  Author: Rusty Conover <rustyconover@users.noreply.github.com>
  Date : 2015-04-11 23:35:16 +0000

    Merge pull request #56 from paultcochrane/pr/fix_kwalitee_fails

    Fix kwalitee fails 

  Change: f53b5511860a5efcf0291d1b8e1a5df2c5c68bb1
  Author: Paul Cochrane <paul@liekut.de>
  Date : 2015-04-11 22:36:06 +0000

    Automatically generate META.yml provides section

    This addresses the "meta yml has provides" experimental kwalitee
    metric. See http://cpants.cpanauthors.org/dist/Net-Stripe for more
    details. 

  Change: ea0b54546dadb26e05b413c98e56eb5592a3df9a
  Author: Paul Cochrane <paul@liekut.de>
  Date : 2015-04-11 22:33:32 +0000

    Detect minimum required Perl version

    This addresses "meta yml declares perl version" extra metric on the
    CPANTS kwalitee page (http://cpants.cpanauthors.org/dist/Net-Stripe) 

  Change: 2f0adada63b8bb98830bf84a65272aa46d9e3d38
  Author: Paul Cochrane <paul@liekut.de>
  Date : 2015-04-11 22:13:15 +0000

    Add missing ABSTRACT 

  Change: ee5075fadcdcb20c5e0bbb55454d692bf1c2742a
  Author: Paul Cochrane <paul@liekut.de>
  Date : 2015-04-03 00:12:11 +0000

    Ignore dzil-generated .build directory

    This stops the automatically generated .build directory (created via
    dzil) from appearing in `git status`. 

  Change: 54d5084362cc0ee5743f18e87dece07cd275fdda
  Author: Paul Cochrane <paul@liekut.de>
  Date : 2015-04-02 16:26:01 +0000

    Convert text from dos to unix line endings

    This is to be consistent with the rest of the project, which uses
    unix-style line endings. 

  Change: a1f940e94aed575cc0120983e030860af88b92c3
  Author: Paul Cochrane <paul@liekut.de>
  Date : 2015-04-02 16:13:48 +0000

    [t] remove trailing whitespace 

  Change: 38f88eebcb5073946fbdf9b0eafbda2704142532
  Author: Paul Cochrane <paul@liekut.de>
  Date : 2015-04-02 16:09:36 +0000

    [lib] remove trailing whitespace 

  Change: ce52b8955b43271dd835fecdf6e050a71a80f568
  Author: Paul Cochrane <paul@liekut.de>
  Date : 2015-04-01 21:30:13 +0000

    Replace ContributorsFromGit with Git::Contributors

    This is because ContributorsFromGit isn't as well maintained and
    ETHER created Git::Contributors out of frustration to fix this issue
    (see
    https://github.com/RsrchBoy/Dist-Zilla-Plugin-ContributorsFromGit/iss
    ues/19). This has the same functionality and builds and tests
    properly and should be considered a better alternative. 

  Change: ea3ba4f95400fc88366000c8b382e9e50ca6586c
  Author: Devin M. Ceartas <devin@nacredata.com>
  Date : 2015-02-16 21:18:07 +0000

    Implement "invoice" property on Charge objects. 

  Change: b2d9eb9072805e3995ee2cb9e654db4e9e36af66
  Author: Rusty Conover <rustyconover@users.noreply.github.com>
  Date : 2015-02-04 18:15:35 +0000

    Merge pull request #48 from NacreData/master

    Implement metadata in Charge object 

  Change: 64043dbfcf827c32ab3e8aaf93bcee742148611e
  Author: Devin M. Ceartas <devin@nacredata.com>
  Date : 2015-02-04 16:00:28 +0000

    Implement metadata in Charge object, add tests for metadata in charge
    & customer 

  Change: a32e36cd82bf52fc5d7776ecbce30f2188eb37b8
  Author: Rusty Conover <rustyconover@users.noreply.github.com>
  Date : 2015-01-21 21:22:42 +0000

    Merge pull request #47 from rustyconover/master

    Changes for 0.27 

  Change: 890c3e59d5884eb3cd8e6d6decfc3a02a5c3bf9a
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2015-01-21 21:18:50 +0000

    Fix Abstract for Net::Stripe::Refund 

  Change: 30cdad1cd710202ba2325a65d701f6b5a960a725
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2015-01-20 10:52:13 +0000

    Remove unnecessary version line 

  Change: a364a15639878a56347462094a2ec715d90927a3
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2015-01-20 10:51:13 +0000

    Merge branch 'yahermann-master' 

  Change: 2569fa6c56d04cdc1696f1181fcb20ae214d447d
  Author: Hermann Calabria <hermann@ivouch.com>
  Date : 2015-01-19 17:16:06 +0000

    fixed documentation for refund_charge() and upped version # to 0.26 

  Change: 19e78b64aa55c96f02bcaf2e6530867722f77740
  Author: Hermann Calabria <hermann@ivouch.com>
  Date : 2015-01-19 15:40:48 +0000

    refund_charge(): added reason, refund_application_fee, and metadata.
    added tests for refund. also fixed card->type, should be card->brand,
    and fixed test. all tests pass now. 

  Change: a27cc9cdd75f0f8143168a009cd02bba864deea6
  Author: Hermann Calabria <hermann@ivouch.com>
  Date : 2015-01-19 13:29:28 +0000

    added working charge->refund_charge() 

  Change: 9c10781f99906cd7310a3c107e8edb0b1201f00e
  Author: Rusty Conover <rustyconover@users.noreply.github.com>
  Date : 2014-12-15 00:36:12 +0000

    Merge pull request #43 from rustyconover/master

    0.25 - Fixes for dealing with invoices. 

  Change: 369fa14866f4f7e1020f43abca1a336944149794
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-12-15 00:13:45 +0000

    Fix some bugs dealing with invoices. 

  Change: 8464bb68dbfb30fdc4c4a980791f86706d48e572
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-12-11 01:08:56 +0000

    Add cancel_at_period end 

  Change: 6568aefa57e4ff51b2c7e1eeccce6e02e923ab13
  Author: Rusty Conover <rustyconover@users.noreply.github.com>
  Date : 2014-12-10 20:32:29 +0000

    Merge pull request #42 from rustyconover/master

    Sync 0.23 to lukec/stripe-perl 

  Change: 3e7f91b004116148834ffc4c3192f5c50a7c0ab2
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-12-10 20:27:01 +0000

    Add prorate option to post_subscription.

    Add quantity and account_balance fields to customer
    Net::Stripe::Customer. 

  Change: 62bb29cae76c879f35f33ca0edf59621f74a4e26
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-10-13 23:36:45 +0000

    Release 0.22

    application_fee was being passed to the Charge object from Stripe.pm,
    but there was no corresponding parameter defined, so it wasn't
    actually getting passed on in the request - Devin Ceartas 

  Change: 15d19490ea0fbb776623570d82ae822c6ee10a26
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-10-13 23:32:29 +0000

    Merge branch 'master' of github.com:lukec/stripe-perl 

  Change: 3049dd9cf9420e6278d1a164b9a012cd2282cb2c
  Author: Devin Ceartas <devin@nacredata.com>
  Date : 2014-10-14 03:31:47 +0000

    Merge pull request #41 from NacreData/master

    application_fee in Net::Stripe::Charge for Stripe Connect to work 

  Change: 76164b2c422d5adfb0d25c5954fec40a5d4564b8
  Author: Devin M. Ceartas <devin@nacredata.com>
  Date : 2014-10-13 23:27:54 +0000

    application_fee in Net::Stripe::Charge for Stripe Connect to work 

  Change: 003909470184ce13b787c67a70875dd0b2d52693
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-09-25 19:15:45 +0000

    Release 0.20

    Deleting a customer wide discount from andrewsolomon 

  Change: ad777bd2428db4d5b732cc4c9605136dbef07299
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-09-25 19:14:49 +0000

    Merge branch 'master' of github.com:lukec/stripe-perl 

  Change: 81ecbc5f17e2db1ee4698568d36f85752177cba8
  Author: Rusty Conover <rustyconover@users.noreply.github.com>
  Date : 2014-09-25 19:02:10 +0000

    Merge pull request #40 from andrewsolomon/master

    Deleting a Customer-wide Discount 

  Change: 26d4fa699a74977c06041c7196c1f821361ca53d
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-09-20 21:19:54 +0000

    Release 0.19 

  Change: 2fc58fcfa6880ad4d6b3b482daef4100c7b14524
  Author: Andrew Solomon <andrew@illywhacker.net>
  Date : 2014-09-13 17:04:23 +0000

    Deleting a Customer-wide Discount 

  Change: 5b103edcbb95b99c52da532dad4eb574a87817f0
  Author: Rusty Conover <rustyconover@users.noreply.github.com>
  Date : 2014-08-10 16:13:55 +0000

    Merge pull request #37 from andrewsolomon/master

    Provide access to customer->discount->start 

  Change: 2d0e4af85dcd66d62ac3cb731be63a0f5c948ab5
  Author: Andrew Solomon <andrew@illywhacker.net>
  Date : 2014-08-10 18:29:41 +0000

    Provide access to customer->discount->start 

  Change: d963e45be808ac0a67f6a95d49b2712dfb6c56ca
  Author: Devin Ceartas <devin@nacredata.com>
  Date : 2014-06-25 14:13:25 +0000

    Merge pull request #34 from NacreData/master

    Fix list_subscriptions method, add tests for list_subscriptions 

  Change: 17bd35f831b32fbeaa0acc4a206b8f35165390ca
  Author: Devin M. Ceartas <devin@nacredata.com>
  Date : 2014-06-25 10:10:01 +0000

    Fix list_subscriptions method, add tests for list_subscriptions 

  Change: 716a38645cd4cb8bcd73c4d0425d412dc9ab6604
  Author: Rusty Conover <rustyconover@users.noreply.github.com>
  Date : 2014-06-01 12:22:56 +0000

    Merge pull request #31 from rustyconover/master

    Allow trial_end to be both an integer and a string. Support trials
    ending now. Release 0.18. 

  Change: 78868ad306fb9f4473ab6286574c939d81a53595
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-06-01 12:21:23 +0000

    Allow trial_end to be both an integer and a string. Support trials
    ending "now".

    Bump to 0.18 

  Change: 4d691c1f27e3527e6c8357b6adf3fe3b8c7dff55
  Author: Rusty Conover <rustyconover@users.noreply.github.com>
  Date : 2014-05-29 11:44:16 +0000

    Merge pull request #29 from rustyconover/master

    Version 0.17 

  Change: cb4cccbeeeb84c95661afb405df94fbdd6c25a54
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-05-29 11:43:07 +0000

    Change version string in access log 

  Change: deaf5d4da578a7b052a1bb0fd5881e390fd4ea8a
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-05-29 11:40:11 +0000

    Bump to version 0.17 start using PkgVersion plugin 

  Change: a6ab0dd81f63639e8f2a64a8b4c0126b83d5ab78
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-05-29 11:30:27 +0000

    Add documentation of pay_invoice. 

  Change: c081f4218fffe1de5e34bb2124bed2e426f7f874
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-05-26 19:54:38 +0000

    Add pay_invoice and allow new card with post_card.

    Add new pay_invoice method, and fix a bug with post_card not
    recognizing a new credit card rather than an update. 

  Change: 43de0ec4f312b0708c5e2d42ee62f9ed3ee9a143
  Author: Rusty Conover <rustyconover@users.noreply.github.com>
  Date : 2014-05-21 15:50:34 +0000

    Merge pull request #27 from rustyconover/master

    Version 0.16 

  Change: 240790ef93bd38c16a32bacf238393904d19e51e
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-05-21 15:49:22 +0000

    Bump to 0.16 

  Change: 538116528ca1b9f7d8de15097ffc7705ba6e5129
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-05-21 15:43:55 +0000

    Move from MooseX::Method::Signatures to Kavorka 

  Change: 95edaa21f9025c84145a51e98c0075507f9e89a1
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-05-11 11:53:09 +0000

    Bump version to 0.15.

    Add keep alive to user agent. 

  Change: 95c2d6051bfca97a472f638eac0cdf896e2a4754
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-04-27 20:02:34 +0000

    Fixes and cleanups.

    Add default card parameter to post_customer().

    Fix _post to handle objects being included in argument, convert them
    to form fields if they are nested inside of a posted argument hash.

    Add id to the Card object.

    Add cards to the Customer object as a Net::Stripe::List. 

  Change: 773c89f1afe19441adee43557358576506d660c9
  Author: Rusty Conover <rustyconover@users.noreply.github.com>
  Date : 2014-04-26 23:26:44 +0000

    Merge pull request #25 from rustyconover/master

    Change to Net::Stripe::List for all lists. Add documentation to
    object classes. 

  Change: 739412308f32119442636f383963f487c0c3e058
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-04-26 23:24:51 +0000

    Bump version to 0.14 

  Change: f0095fd94abab5b03269447f0d1aa2679f7a9589
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-04-26 19:14:18 +0000

    More docs on attributes 

  Change: e79ee64373938bd3fc487e82219495c7acb025cc
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-04-26 19:08:17 +0000

    Add some boolean type checking to hash_to_object. 

  Change: ac4b97380a5f10ee201f6ac571e85b37d8256877
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-04-26 18:46:23 +0000

    Add ClassMopper to weaver.ini for documentation of our objects. 

  Change: 8bf02e492f08cb4e9fade4c9ba1534deec826e3d
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-04-26 18:08:31 +0000

    Remove some Moose subtypes and just specify the allowed objects. 

  Change: 75befc30001710fa4a24ddb596dc18d0a380e8fd
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-04-26 17:48:50 +0000

    Remove unnecessary use of Data::Dumper 

  Change: e07052a53b72d4c637f40b86c8cc96882da591b9
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-04-26 17:46:46 +0000

    Add Net::Stripe::List for correct and proper list handling.

    Add Net::Stripe::LineItem to contain information about line items
    from an invoice. 

  Change: 99ffd3eaec8c05eca01c4e374eef92199d14e50e
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-04-26 12:09:42 +0000

    POD changes 

  Change: 17a0e3d1cb812df5d5ac5339fa86965cb763478c
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-04-26 11:42:28 +0000

    Change list handling to use Net::Stripe::List.

    Add Net::Stripe::List to handle all returned lists from Stripe. Adds
    suppor for the has_more flag, so the user can page through results.

    Change live.t to use new list structure. Remove
    Net::Stripe::SubscriptionList. 

  Change: 24a5c2516b0bad5ad828df17a9f69a3b23ad6f06
  Author: Rusty Conover <rustyconover@users.noreply.github.com>
  Date : 2014-04-25 22:37:59 +0000

    Merge pull request #24 from rustyconover/master

    Add documentation, change to named parameters to all functions,
    update tests and add example code.

    Changed all functions to use named parameters to follow the Stripe
    API. This will break some existing code that relied on positional
    parameters. See the documentation for changes and new examples of
    calling functions. One example get_invoice() you now must pass
    get_invoice(invoice_id => $id) where you previously called
    get_invoice($id). I think named parameters allow more flexibility and
    expressiveness.

    Added documentation of each function along with an example call of
    that function to the POD documentation.

    Described all method's accepted parameters and types.

    Changed to using MooseX::Method::Signatures rather than method module
    to remove some older dependencies and add better type checking to
    parameters.

    Reworked live.t to reflect the API changes. 

  Change: 89f8ca48009ff0b364f8ec18a9e875c251652ec6
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-04-25 22:28:56 +0000

    More example and documentation fixes 

  Change: c30780c0e51cb67aea3f906e4288ac3454299833
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-04-25 22:25:28 +0000

    Add more examples and fix up POD documentation 

  Change: 5eb0aa11865360ff408a360f515df73b794339ac
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-04-25 18:36:50 +0000

    Add more examples 

  Change: c2310e92cc4fcc79488b6b7f9c01dae619c80302
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-04-25 18:25:01 +0000

    Add some initial examples of calling functions 

  Change: 80d6a93d7241eb80cca49e4b3dfdca977f83cb91
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-04-25 18:19:51 +0000

    Fix pod weaver bug with balance transaction functions. 

  Change: 296f14fea3d5ba746fd84bf4769f51b3055babfe
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-04-25 18:13:42 +0000

    Bump version number 

  Change: f8092e06daddfc453d3719ab3407e9af05709b81
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-04-25 18:11:55 +0000

    Change all methods to use named parameters and proper signatures.

    Add documentation to all methods.

    Change tests as appropriate to match the new method signatures. 

  Change: 9c6dd9331807054bd2ee47be8dd541ae60723738
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-04-25 00:46:16 +0000

    Remove use of methods module, replace with
    MooseX::Method::Signatures.

    Fixes a problem with methods module prereqs on some platforms while
    retaining all functionality.

    Bump version 

  Change: 5d49548425af494e7751062ecbca8d7192f74bd7
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-04-22 21:15:09 +0000

    A few POD fixes and 0.11 release. 

  Change: 1d57a2b75acc847a18136576a03b748451fd9714
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-04-22 21:10:26 +0000

    Add README.pod which is generated from Dist::Zilla. 

  Change: 36a402bd11adb738473f34964264135ef5f0974c
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-04-22 21:07:43 +0000

    Fix documentation, add abstracts to all modules.

    Finish moving to Pod::Weaver. 

  Change: ea3d1afd4707c0ee458a126f2796bfc2b341998f
  Author: Rusty Conover <rustyconover@users.noreply.github.com>
  Date : 2014-04-22 16:30:16 +0000

    Merge pull request #23 from andrewsolomon/master

    add $customer->discount->coupon attributes 

  Change: b0a1b43a193969140b76ee84257cbb0de9e4ec90
  Author: Andrew Solomon <andrew@illywhacker.net>
  Date : 2014-04-22 20:27:16 +0000

    add $customer->discount->coupon attributes 

  Change: e2e82db114e891e1557128d8b22f1fa1458df23d
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-04-22 08:33:16 +0000

    Remove duplicated trial end. Allow it to be an int or string, because
    of the special "now" value. 

  Change: 64481e09794bb46b99f9941a36a91e1288f4ad3b
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-04-22 07:53:29 +0000

    Merge branch 'master' of github.com:lukec/stripe-perl 

  Change: 48942b0ab47e9a47055b1bb3c86ea59425bc27f9
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-04-22 07:51:12 +0000

    Fix a problem with JSON::PP::Boolean usage.

    Change any type constraint that expects a Bool into Bool|Object
    because of a difference in how JSON::PP maps booleans.

    Change some code to map both JSON::XS::Boolean and JSON::PP::Boolean
    to one and zero. 

  Change: c8606398de3b947e8b95b02b51106f01bed39a20
  Author: Rusty Conover <rustyconover@users.noreply.github.com>
  Date : 2014-04-21 23:54:50 +0000

    Merge pull request #21 from rustyconover/master

    Change to using Dist::Zilla and start with provisionary version 0.009 

  Change: 47b98c1cfd6925446cf1378a1549bafa2a3953bb
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-04-21 23:53:13 +0000

    Change to using Dist::Zilla and start with provisionary version 0.009

    Pull changes and contributors from Github. 

  Change: b32477769aa6e4eecb037708c131f330de0e9631
  Author: Rusty Conover <rustyconover@users.noreply.github.com>
  Date : 2014-04-21 23:17:33 +0000

    Merge pull request #20 from rustyconover/master

    Work on Invoices, metadata, error handling, and a bug fix with
    customer's trial_end. 

  Change: 5ba493a377176e58990436d1ab3a486fc4856e1e
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-04-21 23:15:03 +0000

    Merge remote-tracking branch 'lukec/master' 

  Change: 5bb5a8ebe6a550b2c1c09c4110b5e4152a784bc1
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-04-21 23:09:28 +0000

    Change post_invoice() to accept a Net::Stripe::Invoice object.

    Handle a HTTP 500 error more directly in make_request.

    Allow "now" as a trial end value when creating a Customer object with
    a subscription plan.

    Add support for metadata and a description on the Invoice object.

    Refactor the metadata form fields code into
    form_fields_for_metadata()

    Add custom code to the closed parameter on the Invoice object, to
    only post it back to Stripe if the value has changed.

    Add form_fields_for_metadata in Net::Stripe::Resource since it is
    used by Customers and Invoices. 

  Change: 88764afb97c99c77446dd9fdff930967809d749c
  Author: Rusty Conover <rustyconover@users.noreply.github.com>
  Date : 2014-04-21 23:05:53 +0000

    Merge pull request #19 from NacreData/master

    Charges attributes; new BalanceTransaction; etc. 

  Change: 388fc3545682361b7e9fc300a9fa848b4e7ee6dd
  Author: Devin M. Ceartas <devin@nacredata.com>
  Date : 2014-04-21 22:45:42 +0000

    * new BalanceTransfer Object (contains Stripe fee) * allow passing of
    "created" hashref to _get_collections,

    used for instance to get Charges constrained by dates * teach
    hash_to_object() to convert Stripe's underscore_words

    to module's UpperCamelCase * additional attributes in Charge object 

  Change: 26afeb856761b6c0e8c32e22892ede73535b4827
  Author: Devin M. Ceartas <devin@nacredata.com>
  Date : 2014-04-21 22:06:19 +0000

    Merge branch 'master' of github.com:rustyconover/Net-Stripe 

  Change: 09a3359130ce2bd7580ac1e47090877c70ecc2ae
  Author: Rusty Conover <rustyconover@users.noreply.github.com>
  Date : 2014-04-21 09:14:54 +0000

    Merge pull request #15 from sachinjsk/master

    fixed typo 

  Change: ee37f01bfdc4bf3483a54820b97c708842f26689
  Author: Rusty Conover <rustyconover@users.noreply.github.com>
  Date : 2014-04-21 09:14:28 +0000

    Merge pull request #12 from oalders/repository-url

    Adds repository URL to META resources. 

  Change: 592d47fc63e2768bbce4ed397ef15f4aee7e0301
  Author: Rusty Conover <rustyconover@users.noreply.github.com>
  Date : 2014-04-21 09:12:46 +0000

    Merge pull request #18 from rustyconover/master

    Initial pull of work on github to recent release. 

  Change: 348d404ce3b1c294f26275d35bcc311938d243d8
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-04-19 16:20:39 +0000

    Add post_invoice and add invoice parameter to Invoiceitem.pm to allow
    invoice items to be added to an open invoice. 

  Change: d5d0317549cbdbf1f08be30fc19a7d60416418e6
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-04-17 19:14:32 +0000

    Add methods for dealing with Cards and additional fields to the Card
    object. 

  Change: 8a307dd7ca045ffff474f8db00002cb45b0fa352
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-04-17 15:40:06 +0000

    Allow undefined statement descriptions for plans. 

  Change: 665deed7c73b1e40c90fd08b4de56a6f480375ee
  Author: Devin M. Ceartas <devin@nacredata.com>
  Date : 2014-04-17 11:18:10 +0000

    Note removal of "count" attribute in recent Stripe update to Lists 

  Change: 55c9f445185bc4b663d6c03b0d1775adce9b9a5d
  Author: Devin M. Ceartas <devin@nacredata.com>
  Date : 2014-04-15 17:43:47 +0000

    Note removal of "count" attribute in recent Stripe update to Lists 

  Change: af89dedc17bd2341aaca3fb03e69243631f737af
  Author: Devin Ceartas <devin@nacredata.com>
  Date : 2014-04-15 21:07:21 +0000

    Merge pull request #1 from rustyconover/master

    Latest work on fixing up the module 

  Change: aae5aed5f27443a2c0fcd0cd7e0586455e4f1603
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-03-15 00:07:45 +0000

    Add support for statement_description in plans. 

  Change: d52aa3d39866b48fe0413a1f2f11542321dc210d
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-03-14 23:54:52 +0000

    Add interval_count to plans.

    Add interval_count to Net::Stripe::Plan.

    Fix missing module. 

  Change: 74fb3562eacb47f91b8bb3e9d2d962259eea7326
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-03-14 23:49:05 +0000

    Add flag debug_network

    Add debug_network flag which allows the HTTPS request and response
    data to be shown for debugging purposes. 

  Change: 63f7f14ef57ce7a923ad54e7ebbeab272ded71ea
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-03-14 22:43:38 +0000

    Finish supporting multiple subscriptions 

  Change: 4953c21764883e540e07ed1ea9fe4bf1061df3bc
  Author: Rusty Conover <rusty@luckydinosaur.com>
  Date : 2014-03-14 22:42:30 +0000

    Support multiple subscriptions

    Change Customer object to contain subscriptions and subscription
    since customers can now have multiple subscriptions.

    Change test to use subscription id for delete_subscription calls. 

  Change: f741f7843a90f2d23e085c46846dc592ca7d8f06
  Author: Devin M. Ceartas <devin@nacredata.com>
  Date : 2014-03-09 17:02:53 +0000

    Multiple subscriptions are now possible, updating is different from
    creating, there is a list subscription method 

  Change: d5a33c2cbdd79833f0c9064707709e6d752d52f7
  Author: Devin M. Ceartas <devin@nacredata.com>
  Date : 2014-03-05 14:21:15 +0000

    Add ability to add "metadata" hashref to Customer object creation. 

  Change: e3bab9d371ffdb4f843249b86b2f6a8ec3e43ff0
  Author: Devin M. Ceartas <devin@nacredata.com>
  Date : 2014-03-05 11:33:45 +0000

    test for 1, not "true"; swallow an exected warning to /dev/null...
    All existing tests now pass! 

  Change: f1b4133bbf03270da05ef0d3b7a2e8db46d4ea3e
  Author: Devin M. Ceartas <devin@nacredata.com>
  Date : 2014-03-05 11:30:10 +0000

    Yet another test needing Customer->active_card changed to
    Customer->default_card 

  Change: 32e2e52a78019b60a9e44d311c3ea8d4e9ba5d38
  Author: Devin M. Ceartas <devin@nacredata.com>
  Date : 2014-03-05 11:23:00 +0000

    Correct Test: if cancelled with "at_period_end", a subscription will
    not yet have "ended_at" set. Test 114 passes now. 

  Change: e64c833ec05e25d63710d677ef37712adf8ac489
  Author: Devin M. Ceartas <devin@nacredata.com>
  Date : 2014-03-05 11:12:51 +0000

    Another test needing Customer->active_card changed to
    Customer->default_card 

  Change: 8c1c99ce1423b8eaa8eed6172eeb4e036d5dfd59
  Author: Devin M. Ceartas <devin@nacredata.com>
  Date : 2014-03-05 11:04:35 +0000

    Customer has a "default_card" not an "active_card", and this
    "default_card" is a card id, not a Stripe Card object. Test 94 now
    passes. 

  Change: 10e75ec296b1176a4855769340ed094cfe676cd7
  Author: Devin M. Ceartas <devin@nacredata.com>
  Date : 2014-03-05 10:16:46 +0000

    Hide expected warnings; Fix invalid currency test. 

  Change: d680cb2c91914c5f1d9644dcf754827b683283fd
  Author: Devin M. Ceartas <devin@nacredata.com>
  Date : 2014-03-05 10:01:52 +0000

    "fee" was removed from the returned Charge object by Stripe, see
    2013-12-03 changes at https://stripe.com/docs/upgrades 

  Change: b16bbe8068fa9e2a1bf4199255ec8145d6540c31
  Author: Devin M. Ceartas <devin@nacredata.com>
  Date : 2014-03-05 09:49:35 +0000

    Clean up test output by hiding expected warnings 

  Change: c37f0b7362c4d36d86d5a2399c57c08d9fc33a9a
  Author: Devin M. Ceartas <devin@nacredata.com>
  Date : 2014-03-05 09:23:26 +0000

    return array ref of objects from _make_request() if a list is
    returned, rather than trying to instantiate non-existent
    Net::Stripe::List class: fixes test #20 

  Change: 50c32c9b40662060fa87e832eeef50fad61c2510
  Author: Devin M. Ceartas <devin@nacredata.com>
  Date : 2014-03-04 16:54:45 +0000

    patch from sachinjsk
    https://github.com/sachinjsk/stripe-perl/commit/1e57e9667797206f27356
    b3664f37a190b4f26eb 

  Change: 8ca8bccd66fdc406f4270242d67b4c1fbeef0d22
  Author: Devin M. Ceartas <devin@nacredata.com>
  Date : 2014-03-04 16:52:11 +0000

    Patch from oalders
    https://github.com/oalders/stripe-perl/commit/eaaf1a442654da5f7eb9098
    c7f0668b446aa8cae 

  Change: 1e57e9667797206f27356b3664f37a190b4f26eb
  Author: Sachin Sebastian <sachinjsk@users.noreply.github.com>
  Date : 2014-01-12 19:41:12 +0000

    fixed typo 

  Change: c7e06c6f22ddbc0886b5675b6ca4390c98c28453
  Author: Luke Closs <me@luk.ec>
  Date : 2013-10-07 02:46:03 +0000

    Update code to work with newer API 

  Change: f56e45f7687f876e25fac589b046d53c8cdb736d
  Author: Luke Closs <me@luk.ec>
  Date : 2013-10-07 02:45:45 +0000

    Allow posting hashes directly 

  Change: 4573df5d7a60470e2db93201491dc68ec06117fc
  Author: Luke Closs <me@luk.ec>
  Date : 2013-10-07 02:45:30 +0000

    Add post_customer_subscription() 

  Change: 6c38ded4352b4ee1fdca457b840b9170c818d8ad
  Author: Luke Closs <me@luk.ec>
  Date : 2013-10-05 01:36:46 +0000

    Bump version 

  Change: f36369ad0c56eff3d6659ed504d8b47c47a213d5
  Author: Luke Closs <me@luk.ec>
  Date : 2013-10-05 01:25:40 +0000

    Try allowing plans to be read/write 

  Change: cec16d2bfffd434602121c74a2388604cee84a66
  Author: Olaf Alders <olaf@wundersolutions.com>
  Date : 2013-08-14 00:36:28 +0000

    Adds repository URL to META resources. 

  Change: f2a4b3771f318554041999683109d056c6b11cb1
  Author: Luke Closs <luke@5thplane.com>
  Date : 2012-10-23 09:43:23 +0000

    Add missing dependency on namespace::clean 

  Change: 0a6e418f2a655fcb57f3a35f36b6436ceb736589
  Author: Luke Closs <luke@5thplane.com>
  Date : 2012-10-23 09:41:28 +0000

    update docs 

  Change: 4f3727b5d9602b3eee4e312b0e35a1c39a3da655
  Author: Luke Closs <github@5thplane.com>
  Date : 2012-06-25 22:29:14 +0000

    Merge pull request #10 from dpetrov/master

    Updating Invoiceitem should not update currency 

  Change: 6f40686c55e737235cf32b3dc884f72190c83e7c
  Author: Dimitar Petrov <mitakaa@gmail.com>
  Date : 2012-06-24 20:45:48 +0000

    Pass the copied object to post_invoiceitems 

  Change: 880782b601d98551199b586d505e7aa295a33583
  Author: Dimitar Petrov <mitakaa@gmail.com>
  Date : 2012-06-24 20:42:18 +0000

    Updating Invoiceitem should not update currency 

  Change: cc3a2d8bc730d66ed4e8845d53ebb4e2fd1758f0
  Author: Luke Closs <gravatar@5thplane.com>
  Date : 2012-06-01 12:40:19 +0000

    Merge pull request #8 from letolabs/synopsis

    Make the code in the Net::Stripe synopsis copy+paste friendly ... 

  Change: f42bfac875bd71196327c15f05f4738c30b510ed
  Author: Jonathan "Duke" Leto <jonathan@leto.net>
  Date : 2012-06-01 12:38:29 +0000

    Make the code in the Net::Stripe synopsis copy+paste friendly and
    give examples of looking at the card associated with a charge and
    looking up charges by id 

  Change: 5969168f2a44ccde83369d2a14a6876ec7361a1a
  Author: Luke Closs <gravatar@5thplane.com>
  Date : 2012-06-01 12:02:53 +0000

    Merge pull request #7 from letolabs/update_moose_dep

    Update moose dep to a known-good version 

  Change: df053bdfd86a2929b8906be48b021ede7aa9ceb2
  Author: Jonathan "Duke" Leto <jonathan@leto.net>
  Date : 2012-06-01 12:01:42 +0000

    Update moose dep to a known-good version 

  Change: aea985642d50ee2646673b2d9af6eb8a9428a369
  Author: Luke Closs <luke@5thplane.com>
  Date : 2012-05-30 09:16:29 +0000

    get customer on a deleted customer returns a hash instead of an
    object 

  Change: cfad6b6c740e00be208fdf1c7041bbefb8901d15
  Author: Luke Closs <luke@5thplane.com>
  Date : 2012-05-03 11:45:24 +0000

    add a missing note to the changelog 

  Change: 673052507335122264cb874b4cb1b153dceaeb4e
  Author: Luke Closs <luke@5thplane.com>
  Date : 2012-04-27 16:25:18 +0000

    add date 

  Change: f197ec6fb15e612e075a01e67e6255700ee8189f
  Author: Luke Closs <luke@5thplane.com>
  Date : 2012-04-27 16:24:55 +0000

    Add more fields to invoices 

  Change: fec51c307da7d475a286bc6b63eafe01087cf195
  Author: Luke Closs <gravatar@5thplane.com>
  Date : 2012-04-24 11:20:18 +0000

    Merge pull request #4 from briancollins/master

    Allow null attributes in API responses 

  Change: 113469fa4043c9d84b1a2146eea382fb6c932ceb
  Author: Brian Collins <bricollins@gmail.com>
  Date : 2012-04-24 19:15:16 +0000

    Handle null response attributes

    The Stripe API now returns all attributes of objects, whether they
    are null or not. 

  Change: 493acbbbe0555004de311b660217363b2efe03aa
  Author: Luke Closs <luke@5thplane.com>
  Date : 2012-02-02 09:21:26 +0000

    Bump to 0.06 and fix MANIFEST so Invoiceitem.pm is shipped 

  Change: 82680adfb0a4e7d532e0ffa2fe60fa0903b36a05
  Author: Luke Closs <luke@5thplane.com>
  Date : 2012-02-01 13:03:12 +0000

    add a date so i can release this 

  Change: 3b1e46051d5b05c6725e0c8617f51c4240a33811
  Author: Luke Closs <luke@5thplane.com>
  Date : 2012-01-02 23:16:52 +0000

    Bump version and update Changes 

  Change: 2ea787464e0998f114df9ca82989bc67da5f3278
  Author: Luke Closs <gravatar@5thplane.com>
  Date : 2012-01-02 23:14:17 +0000

    Merge pull request #3 from tomeliaz/master

    Add support for partial refunds via second parameter on refund_charge
    call. 

  Change: b9f1436a8dc1be3cecca7ee533be995d1075f5c4
  Author: Tom Eliaz <tom@tomeliaz.com>
  Date : 2012-01-02 22:59:30 +0000

    Add support for partial refunds via second parameter on refund_charge
    call.

    Add optional second parameter to redund_charge which is an amount in
    cents to refund. Add amount_refunded field to Charge which is filled
    by the API on return from a

    partial refund API call. Add live test of partial and total (no
    amount specified) refund. 

  Change: b8a291bbf31cfca51601503914da70101ef9e6a0
  Author: Luke Closs <gravatar@5thplane.com>
  Date : 2011-11-27 22:13:05 +0000

    Merge pull request #2 from dreinhold/master

    Perl Stripe Update 

  Change: c97f3c68b45eb348c89a5c10c23f5dfee0bdd11a
  Author: Dylan Reinhold <dylan@gasdasoftware.com>
  Date : 2011-11-27 22:08:30 +0000

    Add a .gitignore into repo 

  Change: cf0cfa54805661c60c8b26a0758bf2116c819df3
  Author: Dylan Reinhold <dylan@gasdasoftware.com>
  Date : 2011-11-27 22:07:29 +0000

    Updated dependency list in alphabetical order 

  Change: 67cd30e471f74d279619914a6377139444cd3d2a
  Author: Dylan Reinhold <dylan@gasdasoftware.com>
  Date : 2011-11-27 21:17:49 +0000

    Added 2 required modules to Makefile.PL

    The module requires

    Test::Exception

    DateTime 

  Change: 80e457903463043741196164898eb0694857a8c4
  Author: Luke Closs <luke@5thplane.com>
  Date : 2011-11-23 10:50:20 +0000

    Fix Invoiceitem package name 

  Change: 776f8bde0ee221088ff49c4d145126d4526613ef
  Author: Luke Closs <luke@5thplane.com>
  Date : 2011-11-14 12:31:58 +0000

    Add missing LWP::Protocol::https dep 

  Change: a8a9c05dacd117eff96e80bfe3784e52b696b25b
  Author: Luke Closs <luke@5thplane.com>
  Date : 2011-11-03 19:21:47 +0000

    Prepare for 0.02 release 

  Change: 8011941a07fb51f218ec32923a730542178aaf37
  Author: Luke Closs <gravatar@5thplane.com>
  Date : 2011-11-03 19:20:04 +0000

    Merge pull request #1 from tomeliaz/master

    Throwable needed for Error.pm 

  Change: a610d33901f1fdd7ba3d8ccd7133bf1e671fd212
  Author: Tom Eliaz <tom@tomeliaz.com>
  Date : 2011-11-03 17:28:49 +0000

    Error requires Throwable to be installed 

  Change: fc34c2ee76db1b3a0bde7c5da0c2d0326f890507
  Author: Luke Closs <luke@5thplane.com>
  Date : 2011-11-01 15:47:21 +0000

    clean up noise in this test 

  Change: fb81c6b575d9cda01bea50a78a3279337851ecd2
  Author: Luke Closs <luke@5thplane.com>
  Date : 2011-11-01 15:45:07 +0000

    add a warning 

  Change: 72a54b00fcc9f50d423264e8a812c9d2f508a01c
  Author: Luke Closs <luke@5thplane.com>
  Date : 2011-11-01 15:39:57 +0000

    Add POD and some packaging 

  Change: a120be83c25fd804be3c29c459276bf4fe5098bc
  Author: Luke Closs <luke@5thplane.com>
  Date : 2011-11-01 14:32:44 +0000

    Add coupons and the Invoice.pm 

  Change: d27158bbbce780ff8dc54101f6f4826b60c22939
  Author: Luke Closs <luke@5thplane.com>
  Date : 2011-11-01 14:15:25 +0000

    Add Invoices 

  Change: 80f325eb96ab17e9f6284214d3b30254db265947
  Author: Luke Closs <luke@5thplane.com>
  Date : 2011-11-01 12:57:33 +0000

    Add invoiceitems to the API 

  Change: d00d550f9b152659e8e2cd2ed06906e433db78fe
  Author: Luke Closs <luke@5thplane.com>
  Date : 2011-11-01 09:24:12 +0000

    Add customer subscription apis 

  Change: 8600e978be3cba0f08041a9c6e0adab75a89bb81
  Author: Luke Closs <luke@5thplane.com>
  Date : 2011-10-29 15:19:00 +0000

    Make most things read-only 

  Change: 04211f639c6a736616c4b1c7f4241196e3013723
  Author: Luke Closs <luke@5thplane.com>
  Date : 2011-10-28 21:08:50 +0000

    Uh, i think I wrote this in Perl, not Ruby. :) 

  Change: f85bc9ecd662f5d2b0c847fa4b25051acd7a31e5
  Author: Luke Closs <luke@5thplane.com>
  Date : 2011-10-28 21:08:20 +0000

    add a readme 

  Change: f3a33cea2275ba369fc813e7aaf0664cf9b9d779
  Author: Luke Closs <luke@5thplane.com>
  Date : 2011-10-28 21:05:42 +0000

    Add Coupons and subscriptions and more tests 

  Change: a1eb2c51dad15b0d335db8d6a0f31da80c807470
  Author: Luke Closs <luke@5thplane.com>
  Date : 2011-10-28 20:21:18 +0000

    Add plans and basic plan tests 

  Change: 58ad0cea7fc515f6a759cd9d31bb6f8a91c7df81
  Author: Luke Closs <luke@5thplane.com>
  Date : 2011-10-28 19:52:16 +0000

    Add and fix tests 

  Change: 9cc1ef58343393add8f5eb7ce67c7bec7b69796e
  Author: Luke Closs <luke@5thplane.com>
  Date : 2011-10-28 19:52:09 +0000

    stringify the errors nicely 

  Change: 4a4fbd0c68c7253b4e5b430b12bc96d29fe80daf
  Author: Luke Closs <luke@5thplane.com>
  Date : 2011-10-28 19:51:47 +0000

    no need to worry about this, their api does it 

  Change: e77457656d7224fdcf666aefa344c6fd59a6ee4c
  Author: Luke Closs <luke@5thplane.com>
  Date : 2011-10-28 17:32:57 +0000

    Add tokens to charge & customer requests 

  Change: c369379fd706de821637c3ebbb882da846f8fe75
  Author: Luke Closs <luke@5thplane.com>
  Date : 2011-10-28 17:07:47 +0000

    Add Tokens and Customers 

  Change: 7c1306bfdd5309988a460af36165c0c6049bf3a1
  Author: Luke Closs <luke@5thplane.com>
  Date : 2011-10-28 14:15:17 +0000

    Initial commit 

================
End of releases.
================

CODE_OF_CONDUCT.md  view on Meta::CPAN

# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
 advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
 address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
 professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at Lukecloss@gmail.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq

LICENSE  view on Meta::CPAN

This software is copyright (c) 2015 by Prime Radiant, Inc., (c) copyright 2014 Lucky Dinosaur LLC.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

Terms of the Perl programming language system itself

a) the GNU General Public License as published by the Free
   Software Foundation; either version 1, or (at your option) any
   later version, or
b) the "Artistic License"

--- The GNU General Public License, Version 1, February 1989 ---

This software is Copyright (c) 2015 by Prime Radiant, Inc., (c) copyright 2014 Lucky Dinosaur LLC.

This is free software, licensed under:

  The GNU General Public License, Version 1, February 1989

                    GNU GENERAL PUBLIC LICENSE
                     Version 1, February 1989

 Copyright (C) 1989 Free Software Foundation, Inc.
 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

                            Preamble

  The license agreements of most software companies try to keep users
at the mercy of those companies.  By contrast, our General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users.  The
General Public License applies to the Free Software Foundation's
software and to any other program whose authors commit to using it.
You can use it for your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Specifically, the General Public License is designed to make
sure that you have the freedom to give away or sell copies of free
software, that you receive source code or can get it if you want it,
that you can change the software or use pieces of it in new free
programs; and that you know you can do these things.

  To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.

  For example, if you distribute copies of a such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have.  You must make sure that they, too, receive or can get the
source code.  And you must tell them their rights.

  We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.

  Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software.  If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.

  The precise terms and conditions for copying, distribution and
modification follow.

                    GNU GENERAL PUBLIC LICENSE
   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

  0. This License Agreement applies to any program or other work which
contains a notice placed by the copyright holder saying it may be
distributed under the terms of this General Public License.  The
"Program", below, refers to any such program or work, and a "work based
on the Program" means either the Program or any work containing the
Program or a portion of it, either verbatim or with modifications.  Each
licensee is addressed as "you".

  1. You may copy and distribute verbatim copies of the Program's source
code as you receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice and
disclaimer of warranty; keep intact all the notices that refer to this
General Public License and to the absence of any warranty; and give any
other recipients of the Program a copy of this General Public License
along with the Program.  You may charge a fee for the physical act of
transferring a copy.

  2. You may modify your copy or copies of the Program or any portion of
it, and copy and distribute such modifications under the terms of Paragraph
1 above, provided that you also do the following:

    a) cause the modified files to carry prominent notices stating that
    you changed the files and the date of any change; and

    b) cause the whole of any work that you distribute or publish, that
    in whole or in part contains the Program or any part thereof, either
    with or without modifications, to be licensed at no charge to all
    third parties under the terms of this General Public License (except
    that you may choose to grant warranty protection to some or all
    third parties, at your option).

    c) If the modified program normally reads commands interactively when
    run, you must cause it, when started running for such interactive use
    in the simplest and most usual way, to print or display an
    announcement including an appropriate copyright notice and a notice
    that there is no warranty (or else, saying that you provide a
    warranty) and that users may redistribute the program under these
    conditions, and telling the user how to view a copy of this General
    Public License.

    d) You may charge a fee for the physical act of transferring a
    copy, and you may at your option offer warranty protection in
    exchange for a fee.

Mere aggregation of another independent work with the Program (or its
derivative) on a volume of a storage or distribution medium does not bring
the other work under the scope of these terms.

  3. You may copy and distribute the Program (or a portion or derivative of
it, under Paragraph 2) in object code or executable form under the terms of
Paragraphs 1 and 2 above provided that you also do one of the following:

    a) accompany it with the complete corresponding machine-readable
    source code, which must be distributed under the terms of
    Paragraphs 1 and 2 above; or,

    b) accompany it with a written offer, valid for at least three
    years, to give any third party free (except for a nominal charge
    for the cost of distribution) a complete machine-readable copy of the
    corresponding source code, to be distributed under the terms of
    Paragraphs 1 and 2 above; or,

    c) accompany it with the information you received as to where the
    corresponding source code may be obtained.  (This alternative is
    allowed only for noncommercial distribution and only if you
    received the program in object code or executable form alone.)

Source code for a work means the preferred form of the work for making
modifications to it.  For an executable file, complete source code means
all the source code for all modules it contains; but, as a special
exception, it need not include source code for modules which are standard
libraries that accompany the operating system on which the executable
file runs, or for standard header files or definitions files that
accompany that operating system.

  4. You may not copy, modify, sublicense, distribute or transfer the
Program except as expressly provided under this General Public License.
Any attempt otherwise to copy, modify, sublicense, distribute or transfer
the Program is void, and will automatically terminate your rights to use
the Program under this License.  However, parties who have received
copies, or rights to use copies, from you under this General Public
License will not have their licenses terminated so long as such parties
remain in full compliance.

  5. By copying, distributing or modifying the Program (or any work based
on the Program) you indicate your acceptance of this license to do so,
and all its terms and conditions.

  6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the original
licensor to copy, distribute or modify the Program subject to these
terms and conditions.  You may not impose any further restrictions on the
recipients' exercise of the rights granted herein.

  7. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

Each version is given a distinguishing version number.  If the Program
specifies a version number of the license which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation.  If the Program does not specify a version number of
the license, you may choose any version ever published by the Free Software
Foundation.

  8. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission.  For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this.  Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.

                            NO WARRANTY

  9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.

  10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.

                     END OF TERMS AND CONDITIONS

        Appendix: How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to humanity, the best way to achieve this is to make it
free software which everyone can redistribute and change under these
terms.

  To do so, attach the following notices to the program.  It is safest to
attach them to the start of each source file to most effectively convey
the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) 19yy  <name of author>

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 1, or (at your option)
    any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA  02110-1301 USA


Also add information on how to contact you by electronic and paper mail.

If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:

    Gnomovision version 69, Copyright (C) 19xx name of author
    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the
appropriate parts of the General Public License.  Of course, the
commands you use may be called something other than `show w' and `show
c'; they could even be mouse-clicks or menu items--whatever suits your
program.

You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary.  Here a sample; alter the names:

  Yoyodyne, Inc., hereby disclaims all copyright interest in the
  program `Gnomovision' (a program to direct compilers to make passes
  at assemblers) written by James Hacker.

  <signature of Ty Coon>, 1 April 1989
  Ty Coon, President of Vice

That's all there is to it!


--- The Artistic License 1.0 ---

This software is Copyright (c) 2015 by Prime Radiant, Inc., (c) copyright 2014 Lucky Dinosaur LLC.

This is free software, licensed under:

  The Artistic License 1.0

The Artistic License

Preamble

The intent of this document is to state the conditions under which a Package
may be copied, such that the Copyright Holder maintains some semblance of
artistic control over the development of the package, while giving the users of
the package the right to use and distribute the Package in a more-or-less
customary fashion, plus the right to make reasonable modifications.

Definitions:

  - "Package" refers to the collection of files distributed by the Copyright
    Holder, and derivatives of that collection of files created through
    textual modification. 
  - "Standard Version" refers to such a Package if it has not been modified,
    or has been modified in accordance with the wishes of the Copyright
    Holder. 
  - "Copyright Holder" is whoever is named in the copyright or copyrights for
    the package. 
  - "You" is you, if you're thinking about copying or distributing this Package.
  - "Reasonable copying fee" is whatever you can justify on the basis of media
    cost, duplication charges, time of people involved, and so on. (You will
    not be required to justify it to the Copyright Holder, but only to the
    computing community at large as a market that must bear the fee.) 
  - "Freely Available" means that no fee is charged for the item itself, though
    there may be fees involved in handling the item. It also means that
    recipients of the item may redistribute it under the same conditions they
    received it. 

1. You may make and give away verbatim copies of the source form of the
Standard Version of this Package without restriction, provided that you
duplicate all of the original copyright notices and associated disclaimers.

2. You may apply bug fixes, portability fixes and other modifications derived
from the Public Domain or from the Copyright Holder. A Package modified in such
a way shall still be considered the Standard Version.

3. You may otherwise modify your copy of this Package in any way, provided that
you insert a prominent notice in each changed file stating how and when you
changed that file, and provided that you do at least ONE of the following:

  a) place your modifications in the Public Domain or otherwise make them
     Freely Available, such as by posting said modifications to Usenet or an
     equivalent medium, or placing the modifications on a major archive site
     such as ftp.uu.net, or by allowing the Copyright Holder to include your
     modifications in the Standard Version of the Package.

  b) use the modified Package only within your corporation or organization.

  c) rename any non-standard executables so the names do not conflict with
     standard executables, which must also be provided, and provide a separate
     manual page for each non-standard executable that clearly documents how it
     differs from the Standard Version.

  d) make other distribution arrangements with the Copyright Holder.

4. You may distribute the programs of this Package in object code or executable
form, provided that you do at least ONE of the following:

  a) distribute a Standard Version of the executables and library files,
     together with instructions (in the manual page or equivalent) on where to
     get the Standard Version.

  b) accompany the distribution with the machine-readable source of the Package
     with your modifications.

  c) accompany any non-standard executables with their corresponding Standard
     Version executables, giving the non-standard executables non-standard
     names, and clearly documenting the differences in manual pages (or
     equivalent), together with instructions on where to get the Standard
     Version.

  d) make other distribution arrangements with the Copyright Holder.

5. You may charge a reasonable copying fee for any distribution of this
Package.  You may charge any fee you choose for support of this Package. You
may not charge a fee for this Package itself. However, you may distribute this
Package in aggregate with other (possibly commercial) programs as part of a
larger (possibly commercial) software distribution provided that you do not
advertise this Package as a product of your own.

6. The scripts and library files supplied as input to or produced as output
from the programs of this Package do not automatically fall under the copyright
of this Package, but belong to whomever generated them, and may be sold
commercially, and may be aggregated with this Package.

7. C or perl subroutines supplied by you and linked into this Package shall not
be considered part of this Package.

8. The name of the Copyright Holder may not be used to endorse or promote
products derived from this software without specific prior written permission.

9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.

The End

MANIFEST  view on Meta::CPAN

# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.012.
CHANGES
CODE_OF_CONDUCT.md
LICENSE
MANIFEST
META.json
META.yml
Makefile.PL
README
dist.ini
lib/Net/Stripe.pm
lib/Net/Stripe/BalanceTransaction.pm
lib/Net/Stripe/Card.pm
lib/Net/Stripe/Charge.pm
lib/Net/Stripe/Constants.pm
lib/Net/Stripe/Coupon.pm
lib/Net/Stripe/Customer.pm
lib/Net/Stripe/Discount.pm
lib/Net/Stripe/Error.pm
lib/Net/Stripe/Invoice.pm
lib/Net/Stripe/Invoiceitem.pm
lib/Net/Stripe/LineItem.pm
lib/Net/Stripe/List.pm
lib/Net/Stripe/PaymentIntent.pm
lib/Net/Stripe/PaymentMethod.pm
lib/Net/Stripe/Plan.pm
lib/Net/Stripe/Product.pm
lib/Net/Stripe/Refund.pm
lib/Net/Stripe/Resource.pm
lib/Net/Stripe/Source.pm
lib/Net/Stripe/Subscription.pm
lib/Net/Stripe/Token.pm
lib/Net/Stripe/TypeConstraints.pm
t/live.t
t/local.t
weaver.ini

META.json  view on Meta::CPAN

{
   "abstract" : "API client for Stripe.com",
   "author" : [
      "Luke Closs",
      "Rusty Conover"
   ],
   "dynamic_config" : 0,
   "generated_by" : "Dist::Zilla version 6.012, CPAN::Meta::Converter version 2.150010",
   "license" : [
      "perl_5"
   ],
   "meta-spec" : {
      "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
      "version" : 2
   },
   "name" : "Net-Stripe",
   "prereqs" : {
      "configure" : {
         "requires" : {
            "ExtUtils::MakeMaker" : "0",
            "perl" : "5.004"
         },
         "suggests" : {
            "JSON::PP" : "2.27300"
         }
      },
      "runtime" : {
         "requires" : {
            "Class::Load" : "0",
            "DateTime" : "0",
            "HTTP::Request::Common" : "0",
            "JSON" : "0",
            "Kavorka" : "0",
            "LWP::UserAgent" : "0",
            "MIME::Base64" : "0",
            "Moose" : "0",
            "Moose::Util::TypeConstraints" : "0",
            "MooseX::Clone" : "0",
            "Throwable" : "0",
            "Type::Tiny" : "1.008004",
            "URI" : "0",
            "URI::Escape" : "0",
            "constant" : "0",
            "namespace::clean" : "0",
            "overload" : "0",
            "perl" : "5.006",
            "strict" : "0"
         }
      },
      "test" : {
         "requires" : {
            "DateTime::Duration" : "0",
            "Test::Exception" : "0",
            "Test::More" : "0",
            "Test::Warn" : "0",
            "perl" : "5.006",
            "warnings" : "0"
         }
      }
   },
   "provides" : {
      "Net::Stripe" : {
         "file" : "lib/Net/Stripe.pm",
         "version" : "0.42"
      },
      "Net::Stripe::BalanceTransaction" : {
         "file" : "lib/Net/Stripe/BalanceTransaction.pm",
         "version" : "0.42"
      },
      "Net::Stripe::Card" : {
         "file" : "lib/Net/Stripe/Card.pm",
         "version" : "0.42"
      },
      "Net::Stripe::Charge" : {
         "file" : "lib/Net/Stripe/Charge.pm",
         "version" : "0.42"
      },
      "Net::Stripe::Constants" : {
         "file" : "lib/Net/Stripe/Constants.pm",
         "version" : "0.42"
      },
      "Net::Stripe::Coupon" : {
         "file" : "lib/Net/Stripe/Coupon.pm",
         "version" : "0.42"
      },
      "Net::Stripe::Customer" : {
         "file" : "lib/Net/Stripe/Customer.pm",
         "version" : "0.42"
      },
      "Net::Stripe::Discount" : {
         "file" : "lib/Net/Stripe/Discount.pm",
         "version" : "0.42"
      },
      "Net::Stripe::Error" : {
         "file" : "lib/Net/Stripe/Error.pm",
         "version" : "0.42"
      },
      "Net::Stripe::Invoice" : {
         "file" : "lib/Net/Stripe/Invoice.pm",
         "version" : "0.42"
      },
      "Net::Stripe::Invoiceitem" : {
         "file" : "lib/Net/Stripe/Invoiceitem.pm",
         "version" : "0.42"
      },
      "Net::Stripe::LineItem" : {
         "file" : "lib/Net/Stripe/LineItem.pm",
         "version" : "0.42"
      },
      "Net::Stripe::List" : {
         "file" : "lib/Net/Stripe/List.pm",
         "version" : "0.42"
      },
      "Net::Stripe::PaymentIntent" : {
         "file" : "lib/Net/Stripe/PaymentIntent.pm",
         "version" : "0.42"
      },
      "Net::Stripe::PaymentMethod" : {
         "file" : "lib/Net/Stripe/PaymentMethod.pm",
         "version" : "0.42"
      },
      "Net::Stripe::Plan" : {
         "file" : "lib/Net/Stripe/Plan.pm",
         "version" : "0.42"
      },
      "Net::Stripe::Product" : {
         "file" : "lib/Net/Stripe/Product.pm",
         "version" : "0.42"
      },
      "Net::Stripe::Refund" : {
         "file" : "lib/Net/Stripe/Refund.pm",
         "version" : "0.42"
      },
      "Net::Stripe::Resource" : {
         "file" : "lib/Net/Stripe/Resource.pm",
         "version" : "0.42"
      },
      "Net::Stripe::Source" : {
         "file" : "lib/Net/Stripe/Source.pm",
         "version" : "0.42"
      },
      "Net::Stripe::Subscription" : {
         "file" : "lib/Net/Stripe/Subscription.pm",
         "version" : "0.42"
      },
      "Net::Stripe::Token" : {
         "file" : "lib/Net/Stripe/Token.pm",
         "version" : "0.42"
      },
      "Net::Stripe::TypeConstraints" : {
         "file" : "lib/Net/Stripe/TypeConstraints.pm",
         "version" : "0.42"
      }
   },
   "release_status" : "stable",
   "resources" : {
      "bugtracker" : {
         "web" : "https://github.com/lukec/stripe-perl/issues"
      },
      "homepage" : "https://stripe.com/docs",
      "repository" : {
         "type" : "git",
         "url" : "git://github.com/lukec/stripe-perl.git",
         "web" : "https://github.com/lukec/stripe-perl"
      }
   },
   "version" : "0.42",
   "x_contributors" : [
      "Andrew Solomon <andrew@geekuni.com>",
      "Andrew Solomon <andrew@illywhacker.net>",
      "Brian Collins <bricollins@gmail.com>",
      "Devin M. Certas <devin@nacredata.com>",
      "Dimitar Petrov <mitakaa@gmail.com>",
      "Dylan Reinhold <dylan@gasdasoftware.com>",
      "E. Choroba <choroba@matfyz.cz>",
      "Florian Heyer <info@heyer-it.de>",
      "Hermann Calabria <hermann@ivouch.com>",
      "Jonathan \"Duke\" Leto <jonathan@leto.net>",
      "Luke Closs <lukec@users.noreply.github.com>",
      "Luke Closs <me@luk.ec>",
      "Mohammad S Anwar <mohammad.anwar@yahoo.com>",
      "Olaf Alders <olaf@wundersolutions.com>",
      "Paul Cochrane <paul@liekut.de>",
      "Peter Scott <peter@shotgundriver.com>",
      "Rusty Conover <rusty@luckydinosaur.com>",
      "Sachin Sebastian <sachinjsk@users.noreply.github.com>",
      "Sherrard Burton <32931314+sherrardb@users.noreply.github.com>",
      "Sherrard Burton <sburton@allafrica.com>",
      "Slobodan Mi\u0161kovi\u0107 <slobodan@miskovic.ca>",
      "Tom Eliaz <tom@tomeliaz.com>"
   ],
   "x_generated_by_perl" : "v5.20.2",
   "x_serialization_backend" : "Cpanel::JSON::XS version 3.0225"
}

META.yml  view on Meta::CPAN

---
abstract: 'API client for Stripe.com'
author:
  - 'Luke Closs'
  - 'Rusty Conover'
build_requires:
  DateTime::Duration: '0'
  Test::Exception: '0'
  Test::More: '0'
  Test::Warn: '0'
  perl: '5.006'
  warnings: '0'
configure_requires:
  ExtUtils::MakeMaker: '0'
  perl: '5.004'
dynamic_config: 0
generated_by: 'Dist::Zilla version 6.012, CPAN::Meta::Converter version 2.150010'
license: perl
meta-spec:
  url: http://module-build.sourceforge.net/META-spec-v1.4.html
  version: '1.4'
name: Net-Stripe
provides:
  Net::Stripe:
    file: lib/Net/Stripe.pm
    version: '0.42'
  Net::Stripe::BalanceTransaction:
    file: lib/Net/Stripe/BalanceTransaction.pm
    version: '0.42'
  Net::Stripe::Card:
    file: lib/Net/Stripe/Card.pm
    version: '0.42'
  Net::Stripe::Charge:
    file: lib/Net/Stripe/Charge.pm
    version: '0.42'
  Net::Stripe::Constants:
    file: lib/Net/Stripe/Constants.pm
    version: '0.42'
  Net::Stripe::Coupon:
    file: lib/Net/Stripe/Coupon.pm
    version: '0.42'
  Net::Stripe::Customer:
    file: lib/Net/Stripe/Customer.pm
    version: '0.42'
  Net::Stripe::Discount:
    file: lib/Net/Stripe/Discount.pm
    version: '0.42'
  Net::Stripe::Error:
    file: lib/Net/Stripe/Error.pm
    version: '0.42'
  Net::Stripe::Invoice:
    file: lib/Net/Stripe/Invoice.pm
    version: '0.42'
  Net::Stripe::Invoiceitem:
    file: lib/Net/Stripe/Invoiceitem.pm
    version: '0.42'
  Net::Stripe::LineItem:
    file: lib/Net/Stripe/LineItem.pm
    version: '0.42'
  Net::Stripe::List:
    file: lib/Net/Stripe/List.pm
    version: '0.42'
  Net::Stripe::PaymentIntent:
    file: lib/Net/Stripe/PaymentIntent.pm
    version: '0.42'
  Net::Stripe::PaymentMethod:
    file: lib/Net/Stripe/PaymentMethod.pm
    version: '0.42'
  Net::Stripe::Plan:
    file: lib/Net/Stripe/Plan.pm
    version: '0.42'
  Net::Stripe::Product:
    file: lib/Net/Stripe/Product.pm
    version: '0.42'
  Net::Stripe::Refund:
    file: lib/Net/Stripe/Refund.pm
    version: '0.42'
  Net::Stripe::Resource:
    file: lib/Net/Stripe/Resource.pm
    version: '0.42'
  Net::Stripe::Source:
    file: lib/Net/Stripe/Source.pm
    version: '0.42'
  Net::Stripe::Subscription:
    file: lib/Net/Stripe/Subscription.pm
    version: '0.42'
  Net::Stripe::Token:
    file: lib/Net/Stripe/Token.pm
    version: '0.42'
  Net::Stripe::TypeConstraints:
    file: lib/Net/Stripe/TypeConstraints.pm
    version: '0.42'
requires:
  Class::Load: '0'
  DateTime: '0'
  HTTP::Request::Common: '0'
  JSON: '0'
  Kavorka: '0'
  LWP::UserAgent: '0'
  MIME::Base64: '0'
  Moose: '0'
  Moose::Util::TypeConstraints: '0'
  MooseX::Clone: '0'
  Throwable: '0'
  Type::Tiny: '1.008004'
  URI: '0'
  URI::Escape: '0'
  constant: '0'
  namespace::clean: '0'
  overload: '0'
  perl: '5.006'
  strict: '0'
resources:
  bugtracker: https://github.com/lukec/stripe-perl/issues
  homepage: https://stripe.com/docs
  repository: git://github.com/lukec/stripe-perl.git
version: '0.42'
x_contributors:
  - 'Andrew Solomon <andrew@geekuni.com>'
  - 'Andrew Solomon <andrew@illywhacker.net>'
  - 'Brian Collins <bricollins@gmail.com>'
  - 'Devin M. Certas <devin@nacredata.com>'
  - 'Dimitar Petrov <mitakaa@gmail.com>'
  - 'Dylan Reinhold <dylan@gasdasoftware.com>'
  - 'E. Choroba <choroba@matfyz.cz>'
  - 'Florian Heyer <info@heyer-it.de>'
  - 'Hermann Calabria <hermann@ivouch.com>'
  - 'Jonathan "Duke" Leto <jonathan@leto.net>'
  - 'Luke Closs <lukec@users.noreply.github.com>'
  - 'Luke Closs <me@luk.ec>'
  - 'Mohammad S Anwar <mohammad.anwar@yahoo.com>'
  - 'Olaf Alders <olaf@wundersolutions.com>'
  - 'Paul Cochrane <paul@liekut.de>'
  - 'Peter Scott <peter@shotgundriver.com>'
  - 'Rusty Conover <rusty@luckydinosaur.com>'
  - 'Sachin Sebastian <sachinjsk@users.noreply.github.com>'
  - 'Sherrard Burton <32931314+sherrardb@users.noreply.github.com>'
  - 'Sherrard Burton <sburton@allafrica.com>'
  - 'Slobodan Mišković <slobodan@miskovic.ca>'
  - 'Tom Eliaz <tom@tomeliaz.com>'
x_generated_by_perl: v5.20.2
x_serialization_backend: 'YAML::Tiny version 1.73'

Makefile.PL  view on Meta::CPAN

# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.012.
use strict;
use warnings;

use 5.006;

use ExtUtils::MakeMaker;

my %WriteMakefileArgs = (
  "ABSTRACT" => "API client for Stripe.com",
  "AUTHOR" => "Luke Closs, Rusty Conover",
  "CONFIGURE_REQUIRES" => {
    "ExtUtils::MakeMaker" => 0
  },
  "DISTNAME" => "Net-Stripe",
  "LICENSE" => "perl",
  "MIN_PERL_VERSION" => "5.006",
  "NAME" => "Net::Stripe",
  "PREREQ_PM" => {
    "Class::Load" => 0,
    "DateTime" => 0,
    "HTTP::Request::Common" => 0,
    "JSON" => 0,
    "Kavorka" => 0,
    "LWP::UserAgent" => 0,
    "MIME::Base64" => 0,
    "Moose" => 0,
    "Moose::Util::TypeConstraints" => 0,
    "MooseX::Clone" => 0,
    "Throwable" => 0,
    "Type::Tiny" => "1.008004",
    "URI" => 0,
    "URI::Escape" => 0,
    "constant" => 0,
    "namespace::clean" => 0,
    "overload" => 0,
    "strict" => 0
  },
  "TEST_REQUIRES" => {
    "DateTime::Duration" => 0,
    "Test::Exception" => 0,
    "Test::More" => 0,
    "Test::Warn" => 0,
    "warnings" => 0
  },
  "VERSION" => "0.42",
  "test" => {
    "TESTS" => "t/*.t"
  }
);


my %FallbackPrereqs = (
  "Class::Load" => 0,
  "DateTime" => 0,
  "DateTime::Duration" => 0,
  "HTTP::Request::Common" => 0,
  "JSON" => 0,
  "Kavorka" => 0,
  "LWP::UserAgent" => 0,
  "MIME::Base64" => 0,
  "Moose" => 0,
  "Moose::Util::TypeConstraints" => 0,
  "MooseX::Clone" => 0,
  "Test::Exception" => 0,
  "Test::More" => 0,
  "Test::Warn" => 0,
  "Throwable" => 0,
  "Type::Tiny" => "1.008004",
  "URI" => 0,
  "URI::Escape" => 0,
  "constant" => 0,
  "namespace::clean" => 0,
  "overload" => 0,
  "strict" => 0,
  "warnings" => 0
);


unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
  delete $WriteMakefileArgs{TEST_REQUIRES};
  delete $WriteMakefileArgs{BUILD_REQUIRES};
  $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs;
}

delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
  unless eval { ExtUtils::MakeMaker->VERSION(6.52) };

WriteMakefile(%WriteMakefileArgs);

README  view on Meta::CPAN

This archive contains the distribution Net-Stripe,
version 0.42:

  API client for Stripe.com

This software is copyright (c) 2015 by Prime Radiant, Inc., (c) copyright 2014 Lucky Dinosaur LLC.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.


This README file was generated by Dist::Zilla::Plugin::Readme v6.012.

dist.ini  view on Meta::CPAN

name     = Net-Stripe
abstract = API client for Stripe.com
author   = Luke Closs
author   = Rusty Conover
license  = Perl_5
copyright_holder = Prime Radiant, Inc., (c) copyright 2014 Lucky Dinosaur LLC
copyright_year   = 2015
[@Basic]
[MinimumPerl]
[MetaProvides::Class]
[MetaProvides::Package]
[AutoPrereqs]
; authordep Pod::Weaver::Section::ClassMopper
; authordep Pod::Weaver::Section::Contributors
[@GitHub]
repo = lukec/stripe-perl
[ChangelogFromGit]
[Git::NextVersion]
version_regexp = ^(\d+\.\d+)$
[PodWeaver]
[Git::Contributors]
[PkgVersion]
[ReadmeAnyFromPod / pod.root ]
    filename = README.pod
    type = pod
    location = root
[MetaJSON]

lib/Net/Stripe.pm  view on Meta::CPAN

package Net::Stripe;
$Net::Stripe::VERSION = '0.42';
use Moose;
use Class::Load;
use Type::Tiny 1.008004;
use Kavorka;
use LWP::UserAgent;
use HTTP::Request::Common qw/GET POST DELETE/;
use MIME::Base64 qw/encode_base64/;
use URI::Escape qw/uri_escape/;
use JSON qw/decode_json/;
use URI qw//;
use DateTime qw//;
use Net::Stripe::TypeConstraints;
use Net::Stripe::Constants;
use Net::Stripe::Token;
use Net::Stripe::Invoiceitem;
use Net::Stripe::Invoice;
use Net::Stripe::Card;
use Net::Stripe::Source;
use Net::Stripe::Plan;
use Net::Stripe::Product;
use Net::Stripe::Coupon;
use Net::Stripe::Charge;
use Net::Stripe::Customer;
use Net::Stripe::Discount;
use Net::Stripe::Subscription;
use Net::Stripe::Error;
use Net::Stripe::BalanceTransaction;
use Net::Stripe::List;
use Net::Stripe::LineItem;
use Net::Stripe::Refund;
use Net::Stripe::PaymentMethod;
use Net::Stripe::PaymentIntent;

# ABSTRACT: API client for Stripe.com


has 'debug'         => (is => 'rw', isa => 'Bool',   default    => 0, documentation => "The debug flag");
has 'debug_network' => (is => 'rw', isa => 'Bool',   default    => 0, documentation => "The debug network request flag");
has 'api_key'       => (is => 'ro', isa => 'Str',    required   => 1, documentation => "You get this from your Stripe Account settings");
has 'api_base'      => (is => 'ro', isa => 'Str',    lazy_build => 1, documentation => "This is the base part of the URL for every request made");
has 'ua'            => (is => 'ro', isa => 'Object', lazy_build => 1, documentation => "The LWP::UserAgent that is used for requests");
has 'api_version'   => (is => 'ro', isa => 'StripeAPIVersion', documentation => "This is the value of the Stripe-Version header you wish to transmit for API calls");
has 'force_api_version' => (is => 'ro', isa => 'Bool', default => 0, documentation => "Set this to true to bypass the safety checks for API version compatibility.");

sub BUILD {
    my ( $self, $args ) = @_;
    $self->_validate_api_version_range();
    $self->_validate_api_version_value();
}


Charges: {
    method post_charge(Int :$amount,
                       Str :$currency,
                       StripeCustomerId :$customer?,
                       StripeTokenId|StripeCardId :$card?,
                       StripeTokenId|StripeCardId|StripeSourceId :$source?,
                       Str :$description?,
                       HashRef :$metadata?,
                       Bool :$capture?,
                       Str :$statement_descriptor?,
                       Int :$application_fee?,
                       Str :$receipt_email?
                     ) {

        if ( defined( $card ) ) {
            my $card_id_type = Moose::Util::TypeConstraints::find_type_constraint( 'StripeCardId' );
            if ( defined( $customer ) && ! $card_id_type->check( $card ) ) {
                die Net::Stripe::Error->new(
                    type => "post_charge error",
                    message => sprintf(
                        "Invalid value '%s' passed for parameter 'card'. Charges for an existing customer can only accept a card id.",
                        $card,
                    ),
                );
            }

            my $token_id_type = Moose::Util::TypeConstraints::find_type_constraint( 'StripeTokenId' );
            if ( ! defined( $customer ) && ! $token_id_type->check( $card ) ) {
                die Net::Stripe::Error->new(
                    type => "post_charge error",
                    message => sprintf(
                        "Invalid value '%s' passed for parameter 'card'. Charges without an existing customer can only accept a token id.",
                        $card,
                    ),
                );
            }
        }

        if ( defined( $source ) ) {
            my $card_id_type = Moose::Util::TypeConstraints::find_type_constraint( 'StripeCardId' );
            if ( defined( $customer ) && ! $card_id_type->check( $source ) ) {
                die Net::Stripe::Error->new(
                    type => "post_charge error",
                    message => sprintf(
                        "Invalid value '%s' passed for parameter 'source'. Charges for an existing customer can only accept a card id.",
                        $source,
                    ),
                );
            }

            my $token_id_type = Moose::Util::TypeConstraints::find_type_constraint( 'StripeTokenId' );
            my $source_id_type = Moose::Util::TypeConstraints::find_type_constraint( 'StripeSourceId' );
            if ( ! defined( $customer ) && ! $token_id_type->check( $source ) && ! $source_id_type->check( $source ) ) {
                die Net::Stripe::Error->new(
                    type => "post_charge error",
                    message => sprintf(
                        "Invalid value '%s' passed for parameter 'source'. Charges without an existing customer can only accept a token id or source id.",
                        $source,
                    ),
                );
            }
        }

        my $charge = Net::Stripe::Charge->new(amount => $amount,
                                              currency => $currency,
                                              customer => $customer,
                                              card => $card,
                                              source => $source,
                                              description => $description,
                                              metadata => $metadata,
                                              capture => $capture,
                                              statement_descriptor => $statement_descriptor,
                                              application_fee => $application_fee,
                                              receipt_email => $receipt_email
                                          );
        return $self->_post('charges', $charge);
    }

    method get_charge(Str :$charge_id) {
        return $self->_get("charges/" . $charge_id);
    }

    method refund_charge(Net::Stripe::Charge|Str :$charge, Int :$amount?) {
        if (ref($charge)) {
            $charge = $charge->id;
        }

        my $refund = Net::Stripe::Refund->new(id => $charge,
                                              amount => $amount
                                          );
        return $self->_post("charges/$charge/refunds", $refund);
    }

    method get_charges(HashRef :$created?,
                       Net::Stripe::Customer|Str :$customer?,
                       Str :$ending_before?,
                       Int :$limit?,
                       Str :$starting_after?) {
        if (ref($customer)) {
            $customer = $customer->id;
        }
        my %args = (
            path => 'charges',
            created => $created,
            customer => $customer,
            ending_before => $ending_before,
            limit => $limit,
            starting_after => $starting_after,
        );
        $self->_get_all(%args);
    }

    method capture_charge(
        Net::Stripe::Charge|Str :$charge!,
        Int :$amount?,
    ) {
        if (ref($charge)) {
            $charge = $charge->id;
        }

        my %args = (
            amount => $amount,
        );
        return $self->_post("charges/$charge/capture", \%args);
    }

}


PaymentIntents: {
    method create_payment_intent(
        Int :$amount!,
        Str :$currency!,
        Int :$application_fee_amount?,
        StripeCaptureMethod :$capture_method?,
        Bool :$confirm?,
        StripeConfirmationMethod :$confirmation_method?,
        StripeCustomerId :$customer?,
        Str :$description?,
        Bool :$error_on_requires_action?,
        Str :$mandate?,
        HashRef :$mandate_data?,
        HashRef[Str] :$metadata?,
        Bool :$off_session?,
        Str :$on_behalf_of?,
        StripePaymentMethodId :$payment_method?,
        HashRef :$payment_method_options?,
        ArrayRef[StripePaymentMethodType] :$payment_method_types?,
        Str :$receipt_email?,
        Str :$return_url?,
        Bool :$save_payment_method?,
        Str :$setup_future_usage?,
        HashRef :$shipping?,
        Str :$statement_descriptor?,
        Str :$statement_descriptor_suffix?,
        HashRef :$transfer_data?,
        Str :$transfer_group?,
        Bool :$use_stripe_sdk?,
    ) {
        my %args = (
            amount => $amount,
            currency => $currency,
            application_fee_amount => $application_fee_amount,
            capture_method => $capture_method,
            confirm => $confirm,
            confirmation_method => $confirmation_method,
            customer => $customer,
            description => $description,
            error_on_requires_action => $error_on_requires_action,
            mandate => $mandate,
            mandate_data => $mandate_data,
            metadata => $metadata,
            off_session => $off_session,
            on_behalf_of => $on_behalf_of,
            payment_method => $payment_method,
            payment_method_options => $payment_method_options,
            payment_method_types => $payment_method_types,
            receipt_email => $receipt_email,
            return_url => $return_url,
            save_payment_method => $save_payment_method,
            setup_future_usage => $setup_future_usage,
            shipping => $shipping,
            statement_descriptor => $statement_descriptor,
            statement_descriptor_suffix => $statement_descriptor_suffix,
            transfer_data => $transfer_data,
            transfer_group => $transfer_group,
            use_stripe_sdk => $use_stripe_sdk,
        );
        my $payment_intent_obj = Net::Stripe::PaymentIntent->new( %args );
        return $self->_post("payment_intents", $payment_intent_obj);
    }

    method get_payment_intent(
        StripePaymentIntentId :$payment_intent_id!,
        Str :$client_secret?,
    ) {
        my %args = (
            client_secret => $client_secret,
        );
        return $self->_get("payment_intents/$payment_intent_id", \%args);
    }

    method update_payment_intent(
        StripePaymentIntentId :$payment_intent_id!,
        Int :$amount?,
        Int :$application_fee_amount?,
        Str :$currency?,
        StripeCustomerId :$customer?,
        Str :$description?,
        HashRef[Str]|EmptyStr :$metadata?,
        StripePaymentMethodId :$payment_method?,
        HashRef :$payment_method_options?,
        ArrayRef[StripePaymentMethodType] :$payment_method_types?,
        Str :$receipt_email?,
        Bool :$save_payment_method?,
        Str :$setup_future_usage?,
        HashRef :$shipping?,
        Str :$statement_descriptor?,
        Str :$statement_descriptor_suffix?,
        HashRef :$transfer_data?,
        Str :$transfer_group?,
    ) {
        my %args = (
            amount => $amount,
            application_fee_amount => $application_fee_amount,
            currency => $currency,
            customer => $customer,
            description => $description,
            metadata => $metadata,
            payment_method => $payment_method,
            payment_method_options => $payment_method_options,
            payment_method_types => $payment_method_types,
            receipt_email => $receipt_email,
            save_payment_method => $save_payment_method,
            setup_future_usage => $setup_future_usage,
            shipping => $shipping,
            statement_descriptor => $statement_descriptor,
            statement_descriptor_suffix => $statement_descriptor_suffix,
            transfer_data => $transfer_data,
            transfer_group => $transfer_group,
        );
        my $payment_intent_obj = Net::Stripe::PaymentIntent->new( %args );
        return $self->_post("payment_intents/$payment_intent_id", $payment_intent_obj);
    }

    method confirm_payment_intent(
        StripePaymentIntentId :$payment_intent_id!,
        Str :$client_secret?,
        Bool :$error_on_requires_action?,
        Str :$mandate?,
        HashRef :$mandate_data?,
        Bool :$off_session?,
        StripePaymentMethodId :$payment_method?,
        HashRef :$payment_method_options?,
        ArrayRef[StripePaymentMethodType] :$payment_method_types?,
        Str :$receipt_email?,
        Str :$return_url?,
        Bool :$save_payment_method?,
        Str :$setup_future_usage?,
        HashRef :$shipping?,
        Bool :$use_stripe_sdk?,
    ) {
        my %args = (
            client_secret => $client_secret,
            error_on_requires_action => $error_on_requires_action,
            mandate => $mandate,
            mandate_data => $mandate_data,
            off_session => $off_session,
            payment_method => $payment_method,
            payment_method_options => $payment_method_options,
            payment_method_types => $payment_method_types,
            receipt_email => $receipt_email,
            return_url => $return_url,
            save_payment_method => $save_payment_method,
            setup_future_usage => $setup_future_usage,
            shipping => $shipping,
            use_stripe_sdk => $use_stripe_sdk,
        );
        return $self->_post("payment_intents/$payment_intent_id/confirm", \%args);
    }

    method capture_payment_intent(
        StripePaymentIntentId :$payment_intent_id!,
        Int :$amount_to_capture?,
        Int :$application_fee_amount?,
        Str :$statement_descriptor?,
        Str :$statement_descriptor_suffix?,
        HashRef :$transfer_data?,
    ) {
        my %args = (
            amount_to_capture => $amount_to_capture,
            application_fee_amount => $application_fee_amount,
            statement_descriptor => $statement_descriptor,
            statement_descriptor_suffix => $statement_descriptor_suffix,
            transfer_data => $transfer_data,
        );
        return $self->_post("payment_intents/$payment_intent_id/capture", \%args);
    }

    method cancel_payment_intent(
        StripePaymentIntentId :$payment_intent_id!,
        StripeCancellationReason :$cancellation_reason?,
    ) {
        my %args = (
            cancellation_reason => $cancellation_reason,
        );
        return $self->_post("payment_intents/$payment_intent_id/cancel", \%args);
    }

    method list_payment_intents(
        StripeCustomerId :$customer?,
        HashRef[Int] :$created?,
        Str :$ending_before?,
        Int :$limit?,
        Str :$starting_after?,
    ) {
        my %args = (
            customer => $customer,
            created => $created,
            ending_before => $ending_before,
            limit => $limit,
            starting_after => $starting_after,
        );
        return $self->_get("payment_intents", \%args);
    }
}



BalanceTransactions: {
    method get_balance_transaction(Str :$id) {
        return $self->_get("balance/history/$id");
    }
}



Customers: {
    method post_customer(Net::Stripe::Customer|StripeCustomerId :$customer?,
                         Int :$account_balance?,
                         Int :$balance?,
                         Net::Stripe::Token|StripeTokenId :$card?,
                         Str :$coupon?,
                         Str :$default_card?,
                         StripeCardId|StripeSourceId :$default_source?,
                         Str :$description?,
                         Str :$email?,
                         HashRef :$metadata?,
                         Str :$plan?,
                         Int :$quantity?,
                         StripeTokenId|StripeSourceId :$source?,
                         Int|Str :$trial_end?) {

        my $customer_obj;
        if ( ref( $customer ) ) {
            $customer_obj = $customer;
        } else {
            my %args = (
                account_balance => $account_balance,
                balance => $balance,
                card => $card,
                coupon => $coupon,
                default_card => $default_card,
                default_source => $default_source,
                email => $email,
                metadata => $metadata,
                plan => $plan,
                quantity => $quantity,
                source => $source,
                trial_end => $trial_end,
            );
            $args{id} = $customer if defined( $customer );

            $customer_obj = Net::Stripe::Customer->new( %args );
        }

        if ( my $customer_id = $customer_obj->id ) {
            return $self->_post("customers/$customer_id", $customer_obj);
        } else {
            return $self->_post('customers', $customer_obj);
        }
    }

    method list_subscriptions(Net::Stripe::Customer|Str :$customer,
                              Str :$ending_before?,
                              Int :$limit?,
                              Str :$starting_after?) {
        if (ref($customer)) {
            $customer = $customer->id;
        }
        my %args = (
            path => "customers/$customer/subscriptions",
            ending_before => $ending_before,
            limit => $limit,
            starting_after => $starting_after,
        );
        return $self->_get_all(%args);
    }

    method get_customer(Str :$customer_id) {
        return $self->_get("customers/$customer_id");
    }

    method delete_customer(Net::Stripe::Customer|Str :$customer) {
        if (ref($customer)) {
            $customer = $customer->id;
        }
        $self->_delete("customers/$customer");
    }

    method get_customers(HashRef :$created?, Str :$ending_before?, Int :$limit?, Str :$starting_after?, Str :$email?) {
        my %args = (
            path => 'customers',
            created => $created,
            ending_before => $ending_before,
            limit => $limit,
            starting_after => $starting_after,
            email => $email,
        );
        $self->_get_all(%args);
    }
}


Cards: {
    method get_card(Net::Stripe::Customer|Str :$customer,
                    Str :$card_id) {
        if (ref($customer)) {
            $customer = $customer->id;
        }
        return $self->_get("customers/$customer/sources/$card_id");
    }

    method get_cards(Net::Stripe::Customer|Str :$customer,
                     HashRef :$created?,
                     Str :$ending_before?,
                     Int :$limit?,
                     Str :$starting_after?) {
        if (ref($customer)) {
            $customer = $customer->id;
        }

        my %args = (
            path => "customers/$customer/sources",
            object => "card",
            created => $created,
            ending_before => $ending_before,
            limit => $limit,
            starting_after => $starting_after,
        );
        $self->_get_all(%args);
    }

    method post_card(
        Net::Stripe::Customer|StripeCustomerId :$customer!,
        Net::Stripe::Token|StripeTokenId :$card?,
        StripeTokenId :$source?,
    ) {

        die Net::Stripe::Error->new(
            type => "post_card error",
            message => "One of parameters 'source' or 'card' is required.",
        ) unless defined( $card ) || defined( $source );

        my $customer_id = ref( $customer ) ? $customer->id : $customer;

        if ( defined( $card ) ) {
            # card here is either Net::Stripe::Token or StripeTokenId
            my $token_id = ref( $card ) ? $card->id : $card;
            return $self->_post("customers/$customer_id/cards", {card=> $token_id});
        }

        if ( defined( $source ) ) {
            return $self->_post("customers/$customer_id/cards", { source=> $source });
        }
    }

    method update_card(StripeCustomerId :$customer_id!,
                     StripeCardId :$card_id!,
                     HashRef :$card!) {
        return $self->_post("customers/$customer_id/cards/$card_id", $card);
    }

    method delete_card(Net::Stripe::Customer|Str :$customer, Net::Stripe::Card|Str :$card) {
      if (ref($customer)) {
          $customer = $customer->id;
      }

      if (ref($card)) {
          $card = $card->id;
      }

      return $self->_delete("customers/$customer/sources/$card");
    }
}


Sources: {
    method create_source(
        StripeSourceType :$type!,
        Int :$amount?,
        Str :$currency?,
        StripeSourceFlow :$flow?,
        HashRef :$mandate?,
        HashRef :$metadata?,
        HashRef :$owner?,
        HashRef :$receiver?,
        HashRef :$redirect?,
        HashRef :$source_order?,
        Str :$statement_descriptor?,
        StripeTokenId :$token?,
        StripeSourceUsage :$usage?,
    ) {

        die Net::Stripe::Error->new(
            type => "create_source error",
            message => "Parameter 'token' is required for source type 'card'",
            param => 'token',
        ) if defined( $type ) && $type eq 'card' && ! defined( $token );

        my %args = (
            amount => $amount,
            currency => $currency,
            flow => $flow,
            mandate => $mandate,
            metadata => $metadata,
            owner => $owner,
            receiver => $receiver,
            redirect => $redirect,
            source_order => $source_order,
            statement_descriptor => $statement_descriptor,
            token => $token,
            type => $type,
            usage => $usage,
        );
        my $source_obj = Net::Stripe::Source->new( %args );
        return $self->_post("sources", $source_obj);
    }

    method get_source(
        StripeSourceId :$source_id!,
        Str :$client_secret?,
    ) {
        my %args = (
            client_secret => $client_secret,
        );
        return $self->_get("sources/$source_id", \%args);
    }

    method update_source(
        StripeSourceId :$source_id!,
        Int :$amount?,
        HashRef :$mandate?,
        HashRef|EmptyStr :$metadata?,
        HashRef :$owner?,
        HashRef :$source_order?,
    ) {
        my %args = (
            amount => $amount,
            mandate => $mandate,
            metadata => $metadata,
            owner => $owner,
            source_order => $source_order,
        );
        my $source_obj = Net::Stripe::Source->new( %args );

        my @one_of = qw/ amount mandate metadata owner source_order /;
        my @defined = grep { defined( $source_obj->$_ ) } @one_of;

        die Net::Stripe::Error->new(
            type => "update_source error",
            message => sprintf( "at least one of: %s is required to update a source",
                join( ', ', @one_of ),
            ),
        ) if ! @defined;

        return $self->_post("sources/$source_id", $source_obj);
    }

    method attach_source (
        StripeCustomerId :$customer_id!,
        StripeSourceId :$source_id!,
    ) {
        my %args = (
            source => $source_id,
        );
        return $self->_post("customers/$customer_id/sources", \%args);
    }

    method detach_source(
        StripeCustomerId :$customer_id!,
        StripeSourceId :$source_id!,
    ) {
      return $self->_delete("customers/$customer_id/sources/$source_id");
    }

    # undocumented API endpoint
    method list_sources(
        StripeCustomerId :$customer_id!,
        Str :$object!,
        Str :$ending_before?,
        Int :$limit?,
        Str :$starting_after?,
    ) {
        my %args = (
            ending_before => $ending_before,
            limit => $limit,
            object => $object,
            starting_after => $starting_after,
        );
        return $self->_get("customers/$customer_id/sources", \%args);
    }
}


Subscriptions: {
    method get_subscription(Net::Stripe::Customer|Str :$customer) {
        if (ref($customer)) {
           $customer = $customer->id;
        }
        return $self->_get("customers/$customer/subscription");
    }

    # adds a subscription, keeping any existing subscriptions unmodified
    method post_subscription(Net::Stripe::Customer|Str :$customer,
                             Net::Stripe::Subscription|Str :$subscription?,
                             Net::Stripe::Plan|Str :$plan?,
                             Str :$coupon?,
                             Int|Str :$trial_end?,
                             Net::Stripe::Card|Net::Stripe::Token|Str :$card?,
                             Net::Stripe::Card|Net::Stripe::Token|Str :$source?,
                             Int :$quantity? where { $_ >= 0 },
                             Num :$application_fee_percent?,
                             Bool :$prorate? = 1,
                             Bool :$cancel_at_period_end?,
                         ) {
        if (ref($customer)) {
            $customer = $customer->id;
        }

        if (ref($plan)) {
            $plan = $plan->id;
        }

        if (ref($subscription) ne 'Net::Stripe::Subscription') {
            my %args = (plan => $plan,
                        coupon => $coupon,
                        trial_end => $trial_end,
                        card => $card,
                        source => $source,
                        prorate => $prorate,
                        quantity => $quantity,
                        application_fee_percent => $application_fee_percent,
                        cancel_at_period_end => $cancel_at_period_end);
            if (defined($subscription)) {
                $args{id} = $subscription;
            }
            $subscription = Net::Stripe::Subscription->new( %args );
        }

        if (defined($subscription->id)) {
            return $self->_post("customers/$customer/subscriptions/" . $subscription->id, $subscription);
        } else {
            return $self->_post("customers/$customer/subscriptions", $subscription);
        }
    }

    method delete_subscription(Net::Stripe::Customer|Str :$customer,
                               Net::Stripe::Subscription|Str :$subscription,
                               Bool :$at_period_end?
                           ) {
        if (ref($customer)) {
            $customer = $customer->id;
        }
        if (ref($subscription)) {
            $subscription = $subscription->id;
        }

        my %args;
        $args{at_period_end} = 'true' if $at_period_end;
        return $self->_delete("customers/$customer/subscriptions/$subscription", \%args);
    }
}


PaymentMethods: {
    method create_payment_method(
        StripePaymentMethodType :$type!,
        HashRef :$billing_details?,
        StripeTokenId :$card?,
        HashRef :$fpx?,
        HashRef :$ideal?,
        HashRef[Str] :$metadata?,
        StripePaymentMethodId :$payment_method?,
        HashRef :$sepa_debit?,
    ) {
        my %args = (
            type => $type,
            billing_details => $billing_details,
            card => $card,
            fpx => $fpx,
            ideal => $ideal,
            metadata => $metadata,
            payment_method => $payment_method,
            sepa_debit => $sepa_debit,
        );
        my $payment_method_obj = Net::Stripe::PaymentMethod->new( %args );
        return $self->_post("payment_methods", $payment_method_obj);
    }

    method get_payment_method(
        StripePaymentMethodId :$payment_method_id!,
    ) {
        return $self->_get("payment_methods/$payment_method_id");
    }

    method update_payment_method(
        StripePaymentMethodId :$payment_method_id!,
        HashRef :$billing_details?,
        HashRef[Int] :$card?,
        HashRef[Str]|EmptyStr :$metadata?,
        HashRef :$sepa_debit?,
    ) {
        my %args = (
            billing_details => $billing_details,
            card => $card,
            metadata => $metadata,
            sepa_debit => $sepa_debit,
        );
        my $payment_method_obj = Net::Stripe::PaymentMethod->new( %args );
        return $self->_post("payment_methods/$payment_method_id", $payment_method_obj);
    }

    method list_payment_methods(
        StripeCustomerId :$customer!,
        StripePaymentMethodType :$type!,
        Str :$ending_before?,
        Int :$limit?,
        Str :$starting_after?,
    ) {
        my %args = (
            customer => $customer,
            type => $type,
            ending_before => $ending_before,
            limit => $limit,
            starting_after => $starting_after,
        );
        return $self->_get("payment_methods", \%args);
    }

    method attach_payment_method(
        StripeCustomerId :$customer!,
        StripePaymentMethodId :$payment_method_id!,
    ) {
        my %args = (
            customer => $customer,
        );
        return $self->_post("payment_methods/$payment_method_id/attach", \%args);
    }

    method detach_payment_method(
        StripePaymentMethodId :$payment_method_id!,
    ) {
        return $self->_post("payment_methods/$payment_method_id/detach");
    }
}


Tokens: {
    method get_token(Str :$token_id) {
        return $self->_get("tokens/$token_id");
    }
}


Products: {
    method create_product(
        Str :$name!,
        Bool :$active?,
        ArrayRef[Str] :$attributes?,
        Str :$caption?,
        ArrayRef[Str] :$deactivate_on?,
        Str :$description?,
        StripeProductId|Str :$id?,
        ArrayRef[Str] :$images?,
        HashRef[Str] :$metadata?,
        HashRef[Num] :$package_dimensions?,
        Bool :$shippable?,
        Str :$statement_descriptor?,
        StripeProductType :$type?,
        Str :$unit_label?,
        Str :$url?,
    ) {
        my %args = (
            name => $name,
            active => $active,
            attributes => $attributes,
            caption => $caption,
            deactivate_on => $deactivate_on,
            description => $description,
            id => $id,
            images => $images,
            metadata => $metadata,
            package_dimensions => $package_dimensions,
            shippable => $shippable,
            statement_descriptor => $statement_descriptor,
            type => $type,
            unit_label => $unit_label,
            url => $url,
        );
        my $product_obj = Net::Stripe::Product->new( %args );
        return $self->_post('products', $product_obj);
    }

    method get_product(
        StripeProductId|Str :$product_id!,
    ) {
        return $self->_get("products/$product_id");
    }

    method update_product(
        StripeProductId|Str :$product_id!,
        Bool :$active?,
        ArrayRef[Str] :$attributes?,
        Str :$caption?,
        ArrayRef[Str] :$deactivate_on?,
        Str :$description?,
        ArrayRef[Str] :$images?,
        HashRef[Str]|EmptyStr :$metadata?,
        Str :$name?,
        HashRef[Num] :$package_dimensions?,
        Bool :$shippable?,
        Str :$statement_descriptor?,
        StripeProductType :$type?,
        Str :$unit_label?,
        Str :$url?,
    ) {
        my %args = (
            active => $active,
            attributes => $attributes,
            caption => $caption,
            deactivate_on => $deactivate_on,
            description => $description,
            images => $images,
            metadata => $metadata,
            name => $name,
            package_dimensions => $package_dimensions,
            shippable => $shippable,
            statement_descriptor => $statement_descriptor,
            type => $type,
            unit_label => $unit_label,
            url => $url,
        );
        my $product_obj = Net::Stripe::Product->new( %args );
        return $self->_post("products/$product_id", $product_obj);
    }

    method list_products(
        Bool :$active?,
        ArrayRef[StripeProductId|Str] :$ids,
        Bool :$shippable?,
        StripeProductType :$type?,
        Str :$url?,
        HashRef[Str] :$created?,
        Str :$ending_before?,
        Int :$limit?,
        Str :$starting_after?,
    ) {
        my %args = (
            path => "products",
            active => _encode_boolean( $active ),
            ids => $ids,
            shippable => _encode_boolean( $shippable ),
            type => $type,
            url => $url,
            created => $created,
            ending_before => $ending_before,
            limit => $limit,
            starting_after => $starting_after,
        );
        return $self->_get_all( %args );
    }

    method delete_product(
        StripeProductId|Str :$product_id!,
    ) {
        $self->_delete("products/$product_id");
    }
}


Plans: {
    method post_plan(Str :$id,
                     Int :$amount,
                     Str :$currency,
                     Str :$interval,
                     Int :$interval_count?,
                     Str :$name,
                     StripeProductId|Str :$product,
                     Int :$trial_period_days?,
                     HashRef :$metadata?,
                     Str :$statement_descriptor?) {
        my $plan = Net::Stripe::Plan->new(id => $id,
                                          amount => $amount,
                                          currency => $currency,
                                          interval => $interval,
                                          interval_count => $interval_count,
                                          name => $name,
                                          product => $product,
                                          trial_period_days => $trial_period_days,
                                          metadata => $metadata,
                                          statement_descriptor => $statement_descriptor);
        return $self->_post('plans', $plan);
    }

    method get_plan(Str :$plan_id) {
        return $self->_get("plans/" . uri_escape($plan_id));
    }

    method delete_plan(Str|Net::Stripe::Plan $plan) {
        if (ref($plan)) {
            $plan = $plan->id;
        }
        $self->_delete("plans/$plan");
    }

    method get_plans(
        StripeProductId|Str :$product?,
        Str :$ending_before?,
        Int :$limit?,
        Str :$starting_after?,
    ) {
        my %args = (
            path => 'plans',
            product => $product,
            ending_before => $ending_before,
            limit => $limit,
            starting_after => $starting_after,
        );
        $self->_get_all(%args);
    }
}



Coupons: {
    method post_coupon(Str :$id?,
                       Str :$duration,
                       Int :$amount_off?,
                       Str :$currency?,
                       Int :$duration_in_months?,
                       Int :$max_redemptions?,
                       HashRef :$metadata?,
                       Int :$percent_off?,
                       Int :$redeem_by?) {
        my $coupon = Net::Stripe::Coupon->new(id => $id,
                                              duration => $duration,
                                              amount_off => $amount_off,
                                              currency => $currency,
                                              duration_in_months => $duration_in_months,
                                              max_redemptions => $max_redemptions,
                                              metadata => $metadata,
                                              percent_off => $percent_off,
                                              redeem_by => $redeem_by
                                          );
        return $self->_post('coupons', $coupon);
    }

    method get_coupon(Str :$coupon_id) {
        return $self->_get("coupons/" . uri_escape($coupon_id));
    }

    method delete_coupon($id) {
        $id = $id->id if ref($id);
        $self->_delete("coupons/$id");
    }

    method get_coupons(Str :$ending_before?, Int :$limit?, Str :$starting_after?) {
        my %args = (
            path => 'coupons',
            ending_before => $ending_before,
            limit => $limit,
            starting_after => $starting_after,
        );
        $self->_get_all(%args);
    }
}


Discounts: {
    method delete_customer_discount(Net::Stripe::Customer|Str :$customer) {
        if (ref($customer)) {
            $customer = $customer->id;
        }
        $self->_delete("customers/$customer/discount");
    }
}



Invoices: {

    method create_invoice(Net::Stripe::Customer|Str :$customer,
                          Int :$application_fee?,
                          Str :$description?,
                          HashRef :$metadata?,
                          Net::Stripe::Subscription|Str :$subscription?,
                          Bool :$auto_advance?) {
        if (ref($customer)) {
            $customer = $customer->id;
        }

        if (ref($subscription)) {
            $subscription = $subscription->id;
        }

        return $self->_post("invoices",
                            {
                                customer => $customer,
                                application_fee => $application_fee,
                                description => $description,
                                metadata => $metadata,
                                subscription => $subscription,
                                auto_advance => $auto_advance,
                            });
    }


    method post_invoice(Net::Stripe::Invoice|Str :$invoice,
                        Int :$application_fee?,
                        Bool :$closed?,
                        Bool :$auto_advance?,
                        Str :$description?,
                        HashRef :$metadata?) {
        if (ref($invoice)) {
            $invoice = $invoice->id;
        }

        return $self->_post("invoices/$invoice",
                            {
                                application_fee => $application_fee,
                                closed => $closed,
                                auto_advance => $auto_advance,
                                description => $description,
                                metadata => $metadata
                            });
    }

    method get_invoice(Str :$invoice_id) {
        return $self->_get("invoices/$invoice_id");
    }

    method pay_invoice(Str :$invoice_id) {
        return $self->_post("invoices/$invoice_id/pay");
    }

    method get_invoices(Net::Stripe::Customer|Str :$customer?,
                        Int|HashRef :$date?,
                        Str :$ending_before?,
                        Int :$limit?,
                        Str :$starting_after?) {
        if (ref($customer)) {
            $customer = $customer->id
        }

        my %args = (
            customer => $customer,
            date => $date,
            ending_before => $ending_before,
            limit => $limit,
            starting_after => $starting_after,
        );
        $self->_get('invoices', \%args);
    }

    method get_upcominginvoice(Net::Stripe::Customer|Str $customer) {
        if (ref($customer)) {
            $customer = $customer->id;
        }
        my %args = (
            path => 'invoices/upcoming',
            customer => $customer,
        );
        return $self->_get_all(%args);
    }
}


InvoiceItems: {
    method create_invoiceitem(Net::Stripe::Customer|Str :$customer,
                              Int :$amount,
                              Str :$currency,
                              Net::Stripe::Invoice|Str :$invoice?,
                              Net::Stripe::Subscription|Str :$subscription?,
                              Str :$description?,
                              HashRef :$metadata?) {
        if (ref($customer)) {
            $customer = $customer->id;
        }

        if (ref($invoice)) {
            $invoice = $invoice->id;
        }

        if (ref($subscription)) {
            $subscription = $subscription->id;
        }

        my $invoiceitem = Net::Stripe::Invoiceitem->new(customer => $customer,
                                                        amount => $amount,
                                                        currency => $currency,
                                                        invoice => $invoice,
                                                        subscription => $subscription,
                                                        description => $description,
                                                        metadata => $metadata);
        return $self->_post('invoiceitems', $invoiceitem);
    }


    method post_invoiceitem(Net::Stripe::Invoiceitem|Str :$invoice_item,
                            Int :$amount?,
                            Str :$description?,
                            HashRef :$metadata?) {
        if (!defined($amount) && !defined($description) && !defined($metadata)) {
            my $item = $invoice_item->clone; $item->clear_currency;
            return $self->_post("invoiceitems/" . $item->id, $item);
        }

        if (ref($invoice_item)) {
            $invoice_item = $invoice_item->id;
        }

        return $self->_post("invoiceitems/" . $invoice_item,
                            {
                                amount => $amount,
                                description => $description,
                                metadata => $metadata
                            });
    }

    method get_invoiceitem(Str :$invoice_item) {
        return $self->_get("invoiceitems/$invoice_item");
    }

    method delete_invoiceitem(Net::Stripe::Invoiceitem|Str :$invoice_item) {
        if (ref($invoice_item)) {
            $invoice_item = $invoice_item->id;
        }
        $self->_delete("invoiceitems/$invoice_item");
    }

    method get_invoiceitems(HashRef :$created?,
                            Net::Stripe::Customer|Str :$customer?,
                            Str :$ending_before?,
                            Int :$limit?,
                            Str :$starting_after?) {
        if (ref($customer)) {
            $customer = $customer->id;
        }
        my %args = (
            path => 'invoiceitems',
            customer => $customer,
            created => $created,
            ending_before => $ending_before,
            limit => $limit,
            starting_after => $starting_after,
        );
        $self->_get_all(%args);
    }
}

# Helper methods

method _get(Str $path!, HashRef|StripeResourceObject $obj?) {
    my $uri_obj = URI->new( $self->api_base . '/' . $path );

    if ( $obj ) {
        my %form_fields = %{ convert_to_form_fields( $obj ) };
        $uri_obj->query_form( \%form_fields ) if %form_fields;
    }

    my $req = GET $uri_obj->as_string;
    return $self->_make_request($req);
}

method _delete(Str $path!, HashRef|StripeResourceObject $obj?) {
    my $uri_obj = URI->new( $self->api_base . '/' . $path );

    if ( $obj ) {
        my %form_fields = %{ convert_to_form_fields( $obj ) };
        $uri_obj->query_form( \%form_fields ) if %form_fields;
    }

    my $req = DELETE $uri_obj->as_string;
    return $self->_make_request($req);
}

sub convert_to_form_fields {
    my $hash = shift;
    my $stripe_resource_object_type = Moose::Util::TypeConstraints::find_type_constraint( 'StripeResourceObject' );
    if (ref($hash) eq 'HASH') {
        my $r = {};
        foreach my $key (grep { defined($hash->{$_}) }keys %$hash) {
            if ( $stripe_resource_object_type->check( $hash->{$key} ) ) {
                %{$r} = ( %{$r}, %{ convert_to_form_fields($hash->{$key}) } );
            } elsif (ref($hash->{$key}) eq 'HASH') {
                foreach my $fn (keys %{$hash->{$key}}) {
                    $r->{$key . '[' . $fn . ']'} = $hash->{$key}->{$fn};
                }
            } elsif (ref($hash->{$key}) eq 'ARRAY') {
                $r->{$key . '[]'} = $hash->{$key};
            } else {
                $r->{$key} = $hash->{$key};
            }
        }
        return $r;
    } elsif ($stripe_resource_object_type->check($hash)) {
        return { $hash->form_fields };
    }
    return $hash;
}

method _post(Str $path!, HashRef|StripeResourceObject $obj?) {
    my %headers;
    if ( $obj ) {
        my %form_fields = %{ convert_to_form_fields( $obj ) };
        $headers{Content} = [ %form_fields ] if %form_fields;
    }

    my $req = POST $self->api_base . '/' . $path, %headers;
    return $self->_make_request($req);
}

method _get_response(
    HTTP::Request :$req!,
    Bool :$suppress_api_version? = 0,
) {
    $req->header( Authorization =>
        "Basic " . encode_base64($self->api_key . ':'));

    if ($self->api_version && ! $suppress_api_version) {
         $req->header( 'Stripe-Version' => $self->api_version );
    }

    if ($self->debug_network) {
        print STDERR "Sending to Stripe:\n------\n" . $req->as_string() . "------\n";

    }
    my $resp = $self->ua->request($req);

    if ($self->debug_network) {
        print STDERR "Received from Stripe:\n------\n" . $resp->as_string()  . "------\n";
    }

    if ($resp->code == 200) {
        return $resp;
    } elsif ($resp->code == 500) {
        die Net::Stripe::Error->new(
            type => "HTTP request error",
            code => $resp->code,
            message => $resp->status_line . " - " . $resp->content,
        );
    }

    my $e = eval {
        my $hash = decode_json($resp->content);
        Net::Stripe::Error->new($hash->{error})
    };
    if ($@) {
        Net::Stripe::Error->new(
            type => "Could not decode HTTP response: $@",
            message => $resp->status_line . " - " . $resp->content,
        );
    };

    warn "$e\n" if $self->debug;
    die $e;
}

method _make_request(HTTP::Request $req!) {
    my $resp = $self->_get_response(
        req => $req,
    );
    my $ref = decode_json( $resp->content );
    if ( ref( $ref ) eq 'ARRAY' ) {
        # some list-type data structures are arrayrefs in API versions 2012-09-24 and earlier.
        # if those data structures are at the top level, such as when
        # we request 'GET /charges/cus_.../', we need to coerce that
        # arrayref into the form that Net::Stripe::List expects.
        return _array_to_object( $ref, $req->uri );
    } elsif ( ref( $ref ) eq 'HASH' ) {
        # all top-level data structures are hashes in API versions 2012-10-26 and later
        return _hash_to_object( $ref );
    } else {
        die Net::Stripe::Error->new(
            type => "HTTP request error",
            message => sprintf(
                "Invalid object type returned: '%s'",
                ref( $ref ) || 'NONREF',
            ),
        );
    }
}

sub _hash_to_object {
    my $hash   = shift;

    if ( exists( $hash->{deleted} ) && exists( $hash->{object} ) && $hash->{object} ne 'customer' ) {
      delete( $hash->{object} );
    }

    # coerce pre-2011-08-01 API arrayref list format into a hashref
    # compatible with Net::Stripe::List
    $hash = _pre_2011_08_01_processing( $hash );

    # coerce pre-2012-10-26 API invoice lines format into a hashref
    # compatible with Net::Stripe::List
    $hash = _pre_2012_10_26_processing( $hash );

    # coerce post-2015-02-18 source-type args to to card-type args
    $hash = _post_2015_02_18_processing( $hash );

    # coerce post-2019-10-17 balance to account_balance
    $hash = _post_2019_10_17_processing( $hash );

    foreach my $k (grep { ref($hash->{$_}) } keys %$hash) {
        my $v = $hash->{$k};
        if (ref($v) eq 'HASH' && defined($v->{object})) {
            $hash->{$k} = _hash_to_object($v);
        } elsif (ref($v) =~ /^(JSON::XS::Boolean|JSON::PP::Boolean)$/) {
            $hash->{$k} = $v ? 1 : 0;
        }
    }

    if (defined($hash->{object})) {
        if ($hash->{object} eq 'list') {
            $hash->{data} = [map { _hash_to_object($_) } @{$hash->{data}}];
            return Net::Stripe::List->new($hash);
        }
        my @words  = map { ucfirst($_) } split('_', $hash->{object});
        my $object = join('', @words);
        my $class  = 'Net::Stripe::' . $object;
        if (Class::Load::is_class_loaded($class)) {
          return $class->new($hash);
        }
    }
    return $hash;
}

sub _array_to_object {
    my ( $array, $uri ) = @_;
    my $list = _array_to_list( $array );
    # strip the protocol, domain and query args in order to mimic the
    # url returned with Stripe lists in API versions 2012-10-26 and later
    $uri =~ s#\?.*$##;
    $uri =~ s#^https://[^/]+##;
    $list->{url} = $uri;
    return _hash_to_object( $list );
}

sub _array_to_list {
    my $array = shift;
    my $count = scalar( @$array );
    my $list = {
        object => 'list',
        count => $count,
        has_more => 0,
        data => $array,
        total_count => $count,
    };
    return $list;
}

# coerce pre-2011-08-01 API arrayref list format into a hashref
# compatible with Net::Stripe::List
sub _pre_2011_08_01_processing {
    my $hash = shift;
    foreach my $type ( qw/ cards sources subscriptions / ) {
        if ( exists( $hash->{$type} ) && ref( $hash->{$type} ) eq 'ARRAY' ) {
            $hash->{$type} = _array_to_list( delete( $hash->{$type} ) );
            my $customer_id;
            if ( exists( $hash->{object} ) && $hash->{object} eq 'customer' && exists( $hash->{id} ) ) {
                $customer_id = $hash->{id};
            } elsif ( exists( $hash->{customer} ) ) {
                $customer_id = $hash->{customer};
            }
            # Net::Stripe::List->new() will fail without url, but we
            # can make debugging easier by providing a message here
            die Net::Stripe::Error->new(
                type => "object coercion error",
                message => sprintf(
                    "Could not determine customer id while coercing %s list into Net::Stripe::List.",
                    $type,
                ),
            ) unless $customer_id;

            # mimic the url sent with standard Stripe lists
            $hash->{$type}->{url} = "/v1/customers/$customer_id/$type";
        }
    }

    foreach my $type ( qw/ refunds / ) {
        if ( exists( $hash->{$type} ) && ref( $hash->{$type} ) eq 'ARRAY' ) {
            $hash->{$type} = _array_to_list( delete( $hash->{$type} ) );
            my $charge_id;
            if ( exists( $hash->{object} ) && $hash->{object} eq 'charge' && exists( $hash->{id} ) ) {
                $charge_id = $hash->{id};
            }
            # Net::Stripe::List->new() will fail without url, but we
            # can make debugging easier by providing a message here
            die Net::Stripe::Error->new(
                type => "object coercion error",
                message => sprintf(
                    "Could not determine charge id while coercing %s list into Net::Stripe::List.",
                    $type,
                ),
            ) unless $charge_id;
            # mimic the url sent with standard Stripe lists
            $hash->{$type}->{url} = "/v1/charges/$charge_id/$type";
        }
    }

    foreach my $type ( qw/ charges / ) {
        if ( exists( $hash->{$type} ) && ref( $hash->{$type} ) eq 'ARRAY' ) {
            $hash->{$type} = _array_to_list( delete( $hash->{$type} ) );
            my $payment_intent_id;
            if ( exists( $hash->{object} ) && $hash->{object} eq 'payment_intent' && exists( $hash->{id} ) ) {
                $payment_intent_id = $hash->{id};
            } elsif ( exists( $hash->{payment_intent} ) ) {
                $payment_intent_id = $hash->{payment_intent};
            }
            # Net::Stripe::List->new() will fail without url, but we
            # can make debugging easier by providing a message here
            die Net::Stripe::Error->new(
                type => "object coercion error",
                message => sprintf(
                    "Could not determine payment_intent id while coercing %s list into Net::Stripe::List.",
                    $type,
                ),
            ) unless $payment_intent_id;

            # mimic the url sent with standard Stripe lists
            $hash->{$type}->{url} = "/v1/charges?payment_intent=$payment_intent_id";
        }
    }

    return $hash;
}

# coerce pre-2012-10-26 API invoice lines format into a hashref
# compatible with Net::Stripe::List
sub _pre_2012_10_26_processing {
    my $hash = shift;
    if (
        exists( $hash->{object} ) && $hash->{object} eq 'invoice' &&
        exists( $hash->{lines} ) && ref( $hash->{lines} ) eq 'HASH' &&
        ! exists( $hash->{lines}->{object} )
    ) {
        my $data = [];
        my $lines = delete( $hash->{lines} );
        foreach my $key ( sort( keys( %$lines ) ) ) {
            my $ref = $lines->{$key};
            unless ( ref( $ref ) eq 'ARRAY' ) {
                die Net::Stripe::Error->new(
                    type => "object coercion error",
                    message => sprintf(
                        "Found invalid subkey type '%s' while coercing invoice lines into a Net::Stripe::List.",
                        ref( $ref ),
                    ),
                );
            }
            foreach my $item ( @$ref ) {
                push @$data, $item;
            }
        }
        $hash->{lines} = _array_to_list( $data );

        my $customer_id;
        if ( exists( $hash->{customer} ) ) {
            $customer_id = $hash->{customer};
        }
        # Net::Stripe::List->new() will fail without url, but we
        # can make debugging easier by providing a message here
        die Net::Stripe::Error->new(
            type => "object coercion error",
            message => "Could not determine customer id while coercing invoice lines into Net::Stripe::List.",
        ) unless $customer_id;

        # mimic the url sent with standard Stripe lists
        $hash->{lines}->{url} = "/v1/invoices/upcoming/lines?customer=$customer_id";
    }
    return $hash;
}

# coerce post-2015-02-18 source-type args to to card-type args
sub _post_2015_02_18_processing {
    my $hash = shift;

    if (
        exists( $hash->{object} ) &&
        ( $hash->{object} eq 'charge' || $hash->{object} eq 'customer' )
    ) {
        if (
            ! exists( $hash->{card} ) &&
            exists( $hash->{source} ) && ref( $hash->{source} ) eq 'HASH' &&
            exists( $hash->{source}->{object} ) && $hash->{source}->{object} eq 'card'
        ) {
            $hash->{card} = Storable::dclone( $hash->{source} );
        }

        if (
            ! exists( $hash->{cards} ) &&
            exists( $hash->{sources} ) && ref( $hash->{sources} ) eq 'HASH' &&
            exists( $hash->{sources}->{object} ) && $hash->{sources}->{object} eq 'list'
        ) {
            $hash->{cards} = Storable::dclone( $hash->{sources} );
        }

        my $card_id_type = Moose::Util::TypeConstraints::find_type_constraint( 'StripeCardId' );
        if (
            ! exists( $hash->{default_card} ) &&
            exists( $hash->{default_source} ) &&
            $card_id_type->check( $hash->{default_source} )
        ) {
            $hash->{default_card} = $hash->{default_source};
        }
    }
    return $hash;
}

# coerce post-2019-10-17 balance to account_balance
fun _post_2019_10_17_processing(
    HashRef $hash,
) {
    if ( exists( $hash->{object} ) && $hash->{object} eq 'customer' ) {
        if ( ! exists( $hash->{account_balance} ) && exists( $hash->{balance} ) ) {
            $hash->{account_balance} = $hash->{balance};
        }
    }
    return $hash;
}

method _get_all(
    Str :$path!,
    Maybe[Str] :$ending_before?,
    Maybe[Int] :$limit?,
    Maybe[Str] :$starting_after?,
    %object_filters,
) {

    # minimize the number of API calls by retrieving as many results as
    # possible per call. the API currently returns a maximum of 100 results.
    my $API_PAGE_SIZE = 100;
    my $PAGE_SIZE = $limit;
    my $GET_MORE;
    if ( defined( $limit ) && ( $limit eq '0' || $limit > $API_PAGE_SIZE ) ) {
        $PAGE_SIZE = $API_PAGE_SIZE;
        $GET_MORE = 1;
    }

    my %args = (
        %object_filters,
        ending_before => $ending_before,
        limit => $PAGE_SIZE,
        starting_after => $starting_after,
    );
    my $list = $self->_get($path, \%args);

    if ( $GET_MORE && $list->elements() > 0 ) {
        # passing 'ending_before' causes the API to start with the oldest
        # records. so in order to always provide records in reverse-chronological
        # order, we must prepend these to the existing records.
        my $REVERSE = defined( $ending_before ) && ! defined( $starting_after );
        my $MAX_COUNT = $limit eq '0' ? undef : $limit;
        while ( 1 ) {
            my $PAGE_SIZE = $API_PAGE_SIZE;
            if ( defined( $MAX_COUNT ) ) {
                my $TO_FETCH = $MAX_COUNT - scalar( $list->elements );
                last if $TO_FETCH <= 0;
                $PAGE_SIZE = $TO_FETCH if $TO_FETCH < $PAGE_SIZE;
            }

            my %args = (
                %object_filters,
                limit => $PAGE_SIZE,
                ( $REVERSE ? $list->_previous_page_args() : $list->_next_page_args() ),
            );
            my $page = $self->_get($path, \%args);

            last if $page->is_empty;

            $list = Net::Stripe::List::_merge_lists(
                lists => [ $REVERSE ?
                    ( $page, $list ) :
                    ( $list, $page )
                ],
            );
        }
    }
    return $list;
}

fun _encode_boolean(
    Bool $value!,
) {
    # a bare `return` with no arguemnts evaluates to an empty list, resulting
    # in 'odd number of elements in hash assignment, so we must return undef
    return undef unless defined( $value );
    return $value ? 'true' : 'false';
}

method _build_api_base { 'https://api.stripe.com/v1' }

method _build_ua {
    my $ua = LWP::UserAgent->new(keep_alive => 4);
    $ua->agent("Net::Stripe/" . ($Net::Stripe::VERSION || 'dev'));
    return $ua;
}

# since the Stripe API does not have a ping-like method, we have to perform
# an extraneous request in order to retrieve the Stripe-Version header with
# the response. for now, we will use the 'balance' endpoint because it one of
# the simplest and least-privileged.
method _get_stripe_verison_header(
    Bool :$suppress_api_version? = 0,
) {
    my $path = 'balance';
    my $req = GET $self->api_base . '/' . $path;

    # swallow the possible invalid API version warning
    local $SIG{__WARN__} = sub {};
    my $resp = $self->_get_response(
        req => $req,
        suppress_api_version => $suppress_api_version,
    );

    my $stripe_version = $resp->header( 'Stripe-Version' );
    my $stripe_api_version_type = Moose::Util::TypeConstraints::find_type_constraint( 'StripeAPIVersion' );
    die Net::Stripe::Error->new(
        type => "API version validation error",
        message => sprintf( "Failed to retrieve the Stripe-Version header: '%s'",
            defined( $stripe_version ) ? $stripe_version : 'undefined',
        ),
    ) unless defined( $stripe_version ) && $stripe_api_version_type->check( $stripe_version );

    return $stripe_version;
}

method _get_account_api_version {
    my $stripe_version = $self->_get_stripe_verison_header(
        suppress_api_version => 1,
    );
    return $stripe_version;
}

# if we have set an explicit API version, confirm that it is valid. if
# it is invalid, _get_response() dies with an invalid_request_error.
method _validate_api_version_value {
    return unless defined( $self->api_version );

    my $stripe_version = $self->_get_stripe_verison_header();
    die Net::Stripe::Error->new(
        type => "API version validation error",
        message => sprintf( "Stripe API version mismatch. Sent: '%s'. Received: '%s'.",
            $self->api_version,
            $stripe_version,
        ),
    ) unless $stripe_version eq $self->api_version;

    return 1;
}

# if we have set an explicit API version, confirm that it is within the
# appropriate range. otherwise, retrieve the default value for this
# account and confirm that it is within the appropriate range.
method _validate_api_version_range {
    if ( $self->force_api_version ) {
        warn "bypassing API version range safety check" if $self->debug;
        return 1;
    }

    my $api_version = defined( $self->api_version ) ? $self->api_version : $self->_get_account_api_version();

    my @api_version = split( '-', $api_version );
    my $api_version_dt;
    eval {
        $api_version_dt = DateTime->new(
            year      => $api_version[0],
            month     => $api_version[1],
            day       => $api_version[2],
            time_zone => 'UTC',
        );
    };
    if ( my $error = $@ ) {
        die Net::Stripe::Error->new(
            type => "API version validation error",
            message => sprintf( "Invalid date string '%s' provided for api_version: %s",
                $api_version,
                $error,
            ),
        );
    }

    my @min_api_version = split( '-', Net::Stripe::Constants::MIN_API_VERSION );
    my $min_api_version_dt = DateTime->new(
        year      => $min_api_version[0],
        month     => $min_api_version[1],
        day       => $min_api_version[2],
        time_zone => 'UTC',
    );

    my @max_api_version = split( '-', Net::Stripe::Constants::MAX_API_VERSION );
    my $max_api_version_dt = DateTime->new(
        year      => $max_api_version[0],
        month     => $max_api_version[1],
        day       => $max_api_version[2],
        time_zone => 'UTC',
    );

    my $format = "Stripe API version %s is not supported by this version of Net::Stripe. " .
                 "This version of Net::Stripe only supports Stripe API versions from %s to %s. " .
                 "Please check for a version-appropriate branch at https://github.com/lukec/stripe-perl/branches.";
    my $message = sprintf( $format,
        $api_version,
        Net::Stripe::Constants::MIN_API_VERSION,
        Net::Stripe::Constants::MAX_API_VERSION,
    );
    die Net::Stripe::Error->new(
        type => "API version validation error",
        message => $message,
    ) unless $min_api_version_dt <= $api_version_dt && $api_version_dt <= $max_api_version_dt;

    return 1;
}


__PACKAGE__->meta->make_immutable;
1;

__END__

=pod

=head1 NAME

Net::Stripe - API client for Stripe.com

=head1 VERSION

version 0.42

=head1 SYNOPSIS

 my $stripe     = Net::Stripe->new(api_key => $API_KEY);
 my $card_token = 'a token';
 my $charge = $stripe->post_charge(  # Net::Stripe::Charge
     amount      => 12500,
     currency    => 'usd',
     source      => $card_token,
     description => 'YAPC Registration',
 );
 print "Charge was not paid!\n" unless $charge->paid;
 my $card = $charge->card;           # Net::Stripe::Card

 # look up a charge by id
 my $same_charge = $stripe->get_charge(charge_id => $charge->id);

 # ... and the API mirrors https://stripe.com/docs/api
 # Charges: post_charge() get_charge() refund_charge() get_charges()
 # Customer: post_customer()

=head1 DESCRIPTION

This module is a wrapper around the Stripe.com HTTP API.  Methods are
generally named after the HTTP method and the object name.

This method returns Moose objects for responses from the API.

=head2 VERSIONING

Because of occasional non-backward-compatible changes in the Stripe API, a
given version of the SDK is only guaranteed to support Stripe API versions
within the range defined by C<Net::Stripe::Constants::MIN_API_VERSION> and
C<Net::Stripe::Constants::MAX_API_VERSION>.

If you need a version of the SDK supporting a specific older Stripe API
version, you can check for available versions at
L<https://github.com/lukec/stripe-perl/branches>, or by cloning this
repository, located at <https://github.com/lukec/stripe-perl> and using
<git branch> to view available version-specific branches.

=head3 DEFAULT VERSIONING

If you do not set the Stripe API version on object instantiation, API
calls will default to the API version setting for your Stripe account.

=head3 SPECIFIC VERSIONING

If you set the Stripe API version on object instantiation you are telling
Stripe to use that version of the API instead of the default for your account,
and therefore the available API request and response parameters, the names of
those parameters and the structure of the format of the returned data will all
be dictated by the version that you specify. You can read more about the
details of specific API versions at
<https://stripe.com/docs/upgrades#api-changelog>.

=head3 OUT OF SCOPE VERSIONING

If you are wearing a cowboy hat and think - although your specified account
version is outside the range defined in C<Net::Stripe::Constants> - that your
use case is simple enough that it should "just work", you can create your
object instance with C<force_api_version =E<gt> 1>, but don't say we didn't
warn you!

=head1 METHODS

=head2 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.

=item api_version

This is the value of the Stripe-Version header <https://stripe.com/docs/api/versioning>
you wish to transmit for API calls.

=item force_api_version

Set this to true to bypass the safety checks for API version compatibility with
a given version of the SDK. Please see the warnings above, and remember that
you are handling the financial data of your users. Use with extreme caution!

=item debug

You can set this to true to see extra debug info.

=item debug_network

You can set this to true to see the actual network requests.

=back

=head1 ATTRIBUTES

=head2 api_base

Reader: api_base

Type: Str

Additional documentation: This is the base part of the URL for every request made

=head2 api_key

Reader: api_key

Type: Str

This attribute is required.

Additional documentation: You get this from your Stripe Account settings

=head2 api_version

Reader: api_version

Type: StripeAPIVersion

Additional documentation: This is the value of the Stripe-Version header you wish to transmit for API calls

=head2 debug

Reader: debug

Writer: debug

Type: Bool

Additional documentation: The debug flag

=head2 debug_network

Reader: debug_network

Writer: debug_network

Type: Bool

Additional documentation: The debug network request flag

=head2 force_api_version

Reader: force_api_version

Type: Bool

Additional documentation: Set this to true to bypass the safety checks for API version compatibility.

=head2 ua

Reader: ua

Type: Object

Additional documentation: The LWP::UserAgent that is used for requests

=head1 Balance Transaction Methods

=head2 get_balance_transaction

Retrieve a balance transaction.

L<https://stripe.com/docs/api#retrieve_balance_transaction>

=over

=item * id - Str - balance transaction ID to retrieve.

=back

Returns a L<Net::Stripe::BalanceTransaction>.

  $stripe->get_balance_transaction(id => 'id');

=head1 Charge Methods

=head2 post_charge

Create a new charge.

L<https://stripe.com/docs/api/charges/create#create_charge>

=over

=item * amount - Int - amount to charge

=item * currency - Str - currency for charge

=item * customer - StripeCustomerId - customer to charge - optional

=item * card - StripeTokenId or StripeCardId - card to use - optional

=item * source - StripeTokenId or StripeCardId - source to use - optional

=item * description - Str - description for the charge - optional

=item * metadata - HashRef - metadata for the charge - optional

=item * capture - Bool - optional

=item * statement_descriptor - Str - descriptor for statement - optional

=item * application_fee - Int - optional

=item * receipt_email - Str - The email address to send this charge's receipt to - optional

=back

Returns L<Net::Stripe::Charge>.

  $stripe->post_charge(currency => 'USD', amount => 500, customer => 'testcustomer');

=head2 get_charge

Retrieve a charge.

L<https://stripe.com/docs/api#retrieve_charge>

=over

=item * charge_id - Str - charge id to retrieve

=back

Returns L<Net::Stripe::Charge>.

  $stripe->get_charge(charge_id => 'chargeid');

=head2 refund_charge

Refunds a charge.

L<https://stripe.com/docs/api#create_refund>

=over

=item * charge - L<Net::Stripe::Charge> or Str - charge or charge_id to refund

=item * amount - Int - amount to refund in cents, optional

=back

Returns a new L<Net::Stripe::Refund>.

  $stripe->refund_charge(charge => $charge, amount => 500);

=head2 get_charges

Returns a L<Net::Stripe::List> object containing L<Net::Stripe::Charge> objects.

L<https://stripe.com/docs/api#list_charges>

=over

=item * created - HashRef - created conditions to match, optional

=item * customer - L<Net::Stripe::Customer> or Str - customer to match

=item * ending_before - Str - ending before condition, optional

=item * limit - Int - maximum number of charges to return, optional

=item * starting_after - Str - starting after condition, optional

=back

Returns a list of L<Net::Stripe::Charge> objects.

  $stripe->get_charges(customer => $customer, limit => 5);

=head2 capture_charge

L<https://stripe.com/docs/api/charges/capture#capture_charge>

=over

=item * charge - L<Net::Stripe::Charge> or Str - charge to capture

=item * amount - Int - amount to capture

=back

Returns a L<Net::Stripe::Charge>.

  $stripe->capture_charge(charge => $charge_id);

=head1 Customer Methods

=head2 post_customer

Create or update a customer.

L<https://stripe.com/docs/api/customers/create#create_customer>
L<https://stripe.com/docs/api/customers/update#update_customer>

=over

=item * customer - L<Net::Stripe::Customer> or StripeCustomerId - existing customer to update, optional

=item * account_balance - Int, optional

=item * balance - Int, optional

=item * card - L<Net::Stripe::Token> or StripeTokenId, default card for the customer, optional

=item * source - StripeTokenId or StripeSourceId, source for the customer, optional

=item * coupon - Str, optional

=item * default_card - L<Net::Stripe::Token>, L<Net::Stripe::Card>, Str or HashRef, default card for the customer, optional

=item * default_source - StripeCardId or StripeSourceId, default source for the customer, optional

=item * description - Str, optional

=item * email - Str, optional

=item * metadata - HashRef, optional

=item * plan - Str, optional

=item * quantity - Int, optional

=item * trial_end - Int or Str, optional

=back

Returns a L<Net::Stripe::Customer> object.

  my $customer = $stripe->post_customer(
    source => $token_id,
    email => 'stripe@example.com',
    description => 'Test for Net::Stripe',
  );

=head2 list_subscriptions

Returns the subscriptions for a customer.

L<https://stripe.com/docs/api#list_subscriptions>

=over

=item * customer - L<Net::Stripe::Customer> or Str

=item * ending_before - Str, optional

=item * limit - Int, optional

=item * starting_after - Str, optional

=back

Returns a list of L<Net::Stripe::Subscription> objects.

=head2 get_customer

Retrieve a customer.

L<https://stripe.com/docs/api#retrieve_customer>

=over

=item * customer_id - Str - the customer id to retrieve

=back

Returns a L<Net::Stripe::List> object containing L<Net::Stripe::Customer> objects.

  $stripe->get_customer(customer_id => $id);

=head2 delete_customer

Delete a customer.

L<https://stripe.com/docs/api#delete_customer>

=over

=item * customer - L<Net::Stripe::Customer> or Str - the customer to delete

=back

Returns a L<Net::Stripe::Customer> object.

  $stripe->delete_customer(customer => $customer);

=head2 get_customers

Returns a list of customers.

L<https://stripe.com/docs/api#list_customers>

=over

=item * created - HashRef - created conditions, optional

=item * ending_before - Str, optional

=item * limit - Int, optional

=item * starting_after - Str, optional

=back

Returns a L<Net::Stripe::List> object containing L<Net::Stripe::Customer> objects.

  $stripe->get_customers(limit => 7);

=head1 Card Methods

=head2 get_card

Retrieve information about a customer's card.

L<https://stripe.com/docs/api#retrieve_card>

=over

=item * customer - L<Net::Stripe::Customer> or Str - the customer

=item * card_id - Str - the card ID to retrieve

=back

Returns a L<Net::Stripe::Card>.

  $stripe->get_card(customer => 'customer_id', card_id => 'abcdef');

=head2 post_card

Create a card.

L<https://stripe.com/docs/api/cards/create#create_card>

=over

=item * customer - L<Net::Stripe::Customer> or StripeCustomerId

=item * card - L<Net::Stripe::Token> or StripeTokenId

=item * source - StripeTokenId

=back

Returns a L<Net::Stripe::Card>.

  $stripe->post_card(customer => $customer, source => $token_id);

=head2 update_card

Update a card.

L<https://stripe.com/docs/api/cards/update#update_card>

=over

=item * customer_id - StripeCustomerId

=item * card_id - StripeCardId

=item * card - HashRef

=back

Returns a L<Net::Stripe::Card>.

  $stripe->update_card(
      customer_id => $customer_id,
      card_id => $card_id,
      card => {
          name => $new_name,
          metadata => {
              'account-number' => $new_account_nunmber,
          },
      },
  );

=head2 get_cards

Returns a list of cards.

L<https://stripe.com/docs/api#list_cards>

=over

=item * customer - L<Net::Stripe::Customer> or Str

=item * ending_before - Str, optional

=item * limit - Int, optional

=item * starting_after - Str, optional

=back

Returns a L<Net::Stripe::List> object containing L<Net::Stripe::Card> objects.

  $stripe->list_cards(customer => 'abcdec', limit => 10);

=head2 delete_card

Delete a card.

L<https://stripe.com/docs/api#delete_card>

=over

=item * customer - L<Net::Stripe::Customer> or Str

=item * card - L<Net::Stripe::Card> or Str

=back

Returns a L<Net::Stripe::Card>.

  $stripe->delete_card(customer => $customer, card => $card);

=head1 Source Methods

=head2 create_source

Create a new source object

L<https://stripe.com/docs/api/sources/create#create_source>

=over

=item * amount - Int - amount associated with the source

=item * currency - Str - currency associated with the source

=item * flow - StripeSourceFlow - authentication flow for the source

=item * mandate - HashRef - information about a mandate attached to the source

=item * metadata - HashRef - metadata for the source

=item * owner - HashRef - information about the owner of the payment instrument

=item * receiver - HashRef - parameters for the receiver flow

=item * redirect - HashRef - parameters required for the redirect flow

=item * source_order - HashRef - information about the items and shipping associated with the source

=item * statement_descriptor - Str - descriptor for statement

=item * token - StripeTokenId - token used to create the source

=item * type - StripeSourceType - type of source to create - required

=item * usage - StripeSourceUsage - whether the source should be reusable or not

=back

Returns a L<Net::Stripe::Source>

  $stripe->create_source(
      type => 'card',
      token => $token_id,
  );

=head2 get_source

Retrieve an existing source object

L<https://stripe.com/docs/api/sources/retrieve#retrieve_source>

=over

=item * source_id - StripeSourceId - id of source to retrieve - required

=item * client_secret - Str - client secret of the source

=back

Returns a L<Net::Stripe::Source>

  $stripe->get_source(
      source_id => $source_id,
  );

=head2 update_source

Update the specified source by setting the values of the parameters passed

L<https://stripe.com/docs/api/sources/update#update_source>

=over

=item * source_id - StripeSourceId - id of source to update - required

=item * amount - Int - amount associated with the source

=item * metadata - HashRef - metadata for the source

=item * mandate - HashRef - information about a mandate attached to the source

=item * owner - HashRef - information about the owner of the payment instrument

=item * source_order - HashRef - information about the items and shipping associated with the source

=back

Returns a L<Net::Stripe::Source>

  $stripe->update_source(
      source_id => $source_id,
      owner => {
          email => $new_email,
          phone => $new_phone,
      },
  );

=head2 attach_source

Attaches a Source object to a Customer

L<https://stripe.com/docs/api/sources/attach#attach_source>

=over

=item * source_id - StripeSourceId - id of source to be attached - required

=item * customer_id - StripeCustomerId - id of customer to which source should be attached - required

=back

Returns a L<Net::Stripe::Source>

  $stripe->attach_source(
      customer_id => $customer_id,
      source_id => $source->id,
  );

=head2 detach_source

Detaches a Source object from a Customer

L<https://stripe.com/docs/api/sources/detach#detach_source>

=over

=item * source_id - StripeSourceId - id of source to be detached - required

=item * customer_id - StripeCustomerId - id of customer from which source should be detached - required

=back

Returns a L<Net::Stripe::Source>

  $stripe->detach_source(
      customer_id => $customer_id,
      source_id => $source->id,
  );

=head2 list_sources

List all sources belonging to a Customer

=over

=item * customer_id - StripeCustomerId - id of customer for which source to list sources - required

=item * object - Str - object type - required

=item * ending_before - Str - ending before condition

=item * limit - Int - maximum number of charges to return

=item * starting_after - Str - starting after condition

=back

Returns a L<Net::Stripe::List> object containing objects of the requested type

  $stripe->list_sources(
      customer_id => $customer_id,
      object => 'card',
      limit => 10,
  );

=head1 Subscription Methods

=head2 post_subscription

Adds or updates a subscription for a customer.

L<https://stripe.com/docs/api#create_subscription>

=over

=item * customer - L<Net::Stripe::Customer>

=item * subscription - L<Net::Stripe::Subscription> or Str

=item * card - L<Net::Stripe::Card>, L<Net::Stripe::Token> or Str, default card for the customer, optional

=item * coupon - Str, optional

=item * description - Str, optional

=item * plan - Str, optional

=item * quantity - Int, optional

=item * trial_end - Int, or Str optional

=item * application_fee_percent - Int, optional

=item * prorate - Bool, optional

=item * cancel_at_period_end - Bool, optional

=back

Returns a L<Net::Stripe::Subscription> object.

  $stripe->post_subscription(customer => $customer, plan => 'testplan');

=head2 get_subscription

Returns a customer's subscription.

=over

=item * customer - L<Net::Stripe::Customer> or Str

=back

Returns a L<Net::Stripe::Subscription>.

  $stripe->get_subscription(customer => 'test123');

=head2 delete_subscription

Cancel a customer's subscription.

L<https://stripe.com/docs/api#cancel_subscription>

=over

=item * customer - L<Net::Stripe::Customer> or Str

=item * subscription - L<Net::Stripe::Subscription> or Str

=item * at_period_end - Bool, optional

=back

Returns a L<Net::Stripe::Subscription> object.

  $stripe->delete_subscription(customer => $customer, subscription => $subscription);

=head1 Token Methods

=head2 get_token

Retrieves an existing token.

L<https://stripe.com/docs/api#retrieve_token>

=over

=item * token_id - Str

=back

Returns a L<Net::Stripe::Token>.

  $stripe->get_token(token_id => 'testtokenid');

=head1 Product Methods

=head2 create_product

Create a new Product

L<https://stripe.com/docs/api/products/create#create_product>
L<https://stripe.com/docs/api/service_products/create#create_service_product>

=over

=item * name - Str - name of the product - required

=item * active - Bool - whether the product is currently available for purchase

=item * attributes - ArrayRef[Str] - a list of attributes that each sku can provide values for

=item * caption - Str - a short description

=item * deactivate_on - ArrayRef[Str] - an list of connect application identifiers that cannot purchase this product

=item * description - Str - description

=item * id - Str - unique identifier

=item * images - ArrayRef[Str] - a list of image URLs

=item * metadata - HashRef[Str] - metadata

=item * package_dimensions - HashRef - package dimensions for shipping

=item * shippable - Bool - whether the product is a shipped good

=item * statement_descriptor - Str - descriptor for statement

=item * type - StripeProductType - the type of the product

=item * unit_label - Str - label that represents units of the product

=item * url - Str - URL of a publicly-accessible web page for the product

=back

Returns a L<Net::Stripe::Product>

  $stripe->create_product(
      name => $product_name,
      type => 'good',
  );

=head2 get_product

Retrieve an existing Product

L<https://stripe.com/docs/api/products/retrieve#retrieve_product>
L<https://stripe.com/docs/api/service_products/retrieve#retrieve_service_product>

=over

=item * product_id - StripeProductId|Str - id of product to retrieve - required

=back

Returns a L<Net::Stripe::Product>

  $stripe->get_product(
      product_id => $product_id,
  );

=head2 update_product

Update an existing Product

L<https://stripe.com/docs/api/products/update#update_product>
L<https://stripe.com/docs/api/service_products/update#update_service_product>

=over

=item * product_id - StripeProductId|Str - id of product to retrieve - required

=item * active - Bool - whether the product is currently available for purchase

=item * attributes - ArrayRef[Str] - a list of attributes that each sku can provide values for

=item * caption - Str - a short description

=item * deactivate_on - ArrayRef[Str] - an list of connect application identifiers that cannot purchase this product

=item * description - Str - description

=item * images - ArrayRef[Str] - a list of image URLs

=item * metadata - HashRef[Str] - metadata

=item * name - Str - name of the product

=item * package_dimensions - HashRef - package dimensions for shipping

=item * shippable - Bool - whether the product is a shipped good

=item * statement_descriptor - Str - descriptor for statement

=item * type - StripeProductType - the type of the product

=item * unit_label - Str - label that represents units of the product

=item * url - Str - URL of a publicly-accessible web page for the product

=back

Returns a L<Net::Stripe::Product>

  $stripe->update_product(
      product_id => $product_id,
      name => $new_name,
  );

=head2 list_products

Retrieve a list of Products

L<https://stripe.com/docs/api/products/list#list_products>
L<https://stripe.com/docs/api/service_products/list#list_service_products>

=over

=item * active - Bool - only return products that are active or inactive

=item * ids - StripeProductId|Str - only return products with the given ids

=item * shippable - Bool - only return products that can or cannot be shipped

=item * url - Str - only return products with the given url

=item * type - StripeProductType - only return products of this type

=item * created - HashRef[Str] - created conditions to match

=item * ending_before - Str - ending before condition

=item * limit - Int - maximum number of objects to return

=item * starting_after - Str - starting after condition

=back

Returns a L<Net::Stripe::List> object containing L<Net::Stripe::Product> objects.

  $stripe->list_products(
      limit => 5,
  );

=head2 delete_product

Delete an existing Product

L<https://stripe.com/docs/api/products/delete#delete_product>
L<https://stripe.com/docs/api/service_products/delete#delete_service_product>

=over

=item * product_id - StripeProductId|Str - id of product to delete - required

=back

Returns hashref of the form

  {
    deleted => <bool>,
    id => <product_id>,
  }

  $stripe->delete_product(
      product_id => $product_id,
  );

=head1 Plan Methods

=head2 post_plan

Create a new plan.

L<https://stripe.com/docs/api#create_plan>

=over

=item * id - Str - identifier of the plan

=item * amount - Int - cost of the plan in cents

=item * currency - Str

=item * interval - Str

=item * interval_count - Int - optional

=item * name - Str - name of the plan

=item * trial_period_days - Int - optional

=item * statement_descriptor - Str - optional

=item * metadata - HashRef - optional

=back

Returns a L<Net::Stripe::Plan> object.

  $stripe->post_plan(
     id => "free-$future_ymdhms",
     amount => 0,
     currency => 'usd',
     interval => 'year',
     name => "Freeplan $future_ymdhms",
  );

=head2 get_plan

Retrieves a plan.

=over

=item * plan_id - Str

=back

Returns a L<Net::Stripe::Plan>.

  $stripe->get_plan(plan_id => 'plan123');

=head2 delete_plan

Delete a plan.

L<https://stripe.com/docs/api#delete_plan>

=over

=item * plan_id - L<Net::Stripe::Plan> or Str

=back

Returns a L<Net::Stripe::Plan> object.

  $stripe->delete_plan(plan_id => $plan);

=head2 get_plans

Return a list of plans.

L<https://stripe.com/docs/api#list_plans>

=over

=item * product - StripeProductId|Str - only return plans for the given product

=item * ending_before - Str, optional

=item * limit - Int, optional

=item * starting_after - Str, optional

=back

Returns a L<Net::Stripe::List> object containing L<Net::Stripe::Plan> objects.

  $stripe->get_plans(limit => 10);

=head1 Coupon Methods

=head2 post_coupon

Create or update a coupon.

L<https://stripe.com/docs/api#create_coupon>

=over

=item * id - Str, optional

=item * duration - Str

=item * amount_offset - Int, optional

=item * currency - Str, optional

=item * duration_in_months - Int, optional

=item * max_redemptions - Int, optional

=item * metadata - HashRef, optional

=item * percent_off - Int, optional

=item * redeem_by - Int, optional

=back

Returns a L<Net::Stripe::Coupon> object.

  $stripe->post_coupon(
     id => $coupon_id,
     percent_off => 100,
     duration => 'once',
     max_redemptions => 1,
     redeem_by => time() + 100,
  );

=head2 get_coupon

Retrieve a coupon.

L<https://stripe.com/docs/api#retrieve_coupon>

=over

=item * coupon_id - Str

=back

Returns a L<Net::Stripe::Coupon> object.

  $stripe->get_coupon(coupon_id => 'id');

=head2 delete_coupon

Delete a coupon.

L<https://stripe.com/docs/api#delete_coupon>

=over

=item * coupon_id - Str

=back

Returns a L<Net::Stripe::Coupon>.

  $stripe->delete_coupon(coupon_id => 'coupon123');

=head2 get_coupons

=over

=item * ending_before - Str, optional

=item * limit - Int, optional

=item * starting_after - Str, optional

=back

Returns a L<Net::Stripe::List> object containing L<Net::Stripe::Coupon> objects.

  $stripe->get_coupons(limit => 15);

=head1 Invoice Methods

=head2 post_invoice

Update an invoice.

=over

=item * invoice - L<Net::Stripe::Invoice>, Str

=item * application_fee - Int - optional

=item * closed - Bool - optional

=item * description - Str - optional

=item * metadata - HashRef - optional

=back

Returns a L<Net::Stripe::Invoice>.

  $stripe->post_invoice(invoice => $invoice, closed => 1)

=head2 get_invoice

=over

=item * invoice_id - Str

=back

Returns a L<Net::Stripe::Invoice>.

  $stripe->get_invoice(invoice_id => 'testinvoice');

=head2 pay_invoice

=over

=item * invoice_id - Str

=back

Returns a L<Net::Stripe::Invoice>.

  $stripe->pay_invoice(invoice_id => 'testinvoice');

=head2 get_invoices

Returns a list of invoices.

L<https://stripe.com/docs/api#list_customer_invoices>

=over

=item * customer - L<Net::Stripe::Customer> or Str, optional

=item * date - Int or HashRef, optional

=item * ending_before - Str, optional

=item * limit - Int, optional

=item * starting_after - Str, optional

=back

Returns a L<Net::Stripe::List> object containing L<Net::Stripe::Invoice> objects.

  $stripe->get_invoices(limit => 10);

=head2 create_invoice

Create a new invoice.

L<https://stripe.com/docs/api#create_invoice>

=over

=item * customer - L<Net::Stripe::Customer>, Str

=item * application_fee - Int - optional

=item * description - Str - optional

=item * metadata - HashRef - optional

=item * subscription - L<Net::Stripe::Subscription> or Str, optional

=back

Returns a L<Net::Stripe::Invoice>.

  $stripe->create_invoice(customer => 'custid', description => 'test');

=head2 get_invoice

=over

=item * invoice_id - Str

=back

Returns a L<Net::Stripe::Invoice>.

  $stripe->get_invoice(invoice_id => 'test');

=head2 get_upcominginvoice

=over

=item * customer, L<Net::Stripe::Customer> or Str

=back

Returns a L<Net::Stripe::Invoice>.

  $stripe->get_upcominginvoice(customer => $customer);

=head1 Invoice Item Methods

=head2 create_invoiceitem

Create an invoice item.

L<https://stripe.com/docs/api#create_invoiceitem>

=over

=item * customer - L<Net::Stripe::Customer> or Str

=item * amount - Int

=item * currency - Str

=item * invoice - L<Net::Stripe::Invoice> or Str, optional

=item * subscription - L<Net::Stripe::Subscription> or Str, optional

=item * description - Str, optional

=item * metadata - HashRef, optional

=back

Returns a L<Net::Stripe::Invoiceitem> object.

  $stripe->create_invoiceitem(customer => 'test', amount => 500, currency => 'USD');

=head2 post_invoiceitem

Update an invoice item.

L<https://stripe.com/docs/api#create_invoiceitem>

=over

=item * invoice_item - L<Net::Stripe::Invoiceitem> or Str

=item * amount - Int, optional

=item * description - Str, optional

=item * metadata - HashRef, optional

=back

Returns a L<Net::Stripe::Invoiceitem>.

  $stripe->post_invoiceitem(invoice_item => 'itemid', amount => 750);

=head2 get_invoiceitem

Retrieve an invoice item.

=over

=item * invoice_item - Str

=back

Returns a L<Net::Stripe::Invoiceitem>.

  $stripe->get_invoiceitem(invoice_item => 'testitemid');

=head2 delete_invoiceitem

Delete an invoice item.

=over

=item * invoice_item - L<Net::Stripe::Invoiceitem> or Str

=back

Returns a L<Net::Stripe::Invoiceitem>.

  $stripe->delete_invoiceitem(invoice_item => $invoice_item);

=head2 get_invoiceitems

=over

=item * customer - L<Net::Stripe::Customer> or Str, optional

=item * date - Int or HashRef, optional

=item * ending_before - Str, optional

=item * limit - Int, optional

=item * starting_after - Str, optional

=back

Returns a L<Net::Stripe::List> object containing L<Net::Stripe::Invoiceitem> objects.

  $stripe->get_invoiceitems(customer => 'test', limit => 30);

=head1 Discount Methods

=head2 delete_customer_discount

Deletes a customer-wide discount.

L<https://stripe.com/docs/api/curl#delete_discount>

=over

=item * customer - L<Net::Stripe::Customer> or Str - the customer with a discount to delete

=back

  $stripe->delete_customer_discount(customer => $customer);

Returns hashref of the form

  {
    deleted => <bool>
  }

=head1 Payment Method Methods

=head2 create_payment_method

Create a PaymentMethod

L<https://stripe.com/docs/api/payment_methods/create#create_payment_method>

=over

=item * type - StripePaymentMethodType - type of PaymentMethod - required

=item * card - StripeTokenId - Token id for card associated with the PaymentMethod

=item * billing_details - HashRef - billing information associated with the PaymentMethod

=item * fpx - HashRef - details about the FPX payment method

=item * ideal - HashRef - details about the iDEAL payment method

=item * metadata - HashRef[Str] - metadata

=item * sepa_debit - HashRef - details about the SEPA debit bank account

=back

Returns a L<Net::Stripe::PaymentMethod>.

  $stripe->create_payment_method(
      type => 'card',
      card => $token_id,
  );

=head2 get_payment_method

Retrieve an existing PaymentMethod

L<https://stripe.com/docs/api/payment_methods/retrieve#retrieve_payment_method>

=over

=item * payment_method_id - StripePaymentMethodId - id of PaymentMethod to retrieve - required

=back

Returns a L<Net::Stripe::PaymentMethod>

  $stripe->get_payment_method(
      payment_method_id => $payment_method_id,
  );

=head2 update_payment_method

Update a PaymentMethod

L<https://stripe.com/docs/api/payment_methods/update#update_payment_method>

=over

=item * payment_method_id - StripePaymentMethodId - id of PaymentMethod to update - required

=item * billing_details - HashRef - billing information associated with the PaymentMethod

=item * card - HashRef[Int] - card details to update

=item * metadata - HashRef[Str] - metadata

=item * sepa_debit - HashRef - details about the SEPA debit bank account

=back

Returns a L<Net::Stripe::PaymentMethod>

  $stripe->update_payment_method(
      payment_method_id => $payment_method_id,
      metadata => $metadata,
  );

=head2 list_payment_methods

Retrieve a list of PaymentMethods

L<https://stripe.com/docs/api/payment_methods/list#list_payment_methods>

=over

=item * customer - StripeCustomerId - return only PaymentMethods for the specified Customer id - required

=item * type - Str - filter by type - required

=item * ending_before - Str - ending before condition

=item * limit - Int - maximum number of objects to return

=item * starting_after - Str - starting after condition

=back

Returns a L<Net::Stripe::List> object containing L<Net::Stripe::PaymentMethod> objects

  $stripe->list_payment_methods(
      customer => $customer_id,
      type => 'card',
      limit => 10,
  );

=head2 attach_payment_method

Attach a PaymentMethod to a Customer

L<https://stripe.com/docs/api/payment_methods/attach#customer_attach_payment_method>

=over

=item * payment_method_id - StripePaymentMethodId - id of PaymentMethod to attach - required

=item * customer - StripeCustomerId - id of Customer to which to attach the PaymentMethod - required

=back

Returns a L<Net::Stripe::PaymentMethod>

  $stripe->attach_payment_method(
      payment_method_id => $payment_method_id,
      customer => $customer,
  );

=head2 detach_payment_method

Detach a PaymentMethod from a Customer

L<https://stripe.com/docs/api/payment_methods/detach#customer_detach_payment_method>

=over

=item * payment_method_id - StripePaymentMethodId - id of PaymentMethod to detach - required

=back

Returns a L<Net::Stripe::PaymentMethod>.

  $stripe->detach_payment_method(
      payment_method_id => $payment_method_id,
  );

=head1 Payment Intent Methods

=head2 create_payment_intent

Create a PaymentIntent object

L<https://stripe.com/docs/api/payment_intents/create#create_payment_intent>

=over

=item * amount - Int - amount intended to be collected by this PaymentIntent - required

=item * currency - Str - currency - required

=item * application_fee_amount - Int - the amount of the application fee

=item * capture_method - StripeCaptureMethod - capture method

=item * confirm - Bool - attempt to confirm this PaymentIntent immediately

=item * confirmation_method - StripeConfirmationMethod - confirmation method

=item * customer - StripeCustomerId - id of Customer this PaymentIntent belongs to

=item * description - Str - description

=item * error_on_requires_action - Bool - fail the payment attempt if the PaymentIntent transitions into `requires_action`

=item * mandate - Str - id of the mandate to be used for this payment

=item * mandate_data - HashRef - details about the Mandate to create

=item * metadata - HashRef[Str] - metadata

=item * off_session - Bool - indicate that the customer is not in your checkout flow

=item * on_behalf_of - Str - Stripe account ID for which these funds are intended

=item * payment_method - StripePaymentMethodId - id of PaymentMethod to attach to this PaymentIntent

=item * payment_method_options - HashRef - PaymentMethod-specific configuration for this PaymentIntent

=item * payment_method_types - ArrayRef[StripePaymentMethodType] - list of PaymentMethod types that this PaymentIntent is allowed to use

=item * receipt_email - Str - email address to send the receipt to

=item * return_url - Str - URL to redirect your customer back to

=item * save_payment_method - Bool - save the payment method to the customer

=item * setup_future_usage - Str - allow future payments with this PaymentIntent's PaymentMethod

=item * shipping - HashRef - shipping information for this PaymentIntent

=item * statement_descriptor - Str - descriptor for statement

=item * statement_descriptor_suffix - Str - suffix to be concatenated with the statement descriptor

=item * transfer_data - HashRef - parameters used to automatically create a Transfer when the payment succeeds

=item * transfer_group - Str - identifies the resulting payment as part of a group

=item * use_stripe_sdk - Bool - use manual confirmation and the iOS or Android SDKs to handle additional authentication steps

=back

Returns a L<Net::Stripe::PaymentIntent>

  $stripe->create_payment_intent(
      amount => 3300,
      currency => 'usd',
  );

=head2 get_payment_intent

Retrieve an existing PaymentIntent

L<https://stripe.com/docs/api/payment_intents/retrieve#retrieve_payment_intent>

=over

=item * payment_intent_id - StripePaymentIntentId - id of PaymentIntent to retrieve - required

=item * client_secret - Str - client secret of the PaymentIntent to retrieve

=back

Returns a L<Net::Stripe::PaymentIntent>

  $stripe->get_payment_intent(
      payment_intent_id => $payment_intent_id,
  );

=head2 update_payment_intent

Update an existing PaymentIntent

L<https://stripe.com/docs/api/payment_intents/update#update_payment_intent>

=over

=item * payment_intent_id - StripePaymentIntentId - id of PaymentIntent to update - required

=item * amount - Int - amount intended to be collected by this PaymentIntent - required

=item * application_fee_amount - Int - the amount of the application fee

=item * currency - Str - currency - required

=item * customer - StripeCustomerId - id of Customer this PaymentIntent belongs to

=item * description - Str - description

=item * metadata - HashRef[Str] - metadata

=item * payment_method - StripePaymentMethodId - id of PaymentMethod to attach to this PaymentIntent

=item * payment_method_options - HashRef - PaymentMethod-specific configuration for this PaymentIntent

=item * payment_method_types - ArrayRef[StripePaymentMethodType] - list of PaymentMethod types that this PaymentIntent is allowed to use

=item * receipt_email - Str - email address to send the receipt to

=item * save_payment_method - Bool - save the payment method to the customer

=item * setup_future_usage - Str - allow future payments with this PaymentIntent's PaymentMethod

=item * shipping - HashRef - shipping information for this PaymentIntent

=item * statement_descriptor - Str - descriptor for statement

=item * statement_descriptor_suffix - Str - suffix to be concatenated with the statement descriptor

=item * transfer_data - HashRef - parameters used to automatically create a Transfer when the payment succeeds

=item * transfer_group - Str - identifies the resulting payment as part of a group

=back

Returns a L<Net::Stripe::PaymentIntent>

  $stripe->update_payment_intent(
      payment_intent_id => $payment_intent_id,
      description => 'Updated Description',
  );

=head2 confirm_payment_intent

Confirm that customer intends to pay with provided PaymentMethod

L<https://stripe.com/docs/api/payment_intents/confirm#confirm_payment_intent>

=over

=item * payment_intent_id - StripePaymentIntentId - id of PaymentIntent to confirm - required

=item * client_secret - Str - client secret of the PaymentIntent

=item * error_on_requires_action - Bool - fail the payment attempt if the PaymentIntent transitions into `requires_action`

=item * mandate - Str - id of the mandate to be used for this payment

=item * mandate_data - HashRef - details about the Mandate to create

=item * off_session - Bool - indicate that the customer is not in your checkout flow

=item * payment_method - StripePaymentMethodId - id of PaymentMethod to attach to this PaymentIntent

=item * payment_method_options - HashRef - PaymentMethod-specific configuration for this PaymentIntent

=item * payment_method_types - ArrayRef[StripePaymentMethodType] - list of PaymentMethod types that this PaymentIntent is allowed to use

=item * receipt_email - Str - email address to send the receipt to

=item * return_url - Str - URL to redirect your customer back to

=item * save_payment_method - Bool - save the payment method to the customer

=item * setup_future_usage - Str - allow future payments with this PaymentIntent's PaymentMethod

=item * shipping - HashRef - shipping information for this PaymentIntent

=item * use_stripe_sdk - Bool - use manual confirmation and the iOS or Android SDKs to handle additional authentication steps

=back

Returns a L<Net::Stripe::PaymentIntent>

  $stripe->confirm_payment_intent(
      payment_intent_id => $payment_intent_id,
  );

=head2 capture_payment_intent

Capture the funds for the PaymentIntent

L<https://stripe.com/docs/api/payment_intents/capture#capture_payment_intent>

=over

=item * payment_intent_id - StripePaymentIntentId - id of PaymentIntent to capture - required

=item * amount_to_capture - Int - amount to capture from the PaymentIntent

=item * application_fee_amount - Int - application fee amount

=item * statement_descriptor - Str - descriptor for statement

=item * statement_descriptor_suffix - Str - suffix to be concatenated with the statement descriptor

=item * transfer_data - HashRef - parameters used to automatically create a Transfer when the payment succeeds

=back

Returns a L<Net::Stripe::PaymentIntent>

  $stripe->capture_payment_intent(
      payment_intent_id => $payment_intent_id,
  );

=head2 cancel_payment_intent

Cancel the PaymentIntent

L<https://stripe.com/docs/api/payment_intents/cancel#cancel_payment_intent>

=over

=item * payment_intent_id - StripePaymentIntentId - id of PaymentIntent to cancel - required

=item * cancellation_reason - StripeCancellationReason - reason for cancellation

=back

Returns a L<Net::Stripe::PaymentIntent>

  $stripe->cancel_payment_intent(
      payment_intent_id => $payment_intent_id,
      cancellation_reason => 'requested_by_customer',
  );

=head2 list_payment_intents

Retrieve a list of PaymentIntents

L<https://stripe.com/docs/api/payment_intents/list#list_payment_intents>

=over

=item * customer - StripeCustomerId - return only PaymentIntents for the specified Customer id

=item * created - HashRef[Int] - created conditions to match

=item * ending_before - Str - ending before condition

=item * limit - Int - maximum number of objects to return

=item * starting_after - Str - starting after condition

=back

Returns a L<Net::Stripe::List> object containing L<Net::Stripe::PaymentIntent> objects.

  $stripe->list_payment_intents(
      customer => $customer_id,
      type => 'card',
      limit => 10,
  );

=head1 RELEASE NOTES

=head2 Version 0.40

=head3 BREAKING CHANGES

=over

=item deprecate direct handling of PANs

Stripe strongly discourages direct handling of PANs (primary account numbers),
even in test mode, and returns invalid_request_error when passing PANs to the
API from accounts that were created after October 2017. In live mode, all
tokenization should be performed via client-side libraries because direct
handling of PANs violates PCI compliance. So we have removed the methods and
parameter constraints that allow direct handling of PANs and updated the
unit tests appropriately.

=item updating customer card by passing Customer object to post_customer()

If you have code that updates a customer card by updating the internal values
for an existing customer object and then posting that object:

    my $customer_obj = $stripe->get_customer(
        customer_id => $customer_id,
    );
    $customer_obj->card( $new_card );
    $stripe->post_customer( customer => $customer_obj );

you must unset the default_card attribute in the existing object before
posting the customer object.

    $customer_obj->default_card( undef );

Otherwise there is a conflict, since the old default_card attribute in the
object is serialized in the POST stream, and it appears that you are requesting
to set default_card to the id of a card that no longer exists, but rather
is being replaced by the new value of the card attribute in the object.

=item Plan objects now linked to Product objects

For Stripe API versions after 2018-02-15 L<https://stripe.com/docs/upgrades#2018-02-05>
each Plan object is linked to a Product object with type=service. The
Plan object 'name' and 'statement_descriptor' attributes have been moved to
Product objects.

=back

=head3 DEPRECATION WARNING

=over

=item update 'card' to 'source' for Charge and Customer

While the API returns both card-related and source-related values for earlier
versions, making the update mostly backwards-compatible, Stripe API versions
after 2015-02-18 L<https://stripe.com/docs/upgrades#2015-02-18> will no longer
return the card-related values, so you should update your code where necessary
to use the 'source' argument and method for Charge objects, and the 'source',
'sources' and 'default_source' arguments and methods for Customer, in
preparation for the eventual deprecation of the card-related arguments.

=item update 'account_balance' to 'balance' for Customer

While the API returns both 'account_balance' and 'balance' for earlier
versions, making the update backwards-compatible, Stripe API versions
after 2019-10-17 L<https://stripe.com/docs/upgrades#2019-10-17> do not
accept or return 'account_balance', so you should update your code where
necessary to use the 'balance' argument and method for Customer objects in
preparation for the eventual deprecation of the 'account_balance' argument.

=item use 'cancel_at_period_end' instead of 'at_period_end' for canceling Subscriptions

For Stripe API versions after 2018-08-23
L<https://stripe.com/docs/upgrades#2018-08-23>, you can no longer use
'at_period_end' in delete_subscription(). The delete_subscription() method
is reserved for immediate canceling going forward. You should update your
code to use 'cancel_at_period_end in update_subscription() instead.

=item update 'date' to 'created' for Invoice

While the API returns both 'date' and 'created' for earlier versions, making
the update backwards-compatible, Stripe API versions after 2019-03-14
L<https://stripe.com/docs/upgrades#2019-03-14> only return 'created', so you
should update your code where necessary to use the 'created' method for
Invoice objects in preparation for the eventual deprecation of the 'date'
argument.

=item use 'auto_advance' instead of 'closed' for Invoice

The 'closed' attribute for the Invoice object controls automatic collection,
and has been deprecated in favor of the more specific 'auto_advance' attribute.
Where you might have set closed=true on Invoices in the past, set
auto_advance=false. While the API returns both 'closed' and 'auto_advance'
for earlier versions, making the update backwards-compatible, Stripe API
versions after 2018-11-08 L<https://stripe.com/docs/upgrades#2018-11-08>
only return 'auto_advance', so you should update your code where necessary to
use the 'auto_advance' argument and method for Invoice objects in preparation
for the eventual deprecation of the 'closed' argument.

=back

=head3 BUG FIXES

=over

=item fix post_charge() arguments

Some argument types for `customer` and `card` were non-functional in the
current code and have been removed from the Kavorka method signature. We
removed `Net::Stripe::Customer` and `HashRef` for `customer` and we removed
`Net::Stripe::Card` and `Net::Stripe::Token` for `card`, as none of these
forms were being serialized correctly for passing to the API call. We must
retain `Net::Stripe::Card` for the `card` attribute in `Net::Stripe::Charge`
because the `card` value returned from the API call is objectified into
a card object. We have also added TypeConstraints for the string arguments
passed and added in-method validation to ensure that the passed argument
values make sense in the context of one another.

=item cleanup post_card()

Some argument types for `card` are not legitimate, or are being deprecated
and have been removed from the Kavorka method signature. We removed
`Net::Stripe::Card` and updated the string validation to disallow card id
for `card`, as neither of these are legitimate when creating or updating a
card L<https://github.com/lukec/stripe-perl/issues/138>, and the code path
that appeared to be handling `Net::Stripe::Card` was actually unreachable
L<https://github.com/lukec/stripe-perl/issues/100>. We removed the dead code
paths and made the conditional structure more explicit, per discussion in
L<https://github.com/lukec/stripe-perl/pull/133>. We also added unit tests
for all calling forms, per L<https://github.com/lukec/stripe-perl/issues/139>.

=item fix post_customer() arguments

Some argument types for `card` are not legitimate and have been removed from
the Kavorka method signature. We removed `Net::Stripe::Card` and updated the
string validation to disallow card id for `card`, as neither of these are
legitimate when creating or updating a customer L<https://github.com/lukec/stripe-perl/issues/138>.
We have also updated the structure of the method so that we always create a
Net::Stripe::Customer object before posting L<https://github.com/lukec/stripe-perl/issues/148>
and cleaned up and centralized Net::Stripe:Token coercion code.

=item default_card not updating in post_customer()

Prior to ff84dd7, we were passing %args directly to _post(), and therefore
default_card would have been included in the POST stream. Now we are creating
a L<Net::Stripe::Customer> object and posting it, so the posted parameters
rely on the explicit list in $customer_obj->form_fields(), which was lacking
default_card. See also BREAKING CHANGES.

=back

=head3 ENHANCEMENTS

=over

=item coerce old lists

In older Stripe API versions, some list-type data structures were returned
as arrayrefs. We now coerce those old-style lists and collections into the
hashref format that newer versions of the API return, with metadata stored
top-level keys and the list elements in an arrayref with the key 'data',
which is the format that C<Net::Stripe::List> expects. This makes the SDK
compatible with the Stripe API back to the earliest documented API version
L<https://stripe.com/docs/upgrades#2011-06-21>.

=item encode card metdata in convert_to_form_fields()

When passing a hashref with a nested metadata hashref to _post(), that
metadata must be encoded properly before being passed to the Stripe API.
There is now a dedicated block in convert_to_form_fields for this operation.
This update was necessary because of the addition of update_card(), which
accepts a card hashref, which may include metadata.

=item encode objects in convert_to_form_fields()

We removed the nested tertiary operator in _post() and updated
convert_to_form_fields() so that it now handles encoding of objects, both
top-level and nested. This streamlines the hashref vs object serailizing
code, making it easy to adapt to other methods.

=item remove manual serialization in _get_collections() and _get_with_args()

We were using string contatenation to both serilize the individual query args,
in _get_collections(), and to join the individual query args together, in
_get_with_args(). This also involved some unnecessary duplication of the
logic that convert_to_form_fields() was already capable of handling. We now
use convert_to_form_fields() to process the passed data, and L<URI> to
encode and serialize the query string. Along with other updates to
convert_to_form_fields(), _get() can now easily handle the same calling
form as _post(), eliminating the need for _get_collections() and
_get_with_args(). We have also updated _delete() accordingly.

=item add _get_all()

Similar to methods provided by other SDKs, calls using this method will allow
access to all records for a given object type without having to manually
paginate through the results. It is not intended to be used directly, but
will be accessed through new and existing list-retrieval methods. In order to
maintain backwards-compatibility with existing list retrieval behavior, this
method supports passing a value of 0 for 'limit' in order to retrieve all
records. Any other positive integer value for 'limit' will attempt to retrieve
that number of records up to the maximum available. As before, not passing a
value for 'limit', or explicitly passing an undefined value, retrieves whatever
number of records the API returns by default.

=back

=head3 UPDATES

=over

=item update statement_description to statement_descriptor

The statement_description attribute is now statement_descriptor for
L<Net::Stripe::Charge> and L<Net::Stripe::Plan>. The API docs
L<https://stripe.com/docs/upgrades#2014-12-17> indicate that this change
is backwards-compatible. You must update your code to reflect this change
for parameters passed to these objects and methods called on these objects.

=item update unit tests for Charge->status

For Stripe API versions after 2015-02-18 L<https://stripe.com/docs/upgrades#2015-02-18>,
the status property on the Charge object has a value of 'succeeded' for
successful charges. Previously, the status property would be 'paid' for
successful charges. This change does not affect the API calls themselves, but
if your account is using Stripe API version 2015-02-18 or later, you should
update any code that relies on strict checking of the return value of
Charge->status.

=item add update_card()

This method allows updates to card address, expiration, metadata, etc for
existing customer cards.

=item update Token attributes

Added type and client_ip attributes for L<Net::Stripe::Token>.

=item allow capture of partial charge

Passing 'amount' to capture_charge() allows capture of a partial charge.
Per the API, any remaining amount is immediately refunded. The charge object
now also has a 'refunds' attribute, representing a L<Net::Stripe::List>
of L<Net::Stripe::Refund> objects for the charge.

=item add Source

Added a Source object. Also added 'source' attribute and argument for Charge
objects and methods, and added 'source', 'sources' and 'default_source'
attributes and arguments for Customer objects and methods.

=item add balance for Customer

Added 'balance' attribute and arguments for Customer objects and methods.

=item add cancel_at_period_end for update_subscription()

Added 'cancel_at_period_end' argument update_subscription() and added
'cancel_at_period_end' to the POST stream for Subscription objects.

=item update Invoice

Added 'created' attribute for Invoice objects, and removed the required
constraint for the deprecated 'date' attribute. Also added the 'auto_advance'
attribute and removed the required constraint for the deprecated 'closed'
attribute.

=item add Product

Added a Product object. Also added 'product' attribute and argument for Plan
objects and methods.

=item add PaymentMethod and PaymentIntent

Added PaymentMethod and PaymentIntent objects and methods.

=back

=head1 SEE ALSO

L<https://stripe.com>, L<https://stripe.com/docs/api>

=encoding UTF-8

=head1 AUTHORS

=over 4

=item *

Luke Closs

=item *

Rusty Conover

=back

=head1 CONTRIBUTORS

=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 ...

=over 4

=item *

Andrew Solomon <andrew@geekuni.com>

=item *

Andrew Solomon <andrew@illywhacker.net>

=item *

Brian Collins <bricollins@gmail.com>

=item *

Devin M. Certas <devin@nacredata.com>

=item *

Dimitar Petrov <mitakaa@gmail.com>

=item *

Dylan Reinhold <dylan@gasdasoftware.com>

=item *

E. Choroba <choroba@matfyz.cz>

=item *

Florian Heyer <info@heyer-it.de>

=item *

Hermann Calabria <hermann@ivouch.com>

=item *

Jonathan "Duke" Leto <jonathan@leto.net>

=item *

Luke Closs <lukec@users.noreply.github.com>

=item *

Luke Closs <me@luk.ec>

=item *

Mohammad S Anwar <mohammad.anwar@yahoo.com>

=item *

Olaf Alders <olaf@wundersolutions.com>

=item *

Paul Cochrane <paul@liekut.de>

=item *

Peter Scott <peter@shotgundriver.com>

=item *

Rusty Conover <rusty@luckydinosaur.com>

=item *

Sachin Sebastian <sachinjsk@users.noreply.github.com>

=item *

Sherrard Burton <32931314+sherrardb@users.noreply.github.com>

=item *

Sherrard Burton <sburton@allafrica.com>

=item *

Slobodan Mišković <slobodan@miskovic.ca>

=item *

Tom Eliaz <tom@tomeliaz.com>

=back

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Prime Radiant, Inc., (c) copyright 2014 Lucky Dinosaur LLC.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut

lib/Net/Stripe/BalanceTransaction.pm  view on Meta::CPAN

package Net::Stripe::BalanceTransaction;
$Net::Stripe::BalanceTransaction::VERSION = '0.42';
use Moose;
use Moose::Util::TypeConstraints qw(subtype as where message);
extends 'Net::Stripe::Resource';

# ABSTRACT: represent a BalanceTransaction object from Stripe

subtype 'TransactionType',
      as 'Str',
      where { $_ =~ /^(?:charge|refund|adjustment|application_fee(?:_refund)?|transfer_?(?:cancelfailure)?)$/ },
      message { "A transaction type must be one of charge, refund, adjustment, application_fee, application_fee_refund, transfer, transfer_cancel or transfer_failure" };

subtype 'StatusType',
  as 'Str',
  where { $_ =~ /^(?:available|pending)$/ },
  message { "A Status must be one of available or pending" };

has 'id'            => (is => 'ro', isa => 'Str');
has 'amount'        => (is => 'ro', isa => 'Int');
has 'currency'      => (is => 'ro', isa => 'Str', required => 1);
has 'net'           => (is => 'ro', isa => 'Int');
has 'type'          => (is => 'ro', isa => 'TransactionType');
has 'created'       => (is => 'ro', isa => 'Int');
has 'available_on'  => (is => 'ro', isa => 'Int');
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]');

__PACKAGE__->meta->make_immutable;
1;

__END__

=pod

=head1 NAME

Net::Stripe::BalanceTransaction - represent a BalanceTransaction object from Stripe

=head1 VERSION

version 0.42

=head1 ATTRIBUTES

=head2 amount

Reader: amount

Type: Int

=head2 available_on

Reader: available_on

Type: Int

=head2 boolean_attributes

Reader: boolean_attributes

Type: ArrayRef[Str]

=head2 created

Reader: created

Type: Int

=head2 currency

Reader: currency

Type: Str

This attribute is required.

=head2 description

Reader: description

Type: Maybe[Str]

=head2 fee

Reader: fee

Type: Int

=head2 fee_details

Reader: fee_details

Type: Maybe[ArrayRef]

=head2 id

Reader: id

Type: Str

=head2 net

Reader: net

Type: Int

=head2 source

Reader: source

Type: Str

=head2 status

Reader: status

Type: StatusType

=head2 type

Reader: type

Type: TransactionType

=head1 AUTHORS

=over 4

=item *

Luke Closs

=item *

Rusty Conover

=back

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Prime Radiant, Inc., (c) copyright 2014 Lucky Dinosaur LLC.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut

lib/Net/Stripe/Card.pm  view on Meta::CPAN

package Net::Stripe::Card;
$Net::Stripe::Card::VERSION = '0.42';
use Moose;
use Kavorka;
use Net::Stripe::Token;

# ABSTRACT: represent a Card object from Stripe

# Input fields
has 'number'          => (is => 'ro', isa => 'Maybe[Str]');
has 'cvc'             => (is => 'ro', isa => 'Maybe[Int]');
has 'name'            => (is => 'ro', isa => 'Maybe[Str]');
has 'address_line1'   => (is => 'ro', isa => 'Maybe[Str]');
has 'address_line2'   => (is => 'ro', isa => 'Maybe[Str]');
has 'address_zip'     => (is => 'ro', isa => 'Maybe[Str]');
has 'address_city'    => (is => 'ro', isa => 'Maybe[Str]');
has 'address_state'   => (is => 'ro', isa => 'Maybe[Str]');
has 'address_country' => (is => 'ro', isa => 'Maybe[Str]');
has 'metadata'        => (is => 'ro', isa => 'Maybe[HashRef]');

# Both input and output
has 'exp_month'       => (is => 'ro', isa => 'Maybe[Int]', required => 1);
has 'exp_year'        => (is => 'ro', isa => 'Maybe[Int]', required => 1);

# Output fields
has 'id'                   => (is => 'ro', isa => 'Maybe[Str]');
has 'address_line1_check'  => (is => 'ro', isa => 'Maybe[Str]');
has 'address_zip_check'    => (is => 'ro', isa => 'Maybe[Str]');
has 'country'              => (is => 'ro', isa => 'Maybe[Str]');
has 'cvc_check'            => (is => 'ro', isa => 'Maybe[Str]');
has 'fingerprint'          => (is => 'ro', isa => 'Maybe[Str]');
has 'last4'                => (is => 'ro', isa => 'Maybe[Str]');
has 'brand'                => (is => 'ro', isa => 'Maybe[Str]');  # formerly 'type'

method form_fields_for_card_metadata {
    my $metadata = $self->metadata();
    my @metadata = ();
    while( my($k,$v) = each(%$metadata) ) {
      push @metadata, 'card[metadata]['.$k.']';
      push @metadata, $v;
    }
    return @metadata;
}

method form_fields {
    return (
        $self->form_fields_for_card_metadata(),
        map { ("card[$_]" => $self->$_) }
            grep { defined $self->$_ }
                qw/number cvc name address_line1 address_line2 address_zip
                   address_city address_state address_country exp_month exp_year/
    );
}

__PACKAGE__->meta->make_immutable;
1;

__END__

=pod

=head1 NAME

Net::Stripe::Card - represent a Card object from Stripe

=head1 VERSION

version 0.42

=head1 ATTRIBUTES

=head2 address_city

Reader: address_city

Type: Maybe[Str]

=head2 address_country

Reader: address_country

Type: Maybe[Str]

=head2 address_line1

Reader: address_line1

Type: Maybe[Str]

=head2 address_line1_check

Reader: address_line1_check

Type: Maybe[Str]

=head2 address_line2

Reader: address_line2

Type: Maybe[Str]

=head2 address_state

Reader: address_state

Type: Maybe[Str]

=head2 address_zip

Reader: address_zip

Type: Maybe[Str]

=head2 address_zip_check

Reader: address_zip_check

Type: Maybe[Str]

=head2 brand

Reader: brand

Type: Maybe[Str]

=head2 country

Reader: country

Type: Maybe[Str]

=head2 cvc

Reader: cvc

Type: Maybe[Int]

=head2 cvc_check

Reader: cvc_check

Type: Maybe[Str]

=head2 exp_month

Reader: exp_month

Type: Maybe[Int]

This attribute is required.

=head2 exp_year

Reader: exp_year

Type: Maybe[Int]

This attribute is required.

=head2 fingerprint

Reader: fingerprint

Type: Maybe[Str]

=head2 id

Reader: id

Type: Maybe[Str]

=head2 last4

Reader: last4

Type: Maybe[Str]

=head2 metadata

Reader: metadata

Type: Maybe[HashRef]

=head2 name

Reader: name

Type: Maybe[Str]

=head2 number

Reader: number

Type: Maybe[Str]

=head1 AUTHORS

=over 4

=item *

Luke Closs

=item *

Rusty Conover

=back

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Prime Radiant, Inc., (c) copyright 2014 Lucky Dinosaur LLC.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut

lib/Net/Stripe/Charge.pm  view on Meta::CPAN

package Net::Stripe::Charge;
$Net::Stripe::Charge::VERSION = '0.42';
use Moose;
use Kavorka;
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);
has 'currency'            => (is => 'ro', isa => 'Maybe[Str]', required => 1);
has 'customer'            => (is => 'ro', isa => 'Maybe[StripeCustomerId]');
has 'card'                => (is => 'ro', isa => 'Maybe[Net::Stripe::Card|StripeTokenId|StripeCardId]');
has 'source'              => (is => 'ro', isa => 'Maybe[Net::Stripe::Card|Net::Stripe::Source|StripeTokenId|StripeCardId|StripeSourceId]');
has 'description'         => (is => 'ro', isa => 'Maybe[Str]');
has 'livemode'            => (is => 'ro', isa => 'Maybe[Bool|Object]');
has 'paid'                => (is => 'ro', isa => 'Maybe[Bool|Object]');
has 'refunded'            => (is => 'ro', isa => 'Maybe[Bool|Object]');
has 'amount_refunded'     => (is => 'ro', isa => 'Maybe[Int]');
has 'captured'            => (is => 'ro', isa => 'Maybe[Bool|Object]');
has 'balance_transaction' => (is => 'ro', isa => 'Maybe[Str]');
has 'failure_message'     => (is => 'ro', isa => 'Maybe[Str]');
has 'failure_code'        => (is => 'ro', isa => 'Maybe[Str]');
has 'application_fee'     => (is => 'ro', isa => 'Maybe[Int]');
has 'metadata'            => (is => 'rw', isa => 'Maybe[HashRef]');
has 'invoice'             => (is => 'ro', isa => 'Maybe[Str]');
has 'receipt_email'       => (is => 'ro', isa => 'Maybe[Str]');
has 'status'              => (is => 'ro', isa => 'Maybe[Str]');
has 'capture'             => (is => 'ro', isa => 'Bool', default=> 1);
has 'statement_descriptor' => (is => 'ro', isa => 'Maybe[Str]');
has 'refunds'             => (is => 'ro', isa => 'Net::Stripe::List');

method form_fields {
    return $self->form_fields_for(
        qw/amount currency customer description application_fee receipt_email
            capture statement_descriptor card source metadata/
    );
}

__PACKAGE__->meta->make_immutable;
1;

__END__

=pod

=head1 NAME

Net::Stripe::Charge - represent an Charge object from Stripe

=head1 VERSION

version 0.42

=head1 ATTRIBUTES

=head2 amount

Reader: amount

Type: Maybe[Int]

This attribute is required.

=head2 amount_refunded

Reader: amount_refunded

Type: Maybe[Int]

=head2 application_fee

Reader: application_fee

Type: Maybe[Int]

=head2 balance_transaction

Reader: balance_transaction

Type: Maybe[Str]

=head2 boolean_attributes

Reader: boolean_attributes

Type: ArrayRef[Str]

=head2 capture

Reader: capture

Type: Bool

=head2 captured

Reader: captured

Type: Maybe[Bool|Object]

=head2 card

Reader: card

Type: Maybe[Net::Stripe::Card|StripeCardId|StripeTokenId]

=head2 created

Reader: created

Type: Maybe[Int]

=head2 currency

Reader: currency

Type: Maybe[Str]

This attribute is required.

=head2 customer

Reader: customer

Type: Maybe[StripeCustomerId]

=head2 description

Reader: description

Type: Maybe[Str]

=head2 failure_code

Reader: failure_code

Type: Maybe[Str]

=head2 failure_message

Reader: failure_message

Type: Maybe[Str]

=head2 id

Reader: id

Type: Maybe[Str]

=head2 invoice

Reader: invoice

Type: Maybe[Str]

=head2 livemode

Reader: livemode

Type: Maybe[Bool|Object]

=head2 metadata

Reader: metadata

Writer: metadata

Type: Maybe[HashRef]

=head2 paid

Reader: paid

Type: Maybe[Bool|Object]

=head2 receipt_email

Reader: receipt_email

Type: Maybe[Str]

=head2 refunded

Reader: refunded

Type: Maybe[Bool|Object]

=head2 refunds

Reader: refunds

Type: Net::Stripe::List

=head2 source

Reader: source

Type: Maybe[Net::Stripe::Card|Net::Stripe::Source|StripeCardId|StripeSourceId|StripeTokenId]

=head2 statement_descriptor

Reader: statement_descriptor

Type: Maybe[Str]

=head2 status

Reader: status

Type: Maybe[Str]

=head1 AUTHORS

=over 4

=item *

Luke Closs

=item *

Rusty Conover

=back

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Prime Radiant, Inc., (c) copyright 2014 Lucky Dinosaur LLC.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut

lib/Net/Stripe/Constants.pm  view on Meta::CPAN

package Net::Stripe::Constants;
$Net::Stripe::Constants::VERSION = '0.42';
# ABSTRACT: Constants for use in validation and unit tests

use strict;

use constant MIN_API_VERSION  => '2011-01-01';
use constant MAX_API_VERSION  => '2020-03-02';

1;

__END__

=pod

=head1 NAME

Net::Stripe::Constants - Constants for use in validation and unit tests

=head1 VERSION

version 0.42

=head1 AUTHORS

=over 4

=item *

Luke Closs

=item *

Rusty Conover

=back

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Prime Radiant, Inc., (c) copyright 2014 Lucky Dinosaur LLC.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut

lib/Net/Stripe/Coupon.pm  view on Meta::CPAN

package Net::Stripe::Coupon;
$Net::Stripe::Coupon::VERSION = '0.42';
use Moose;
use Kavorka;
extends 'Net::Stripe::Resource';

# ABSTRACT: represent a Coupon object from Stripe

has 'id'                 => (is => 'rw', isa => 'Maybe[Str]');
has 'percent_off'        => (is => 'rw', isa => 'Maybe[Int]', required => 1);
has 'duration'           => (is => 'rw', isa => 'Maybe[Str]', required => 1);
has 'duration_in_months' => (is => 'rw', isa => 'Maybe[Int]');
has 'max_redemptions'    => (is => 'rw', isa => 'Maybe[Int]');
has 'redeem_by'          => (is => 'rw', isa => 'Maybe[Int]');
has 'metadata'           => (is => 'ro', isa => 'Maybe[HashRef]');

method form_fields {
    return $self->form_fields_for(
        qw/id percent_off duration duration_in_months max_redemptions redeem_by
            metadata/
    );
}

__PACKAGE__->meta->make_immutable;
1;

__END__

=pod

=head1 NAME

Net::Stripe::Coupon - represent a Coupon object from Stripe

=head1 VERSION

version 0.42

=head1 ATTRIBUTES

=head2 boolean_attributes

Reader: boolean_attributes

Type: ArrayRef[Str]

=head2 duration

Reader: duration

Writer: duration

Type: Maybe[Str]

This attribute is required.

=head2 duration_in_months

Reader: duration_in_months

Writer: duration_in_months

Type: Maybe[Int]

=head2 id

Reader: id

Writer: id

Type: Maybe[Str]

=head2 max_redemptions

Reader: max_redemptions

Writer: max_redemptions

Type: Maybe[Int]

=head2 metadata

Reader: metadata

Type: Maybe[HashRef]

=head2 percent_off

Reader: percent_off

Writer: percent_off

Type: Maybe[Int]

This attribute is required.

=head2 redeem_by

Reader: redeem_by

Writer: redeem_by

Type: Maybe[Int]

=head1 AUTHORS

=over 4

=item *

Luke Closs

=item *

Rusty Conover

=back

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Prime Radiant, Inc., (c) copyright 2014 Lucky Dinosaur LLC.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut

lib/Net/Stripe/Customer.pm  view on Meta::CPAN

package Net::Stripe::Customer;
$Net::Stripe::Customer::VERSION = '0.42';
use Moose;
use Kavorka;
use Net::Stripe::Plan;
use Net::Stripe::Token;
use Net::Stripe::Card;
use Net::Stripe::Discount;
use Net::Stripe::List;
extends 'Net::Stripe::Resource';

# ABSTRACT: represent a Customer object from Stripe

# Customer creation args
has 'email'       => (is => 'rw', isa => 'Maybe[Str]');
has 'description' => (is => 'rw', isa => 'Maybe[Str]');
has 'trial_end'   => (is => 'rw', isa => 'Maybe[Int|Str]');
has 'card'        => (is => 'rw', isa => 'Maybe[Net::Stripe::Token|Net::Stripe::Card|StripeTokenId]');
has 'source'      => (is => 'rw', isa => 'Maybe[Net::Stripe::Card|StripeTokenId|StripeSourceId]');
has 'quantity'    => (is => 'rw', isa => 'Maybe[Int]');
has 'plan'        => (is => 'rw', isa => 'Maybe[Net::Stripe::Plan|Str]');
has 'coupon'      => (is => 'rw', isa => 'Maybe[Net::Stripe::Coupon|Str]');
has 'discount'    => (is => 'rw', isa => 'Maybe[Net::Stripe::Discount]');
has 'metadata'    => (is => 'rw', isa => 'Maybe[HashRef]');
has 'account_balance' => (is => 'rw', isa => 'Maybe[Int]', trigger => \&_account_balance_trigger);
has 'balance'     => (is => 'rw', isa => 'Maybe[Int]', trigger => \&_balance_trigger);
has 'default_card' => (is => 'rw', isa => 'Maybe[Net::Stripe::Token|Net::Stripe::Card|Str]');
has 'default_source' => (is => 'rw', isa => 'Maybe[StripeCardId|StripeSourceId]');

# API object args

has 'id'           => (is => 'ro', isa => 'Maybe[Str]');
has 'cards'        => (is => 'ro', isa => 'Net::Stripe::List');
has 'deleted'      => (is => 'ro', isa => 'Maybe[Bool|Object]', default => 0);
has 'sources'      => (is => 'ro', isa => 'Net::Stripe::List');
has 'subscriptions' => (is => 'ro', isa => 'Net::Stripe::List');
has 'subscription' => (is => 'ro',
                       lazy => 1,
                       builder => '_build_subscription');

sub _build_subscription {
    my $self = shift;
    return $self->subscriptions->get(0);
}

method _account_balance_trigger(
    Maybe[Int] $new_value!,
    Maybe[Int] $old_value?,
) {
    return unless defined( $new_value );
    return if defined( $old_value ) && $old_value eq $new_value;
    return if defined( $self->balance ) && $self->balance == $new_value;
    $self->balance( $new_value );
}

method _balance_trigger(
    Maybe[Int] $new_value!,
    Maybe[Int] $old_value?,
) {
    return unless defined( $new_value );
    return if defined( $old_value ) && $old_value eq $new_value;
    return if defined( $self->account_balance ) && $self->account_balance == $new_value;
    $self->account_balance( $new_value );
}

method form_fields {
    $self->account_balance( undef ) if
        defined( $self->account_balance ) &&
        defined( $self->balance ) &&
        $self->account_balance == $self->balance;
    return $self->form_fields_for(
        qw/email description trial_end account_balance balance quantity card plan coupon
            metadata default_card source default_source/
    );
}

__PACKAGE__->meta->make_immutable;
1;

__END__

=pod

=head1 NAME

Net::Stripe::Customer - represent a Customer object from Stripe

=head1 VERSION

version 0.42

=head1 ATTRIBUTES

=head2 account_balance

Reader: account_balance

Writer: account_balance

Type: Maybe[Int]

=head2 balance

Reader: balance

Writer: balance

Type: Maybe[Int]

=head2 boolean_attributes

Reader: boolean_attributes

Type: ArrayRef[Str]

=head2 card

Reader: card

Writer: card

Type: Maybe[Net::Stripe::Card|Net::Stripe::Token|StripeTokenId]

=head2 cards

Reader: cards

Type: Net::Stripe::List

=head2 coupon

Reader: coupon

Writer: coupon

Type: Maybe[Net::Stripe::Coupon|Str]

=head2 default_card

Reader: default_card

Writer: default_card

Type: Maybe[Net::Stripe::Card|Net::Stripe::Token|Str]

=head2 default_source

Reader: default_source

Writer: default_source

Type: Maybe[StripeCardId|StripeSourceId]

=head2 deleted

Reader: deleted

Type: Maybe[Bool|Object]

=head2 description

Reader: description

Writer: description

Type: Maybe[Str]

=head2 discount

Reader: discount

Writer: discount

Type: Maybe[Net::Stripe::Discount]

=head2 email

Reader: email

Writer: email

Type: Maybe[Str]

=head2 id

Reader: id

Type: Maybe[Str]

=head2 metadata

Reader: metadata

Writer: metadata

Type: Maybe[HashRef]

=head2 plan

Reader: plan

Writer: plan

Type: Maybe[Net::Stripe::Plan|Str]

=head2 quantity

Reader: quantity

Writer: quantity

Type: Maybe[Int]

=head2 source

Reader: source

Writer: source

Type: Maybe[Net::Stripe::Card|StripeSourceId|StripeTokenId]

=head2 sources

Reader: sources

Type: Net::Stripe::List

=head2 subscription

Reader: subscription

=head2 subscriptions

Reader: subscriptions

Type: Net::Stripe::List

=head2 trial_end

Reader: trial_end

Writer: trial_end

Type: Maybe[Int|Str]

=head1 AUTHORS

=over 4

=item *

Luke Closs

=item *

Rusty Conover

=back

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Prime Radiant, Inc., (c) copyright 2014 Lucky Dinosaur LLC.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut

lib/Net/Stripe/Discount.pm  view on Meta::CPAN

package Net::Stripe::Discount;
$Net::Stripe::Discount::VERSION = '0.42';
use Moose;
use Kavorka;
extends 'Net::Stripe::Resource';

# ABSTRACT: represent a Discount object from Stripe

has 'coupon' => (is => 'rw', isa => 'Maybe[Net::Stripe::Coupon]');
has 'start' => (is => 'rw', isa => 'Maybe[Int]');

__PACKAGE__->meta->make_immutable;
1;

__END__

=pod

=head1 NAME

Net::Stripe::Discount - represent a Discount object from Stripe

=head1 VERSION

version 0.42

=head1 ATTRIBUTES

=head2 boolean_attributes

Reader: boolean_attributes

Type: ArrayRef[Str]

=head2 coupon

Reader: coupon

Writer: coupon

Type: Maybe[Net::Stripe::Coupon]

=head2 start

Reader: start

Writer: start

Type: Maybe[Int]

=head1 AUTHORS

=over 4

=item *

Luke Closs

=item *

Rusty Conover

=back

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Prime Radiant, Inc., (c) copyright 2014 Lucky Dinosaur LLC.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut

lib/Net/Stripe/Error.pm  view on Meta::CPAN

package Net::Stripe::Error;
$Net::Stripe::Error::VERSION = '0.42';
use Moose;
with 'Throwable';
use namespace::clean -except => 'meta';

# ABSTRACT: represent an error result from interacting with Stripe

has 'type'    => (is => 'ro', isa => 'Maybe[Str]', required => 1);
has 'message' => (is => 'ro', isa => 'Maybe[Str]', required => 1);
has 'code'    => (is => 'ro', isa => 'Maybe[Str]');
has 'param'   => (is => 'ro', isa => 'Maybe[Str]');

use overload fallback => 1,
    '""' => sub {
        my $e = shift;
        my $msg = "Error: @{[$e->type]} - @{[$e->message]}";
        $msg .= " On parameter: " . $e->param if $e->param;
        $msg .= "\nCard error: " . $e->code   if $e->code;
        return $msg;
    };

__PACKAGE__->meta->make_immutable;
1;

__END__

=pod

=head1 NAME

Net::Stripe::Error - represent an error result from interacting with Stripe

=head1 VERSION

version 0.42

=head1 ATTRIBUTES

=head2 code

Reader: code

Type: Maybe[Str]

=head2 message

Reader: message

Type: Maybe[Str]

This attribute is required.

=head2 param

Reader: param

Type: Maybe[Str]

=head2 previous_exception

Reader: previous_exception

=head2 type

Reader: type

Type: Maybe[Str]

This attribute is required.

=head1 AUTHORS

=over 4

=item *

Luke Closs

=item *

Rusty Conover

=back

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Prime Radiant, Inc., (c) copyright 2014 Lucky Dinosaur LLC.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut

lib/Net/Stripe/Invoice.pm  view on Meta::CPAN

package Net::Stripe::Invoice;
$Net::Stripe::Invoice::VERSION = '0.42';
use Moose;
use Kavorka;
extends 'Net::Stripe::Resource';

# ABSTRACT: represent an Invoice object from Stripe

has 'id'            => ( is => 'ro', isa => 'Maybe[Str]' );
has 'created'       => ( is => 'ro', isa => 'Maybe[Int]' );
has 'subtotal'      => ( is => 'ro', isa => 'Maybe[Int]', required => 1 );
has 'amount_due'    => ( is => 'ro', isa => 'Maybe[Int]', required => 1 );
has 'attempt_count' => ( is => 'ro', isa => 'Maybe[Int]', required => 1 );
has 'attempted'     => ( is => 'ro', isa => 'Maybe[Bool|Object]', required => 1 );
has 'closed'        => ( is => 'ro', isa => 'Maybe[Bool|Object]', trigger => \&_closed_change_detector);
has 'auto_advance'  => ( is => 'ro', isa => 'Maybe[Bool]');
has 'created'       => ( is => 'ro', isa => 'Maybe[Int]' );
has 'customer'      => ( is => 'ro', isa => 'Maybe[Str]', required => 1 );
has 'date'          => ( is => 'ro', isa => 'Maybe[Str]' );
has 'lines'         => ( is => 'ro', isa => 'Net::Stripe::List', required => 1 );
has 'paid'          => ( is => 'ro', isa => 'Maybe[Bool|Object]', required => 1 );
has 'period_end'    => ( is => 'ro', isa => 'Maybe[Int]' );
has 'period_start'  => ( is => 'ro', isa => 'Maybe[Int]' );
has 'starting_balance' => ( is => 'ro', isa => 'Maybe[Int]' );
has 'subtotal'         => ( is => 'ro', isa => 'Maybe[Int]' );
has 'total'            => ( is => 'ro', isa => 'Maybe[Int]', required => 1 );
has 'charge'           => ( is => 'ro', isa => 'Maybe[Str]' );
has 'ending_balance'   => ( is => 'ro', isa => 'Maybe[Int]' );
has 'next_payment_attempt' => ( is => 'ro', isa => 'Maybe[Int]' );
has 'metadata'         => ( is => 'rw', isa => 'HashRef');
has 'description' => (is => 'rw', isa => 'Maybe[Str]');

sub _closed_change_detector {
    my ($instance, $new_value, $orig_value) = @_;
    # Strip can update invoices but only wants to see the closed flag if it has been changed.
    # Meaning if you retrieve an invoice then try to update it, and it is already closed
    # it will reject the update.
    if (!defined($orig_value) || $new_value ne $orig_value) {
        $instance->{closed_value_changed} = 1;
    }
    return;
}

method form_fields {
    return $self->form_fields_for(
        qw/description metadata auto_advance/,
        ($self->{closed_value_changed} ? qw/closed/ : ())
    );
}

__PACKAGE__->meta->make_immutable;
1;

__END__

=pod

=head1 NAME

Net::Stripe::Invoice - represent an Invoice object from Stripe

=head1 VERSION

version 0.42

=head1 ATTRIBUTES

=head2 amount_due

Reader: amount_due

Type: Maybe[Int]

This attribute is required.

=head2 attempt_count

Reader: attempt_count

Type: Maybe[Int]

This attribute is required.

=head2 attempted

Reader: attempted

Type: Maybe[Bool|Object]

This attribute is required.

=head2 auto_advance

Reader: auto_advance

Type: Maybe[Bool]

=head2 boolean_attributes

Reader: boolean_attributes

Type: ArrayRef[Str]

=head2 charge

Reader: charge

Type: Maybe[Str]

=head2 closed

Reader: closed

Type: Maybe[Bool|Object]

=head2 created

Reader: created

Type: Maybe[Int]

=head2 customer

Reader: customer

Type: Maybe[Str]

This attribute is required.

=head2 date

Reader: date

Type: Maybe[Str]

=head2 description

Reader: description

Writer: description

Type: Maybe[Str]

=head2 ending_balance

Reader: ending_balance

Type: Maybe[Int]

=head2 id

Reader: id

Type: Maybe[Str]

=head2 lines

Reader: lines

Type: Net::Stripe::List

This attribute is required.

=head2 metadata

Reader: metadata

Writer: metadata

Type: HashRef

=head2 next_payment_attempt

Reader: next_payment_attempt

Type: Maybe[Int]

=head2 paid

Reader: paid

Type: Maybe[Bool|Object]

This attribute is required.

=head2 period_end

Reader: period_end

Type: Maybe[Int]

=head2 period_start

Reader: period_start

Type: Maybe[Int]

=head2 starting_balance

Reader: starting_balance

Type: Maybe[Int]

=head2 subtotal

Reader: subtotal

Type: Maybe[Int]

=head2 total

Reader: total

Type: Maybe[Int]

This attribute is required.

=head1 AUTHORS

=over 4

=item *

Luke Closs

=item *

Rusty Conover

=back

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Prime Radiant, Inc., (c) copyright 2014 Lucky Dinosaur LLC.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut

lib/Net/Stripe/Invoiceitem.pm  view on Meta::CPAN

package Net::Stripe::Invoiceitem;
$Net::Stripe::Invoiceitem::VERSION = '0.42';
use Moose;
use Kavorka;
extends 'Net::Stripe::Resource';
with 'MooseX::Clone';

# ABSTRACT: represent an Invoice Item object from Stripe

has 'id'                => (is => 'ro', isa => 'Maybe[Str]');
has 'customer'          => (is => 'ro', isa => 'Maybe[Str]', required => 1);
has 'amount'            => (is => 'rw', isa => 'Maybe[Int]', required => 1);
has 'currency'          => (is => 'rw', isa => 'Maybe[Str]', required => 1, clearer => 'clear_currency');
has 'description'       => (is => 'rw', isa => 'Maybe[Str]');
has 'date'              => (is => 'ro', isa => 'Maybe[Int]');
has 'invoice'           => (is => 'ro', isa => 'Maybe[Str]');
has 'metadata'          => (is => 'rw', isa => 'Maybe[HashRef]');

method form_fields {
    return $self->form_fields_for(
        qw/amount currency description invoice metadata/,
        ($self->id ? () : qw/customer/)
    );
}

__PACKAGE__->meta->make_immutable;
1;

__END__

=pod

=head1 NAME

Net::Stripe::Invoiceitem - represent an Invoice Item object from Stripe

=head1 VERSION

version 0.42

=head1 ATTRIBUTES

=head2 amount

Reader: amount

Writer: amount

Type: Maybe[Int]

This attribute is required.

=head2 boolean_attributes

Reader: boolean_attributes

Type: ArrayRef[Str]

=head2 currency

Reader: currency

Writer: currency

Type: Maybe[Str]

This attribute is required.

=head2 customer

Reader: customer

Type: Maybe[Str]

This attribute is required.

=head2 date

Reader: date

Type: Maybe[Int]

=head2 description

Reader: description

Writer: description

Type: Maybe[Str]

=head2 id

Reader: id

Type: Maybe[Str]

=head2 invoice

Reader: invoice

Type: Maybe[Str]

=head2 metadata

Reader: metadata

Writer: metadata

Type: Maybe[HashRef]

=head1 AUTHORS

=over 4

=item *

Luke Closs

=item *

Rusty Conover

=back

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Prime Radiant, Inc., (c) copyright 2014 Lucky Dinosaur LLC.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut

lib/Net/Stripe/LineItem.pm  view on Meta::CPAN

package Net::Stripe::LineItem;
$Net::Stripe::LineItem::VERSION = '0.42';
use Moose;

# ABSTRACT: represent an Line Item object from Stripe

has 'id'                => (is => 'ro', isa => 'Maybe[Str]');
has 'livemode'          => (is => 'ro', isa => 'Maybe[Bool]');
has 'amount'            => (is => 'ro', isa => 'Maybe[Int]');
has 'currency'          => (is => 'ro', isa => 'Maybe[Str]');
has 'period'            => (is => 'ro', isa => 'Maybe[HashRef]');
has 'proration'         => (is => 'ro', isa => 'Maybe[Bool]');
has 'type'              => (is => 'ro', isa => 'Maybe[Str]');
has 'description'       => (is => 'ro', isa => 'Maybe[Str]');
has 'metadata'          => (is => 'ro', isa => 'Maybe[HashRef]');
has 'plan'              => (is => 'ro', isa => 'Maybe[Net::Stripe::Plan]');
has 'quantity'          => (is => 'ro', isa => 'Maybe[Int]');

__PACKAGE__->meta->make_immutable;
1;

__END__

=pod

=head1 NAME

Net::Stripe::LineItem - represent an Line Item object from Stripe

=head1 VERSION

version 0.42

=head1 ATTRIBUTES

=head2 amount

Reader: amount

Type: Maybe[Int]

=head2 currency

Reader: currency

Type: Maybe[Str]

=head2 description

Reader: description

Type: Maybe[Str]

=head2 id

Reader: id

Type: Maybe[Str]

=head2 livemode

Reader: livemode

Type: Maybe[Bool]

=head2 metadata

Reader: metadata

Type: Maybe[HashRef]

=head2 period

Reader: period

Type: Maybe[HashRef]

=head2 plan

Reader: plan

Type: Maybe[Net::Stripe::Plan]

=head2 proration

Reader: proration

Type: Maybe[Bool]

=head2 quantity

Reader: quantity

Type: Maybe[Int]

=head2 type

Reader: type

Type: Maybe[Str]

=head1 AUTHORS

=over 4

=item *

Luke Closs

=item *

Rusty Conover

=back

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Prime Radiant, Inc., (c) copyright 2014 Lucky Dinosaur LLC.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut

lib/Net/Stripe/List.pm  view on Meta::CPAN

package Net::Stripe::List;
$Net::Stripe::List::VERSION = '0.42';
use Moose;
use Kavorka;

# ABSTRACT: represent a list of objects from Stripe

has 'count'    => (is => 'ro', isa => 'Maybe[Int]'); # no longer included by default, see note below
has 'url'      => (is => 'ro', isa => 'Str', required => 1);
has 'has_more' => (is => 'ro', isa => 'Bool|Object', required => 1);
has 'data'     => (traits => ['Array'],
                   is => 'ro',
                   isa => 'ArrayRef',
                   required => 1,
                   handles => {
                       elements => 'elements',
                       map => 'map',
                       grep => 'grep',
                       first => 'first',
                       get => 'get',
                       join => 'join',
                       is_empty => 'is_empty',
                       sort => 'sort',
                   });

method last {
    return $self->get(scalar($self->elements)-1);
}

method _next_page_args() {
    return (
        starting_after => $self->get(-1)->id,
    );
}

method _previous_page_args() {
    return (
        ending_before => $self->get(0)->id,
    );
}

fun _merge_lists(
    ArrayRef[Net::Stripe::List] :$lists!,
) {
    my $has_count = defined( $lists->[-1]->count );
    my $url = $lists->[-1]->url;
    my %list_args = (
        count => $has_count ? scalar( map { $_->elements } @$lists ) : undef,
        data => [ map { $_->elements } @$lists ],
        has_more => 0,
        url => $url,
    );
    return Net::Stripe::List->new( %list_args );
}

__PACKAGE__->meta->make_immutable;
1;

__END__

=pod

=head1 NAME

Net::Stripe::List - represent a list of objects from Stripe

=head1 VERSION

version 0.42

=head1 ATTRIBUTES

=head2 count

Reader: count

Type: Maybe[Int]

=head2 data

Reader: data

Type: ArrayRef

This attribute is required.

=head2 has_more

Reader: has_more

Type: Bool|Object

This attribute is required.

=head2 url

Reader: url

Type: Str

This attribute is required.

=head1 AUTHORS

=over 4

=item *

Luke Closs

=item *

Rusty Conover

=back

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Prime Radiant, Inc., (c) copyright 2014 Lucky Dinosaur LLC.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut

lib/Net/Stripe/PaymentIntent.pm  view on Meta::CPAN

package Net::Stripe::PaymentIntent;
$Net::Stripe::PaymentIntent::VERSION = '0.42';
use Moose;
use Moose::Util::TypeConstraints qw(enum);
use Kavorka;
extends 'Net::Stripe::Resource';

# ABSTRACT: represent an PaymentIntent object from Stripe

# Args for posting to PaymentIntent endpoints
has 'amount'                      => (is => 'ro', isa => 'Maybe[Int]');
has 'amount_to_capture'           => (is => 'ro', isa => 'Maybe[Int]');
has 'application_fee_amount'      => (is => 'ro', isa => 'Maybe[Int]');
has 'cancellation_reason'         => (is => 'ro', isa => 'Maybe[StripeCancellationReason]');
has 'capture_method'              => (is => 'ro', isa => 'Maybe[StripeCaptureMethod]');
has 'client_secret'               => (is => 'ro', isa => 'Maybe[Str]');
has 'confirm'                     => (is => 'ro', isa => 'Maybe[Bool]');
has 'confirmation_method'         => (is => 'ro', isa => 'Maybe[StripeConfirmationMethod]');
has 'currency'                    => (is => 'ro', isa => 'Maybe[Str]');
has 'customer'                    => (is => 'ro', isa => 'Maybe[StripeCustomerId]');
has 'description'                 => (is => 'ro', isa => 'Maybe[Str]');
has 'error_on_requires_action'    => (is => 'ro', isa => 'Maybe[Bool]');
has 'mandate'                     => (is => 'ro', isa => 'Maybe[Str]');
has 'mandate_data'                => (is => 'ro', isa => 'Maybe[HashRef]');
has 'metadata'                    => (is => 'ro', isa => 'Maybe[HashRef[Str]|EmptyStr]');
has 'off_session'                 => (is => 'ro', isa => 'Maybe[Bool]');
has 'on_behalf_of'                => (is => 'ro', isa => 'Maybe[Str]');
has 'payment_method'              => (is => 'ro', isa => 'Maybe[StripePaymentMethodId]');
has 'payment_method_options'      => (is => 'ro', isa => 'Maybe[HashRef]');
has 'payment_method_types'        => (is => 'ro', isa => 'Maybe[ArrayRef[StripePaymentMethodType]]');
has 'receipt_email'               => (is => 'ro', isa => 'Maybe[Str]');
has 'return_url'                  => (is => 'ro', isa => 'Maybe[Str]');
has 'save_payment_method'         => (is => 'ro', isa => 'Maybe[Bool]');
has 'setup_future_usage'          => (is => 'ro', isa => 'Maybe[Str]');
has 'shipping'                    => (is => 'ro', isa => 'Maybe[HashRef]');
has 'statement_descriptor'        => (is => 'ro', isa => 'Maybe[Str]');
has 'statement_descriptor_suffix' => (is => 'ro', isa => 'Maybe[Str]');
has 'transfer_data'               => (is => 'ro', isa => 'Maybe[HashRef]');
has 'transfer_group'              => (is => 'ro', isa => 'Maybe[Str]');
has 'use_stripe_sdk'              => (is => 'ro', isa => 'Maybe[Bool]');

# Args returned by the API
has 'id'                  => (is => 'ro', isa => 'StripePaymentIntentId');
has 'amount_capturable'   => (is => 'ro', isa => 'Int');
has 'amount_received'     => (is => 'ro', isa => 'Int');
has 'application'         => (is => 'ro', isa => 'Maybe[Str]');
has 'cancellation_reason' => (is => 'ro', isa => 'Maybe[StripeCancellationReason]');
has 'canceled_at'         => (is => 'ro', isa => 'Maybe[Int]');
has 'charges'             => (is => 'ro', isa => 'Net::Stripe::List');
has 'client_secret'       => (is => 'ro', isa => 'Maybe[Str]');
has 'created'             => (is => 'ro', isa => 'Int');
has 'invoice'             => (is => 'ro', isa => 'Maybe[Str]');
has 'last_payment_error'  => (is => 'ro', isa => 'Maybe[HashRef]');
has 'livemode'            => (is => 'ro', isa => 'Bool');
has 'next_action'         => (is => 'ro', isa => 'Maybe[HashRef]');
has 'review'              => (is => 'ro', isa => 'Maybe[Str]');
has 'status'              => (is => 'ro', isa => 'Str');

method form_fields {
    return $self->form_fields_for(qw/
        amount amount_to_capture application_fee_amount cancellation_reason
        capture_method client_secret confirm confirmation_method currency
        customer description error_on_requires_action expand mandate
        mandate_data metadata off_session on_behalf_of payment_method
        payment_method_options payment_method_types receipt_email return_url
        save_payment_method setup_future_usage shipping statement_descriptor
        statement_descriptor_suffix transfer_data transfer_group use_stripe_sdk
    /);
}

__PACKAGE__->meta->make_immutable;
1;

__END__

=pod

=head1 NAME

Net::Stripe::PaymentIntent - represent an PaymentIntent object from Stripe

=head1 VERSION

version 0.42

=head1 ATTRIBUTES

=head2 amount

Reader: amount

Type: Maybe[Int]

=head2 amount_capturable

Reader: amount_capturable

Type: Int

=head2 amount_received

Reader: amount_received

Type: Int

=head2 amount_to_capture

Reader: amount_to_capture

Type: Maybe[Int]

=head2 application

Reader: application

Type: Maybe[Str]

=head2 application_fee_amount

Reader: application_fee_amount

Type: Maybe[Int]

=head2 boolean_attributes

Reader: boolean_attributes

Type: ArrayRef[Str]

=head2 canceled_at

Reader: canceled_at

Type: Maybe[Int]

=head2 cancellation_reason

Reader: cancellation_reason

Type: Maybe[StripeCancellationReason]

=head2 capture_method

Reader: capture_method

Type: Maybe[StripeCaptureMethod]

=head2 charges

Reader: charges

Type: Net::Stripe::List

=head2 client_secret

Reader: client_secret

Type: Maybe[Str]

=head2 confirm

Reader: confirm

Type: Maybe[Bool]

=head2 confirmation_method

Reader: confirmation_method

Type: Maybe[StripeConfirmationMethod]

=head2 created

Reader: created

Type: Int

=head2 currency

Reader: currency

Type: Maybe[Str]

=head2 customer

Reader: customer

Type: Maybe[StripeCustomerId]

=head2 description

Reader: description

Type: Maybe[Str]

=head2 error_on_requires_action

Reader: error_on_requires_action

Type: Maybe[Bool]

=head2 id

Reader: id

Type: StripePaymentIntentId

=head2 invoice

Reader: invoice

Type: Maybe[Str]

=head2 last_payment_error

Reader: last_payment_error

Type: Maybe[HashRef]

=head2 livemode

Reader: livemode

Type: Bool

=head2 mandate

Reader: mandate

Type: Maybe[Str]

=head2 mandate_data

Reader: mandate_data

Type: Maybe[HashRef]

=head2 metadata

Reader: metadata

Type: Maybe[EmptyStr|HashRef[Str]]

=head2 next_action

Reader: next_action

Type: Maybe[HashRef]

=head2 off_session

Reader: off_session

Type: Maybe[Bool]

=head2 on_behalf_of

Reader: on_behalf_of

Type: Maybe[Str]

=head2 payment_method

Reader: payment_method

Type: Maybe[StripePaymentMethodId]

=head2 payment_method_options

Reader: payment_method_options

Type: Maybe[HashRef]

=head2 payment_method_types

Reader: payment_method_types

Type: Maybe[ArrayRef[StripePaymentMethodType]]

=head2 receipt_email

Reader: receipt_email

Type: Maybe[Str]

=head2 return_url

Reader: return_url

Type: Maybe[Str]

=head2 review

Reader: review

Type: Maybe[Str]

=head2 save_payment_method

Reader: save_payment_method

Type: Maybe[Bool]

=head2 setup_future_usage

Reader: setup_future_usage

Type: Maybe[Str]

=head2 shipping

Reader: shipping

Type: Maybe[HashRef]

=head2 statement_descriptor

Reader: statement_descriptor

Type: Maybe[Str]

=head2 statement_descriptor_suffix

Reader: statement_descriptor_suffix

Type: Maybe[Str]

=head2 status

Reader: status

Type: Str

=head2 transfer_data

Reader: transfer_data

Type: Maybe[HashRef]

=head2 transfer_group

Reader: transfer_group

Type: Maybe[Str]

=head2 use_stripe_sdk

Reader: use_stripe_sdk

Type: Maybe[Bool]

=head1 AUTHORS

=over 4

=item *

Luke Closs

=item *

Rusty Conover

=back

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Prime Radiant, Inc., (c) copyright 2014 Lucky Dinosaur LLC.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut

lib/Net/Stripe/PaymentMethod.pm  view on Meta::CPAN

package Net::Stripe::PaymentMethod;
$Net::Stripe::PaymentMethod::VERSION = '0.42';
use Moose;
use Moose::Util::TypeConstraints qw(enum);
use Kavorka;
extends 'Net::Stripe::Resource';

# ABSTRACT: represent a PaymentMethod object from Stripe

# Args for posting to PaymentMethod endpoints
has 'billing_details' => (is => 'ro', isa => 'Maybe[HashRef]');
has 'card'            => (is => 'ro', isa => 'Maybe[Net::Stripe::Card|StripeTokenId]');
has 'fpx'             => (is => 'ro', isa => 'Maybe[HashRef]');
has 'ideal'           => (is => 'ro', isa => 'Maybe[HashRef]');
has 'metadata'        => (is => 'ro', isa => 'Maybe[HashRef[Str]|EmptyStr]');
has 'sepa_debit'      => (is => 'ro', isa => 'Maybe[HashRef]');
has 'type'            => (is => 'ro', isa => 'StripePaymentMethodType');

# Args returned by the API
has 'id'            => (is => 'ro', isa => 'StripePaymentMethodId');
has 'card_present'  => (is => 'ro', isa => 'Maybe[HashRef]');
has 'created'       => (is => 'ro', isa => 'Int');
has 'customer'      => (is => 'ro', isa => 'Maybe[StripeCustomerId]');
has 'livemode'      => (is => 'ro', isa => 'Bool');

method form_fields {
    return $self->form_fields_for(qw/
        billing_details card customer expand fpx ideal metadata sepa_debit type
    /);
}

__PACKAGE__->meta->make_immutable;
1;

__END__

=pod

=head1 NAME

Net::Stripe::PaymentMethod - represent a PaymentMethod object from Stripe

=head1 VERSION

version 0.42

=head1 ATTRIBUTES

=head2 billing_details

Reader: billing_details

Type: Maybe[HashRef]

=head2 boolean_attributes

Reader: boolean_attributes

Type: ArrayRef[Str]

=head2 card

Reader: card

Type: Maybe[Net::Stripe::Card|StripeTokenId]

=head2 card_present

Reader: card_present

Type: Maybe[HashRef]

=head2 created

Reader: created

Type: Int

=head2 customer

Reader: customer

Type: Maybe[StripeCustomerId]

=head2 fpx

Reader: fpx

Type: Maybe[HashRef]

=head2 id

Reader: id

Type: StripePaymentMethodId

=head2 ideal

Reader: ideal

Type: Maybe[HashRef]

=head2 livemode

Reader: livemode

Type: Bool

=head2 metadata

Reader: metadata

Type: Maybe[EmptyStr|HashRef[Str]]

=head2 sepa_debit

Reader: sepa_debit

Type: Maybe[HashRef]

=head2 type

Reader: type

Type: StripePaymentMethodType

=head1 AUTHORS

=over 4

=item *

Luke Closs

=item *

Rusty Conover

=back

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Prime Radiant, Inc., (c) copyright 2014 Lucky Dinosaur LLC.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut

lib/Net/Stripe/Plan.pm  view on Meta::CPAN

package Net::Stripe::Plan;
$Net::Stripe::Plan::VERSION = '0.42';
use Moose;
use Moose::Util::TypeConstraints qw(subtype as where message);
use Kavorka;
extends 'Net::Stripe::Resource';

# ABSTRACT: represent a Plan object from Stripe

subtype 'StatementDescriptor',
    as 'Str',
    where { !defined($_) || $_ =~ /^[^<>"']{0,15}$/ },
    message { "The statement descriptor you provided '$_' must be 15 characters or less and not contain <>\"'." };

has 'id'                => (is => 'ro', isa => 'Maybe[Str]', required => 1);
has 'amount'            => (is => 'ro', isa => 'Maybe[Int]', required => 1);
has 'currency'          => (is => 'ro', isa => 'Maybe[Str]', required => 1);
has 'interval'          => (is => 'ro', isa => 'Maybe[Str]', required => 1);
has 'interval_count'    => (is => 'ro', isa => 'Maybe[Int]', required => 0);
has 'name'              => (is => 'ro', isa => 'Maybe[Str]');
has 'trial_period_days' => (is => 'ro', isa => 'Maybe[Int]');
has 'statement_descriptor' => (is => 'ro', isa => 'Maybe[StatementDescriptor]', required => 0);
has 'metadata'          => (is => 'ro', isa => 'Maybe[HashRef]');
has 'product'           => (is => 'ro', isa => 'Maybe[StripeProductId|Str]');

method form_fields {
    return $self->form_fields_for(
        qw/id amount currency interval interval_count name statement_descriptor
            trial_period_days metadata product/
    );
}

__PACKAGE__->meta->make_immutable;
1;

__END__

=pod

=head1 NAME

Net::Stripe::Plan - represent a Plan object from Stripe

=head1 VERSION

version 0.42

=head1 ATTRIBUTES

=head2 amount

Reader: amount

Type: Maybe[Int]

This attribute is required.

=head2 boolean_attributes

Reader: boolean_attributes

Type: ArrayRef[Str]

=head2 currency

Reader: currency

Type: Maybe[Str]

This attribute is required.

=head2 id

Reader: id

Type: Maybe[Str]

This attribute is required.

=head2 interval

Reader: interval

Type: Maybe[Str]

This attribute is required.

=head2 interval_count

Reader: interval_count

Type: Maybe[Int]

=head2 metadata

Reader: metadata

Type: Maybe[HashRef]

=head2 name

Reader: name

Type: Maybe[Str]

=head2 product

Reader: product

Type: Maybe[Str|StripeProductId]

=head2 statement_descriptor

Reader: statement_descriptor

Type: Maybe[StatementDescriptor]

=head2 trial_period_days

Reader: trial_period_days

Type: Maybe[Int]

=head1 AUTHORS

=over 4

=item *

Luke Closs

=item *

Rusty Conover

=back

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Prime Radiant, Inc., (c) copyright 2014 Lucky Dinosaur LLC.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut

lib/Net/Stripe/Product.pm  view on Meta::CPAN

package Net::Stripe::Product;
$Net::Stripe::Product::VERSION = '0.42';
use Moose;
use Kavorka;
extends 'Net::Stripe::Resource';

# ABSTRACT: represent a Product object from Stripe

# Object creation
has 'active'                => (is => 'ro', isa => 'Maybe[Bool]');
has 'attributes'            => (is => 'ro', isa => 'Maybe[ArrayRef[Str]]');
has 'caption'               => (is => 'ro', isa => 'Maybe[Str]');
has 'deactivate_on'         => (is => 'ro', isa => 'Maybe[ArrayRef[Str]]');
has 'description'           => (is => 'ro', isa => 'Maybe[Str]');
has 'id'                    => (is => 'ro', isa => 'Maybe[StripeProductId|Str]');
has 'images'                => (is => 'ro', isa => 'Maybe[ArrayRef[Str]]');
has 'metadata'              => (is => 'ro', isa => 'Maybe[HashRef[Str]|EmptyStr]');
has 'name'                  => (is => 'ro', isa => 'Maybe[Str]');
has 'package_dimensions'    => (is => 'ro', isa => 'Maybe[HashRef[Num]]');
has 'shippable'             => (is => 'ro', isa => 'Maybe[Bool]');
has 'statement_descriptor'  => (is => 'ro', isa => 'Maybe[Str]');
has 'type'                  => (is => 'ro', isa => 'Maybe[StripeProductType]');
has 'unit_label'            => (is => 'ro', isa => 'Maybe[Str]');
has 'url'                   => (is => 'ro', isa => 'Maybe[Str]');

# API response
has 'created'   => (is => 'ro', isa => 'Maybe[Int]');
has 'livemode'  => (is => 'ro', isa => 'Maybe[Bool]');
has 'updated'   => (is => 'ro', isa => 'Maybe[Int]');

method form_fields {
    return $self->form_fields_for(
        qw/ active attributes caption deactivate_on description id images
            metadata name package_dimensions shippable statement_descriptor
            type unit_label url /
    );
}

__PACKAGE__->meta->make_immutable;
1;

__END__

=pod

=head1 NAME

Net::Stripe::Product - represent a Product object from Stripe

=head1 VERSION

version 0.42

=head1 ATTRIBUTES

=head2 active

Reader: active

Type: Maybe[Bool]

=head2 attributes

Reader: attributes

Type: Maybe[ArrayRef[Str]]

=head2 boolean_attributes

Reader: boolean_attributes

Type: ArrayRef[Str]

=head2 caption

Reader: caption

Type: Maybe[Str]

=head2 created

Reader: created

Type: Maybe[Int]

=head2 deactivate_on

Reader: deactivate_on

Type: Maybe[ArrayRef[Str]]

=head2 description

Reader: description

Type: Maybe[Str]

=head2 id

Reader: id

Type: Maybe[Str|StripeProductId]

=head2 images

Reader: images

Type: Maybe[ArrayRef[Str]]

=head2 livemode

Reader: livemode

Type: Maybe[Bool]

=head2 metadata

Reader: metadata

Type: Maybe[EmptyStr|HashRef[Str]]

=head2 name

Reader: name

Type: Maybe[Str]

=head2 package_dimensions

Reader: package_dimensions

Type: Maybe[HashRef[Num]]

=head2 shippable

Reader: shippable

Type: Maybe[Bool]

=head2 statement_descriptor

Reader: statement_descriptor

Type: Maybe[Str]

=head2 type

Reader: type

Type: Maybe[StripeProductType]

=head2 unit_label

Reader: unit_label

Type: Maybe[Str]

=head2 updated

Reader: updated

Type: Maybe[Int]

=head2 url

Reader: url

Type: Maybe[Str]

=head1 AUTHORS

=over 4

=item *

Luke Closs

=item *

Rusty Conover

=back

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Prime Radiant, Inc., (c) copyright 2014 Lucky Dinosaur LLC.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut

lib/Net/Stripe/Refund.pm  view on Meta::CPAN

package Net::Stripe::Refund;
$Net::Stripe::Refund::VERSION = '0.42';
use Moose;
use Kavorka;
extends 'Net::Stripe::Resource';

# ABSTRACT: represent a Refund object from Stripe

has 'id'                  => (is => 'ro', isa => 'Maybe[Str]');
has 'amount'              => (is => 'ro', isa => 'Maybe[Int]');
has 'created'             => (is => 'ro', isa => 'Maybe[Int]');
has 'currency'            => (is => 'ro', isa => 'Maybe[Str]');
has 'balance_transaction' => (is => 'ro', isa => 'Maybe[Str]');
has 'charge'              => (is => 'ro', isa => 'Maybe[Str]');
has 'metadata'            => (is => 'ro', isa => 'Maybe[HashRef]');
has 'reason'              => (is => 'ro', isa => 'Maybe[Str]');
has 'receipt_number'      => (is => 'ro', isa => 'Maybe[Str]');
has 'status'              => (is => 'ro', isa => 'Maybe[Str]');
has 'description'         => (
    is      => 'ro',
    isa     => 'Maybe[Str]',
    lazy    => 1,
    default => sub {
        warn
            "Use of Net::Stripe::Refund->description is deprecated and will be removed in the next Net::Stripe release";
        return;
    }
);

# Create only
has 'refund_application_fee' => (is => 'ro', isa => 'Maybe[Bool|Object]');

method form_fields {
    return $self->form_fields_for(
        qw/amount refund_application_fee reason metadata/
    );
}

__PACKAGE__->meta->make_immutable;
1;

__END__

=pod

=head1 NAME

Net::Stripe::Refund - represent a Refund object from Stripe

=head1 VERSION

version 0.42

=head1 ATTRIBUTES

=head2 amount

Reader: amount

Type: Maybe[Int]

=head2 balance_transaction

Reader: balance_transaction

Type: Maybe[Str]

=head2 boolean_attributes

Reader: boolean_attributes

Type: ArrayRef[Str]

=head2 charge

Reader: charge

Type: Maybe[Str]

=head2 created

Reader: created

Type: Maybe[Int]

=head2 currency

Reader: currency

Type: Maybe[Str]

=head2 description

Reader: description

Type: Maybe[Str]

=head2 id

Reader: id

Type: Maybe[Str]

=head2 metadata

Reader: metadata

Type: Maybe[HashRef]

=head2 reason

Reader: reason

Type: Maybe[Str]

=head2 receipt_number

Reader: receipt_number

Type: Maybe[Str]

=head2 refund_application_fee

Reader: refund_application_fee

Type: Maybe[Bool|Object]

=head2 status

Reader: status

Type: Maybe[Str]

=head1 AUTHORS

=over 4

=item *

Luke Closs

=item *

Rusty Conover

=back

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Prime Radiant, Inc., (c) copyright 2014 Lucky Dinosaur LLC.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut

lib/Net/Stripe/Resource.pm  view on Meta::CPAN

package Net::Stripe::Resource;
$Net::Stripe::Resource::VERSION = '0.42';
# ABSTRACT: represent a Resource object from Stripe

use Moose;
use Kavorka;

has 'boolean_attributes' => (is => 'ro', isa => 'ArrayRef[Str]');

around BUILDARGS => sub {
    my $orig = shift;
    my $class = shift;
    my %args = @_ == 1 ? %{ $_[0] } : @_;

    # Break out the JSON::XS::Boolean values into 1/0
    for my $field (keys %args) {
        if (ref($args{$field}) =~ /^(JSON::XS::Boolean|JSON::PP::Boolean)$/) {
            $args{$field} = $args{$field} ? 1 : 0;
        }
    }

    if (my $s = $args{source}) {
        if (ref($s) eq 'HASH' && $s->{object} eq 'source') {
            $args{source} = Net::Stripe::Source->new($s);
        }
    }

    for my $f (qw/card default_card/) {
        next unless $args{$f};
        next unless ref($args{$f}) eq 'HASH';
        $args{$f} = Net::Stripe::Card->new($args{$f});
    }

    if (my $s = $args{subscription}) {
        if (ref($s) eq 'HASH') {
            $args{subscription} = Net::Stripe::Subscription->new($s);
        }
    }
    if (my $s = $args{coupon}) {
        if (ref($s) eq 'HASH') {
            $args{coupon} = Net::Stripe::Coupon->new($s);
        }
    }
    if (my $s = $args{discount}) {
        if (ref($s) eq 'HASH') {
            $args{discount} = Net::Stripe::Discount->new($s);
        }
    }
    if (my $p = $args{plan}) {
        if (ref($p) eq 'HASH') {
            $args{plan} = Net::Stripe::Plan->new($p);
        }
    }

    for my $attr ($class->meta()->get_all_attributes()) {
      next if !($attr->type_constraint && (
          $attr->type_constraint eq 'Bool' ||
          $attr->type_constraint eq 'Maybe[Bool]' ||
          $attr->type_constraint eq 'Maybe[Bool|Object]'
      ));
      push @{$args{boolean_attributes}}, $attr->name;
    }

    $class->$orig(%args);
};

fun form_fields_for_hashref (
    Str $field_name!,
    HashRef $hashref!,
) {
    my @field_values;
    foreach my $key (sort keys %$hashref) {
        my $value = $hashref->{$key};
        my $nested_field_name = sprintf( '%s[%s]', $field_name, $key );
        if ( ref( $value ) eq 'HASH' ) {
            push @field_values, form_fields_for_hashref( $nested_field_name, $value );
        } else {
            push @field_values, ( $nested_field_name => $value );
        }
    }
    return @field_values;
}

fun form_fields_for_arrayref (
    Str $field_name!,
    ArrayRef $arrayref!,
) {
    my $nested_field_name = sprintf( '%s[]', $field_name );
    return $nested_field_name => $arrayref;
}

method fields_for($for) {
    return unless $self->can($for);
    my $thingy = $self->$for;
    return unless defined( $thingy );
    return ($for => $thingy->id) if $for eq 'card' && ref($thingy) eq 'Net::Stripe::Token';
    return ($for => $thingy->id) if $for eq 'source' && ref($thingy) eq 'Net::Stripe::Token';
    return $thingy->form_fields if ref($thingy) =~ m/^Net::Stripe::/;
    return form_fields_for_hashref( $for, $thingy ) if ref( $thingy ) eq 'HASH';
    return form_fields_for_arrayref( $for, $thingy ) if ref( $thingy ) eq 'ARRAY';

    my $token_id_type = Moose::Util::TypeConstraints::find_type_constraint( 'StripeTokenId' );
    return form_fields_for_hashref( $for, { token => $thingy } )
        if $self->isa( 'Net::Stripe::PaymentMethod' ) && $for eq 'card' && $token_id_type->check( $thingy );

    return ( $for => $self->get_form_field_value( $for ) );
}

method form_fields_for(@fields!) {
  return map { $self->fields_for( $_ ) } @fields;
}

method is_a_boolean(Str $attr!) {
  my %boolean_attributes = map { $_ => 1 } @{$self->boolean_attributes() || []};
  return exists( $boolean_attributes{$attr} );
}

method get_form_field_value(Str $attr!) {
  my $value = $self->$attr;
  return $value if ! $self->is_a_boolean( $attr );
  return ( defined( $value ) && $value ) ? 'true' : 'false';
}

1;

__END__

=pod

=head1 NAME

Net::Stripe::Resource - represent a Resource object from Stripe

=head1 VERSION

version 0.42

=head1 ATTRIBUTES

=head2 boolean_attributes

Reader: boolean_attributes

Type: ArrayRef[Str]

=head1 AUTHORS

=over 4

=item *

Luke Closs

=item *

Rusty Conover

=back

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Prime Radiant, Inc., (c) copyright 2014 Lucky Dinosaur LLC.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut

lib/Net/Stripe/Source.pm  view on Meta::CPAN

package Net::Stripe::Source;
$Net::Stripe::Source::VERSION = '0.42';
use Moose;
use Kavorka;
extends 'Net::Stripe::Resource';

# ABSTRACT: represent a Source object from Stripe

# Object creation
has 'amount'                => (is => 'ro', isa => 'Maybe[Int]');
has 'currency'              => (is => 'ro', isa => 'Maybe[Str]');
has 'flow'                  => (is => 'ro', isa => 'Maybe[StripeSourceFlow]');
has 'mandate'               => (is => 'ro', isa => 'Maybe[HashRef]');
has 'metadata'              => (is => 'ro', isa => 'Maybe[HashRef[Str]|EmptyStr]');
has 'owner'                 => (is => 'ro', isa => 'Maybe[HashRef]');
has 'receiver'              => (is => 'ro', isa => 'Maybe[HashRef]');
has 'redirect'              => (is => 'ro', isa => 'Maybe[HashRef]');
has 'source_order'          => (is => 'ro', isa => 'Maybe[HashRef]');
has 'statement_descriptor'  => (is => 'ro', isa => 'Maybe[Str]');
has 'token'                 => (is => 'ro', isa => 'Maybe[StripeTokenId]');
has 'type'                  => (is => 'ro', isa => 'Maybe[StripeSourceType]');
has 'usage'                 => (is => 'ro', isa => 'Maybe[StripeSourceUsage]');

# API response
has 'id'                    => (is => 'ro', isa => 'Maybe[StripeSourceId]');
has 'client_secret'         => (is => 'ro', isa => 'Maybe[Str]');
has 'created'               => (is => 'ro', isa => 'Maybe[Int]');
has 'livemode'              => (is => 'ro', isa => 'Maybe[Bool]');
has 'status'                => (is => 'ro', isa => 'Maybe[Str]');
has 'card'                  => (is => 'ro', isa => 'Maybe[Net::Stripe::Card]');

method form_fields {
    return $self->form_fields_for(
        qw/amount currency flow mandate metadata owner receiver redirect source_order statement_descriptor token type usage/
    );
}

__PACKAGE__->meta->make_immutable;
1;

__END__

=pod

=head1 NAME

Net::Stripe::Source - represent a Source object from Stripe

=head1 VERSION

version 0.42

=head1 ATTRIBUTES

=head2 amount

Reader: amount

Type: Maybe[Int]

=head2 boolean_attributes

Reader: boolean_attributes

Type: ArrayRef[Str]

=head2 card

Reader: card

Type: Maybe[Net::Stripe::Card]

=head2 client_secret

Reader: client_secret

Type: Maybe[Str]

=head2 created

Reader: created

Type: Maybe[Int]

=head2 currency

Reader: currency

Type: Maybe[Str]

=head2 flow

Reader: flow

Type: Maybe[StripeSourceFlow]

=head2 id

Reader: id

Type: Maybe[StripeSourceId]

=head2 livemode

Reader: livemode

Type: Maybe[Bool]

=head2 mandate

Reader: mandate

Type: Maybe[HashRef]

=head2 metadata

Reader: metadata

Type: Maybe[EmptyStr|HashRef[Str]]

=head2 owner

Reader: owner

Type: Maybe[HashRef]

=head2 receiver

Reader: receiver

Type: Maybe[HashRef]

=head2 redirect

Reader: redirect

Type: Maybe[HashRef]

=head2 source_order

Reader: source_order

Type: Maybe[HashRef]

=head2 statement_descriptor

Reader: statement_descriptor

Type: Maybe[Str]

=head2 status

Reader: status

Type: Maybe[Str]

=head2 token

Reader: token

Type: Maybe[StripeTokenId]

=head2 type

Reader: type

Type: Maybe[StripeSourceType]

=head2 usage

Reader: usage

Type: Maybe[StripeSourceUsage]

=head1 AUTHORS

=over 4

=item *

Luke Closs

=item *

Rusty Conover

=back

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Prime Radiant, Inc., (c) copyright 2014 Lucky Dinosaur LLC.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut

lib/Net/Stripe/Subscription.pm  view on Meta::CPAN

package Net::Stripe::Subscription;
$Net::Stripe::Subscription::VERSION = '0.42';
use Moose;
use Kavorka;
use Net::Stripe::Token;
use Net::Stripe::Card;
use Net::Stripe::Plan;
use Net::Stripe::Coupon;


extends 'Net::Stripe::Resource';

# ABSTRACT: represent a Subscription object from Stripe

has 'id' => (is => 'ro', isa => 'Maybe[Str]');
has 'plan' => (is => 'rw', isa => 'Maybe[Net::Stripe::Plan|Str]');
has 'coupon'    => (is => 'rw', isa => 'Maybe[Net::Stripe::Coupon|Str]');
has 'prorate'   => (is => 'rw', isa => 'Maybe[Bool|Object]');
has 'card'      => (is => 'rw', isa => 'Maybe[Net::Stripe::Token|Net::Stripe::Card|Str]');
has 'quantity'  => (is => 'rw', isa => 'Maybe[Int]', default => 1);

# Other fields returned by the API
has 'customer'             => (is => 'ro', isa => 'Maybe[Str]');
has 'status'               => (is => 'ro', isa => 'Maybe[Str]');
has 'start'                => (is => 'ro', isa => 'Maybe[Int]');
has 'canceled_at'          => (is => 'ro', isa => 'Maybe[Int]');
has 'ended_at'             => (is => 'ro', isa => 'Maybe[Int]');
has 'current_period_start' => (is => 'ro', isa => 'Maybe[Int]');
has 'current_period_end'   => (is => 'ro', isa => 'Maybe[Int]');
has 'trial_start'          => (is => 'ro', isa => 'Maybe[Str]');
has 'trial_end'            => (is => 'rw', isa => 'Maybe[Str|Int]');
has 'cancel_at_period_end' => (is => 'rw', isa => 'Maybe[Bool]');


method form_fields {
    return $self->form_fields_for(
        qw/coupon prorate trial_end quantity card plan cancel_at_period_end/
    );
}

__PACKAGE__->meta->make_immutable;
1;

__END__

=pod

=head1 NAME

Net::Stripe::Subscription - represent a Subscription object from Stripe

=head1 VERSION

version 0.42

=head1 ATTRIBUTES

=head2 boolean_attributes

Reader: boolean_attributes

Type: ArrayRef[Str]

=head2 cancel_at_period_end

Reader: cancel_at_period_end

Writer: cancel_at_period_end

Type: Maybe[Bool]

=head2 canceled_at

Reader: canceled_at

Type: Maybe[Int]

=head2 card

Reader: card

Writer: card

Type: Maybe[Net::Stripe::Card|Net::Stripe::Token|Str]

=head2 coupon

Reader: coupon

Writer: coupon

Type: Maybe[Net::Stripe::Coupon|Str]

=head2 current_period_end

Reader: current_period_end

Type: Maybe[Int]

=head2 current_period_start

Reader: current_period_start

Type: Maybe[Int]

=head2 customer

Reader: customer

Type: Maybe[Str]

=head2 ended_at

Reader: ended_at

Type: Maybe[Int]

=head2 id

Reader: id

Type: Maybe[Str]

=head2 plan

Reader: plan

Writer: plan

Type: Maybe[Net::Stripe::Plan|Str]

=head2 prorate

Reader: prorate

Writer: prorate

Type: Maybe[Bool|Object]

=head2 quantity

Reader: quantity

Writer: quantity

Type: Maybe[Int]

=head2 start

Reader: start

Type: Maybe[Int]

=head2 status

Reader: status

Type: Maybe[Str]

=head2 trial_end

Reader: trial_end

Writer: trial_end

Type: Maybe[Int|Str]

=head2 trial_start

Reader: trial_start

Type: Maybe[Str]

=head1 AUTHORS

=over 4

=item *

Luke Closs

=item *

Rusty Conover

=back

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Prime Radiant, Inc., (c) copyright 2014 Lucky Dinosaur LLC.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut



( run in 0.538 second using v1.01-cache-2.11-cpan-3989ada0592 )