| 1 | package Business::Giropay::Response::Status; | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | Business::Giropay::Response::Status - response object for L<Business::Giropay::Request::Status> | ||
| 6 | |||
| 7 | =cut | ||
| 8 | |||
| 9 | use Business::Giropay::Types qw/Int Maybe Str/; | ||
| 10 | use Moo; | ||
| 11 | with 'Business::Giropay::Role::Response'; | ||
| 12 | use namespace::clean; | ||
| 13 | |||
| 14 | =head1 ATTRIBUTES | ||
| 15 | |||
| 16 | See L<Business::Giropay::Role::Response/ATTRIBUTES> for attributes common to | ||
| 17 | all request classes. | ||
| 18 | |||
| 19 | =head2 reference | ||
| 20 | |||
| 21 | Unique GiroCheckout transaction ID. | ||
| 22 | |||
| 23 | =cut | ||
| 24 | |||
| 25 | has reference => ( | ||
| 26 | is => 'lazy', | ||
| 27 | isa => Maybe [Str], | ||
| 28 | init_arg => undef, | ||
| 29 | ); | ||
| 30 | |||
| 31 | sub _build_reference { | ||
| 32 | shift->data->{reference}; | ||
| 33 | } | ||
| 34 | |||
| 35 | =head2 backendTxId | ||
| 36 | |||
| 37 | Payment processor transaction id | ||
| 38 | |||
| 39 | =cut | ||
| 40 | |||
| 41 | has backendTxId => ( | ||
| 42 | is => 'lazy', | ||
| 43 | isa => Maybe [Str], | ||
| 44 | init_arg => undef, | ||
| 45 | ); | ||
| 46 | |||
| 47 | sub _build_backendTxId { | ||
| 48 | shift->data->{backendTxId}; | ||
| 49 | } | ||
| 50 | |||
| 51 | =head2 amount | ||
| 52 | |||
| 53 | If a decimal currency is used, the amount is in the smallest unit of value, | ||
| 54 | eg. Cent, Penny. | ||
| 55 | |||
| 56 | =cut | ||
| 57 | |||
| 58 | has amount => ( | ||
| 59 | is => 'lazy', | ||
| 60 | isa => Maybe [Str], | ||
| 61 | init_arg => undef, | ||
| 62 | ); | ||
| 63 | |||
| 64 | sub _build_amount { | ||
| 65 | shift->data->{amount}; | ||
| 66 | } | ||
| 67 | |||
| 68 | =head2 currency | ||
| 69 | |||
| 70 | currency | ||
| 71 | |||
| 72 | =cut | ||
| 73 | |||
| 74 | has currency => ( | ||
| 75 | is => 'lazy', | ||
| 76 | isa => Maybe [Str], | ||
| 77 | init_arg => undef, | ||
| 78 | ); | ||
| 79 | |||
| 80 | sub _build_currency { | ||
| 81 | shift->data->{currency}; | ||
| 82 | } | ||
| 83 | |||
| 84 | =head2 resultPayment | ||
| 85 | |||
| 86 | Payment result code. | ||
| 87 | |||
| 88 | =cut | ||
| 89 | |||
| 90 | has resultPayment => ( | ||
| 91 | is => 'lazy', | ||
| 92 | isa => Maybe [Str], | ||
| 93 | init_arg => undef, | ||
| 94 | ); | ||
| 95 | |||
| 96 | sub _build_resultPayment { | ||
| 97 | shift->data->{resultPayment}; | ||
| 98 | } | ||
| 99 | |||
| 100 | =head2 resultAVS | ||
| 101 | |||
| 102 | Result of the age verification (in case of a giropay-ID transaction). | ||
| 103 | |||
| 104 | =cut | ||
| 105 | |||
| 106 | has resultAVS => ( | ||
| 107 | is => 'lazy', | ||
| 108 | isa => Maybe [Int], | ||
| 109 | init_arg => undef, | ||
| 110 | ); | ||
| 111 | |||
| 112 | sub _build_resultAVS { | ||
| 113 | shift->data->{resultAVS}; | ||
| 114 | } | ||
| 115 | |||
| 116 | =head2 obvName | ||
| 117 | |||
| 118 | Optional adjustable field, which includes the name of the person who has to be verified (in case of a giropay-ID transaction). | ||
| 119 | |||
| 120 | |||
| 121 | =cut | ||
| 122 | |||
| 123 | has obvName => ( | ||
| 124 | is => 'lazy', | ||
| 125 | isa => Maybe [Str], | ||
| 126 | init_arg => undef, | ||
| 127 | ); | ||
| 128 | |||
| 129 | sub _build_obvName { | ||
| 130 | shift->data->{obvName}; | ||
| 131 | } | ||
| 132 | |||
| 133 | =head1 METHODS | ||
| 134 | |||
| 135 | See L<Business::Giropay::Role::Response/METHODS> for methods in addition to | ||
| 136 | the following: | ||
| 137 | |||
| 138 | =head2 has_bic $bic_code | ||
| 139 | |||
| 140 | Returns true if C<$bic_code> exists as a key in L</issuers>. | ||
| 141 | |||
| 142 | =cut | ||
| 143 | |||
| 144 | sub has_bic { | ||
| 145 | my ( $self, $bic ) = @_; | ||
| 146 | exists $self->issuers->{$bic} ? 1 : 0; | ||
| 147 | } | ||
| 148 | |||
| 149 | 1; |