« lib/WebService/Braintree/_/AndroidPayCard.pm
↑ Summary
lib/WebService/Braintree/_/Subscription.pm »
| 1 | # vim: sw=4 ts=4 ft=perl | ||
| 2 | |||
| 3 | package WebService::Braintree::_::ApplePayCard; | ||
| 4 | 22 | $WebService::Braintree::_::ApplePayCard::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::_::ApplePayCard | ||
| 11 | |||
| 12 | =head1 PURPOSE | ||
| 13 | |||
| 14 | This class represents a ApplePay card. | ||
| 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 | 22 | ▶ | use Types::Standard qw(ArrayRef); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 26 | 22 | ▶ | use WebService::Braintree::Types qw( |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 27 | Subscription | ||
| 28 | 22 | ); | |
| 29 | |||
| 30 | # Why is this here? | ||
| 31 | 22 | ▶ | use WebService::Braintree::ApplePayCard::CardType; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 32 | |||
| 33 | =head1 ATTRIBUTES | ||
| 34 | |||
| 35 | =cut | ||
| 36 | |||
| 37 | =head2 bin() | ||
| 38 | |||
| 39 | This returns the card's bin. | ||
| 40 | |||
| 41 | =cut | ||
| 42 | |||
| 43 | 22 | has bin => ( | |
| 44 | is => 'ro', | ||
| 45 | ); | ||
| 46 | |||
| 47 | =head2 card_type() | ||
| 48 | |||
| 49 | This returns the card's type. | ||
| 50 | |||
| 51 | =cut | ||
| 52 | |||
| 53 | 22 | has card_type => ( | |
| 54 | is => 'ro', | ||
| 55 | ); | ||
| 56 | |||
| 57 | =head2 created_at() | ||
| 58 | |||
| 59 | This returns when this card was created. | ||
| 60 | |||
| 61 | =cut | ||
| 62 | |||
| 63 | 22 | has created_at => ( | |
| 64 | is => 'ro', | ||
| 65 | ); | ||
| 66 | |||
| 67 | =head2 customer_id() | ||
| 68 | |||
| 69 | This returns the card's customer ID. | ||
| 70 | |||
| 71 | =cut | ||
| 72 | |||
| 73 | 22 | has customer_id => ( | |
| 74 | is => 'ro', | ||
| 75 | ); | ||
| 76 | |||
| 77 | =head2 default() | ||
| 78 | |||
| 79 | This returns if this card is default. | ||
| 80 | |||
| 81 | C<< is_default() >> is an alias for this attribute. | ||
| 82 | |||
| 83 | =cut | ||
| 84 | |||
| 85 | 22 | has default => ( | |
| 86 | is => 'ro', | ||
| 87 | alias => 'is_default', | ||
| 88 | ); | ||
| 89 | |||
| 90 | =head2 expiration_month() | ||
| 91 | |||
| 92 | This returns the card's expiration month. | ||
| 93 | |||
| 94 | =cut | ||
| 95 | |||
| 96 | 22 | has expiration_month => ( | |
| 97 | is => 'ro', | ||
| 98 | ); | ||
| 99 | |||
| 100 | =head2 expiration_year() | ||
| 101 | |||
| 102 | This returns the card's expiration year. | ||
| 103 | |||
| 104 | =cut | ||
| 105 | |||
| 106 | 22 | has expiration_year => ( | |
| 107 | is => 'ro', | ||
| 108 | ); | ||
| 109 | |||
| 110 | =head2 expired() | ||
| 111 | |||
| 112 | This returns if this card is expired. | ||
| 113 | |||
| 114 | C<< is_expired() >> is an alias for this attribute. | ||
| 115 | |||
| 116 | =cut | ||
| 117 | |||
| 118 | 22 | has expired => ( | |
| 119 | is => 'ro', | ||
| 120 | alias => 'is_expired', | ||
| 121 | ); | ||
| 122 | |||
| 123 | =head2 image_url() | ||
| 124 | |||
| 125 | This returns the card's image URL. | ||
| 126 | |||
| 127 | =cut | ||
| 128 | |||
| 129 | 22 | has image_url => ( | |
| 130 | is => 'ro', | ||
| 131 | ); | ||
| 132 | |||
| 133 | =head2 last_4() | ||
| 134 | |||
| 135 | This returns the card's last-4. | ||
| 136 | |||
| 137 | =cut | ||
| 138 | |||
| 139 | 22 | has last_4 => ( | |
| 140 | is => 'ro', | ||
| 141 | ); | ||
| 142 | |||
| 143 | =head2 payment_instrument_name() | ||
| 144 | |||
| 145 | This returns the card's payment instrument name. | ||
| 146 | |||
| 147 | =cut | ||
| 148 | |||
| 149 | 22 | has payment_instrument_name => ( | |
| 150 | is => 'ro', | ||
| 151 | ); | ||
| 152 | |||
| 153 | =head2 source_description() | ||
| 154 | |||
| 155 | This returns the card's source description. | ||
| 156 | |||
| 157 | =cut | ||
| 158 | |||
| 159 | 22 | has source_description => ( | |
| 160 | is => 'ro', | ||
| 161 | ); | ||
| 162 | |||
| 163 | =head2 subscriptions() | ||
| 164 | |||
| 165 | This returns the card's subscriptions. This will be an arrayref of | ||
| 166 | L<subscriptions|WebService::Braintree::_::Subscription/>. | ||
| 167 | |||
| 168 | =cut | ||
| 169 | |||
| 170 | 22 | has subscriptions => ( | |
| 171 | is => 'ro', | ||
| 172 | isa => ArrayRef[Subscription], | ||
| 173 | coerce => 1, | ||
| 174 | ); | ||
| 175 | |||
| 176 | =head2 token() | ||
| 177 | |||
| 178 | This returns the card's token. | ||
| 179 | |||
| 180 | =cut | ||
| 181 | |||
| 182 | 22 | has token => ( | |
| 183 | is => 'ro', | ||
| 184 | ); | ||
| 185 | |||
| 186 | =head2 updated_at() | ||
| 187 | |||
| 188 | This returns when this card was last updated. | ||
| 189 | |||
| 190 | =cut | ||
| 191 | |||
| 192 | 22 | has updated_at => ( | |
| 193 | is => 'ro', | ||
| 194 | ); | ||
| 195 | |||
| 196 | =head1 METHODS | ||
| 197 | |||
| 198 | =head2 expiration_date() | ||
| 199 | |||
| 200 | This returns this card's expiration date in MM/YYYY format. | ||
| 201 | |||
| 202 | =cut | ||
| 203 | |||
| 204 | 0 | ▶ | sub expiration_date { |
|
Subroutine
expiration_date: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 205 | 0 | my $self = shift; | |
| 206 | 0 | return $self->expiration_month . "/" . $self->expiration_year; | |
| 207 | } | ||
| 208 | |||
| 209 | 22 | __PACKAGE__->meta->make_immutable; | |
| 210 | |||
| 211 | 22 | 1; | |
| 212 | __END__ | ||