| 1 | ##---------------------------------------------------------------------------- | ||
| 2 | ## Stripe API - ~/lib/Net/API/Stripe/Issuing/Authorization.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/issuing/authorizations/object | ||
| 11 | package Net::API::Stripe::Issuing::Authorization; | ||
| 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 approved { shift->_set_get_boolean( 'approved', @_ ); } |
|
Subroutine
approved: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 24 | |||
| 25 | 0 | ▶ | sub authorization_method { shift->_set_get_scalar( 'authorization_method', @_ ); } |
|
Subroutine
authorization_method: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 26 | |||
| 27 | 0 | ▶ | sub authorized_amount { shift->_set_get_number( 'authorized_amount', @_ ); } |
|
Subroutine
authorized_amount: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 28 | |||
| 29 | 0 | ▶ | sub authorized_currency { shift->_set_get_scalar( 'authorized_currency', @_ ); } |
|
Subroutine
authorized_currency: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 30 | |||
| 31 | 0 | ▶ | sub balance_transactions { shift->_set_get_object_array( 'balance_transactions', 'Net::API::Stripe::Balance::Transaction', @_ ); } |
|
Subroutine
balance_transactions: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 32 | |||
| 33 | 0 | ▶ | sub card { shift->_set_get_object( 'card', 'Net::API::Stripe::Issuing::Card', @_ ); } |
|
Subroutine
card: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 34 | |||
| 35 | 0 | ▶ | sub cardholder { shift->_set_get_scalar_or_object( 'cardholder', 'Net::API::Stripe::Issuing::Card::Holder', @_ ); } |
|
Subroutine
cardholder: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 36 | |||
| 37 | 0 | ▶ | sub created { shift->_set_get_datetime( 'created', @_ ); } |
|
Subroutine
created: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 38 | |||
| 39 | 0 | ▶ | sub held_amount { shift->_set_get_number( 'held_amount', @_ ); } |
|
Subroutine
held_amount: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 40 | |||
| 41 | 0 | ▶ | sub held_currency { shift->_set_get_number( 'held_currency', @_ ); } |
|
Subroutine
held_currency: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 42 | |||
| 43 | 0 | ▶ | sub is_held_amount_controllable { shift->_set_get_boolean( 'is_held_amount_controllable', @_ ); } |
|
Subroutine
is_held_amount_controllable: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 44 | |||
| 45 | 0 | ▶ | sub livemode { shift->_set_get_boolean( 'livemode', @_ ); } |
|
Subroutine
livemode: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 46 | |||
| 47 | 0 | ▶ | sub merchant_data { shift->_set_get_object( 'merchant_data', 'Net::API::Stripe::Issuing::MerchantData', @_ ); } |
|
Subroutine
merchant_data: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 48 | |||
| 49 | 0 | ▶ | sub metadata { shift->_set_get_hash( 'metadata', @_ ); } |
|
Subroutine
metadata: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 50 | |||
| 51 | 0 | ▶ | sub pending_authorized_amount { shift->_set_get_number( 'pending_authorized_amount', @_ ); } |
|
Subroutine
pending_authorized_amount: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 52 | |||
| 53 | 0 | ▶ | sub pending_held_amount { shift->_set_get_number( 'pending_held_amount', @_ ); } |
|
Subroutine
pending_held_amount: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 54 | |||
| 55 | 0 | ▶ | sub request_history { shift->_set_get_object_array( 'request_history', 'Net::API::Stripe::Issuing::Authorization::RequestHistory', @_ ); } |
|
Subroutine
request_history: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 56 | |||
| 57 | 0 | ▶ | sub status { shift->_set_get_scalar( 'status', @_ ); } |
|
Subroutine
status: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 58 | |||
| 59 | 0 | ▶ | sub transactions { shift->_set_get_object_array( 'transactions', 'Net::API::Stripe::Issuing::Authorization::Transaction', @_ ); } |
|
Subroutine
transactions: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 60 | |||
| 61 | 0 | ▶ | sub verification_data { shift->_set_get_object( 'verification_data', 'Net::API::Stripe::Issuing::Authorization::VerificationData', @_ ); } |
|
Subroutine
verification_data: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 62 | |||
| 63 | 0 | ▶ | sub wallet_provider { return( shift->_set_get_scalar( 'wallet_provider', @_ ) ); } |
|
Subroutine
wallet_provider: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 64 | |||
| 65 | 1 | 1; | |
| 66 | |||
| 67 | __END__ | ||
| 68 | |||
| 69 | =encoding utf8 | ||
| 70 | |||
| 71 | =head1 NAME | ||
| 72 | |||
| 73 | Net::API::Stripe::Issuing::Authorization - A Stripe Issued Authorization Object | ||
| 74 | |||
| 75 | =head1 SYNOPSIS | ||
| 76 | |||
| 77 | my $auth = $stripe->authorization({ | ||
| 78 | approved => $stripe->true, | ||
| 79 | authorization_method => 'online', | ||
| 80 | authorized_amount => 2000, | ||
| 81 | authorized_currency => 'jpy', | ||
| 82 | balance_transactions => | ||
| 83 | [ | ||
| 84 | { | ||
| 85 | amount => 2000, | ||
| 86 | authorization => $authorization_object, | ||
| 87 | card => $card_object, | ||
| 88 | cardholder => $cardholder_object, | ||
| 89 | currency => 'jpy', | ||
| 90 | merchant_amount => 2000, | ||
| 91 | merchant_currency => 'jpy', | ||
| 92 | merchant_data => $merchant_data_object, | ||
| 93 | metadata => { transaction_id => 123 }, | ||
| 94 | type => 'capture', | ||
| 95 | }, | ||
| 96 | ], | ||
| 97 | card => $card_object, | ||
| 98 | cardholder => $cardholder_object, | ||
| 99 | created => '2020-04-12T04:07:30', | ||
| 100 | held_amount => 2000, | ||
| 101 | held_currency => 'jpy', | ||
| 102 | is_held_amount_controllable => $stripe->true, | ||
| 103 | merchant_data => $merchant_data_object, | ||
| 104 | metadata => { transaction_id => 123 }, | ||
| 105 | pending_authorized_amount => 2000, | ||
| 106 | pending_held_amount => 2000, | ||
| 107 | request_history => [ $request_history_obj1, $request_history_obj2 ], | ||
| 108 | status => 'pending', | ||
| 109 | transactions => [ $transactions_obj1, $transactions_obj2, $transactions_obj3 ], | ||
| 110 | verification_data => $verification_data_object, | ||
| 111 | wallet_provider => undef, | ||
| 112 | }); | ||
| 113 | |||
| 114 | See documentation in L<Net::API::Stripe> for example to make api calls to Stripe to create those objects. | ||
| 115 | |||
| 116 | =head1 VERSION | ||
| 117 | |||
| 118 | v0.100.0 | ||
| 119 | |||
| 120 | =head1 DESCRIPTION | ||
| 121 | |||
| 122 | When an issued card is used to make a purchase, an Issuing Authorization object is created. Authorisations (L<https://stripe.com/docs/issuing/authorizations>) must be approved for the purchase to be completed successfully. | ||
| 123 | |||
| 124 | =head1 CONSTRUCTOR | ||
| 125 | |||
| 126 | =over 4 | ||
| 127 | |||
| 128 | =item B<new>( %ARG ) | ||
| 129 | |||
| 130 | Creates a new L<Net::API::Stripe::Issuing::Authorization> object. | ||
| 131 | |||
| 132 | =back | ||
| 133 | |||
| 134 | =head1 METHODS | ||
| 135 | |||
| 136 | =over 4 | ||
| 137 | |||
| 138 | =item B<id> string | ||
| 139 | |||
| 140 | Unique identifier for the object. | ||
| 141 | |||
| 142 | =item B<object> string, value is "issuing.authorization" | ||
| 143 | |||
| 144 | String representing the object’s type. Objects of the same type share the same value. | ||
| 145 | |||
| 146 | =item B<approved> boolean | ||
| 147 | |||
| 148 | Whether the authorization has been approved. | ||
| 149 | |||
| 150 | =item B<authorization_method> string | ||
| 151 | |||
| 152 | How the card details were provided. One of chip, contactless, keyed_in, online, or swipe. | ||
| 153 | |||
| 154 | =item B<authorized_amount> integer | ||
| 155 | |||
| 156 | The amount that has been authorized. This will be 0 when the object is created, and increase after it has been approved. | ||
| 157 | |||
| 158 | =item B<authorized_currency> currency | ||
| 159 | |||
| 160 | The currency that was presented to the cardholder for the authorization. Three-letter ISO currency code, in lowercase. Must be a supported currency. | ||
| 161 | |||
| 162 | =item B<balance_transactions> array, contains: balance_transaction object | ||
| 163 | |||
| 164 | This is an array of L<Net::API::Stripe::Balance::Transaction> objects. | ||
| 165 | |||
| 166 | =item B<card> hash | ||
| 167 | |||
| 168 | This is a L<Net::API::Stripe::Issuing::Card> object. | ||
| 169 | |||
| 170 | =item B<cardholder> string (expandable) | ||
| 171 | |||
| 172 | The cardholder to whom this authorization belongs. | ||
| 173 | |||
| 174 | When expanded, this is a L<Net::API::Stripe::Issuing::Card::Holder> object. | ||
| 175 | |||
| 176 | =item B<created> timestamp | ||
| 177 | |||
| 178 | Time at which the object was created. Measured in seconds since the Unix epoch. | ||
| 179 | |||
| 180 | =item B<held_amount> integer | ||
| 181 | |||
| 182 | The amount the authorization is expected to be in held_currency. When Stripe holds funds from you, this is the amount reserved for the authorization. This will be 0 when the object is created, and increase after it has been approved. For multi-currency transactions, held_amount can be used to determine the expected exchange rate. | ||
| 183 | |||
| 184 | =item B<held_currency> currency | ||
| 185 | |||
| 186 | The currency of the held amount. This will always be the card currency. | ||
| 187 | |||
| 188 | =item B<is_held_amount_controllable> boolean | ||
| 189 | |||
| 190 | =item B<livemode> boolean | ||
| 191 | |||
| 192 | Has the value true if the object exists in live mode or the value false if the object exists in test mode. | ||
| 193 | |||
| 194 | =item B<merchant_data> hash | ||
| 195 | |||
| 196 | This is a L<Net::API::Stripe::Issuing::MerchantData> object. | ||
| 197 | |||
| 198 | =item B<metadata> hash | ||
| 199 | |||
| 200 | Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. | ||
| 201 | |||
| 202 | =item B<pending_authorized_amount> integer | ||
| 203 | |||
| 204 | The amount the user is requesting to be authorized. This field will only be non-zero during an issuing.authorization.request webhook. | ||
| 205 | |||
| 206 | =item B<pending_held_amount> integer | ||
| 207 | |||
| 208 | The additional amount Stripe will hold if the authorization is approved. This field will only be non-zero during an issuing.authorization.request webhook. | ||
| 209 | |||
| 210 | =item B<request_history> array of hashes | ||
| 211 | |||
| 212 | This is an array of L<Net::API::Stripe::Issuing::Authorization::RequestHistory> objects. | ||
| 213 | |||
| 214 | =item B<status> string | ||
| 215 | |||
| 216 | One of pending, reversed, or closed. | ||
| 217 | |||
| 218 | =item B<transactions> array of hashes | ||
| 219 | |||
| 220 | This is an array of L<Net::API::Stripe::Issuing::Authorization::Transaction> objects. | ||
| 221 | |||
| 222 | =item B<verification_data> hash | ||
| 223 | |||
| 224 | This is a L<Net::API::Stripe::Issuing::Authorization::VerificationData> object. | ||
| 225 | |||
| 226 | =item B<wallet_provider> string | ||
| 227 | |||
| 228 | What, if any, digital wallet was used for this authorization. One of apple_pay, google_pay, or samsung_pay. | ||
| 229 | |||
| 230 | =back | ||
| 231 | |||
| 232 | =head1 API SAMPLE | ||
| 233 | |||
| 234 | { | ||
| 235 | "id": "iauth_fake123456789", | ||
| 236 | "object": "issuing.authorization", | ||
| 237 | "approved": true, | ||
| 238 | "authorization_method": "online", | ||
| 239 | "authorized_amount": 500, | ||
| 240 | "authorized_currency": "usd", | ||
| 241 | "balance_transactions": [], | ||
| 242 | "card": null, | ||
| 243 | "cardholder": null, | ||
| 244 | "created": 1540642827, | ||
| 245 | "held_amount": 0, | ||
| 246 | "held_currency": "usd", | ||
| 247 | "is_held_amount_controllable": false, | ||
| 248 | "livemode": false, | ||
| 249 | "merchant_data": { | ||
| 250 | "category": "taxicabs_limousines", | ||
| 251 | "city": "San Francisco", | ||
| 252 | "country": "US", | ||
| 253 | "name": "Rocket Rides", | ||
| 254 | "network_id": "1234567890", | ||
| 255 | "postal_code": "94107", | ||
| 256 | "state": "CA", | ||
| 257 | "url": null | ||
| 258 | }, | ||
| 259 | "metadata": {}, | ||
| 260 | "pending_authorized_amount": 0, | ||
| 261 | "pending_held_amount": 0, | ||
| 262 | "request_history": [], | ||
| 263 | "status": "reversed", | ||
| 264 | "transactions": [ | ||
| 265 | { | ||
| 266 | "id": "ipi_fake123456789", | ||
| 267 | "object": "issuing.transaction", | ||
| 268 | "amount": -100, | ||
| 269 | "authorization": "iauth_fake123456789", | ||
| 270 | "balance_transaction": null, | ||
| 271 | "card": "ic_fake123456789", | ||
| 272 | "cardholder": null, | ||
| 273 | "created": 1540642827, | ||
| 274 | "currency": "usd", | ||
| 275 | "dispute": null, | ||
| 276 | "livemode": false, | ||
| 277 | "merchant_amount": null, | ||
| 278 | "merchant_currency": null, | ||
| 279 | "merchant_data": { | ||
| 280 | "category": "taxicabs_limousines", | ||
| 281 | "city": "San Francisco", | ||
| 282 | "country": "US", | ||
| 283 | "name": "Rocket Rides", | ||
| 284 | "network_id": "1234567890", | ||
| 285 | "postal_code": "94107", | ||
| 286 | "state": "CA", | ||
| 287 | "url": null | ||
| 288 | }, | ||
| 289 | "metadata": {}, | ||
| 290 | "type": "capture" | ||
| 291 | }, | ||
| 292 | { | ||
| 293 | "id": "ipi_fake123456789", | ||
| 294 | "object": "issuing.transaction", | ||
| 295 | "amount": -100, | ||
| 296 | "authorization": "iauth_fake123456789", | ||
| 297 | "balance_transaction": null, | ||
| 298 | "card": "ic_fake123456789", | ||
| 299 | "cardholder": null, | ||
| 300 | "created": 1540642827, | ||
| 301 | "currency": "usd", | ||
| 302 | "dispute": null, | ||
| 303 | "livemode": false, | ||
| 304 | "merchant_amount": null, | ||
| 305 | "merchant_currency": null, | ||
| 306 | "merchant_data": { | ||
| 307 | "category": "taxicabs_limousines", | ||
| 308 | "city": "San Francisco", | ||
| 309 | "country": "US", | ||
| 310 | "name": "Rocket Rides", | ||
| 311 | "network_id": "1234567890", | ||
| 312 | "postal_code": "94107", | ||
| 313 | "state": "CA", | ||
| 314 | "url": null | ||
| 315 | }, | ||
| 316 | "metadata": {}, | ||
| 317 | "type": "capture" | ||
| 318 | } | ||
| 319 | ], | ||
| 320 | "verification_data": { | ||
| 321 | "address_line1_check": "not_provided", | ||
| 322 | "address_zip_check": "match", | ||
| 323 | "authentication": "none", | ||
| 324 | "cvc_check": "match" | ||
| 325 | }, | ||
| 326 | "wallet_provider": null | ||
| 327 | } | ||
| 328 | |||
| 329 | =head1 HISTORY | ||
| 330 | |||
| 331 | =head2 v0.1 | ||
| 332 | |||
| 333 | Initial version | ||
| 334 | |||
| 335 | =head1 AUTHOR | ||
| 336 | |||
| 337 | Jacques Deguest E<lt>F<jack@deguest.jp>E<gt> | ||
| 338 | |||
| 339 | =head1 SEE ALSO | ||
| 340 | |||
| 341 | Stripe API documentation: | ||
| 342 | |||
| 343 | L<https://stripe.com/docs/api/issuing/authorizations>, L<https://stripe.com/docs/issuing/authorizations> | ||
| 344 | |||
| 345 | =head1 COPYRIGHT & LICENSE | ||
| 346 | |||
| 347 | Copyright (c) 2019-2020 DEGUEST Pte. Ltd. | ||
| 348 | |||
| 349 | You can use, copy, modify and redistribute this package and associated | ||
| 350 | files under the same terms as Perl itself. | ||
| 351 | |||
| 352 | =cut | ||