| 1 | ##---------------------------------------------------------------------------- | ||
| 2 | ## Stripe API - ~/lib/Net/API/Stripe/Checkout/Item.pm | ||
| 3 | ## Version v0.200.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 | package Net::API::Stripe::Checkout::Item; | ||
| 11 | BEGIN | ||
| 12 | { | ||
| 13 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | 1 | ▶ | use parent qw( Net::API::Stripe::Generic ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | 1 | ▶ | our( $VERSION ) = 'v0.200.0'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 16 | }; | ||
| 17 | |||
| 18 | 0 | ▶ | sub amount { return( shift->_set_get_number( 'amount', @_ ) ); } |
|
Subroutine
amount: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 19 | |||
| 20 | 0 | ▶ | sub currency { return( shift->_set_get_scalar( 'currency', @_ ) ); } |
|
Subroutine
currency: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 21 | |||
| 22 | 0 | ▶ | sub custom { return( shift->_set_get_hash( 'custom', @_ ) ); } |
|
Subroutine
custom: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 23 | |||
| 24 | 0 | ▶ | sub description { return( shift->_set_get_scalar( 'description', @_ ) ); } |
|
Subroutine
description: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 25 | |||
| 26 | 0 | ▶ | sub images { return( shift->_set_get_array( 'images', @_ ) ); } |
|
Subroutine
images: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 27 | |||
| 28 | 0 | ▶ | sub name { return( shift->_set_get_scalar( 'name', @_ ) ); } |
|
Subroutine
name: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 29 | |||
| 30 | 0 | ▶ | sub plan { return( shift->_set_get_object( 'plan', 'Net::API::Stripe::Billing::Plan', @_ ) ); } |
|
Subroutine
plan: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 31 | |||
| 32 | 0 | ▶ | sub quantity { return( shift->_set_get_number( 'quantity', @_ ) ); } |
|
Subroutine
quantity: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 33 | |||
| 34 | 0 | ▶ | sub sku { return( shift->_set_get_object( 'sku', 'Net::API::Stripe::Order::SKU', @_ ) ); } |
|
Subroutine
sku: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 35 | |||
| 36 | 0 | ▶ | sub type { return( shift->_set_get_scalar( 'type', @_ ) ); } |
|
Subroutine
type: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 37 | |||
| 38 | 1 | 1; | |
| 39 | |||
| 40 | __END__ | ||
| 41 | |||
| 42 | =encoding utf8 | ||
| 43 | |||
| 44 | =head1 NAME | ||
| 45 | |||
| 46 | Net::API::Stripe::Checkout::Item - A Stripe Checkout Item | ||
| 47 | |||
| 48 | =head1 SYNOPSIS | ||
| 49 | |||
| 50 | my $item = $stripe->session->display_items([ | ||
| 51 | { | ||
| 52 | amount => 2000, | ||
| 53 | currency => 'jpy', | ||
| 54 | description => 'Some item', | ||
| 55 | name => 'Session item', | ||
| 56 | plan => $plan_object, | ||
| 57 | quantity => 1, | ||
| 58 | type => 'plan', | ||
| 59 | }]); | ||
| 60 | |||
| 61 | =head1 VERSION | ||
| 62 | |||
| 63 | v0.200.0 | ||
| 64 | |||
| 65 | =head1 DESCRIPTION | ||
| 66 | |||
| 67 | The line items, plans, or SKUs purchased by the customer. | ||
| 68 | |||
| 69 | This is part of the L<Net::API::Stripe::Checkout::Session> object an called from the method B<display_items> | ||
| 70 | |||
| 71 | =head1 CONSTRUCTOR | ||
| 72 | |||
| 73 | =over 4 | ||
| 74 | |||
| 75 | =item B<new>( %ARG ) | ||
| 76 | |||
| 77 | Creates a new L<Net::API::Stripe::Checkout::Item> object. | ||
| 78 | It may also take an hash like arguments, that also are method of the same name. | ||
| 79 | |||
| 80 | =back | ||
| 81 | |||
| 82 | =head1 METHODS | ||
| 83 | |||
| 84 | =over 4 | ||
| 85 | |||
| 86 | =item B<amount> integer | ||
| 87 | |||
| 88 | Amount for the display item. | ||
| 89 | |||
| 90 | =item B<currency> currency | ||
| 91 | |||
| 92 | Three-letter ISO currency code, in lowercase. Must be a supported currency. | ||
| 93 | |||
| 94 | =item B<custom> hash | ||
| 95 | |||
| 96 | =over 8 | ||
| 97 | |||
| 98 | =item I<description> string | ||
| 99 | |||
| 100 | The description of the line item. | ||
| 101 | |||
| 102 | =item I<images> array containing strings | ||
| 103 | |||
| 104 | The images of the line item. | ||
| 105 | |||
| 106 | =item I<name> string | ||
| 107 | |||
| 108 | The name of the line item. | ||
| 109 | |||
| 110 | =back | ||
| 111 | |||
| 112 | =item B<description> string | ||
| 113 | |||
| 114 | The description for the line item. This is used in session checkout I<line_items>. | ||
| 115 | |||
| 116 | =item B<images> string | ||
| 117 | |||
| 118 | A list of images representing this line item. This is used in session checkout I<line_items>. | ||
| 119 | |||
| 120 | =item B<name> string | ||
| 121 | |||
| 122 | The name for the line item. This is used in session checkout I<line_items>. | ||
| 123 | |||
| 124 | =item B<plan> hash, plan object | ||
| 125 | |||
| 126 | This is a L<Net::API::Stripe::Billing::Plan> object. | ||
| 127 | |||
| 128 | =item B<quantity> integer | ||
| 129 | |||
| 130 | Quantity of the display item being purchased. | ||
| 131 | |||
| 132 | =item B<sku> hash, sku object | ||
| 133 | |||
| 134 | This is a L<Net::API::Stripe::Order::SKU> object. | ||
| 135 | |||
| 136 | =item B<type> string | ||
| 137 | |||
| 138 | The type of display item. One of custom, plan or sku | ||
| 139 | |||
| 140 | =back | ||
| 141 | |||
| 142 | =head1 API SAMPLE | ||
| 143 | |||
| 144 | { | ||
| 145 | "id": "ppage_fake123456789", | ||
| 146 | "object": "checkout.session", | ||
| 147 | "billing_address_collection": null, | ||
| 148 | "cancel_url": "https://example.com/cancel", | ||
| 149 | "client_reference_id": null, | ||
| 150 | "customer": null, | ||
| 151 | "customer_email": null, | ||
| 152 | "display_items": [ | ||
| 153 | { | ||
| 154 | "amount": 1500, | ||
| 155 | "currency": "usd", | ||
| 156 | "custom": { | ||
| 157 | "description": "Comfortable cotton t-shirt", | ||
| 158 | "images": null, | ||
| 159 | "name": "T-shirt" | ||
| 160 | }, | ||
| 161 | "quantity": 2, | ||
| 162 | "type": "custom" | ||
| 163 | } | ||
| 164 | ], | ||
| 165 | "livemode": false, | ||
| 166 | "locale": null, | ||
| 167 | "mode": null, | ||
| 168 | "payment_intent": "pi_fake123456789", | ||
| 169 | "payment_method_types": [ | ||
| 170 | "card" | ||
| 171 | ], | ||
| 172 | "setup_intent": null, | ||
| 173 | "submit_type": null, | ||
| 174 | "subscription": null, | ||
| 175 | "success_url": "https://example.com/success", | ||
| 176 | "line_items": [ | ||
| 177 | { | ||
| 178 | "name": "T-shirt", | ||
| 179 | "description": "Comfortable cotton t-shirt", | ||
| 180 | "amount": 1500, | ||
| 181 | "currency": "jpy", | ||
| 182 | "quantity": 2 | ||
| 183 | } | ||
| 184 | ] | ||
| 185 | } | ||
| 186 | |||
| 187 | =head1 HISTORY | ||
| 188 | |||
| 189 | =head2 v0.1 | ||
| 190 | |||
| 191 | Initial version | ||
| 192 | |||
| 193 | =head1 AUTHOR | ||
| 194 | |||
| 195 | Jacques Deguest E<lt>F<jack@deguest.jp>E<gt> | ||
| 196 | |||
| 197 | =head1 SEE ALSO | ||
| 198 | |||
| 199 | Stripe API documentation: | ||
| 200 | |||
| 201 | L<https://stripe.com/docs/api> | ||
| 202 | |||
| 203 | =head1 COPYRIGHT & LICENSE | ||
| 204 | |||
| 205 | Copyright (c) 2019-2020 DEGUEST Pte. Ltd. | ||
| 206 | |||
| 207 | You can use, copy, modify and redistribute this package and associated | ||
| 208 | files under the same terms as Perl itself. | ||
| 209 | |||
| 210 | =cut | ||
| 211 | |||