| 1 | ##---------------------------------------------------------------------------- | ||
| 2 | ## Stripe API - ~/lib/Net/API/Stripe/Connect/ApplicationFee.pm | ||
| 3 | ## Version v0.100.0 | ||
| 4 | ## Copyright(c) 2019 DEGUEST Pte. Ltd. | ||
| 5 | ## Author: Jacques Deguest <@sitael.tokyo.deguest.jp> | ||
| 6 | ## Created 2019/11/02 | ||
| 7 | ## Modified 2020/05/15 | ||
| 8 | ## | ||
| 9 | ##---------------------------------------------------------------------------- | ||
| 10 | ## https://stripe.com/docs/api/application_fees | ||
| 11 | package Net::API::Stripe::Connect::ApplicationFee; | ||
| 12 | BEGIN | ||
| 13 | { | ||
| 14 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | 1 | ▶ | use parent qw( Net::API::Stripe::Generic ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 16 | 1 | ▶ | our( $VERSION ) = 'v0.100.0'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 17 | }; | ||
| 18 | |||
| 19 | 0 | ▶ | sub id { shift->_set_get_scalar( 'id', @_ ); } |
|
Subroutine
id: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 20 | |||
| 21 | 0 | ▶ | sub object { shift->_set_get_scalar( 'object', @_ ); } |
|
Subroutine
object: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 22 | |||
| 23 | 0 | ▶ | sub account { shift->_set_get_scalar_or_object( 'account', 'Net::API::Stripe::Connect::Account', @_ ); } |
|
Subroutine
account: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 24 | |||
| 25 | 0 | ▶ | sub amount { shift->_set_get_number( 'amount', @_ ); } |
|
Subroutine
amount: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 26 | |||
| 27 | 0 | ▶ | sub amount_refunded { shift->_set_get_number( 'amount_refunded', @_ ); } |
|
Subroutine
amount_refunded: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 28 | |||
| 29 | 0 | ▶ | sub application { shift->_set_get_scalar_or_object( 'application', 'Net::API::Stripe::Connect::Account', @_ ); } |
|
Subroutine
application: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 30 | |||
| 31 | 0 | ▶ | sub balance_transaction { shift->_set_get_scalar_or_object( 'balance_transaction', 'Net::API::Stripe::Balance::Transaction', @_ ); } |
|
Subroutine
balance_transaction: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 32 | |||
| 33 | 0 | ▶ | sub charge { shift->_set_get_scalar_or_object( 'charge', 'Net::API::Stripe::Charge', @_ ); } |
|
Subroutine
charge: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 34 | |||
| 35 | 0 | ▶ | sub created { shift->_set_get_datetime( 'created', @_ ); } |
|
Subroutine
created: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 36 | |||
| 37 | 0 | ▶ | sub currency { shift->_set_get_scalar( 'currency', @_ ); } |
|
Subroutine
currency: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 38 | |||
| 39 | 0 | ▶ | sub livemode { shift->_set_get_boolean( 'livemode', @_ ); } |
|
Subroutine
livemode: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 40 | |||
| 41 | 0 | ▶ | sub originating_transaction { shift->_set_get_scalar_or_object( 'originating_transaction', 'Net::API::Stripe::Charge', @_ ); } |
|
Subroutine
originating_transaction: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 42 | |||
| 43 | 0 | ▶ | sub refunded { shift->_set_get_boolean( 'refunded', @_ ); } |
|
Subroutine
refunded: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 44 | |||
| 45 | 0 | ▶ | sub refunds { shift->_set_get_object( 'refunds', 'Net::API::Stripe::Connect::ApplicationFee::Refunds', @_ ); } |
|
Subroutine
refunds: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 46 | |||
| 47 | 1 | 1; | |
| 48 | |||
| 49 | __END__ | ||
| 50 | |||
| 51 | =encoding utf8 | ||
| 52 | |||
| 53 | =head1 NAME | ||
| 54 | |||
| 55 | Net::API::Stripe::Connect::ApplicationFee - A Stripe Application Fee Object | ||
| 56 | |||
| 57 | =head1 SYNOPSIS | ||
| 58 | |||
| 59 | my $app_fee = $stripe->application_fee({ | ||
| 60 | account => $account_object, | ||
| 61 | amount => 2000, | ||
| 62 | balance_transaction => $balance_transaction_object, | ||
| 63 | currency => 'jpy', | ||
| 64 | }); | ||
| 65 | |||
| 66 | =head1 VERSION | ||
| 67 | |||
| 68 | v0.100.0 | ||
| 69 | |||
| 70 | =head1 DESCRIPTION | ||
| 71 | |||
| 72 | When you collect a transaction fee on top of a charge made for your user (using Connect L<https://stripe.com/docs/connect>), an Application Fee object is created in your account. You can list, retrieve, and refund application fees. | ||
| 73 | |||
| 74 | =head1 CONSTRUCTOR | ||
| 75 | |||
| 76 | =over 4 | ||
| 77 | |||
| 78 | =item B<new>( %ARG ) | ||
| 79 | |||
| 80 | Creates a new L<Net::API::Stripe::Connect::ApplicationFee> object. | ||
| 81 | It may also take an hash like arguments, that also are method of the same name. | ||
| 82 | |||
| 83 | =back | ||
| 84 | |||
| 85 | =head1 METHODS | ||
| 86 | |||
| 87 | =over 4 | ||
| 88 | |||
| 89 | =item B<id> string | ||
| 90 | |||
| 91 | Unique identifier for the object. | ||
| 92 | |||
| 93 | =item B<object> string, value is "application_fee" | ||
| 94 | |||
| 95 | String representing the object’s type. Objects of the same type share the same value. | ||
| 96 | |||
| 97 | =item B<account> string (expandable) | ||
| 98 | |||
| 99 | ID of the Stripe account this fee was taken from. When expanded, this is a L<Net::API::Stripe::Connect::Account> object. | ||
| 100 | |||
| 101 | =item B<amount> integer | ||
| 102 | |||
| 103 | Amount earned, in JPY. | ||
| 104 | |||
| 105 | =item B<amount_refunded> positive integer or zero | ||
| 106 | |||
| 107 | Amount in JPY refunded (can be less than the amount attribute on the fee if a partial refund was issued) | ||
| 108 | |||
| 109 | =item B<application> string (expandable) "application" | ||
| 110 | |||
| 111 | ID of the Connect application that earned the fee. When expanded, this is a L<Net::API::Stripe::Connect::Account> object. | ||
| 112 | |||
| 113 | =item B<balance_transaction> string (expandable) | ||
| 114 | |||
| 115 | Balance transaction that describes the impact of this collected application fee on your account balance (not including refunds). | ||
| 116 | |||
| 117 | When expanded, this is a L<Net::API::Stripe::Balance::Transaction> object. | ||
| 118 | |||
| 119 | =item B<charge> string (expandable) | ||
| 120 | |||
| 121 | ID of the charge that the application fee was taken from. When expanded, this is a L<Net::API::Stripe::Charge> object. | ||
| 122 | |||
| 123 | =item B<created> timestamp | ||
| 124 | |||
| 125 | Time at which the object was created. Measured in seconds since the Unix epoch. | ||
| 126 | |||
| 127 | This is a C<DateTime> object. | ||
| 128 | |||
| 129 | =item B<currency> currency | ||
| 130 | |||
| 131 | Three-letter ISO currency code, in lowercase. Must be a supported currency. | ||
| 132 | |||
| 133 | =item B<livemode> boolean | ||
| 134 | |||
| 135 | Has the value true if the object exists in live mode or the value false if the object exists in test mode. | ||
| 136 | |||
| 137 | =item B<originating_transaction> string (expandable) charge or transfer | ||
| 138 | |||
| 139 | ID of the corresponding charge on the platform account, if this fee was the result of a charge using the destination parameter. | ||
| 140 | |||
| 141 | When expanded, this is a L<Net::API::Stripe::Charge> object. | ||
| 142 | |||
| 143 | =item B<refunded> boolean | ||
| 144 | |||
| 145 | Whether the fee has been fully refunded. If the fee is only partially refunded, this attribute will still be false. | ||
| 146 | |||
| 147 | =item B<refunds> list | ||
| 148 | |||
| 149 | A list of refunds that have been applied to the fee. | ||
| 150 | |||
| 151 | This is a L<Net::API::Stripe::Connect::ApplicationFee::Refunds> object. | ||
| 152 | |||
| 153 | =back | ||
| 154 | |||
| 155 | =head1 API SAMPLE | ||
| 156 | |||
| 157 | { | ||
| 158 | "id": "fee_fake123456789", | ||
| 159 | "object": "application_fee", | ||
| 160 | "account": "acct_fake123456789", | ||
| 161 | "amount": 100, | ||
| 162 | "amount_refunded": 0, | ||
| 163 | "application": "ca_fake123456789", | ||
| 164 | "balance_transaction": "txn_fake123456789", | ||
| 165 | "charge": "ch_fake123456789", | ||
| 166 | "created": 1571480455, | ||
| 167 | "currency": "jpy", | ||
| 168 | "livemode": false, | ||
| 169 | "originating_transaction": null, | ||
| 170 | "refunded": false, | ||
| 171 | "refunds": { | ||
| 172 | "object": "list", | ||
| 173 | "data": [], | ||
| 174 | "has_more": false, | ||
| 175 | "url": "/v1/application_fees/fee_fake123456789/refunds" | ||
| 176 | } | ||
| 177 | } | ||
| 178 | |||
| 179 | =head1 HISTORY | ||
| 180 | |||
| 181 | =head2 v0.1 | ||
| 182 | |||
| 183 | Initial version | ||
| 184 | |||
| 185 | =head1 AUTHOR | ||
| 186 | |||
| 187 | Jacques Deguest E<lt>F<jack@deguest.jp>E<gt> | ||
| 188 | |||
| 189 | =head1 SEE ALSO | ||
| 190 | |||
| 191 | Stripe API documentation: | ||
| 192 | |||
| 193 | L<https://stripe.com/docs/api/application_fees>, L<https://stripe.com/docs/connect/direct-charges#collecting-fees> | ||
| 194 | |||
| 195 | =head1 COPYRIGHT & LICENSE | ||
| 196 | |||
| 197 | Copyright (c) 2019-2020 DEGUEST Pte. Ltd. | ||
| 198 | |||
| 199 | You can use, copy, modify and redistribute this package and associated | ||
| 200 | files under the same terms as Perl itself. | ||
| 201 | |||
| 202 | =cut | ||