| 1 | # vim: sw=4 ts=4 ft=perl | ||
| 2 | |||
| 3 | package WebService::Braintree::_::Discount; | ||
| 4 | 22 | $WebService::Braintree::_::Discount::VERSION = '1.7'; | |
| 5 | 22 | ▶ | use 5.010_001; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 22 | ▶ | use strictures 1; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | =head1 NAME | ||
| 9 | |||
| 10 | WebService::Braintree::_::Discount | ||
| 11 | |||
| 12 | =head1 PURPOSE | ||
| 13 | |||
| 14 | This class represents a discount. | ||
| 15 | |||
| 16 | This class will only be created as part of a L<response|WebService::Braintree::Result> or L<error response|WebService::Braintree::ErrorResult>. | ||
| 17 | |||
| 18 | =cut | ||
| 19 | |||
| 20 | 22 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 21 | 22 | ▶ | use MooX::Aliases; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 22 | |||
| 23 | 22 | extends 'WebService::Braintree::_'; | |
| 24 | |||
| 25 | =head1 METHODS | ||
| 26 | |||
| 27 | =cut | ||
| 28 | |||
| 29 | =head2 amount() | ||
| 30 | |||
| 31 | This is the amount for this discount. | ||
| 32 | |||
| 33 | =cut | ||
| 34 | |||
| 35 | 22 | has amount => ( | |
| 36 | is => 'ro', | ||
| 37 | ); | ||
| 38 | |||
| 39 | =head2 created_at() | ||
| 40 | |||
| 41 | This is when this discount was created. | ||
| 42 | |||
| 43 | =cut | ||
| 44 | |||
| 45 | # Coerce this to Datetime | ||
| 46 | 22 | has created_at => ( | |
| 47 | is => 'ro', | ||
| 48 | ); | ||
| 49 | |||
| 50 | =head2 current_billing_cycle() | ||
| 51 | |||
| 52 | TODO | ||
| 53 | |||
| 54 | =cut | ||
| 55 | |||
| 56 | 22 | has current_billing_cycle => ( | |
| 57 | is => 'ro', | ||
| 58 | ); | ||
| 59 | |||
| 60 | =head2 description() | ||
| 61 | |||
| 62 | The description provided when creating the discount. | ||
| 63 | |||
| 64 | =cut | ||
| 65 | |||
| 66 | 22 | has description => ( | |
| 67 | is => 'ro', | ||
| 68 | ); | ||
| 69 | |||
| 70 | =head2 id() | ||
| 71 | |||
| 72 | The id of the discount. | ||
| 73 | |||
| 74 | =cut | ||
| 75 | |||
| 76 | 22 | has id => ( | |
| 77 | is => 'ro', | ||
| 78 | ); | ||
| 79 | |||
| 80 | =head2 kind() | ||
| 81 | |||
| 82 | The kind of the discount. | ||
| 83 | |||
| 84 | =cut | ||
| 85 | |||
| 86 | 22 | has kind => ( | |
| 87 | is => 'ro', | ||
| 88 | ); | ||
| 89 | |||
| 90 | =head2 merchant_id() | ||
| 91 | |||
| 92 | The merchant_id of the discount. | ||
| 93 | |||
| 94 | =cut | ||
| 95 | |||
| 96 | 22 | has merchant_id => ( | |
| 97 | is => 'ro', | ||
| 98 | ); | ||
| 99 | |||
| 100 | =head2 name() | ||
| 101 | |||
| 102 | The name provided when creating the discount. If one was not provided, then | ||
| 103 | Braintree generated one. | ||
| 104 | |||
| 105 | =cut | ||
| 106 | |||
| 107 | 22 | has name => ( | |
| 108 | is => 'ro', | ||
| 109 | ); | ||
| 110 | |||
| 111 | =head2 never_expires() | ||
| 112 | |||
| 113 | The name provided when creating the discount. If one was not provided, then | ||
| 114 | Braintree generated one. | ||
| 115 | |||
| 116 | C<< is_never_expires >> is an alias. | ||
| 117 | |||
| 118 | =cut | ||
| 119 | |||
| 120 | # Coerce this to Boolean. | ||
| 121 | 22 | has never_expires => ( | |
| 122 | is => 'ro', | ||
| 123 | alias => 'is_never_expires', | ||
| 124 | ); | ||
| 125 | |||
| 126 | =head2 number_of_billing_cycles() | ||
| 127 | |||
| 128 | This is the number of billing cycles in the discount. | ||
| 129 | |||
| 130 | =cut | ||
| 131 | |||
| 132 | # Coerce this to Int. | ||
| 133 | 22 | has number_of_billing_cycles => ( | |
| 134 | is => 'ro', | ||
| 135 | ); | ||
| 136 | |||
| 137 | =head2 quantity() | ||
| 138 | |||
| 139 | This is the quanty of the discount. | ||
| 140 | |||
| 141 | =cut | ||
| 142 | |||
| 143 | # Coerce this to Int. | ||
| 144 | 22 | has quantity => ( | |
| 145 | is => 'ro', | ||
| 146 | ); | ||
| 147 | |||
| 148 | =head2 updated_at() | ||
| 149 | |||
| 150 | This is when this discount was last updated. If it has never been updated, | ||
| 151 | then this should equal the L<created_at|/created_at> date. | ||
| 152 | |||
| 153 | =cut | ||
| 154 | |||
| 155 | # Coerce this to Datetime | ||
| 156 | 22 | has updated_at => ( | |
| 157 | is => 'ro', | ||
| 158 | ); | ||
| 159 | |||
| 160 | 22 | __PACKAGE__->meta->make_immutable; | |
| 161 | |||
| 162 | 22 | 1; | |
| 163 | __END__ | ||