| 1 | package Business::OnlinePayment::Iridium; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use Moose; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use aliased 'Business::OnlinePayment::Iridium::Action::GetGatewayEntryPoints'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 1 | ▶ | use aliased 'Business::OnlinePayment::Iridium::Action::GetCardType'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 1 | ▶ | use aliased 'Business::OnlinePayment::Iridium::Action::CardDetailsTransaction'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | use aliased | ||||||||||||||||||||||||||||
| 10 | 1 | ▶ | 'Business::OnlinePayment::Iridium::Action::CrossReferenceTransaction'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | use aliased | ||||||||||||||||||||||||||||
| 12 | 1 | ▶ | 'Business::OnlinePayment::Iridium::Action::ThreeDSecureAuthentication'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | 1 | ▶ | use Carp qw/carp croak/; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 1 | our $VERSION = '1.03'; # VERSION: generated by DZP::OurPkgVersion | |||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 0 | ▶ | sub FIELD_MAP { | ||||||||||||||||||||||||||
|
Subroutine
FIELD_MAP: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 19 | return ( | ||||||||||||||||||||||||||||
| 20 | 0 | 'login' => 'MerchantID', | |||||||||||||||||||||||||||
| 21 | 'password' => 'Password', | ||||||||||||||||||||||||||||
| 22 | 'card_number' => 'CardNumber', | ||||||||||||||||||||||||||||
| 23 | 'name_on_card' => 'CardName', | ||||||||||||||||||||||||||||
| 24 | 'cv2' => 'CV2', | ||||||||||||||||||||||||||||
| 25 | 'issue_number' => 'IssueNumber', | ||||||||||||||||||||||||||||
| 26 | 'amount' => 'Amount', | ||||||||||||||||||||||||||||
| 27 | 'invoice_number' => 'OrderID', | ||||||||||||||||||||||||||||
| 28 | 'description' => 'OrderDescription', | ||||||||||||||||||||||||||||
| 29 | 'action' => 'TransactionType', | ||||||||||||||||||||||||||||
| 30 | 'expiration' => 'Expiration', | ||||||||||||||||||||||||||||
| 31 | 'cross_reference' => 'CrossReference', | ||||||||||||||||||||||||||||
| 32 | 'pares' => 'PaRES', | ||||||||||||||||||||||||||||
| 33 | 'echo_cardtype' => 'EchoCardType', | ||||||||||||||||||||||||||||
| 34 | 'echo_avs_check_result' => 'EchoAVSCheckResult', | ||||||||||||||||||||||||||||
| 35 | 'echo_cvs_check_result' => 'EchoCVSCheckResult', | ||||||||||||||||||||||||||||
| 36 | 'echo_amount_received' => 'EchoAmountReceived', | ||||||||||||||||||||||||||||
| 37 | 'duplicate_delay' => 'DuplicateDelay', | ||||||||||||||||||||||||||||
| 38 | 'avs_override_policy' => 'AVSOverridePolicy', | ||||||||||||||||||||||||||||
| 39 | 'cvs_override_policy' => 'CVSOverridePolicy', | ||||||||||||||||||||||||||||
| 40 | 'three_d_secure_override_policy' => 'ThreeDSecureOverridePolicy', | ||||||||||||||||||||||||||||
| 41 | 'address1' => 'Address1', | ||||||||||||||||||||||||||||
| 42 | 'address2' => 'Address2', | ||||||||||||||||||||||||||||
| 43 | 'address3' => 'Address3', | ||||||||||||||||||||||||||||
| 44 | 'address4' => 'Address4', | ||||||||||||||||||||||||||||
| 45 | 'city' => 'City', | ||||||||||||||||||||||||||||
| 46 | 'state' => 'State', | ||||||||||||||||||||||||||||
| 47 | 'postcode' => 'PostCode', | ||||||||||||||||||||||||||||
| 48 | 'country_code' => 'CountryCode', | ||||||||||||||||||||||||||||
| 49 | 'email' => 'EmailAddress', | ||||||||||||||||||||||||||||
| 50 | 'phone_number' => 'PhoneNumber', | ||||||||||||||||||||||||||||
| 51 | 'customer_ip_address' => 'CustomerIPAddress', | ||||||||||||||||||||||||||||
| 52 | 'pass_outdata' => 'PassOutData', | ||||||||||||||||||||||||||||
| 53 | ); | ||||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | 0 | ▶ | sub ACTION_MAP { | ||||||||||||||||||||||||||
|
Subroutine
ACTION_MAP: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 58 | return ( | ||||||||||||||||||||||||||||
| 59 | 0 | 'normal authorization' => 'SALE', | |||||||||||||||||||||||||||
| 60 | 'refund ammount' => 'REFUND', | ||||||||||||||||||||||||||||
| 61 | 'authorization only' => 'PREAUTH', | ||||||||||||||||||||||||||||
| 62 | 'post authorization' => 'STORE', | ||||||||||||||||||||||||||||
| 63 | ); | ||||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||
| 66 | 1 | extends 'Business::OnlinePayment'; | |||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||
| 68 | 1 | has 'require_3d' => ( | |||||||||||||||||||||||||||
| 69 | isa => 'Bool', | ||||||||||||||||||||||||||||
| 70 | is => 'rw', | ||||||||||||||||||||||||||||
| 71 | default => '0' | ||||||||||||||||||||||||||||
| 72 | ); | ||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||
| 74 | 1 | has 'forward_to' => ( | |||||||||||||||||||||||||||
| 75 | isa => 'Str', | ||||||||||||||||||||||||||||
| 76 | is => 'rw', | ||||||||||||||||||||||||||||
| 77 | required => '0' | ||||||||||||||||||||||||||||
| 78 | ); | ||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||
| 80 | 1 | has 'authentication_key' => ( | |||||||||||||||||||||||||||
| 81 | isa => 'Str', | ||||||||||||||||||||||||||||
| 82 | is => 'rw', | ||||||||||||||||||||||||||||
| 83 | required => '0' | ||||||||||||||||||||||||||||
| 84 | ); | ||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||
| 86 | 1 | has 'pareq' => ( | |||||||||||||||||||||||||||
| 87 | isa => 'Str', | ||||||||||||||||||||||||||||
| 88 | is => 'rw', | ||||||||||||||||||||||||||||
| 89 | required => '0' | ||||||||||||||||||||||||||||
| 90 | ); | ||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||
| 92 | 1 | has 'cross_reference' => ( | |||||||||||||||||||||||||||
| 93 | isa => 'Str', | ||||||||||||||||||||||||||||
| 94 | is => 'rw', | ||||||||||||||||||||||||||||
| 95 | required => '0' | ||||||||||||||||||||||||||||
| 96 | ); | ||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||
| 98 | # PODNAME: Business::OnlinePayment::Iridium | ||||||||||||||||||||||||||||
| 99 | # ABSTRACT: PayVector (Iridium) backend for Business::OnlinePayment | ||||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||
| 102 | 0 | ▶ | sub _check_amount_field { | ||||||||||||||||||||||||||
|
Subroutine
_check_amount_field: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||
| 103 | 0 | my %content = shift->content; | |||||||||||||||||||||||||||
| 104 | confess 'missing required field amount' | ||||||||||||||||||||||||||||
| 105 | unless exists $content{'amount'} | ||||||||||||||||||||||||||||
| 106 | 0 | ▶ | || lc( $content{'action'} ) eq 'authorization only'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
exists $content{"amount"} or lc $content{"action"} eq "authorization only"
MC/DC0%0/2
exists $content{"amount"} or lc $content{"action"} eq "authorization only"
exists $content{"amount"}
lc $content{"action"} eq "authorization only"
Truth table0%0/3
A or B
A= exists $content{"amount"}B= lc $content{"action"} eq "authorization only"
| |||||||||||||||||||||||||||||
| 107 | } | ||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||
| 109 | 0 | ▶ | sub _running_in_test_mode { | ||||||||||||||||||||||||||
|
Subroutine
_running_in_test_mode: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||
| 110 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 111 | 0 | ▶ | if ( $self->test_transaction ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 112 | 0 | carp $self->error_message('Only test cards work in test mode'); | |||||||||||||||||||||||||||
| 113 | 0 | return 1; | |||||||||||||||||||||||||||
| 114 | } | ||||||||||||||||||||||||||||
| 115 | else { | ||||||||||||||||||||||||||||
| 116 | 0 | return 0; | |||||||||||||||||||||||||||
| 117 | } | ||||||||||||||||||||||||||||
| 118 | } | ||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||
| 120 | 0 | ▶ | sub _format_amount { | ||||||||||||||||||||||||||
|
Subroutine
_format_amount: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 121 | 0 | my ( $self, $amount ) = @_; | |||||||||||||||||||||||||||
| 122 | 0 | $amount = sprintf( "%.2f", $amount ); | |||||||||||||||||||||||||||
| 123 | 0 | $amount =~ s/\.//; | |||||||||||||||||||||||||||
| 124 | 0 | return $amount; | |||||||||||||||||||||||||||
| 125 | } | ||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||
| 127 | 0 | ▶ | sub _submit_callback { | ||||||||||||||||||||||||||
|
Subroutine
_submit_callback: not called CC=5 SCAR=34.0
| |||||||||||||||||||||||||||||
| 128 | 0 | my ( $self, $res_result, $res_data ) = @_; | |||||||||||||||||||||||||||
| 129 | 0 | ▶ | if ( $self->result_code == 0 ) { | ||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||
| 130 | 0 | $self->is_success(1); | |||||||||||||||||||||||||||
| 131 | 0 | $self->authorization( $res_data->{'AuthCode'} ); | |||||||||||||||||||||||||||
| 132 | 0 | $self->cross_reference( $res_data->{'CrossReference'} ); | |||||||||||||||||||||||||||
| 133 | } | ||||||||||||||||||||||||||||
| 134 | ▶ | elsif ($self->result_code == 20 | |||||||||||||||||||||||||||
|
Condition0%0/3
$self->result_code == 20 and $res_result->{"PreviousTransactionResult"}{"StatusCode"} == 0
MC/DC0%0/2
$self->result_code == 20 and $res_result->{"PreviousTransactionResult"}{"StatusCode"} == 0
$self->result_code == 20
$res_result->{"PreviousTransactionResult"}{"StatusCode"} == 0
Truth table0%0/3
A and B
A= $self->result_code == 20B= $res_result->{"PreviousTransactionResult"}{"StatusCode"} == 0
| |||||||||||||||||||||||||||||
| 135 | && $res_result->{'PreviousTransactionResult'}->{'StatusCode'} == 0 ) | ||||||||||||||||||||||||||||
| 136 | { | ||||||||||||||||||||||||||||
| 137 | 0 | $self->is_success(1); | |||||||||||||||||||||||||||
| 138 | 0 | $self->authorization( $res_data->{'AuthCode'} ); | |||||||||||||||||||||||||||
| 139 | 0 | $self->cross_reference( $res_data->{'CrossReference'} ); | |||||||||||||||||||||||||||
| 140 | } | ||||||||||||||||||||||||||||
| 141 | elsif ( $self->result_code == 3 ) { | ||||||||||||||||||||||||||||
| 142 | 0 | $self->require_3d(1); | |||||||||||||||||||||||||||
| 143 | 0 | my $threeD_data = $res_data->{'ThreeDSecureOutputData'}; | |||||||||||||||||||||||||||
| 144 | 0 | $self->forward_to( $threeD_data->{'ACSURL'} ); | |||||||||||||||||||||||||||
| 145 | 0 | $self->pareq( $threeD_data->{'PaREQ'} ); | |||||||||||||||||||||||||||
| 146 | 0 | $self->cross_reference( $res_data->{'CrossReference'} ); | |||||||||||||||||||||||||||
| 147 | |||||||||||||||||||||||||||||
| 148 | # Set error_message in case you just use is_success and don't check | ||||||||||||||||||||||||||||
| 149 | # for require_3d (for simple users ;-) ). | ||||||||||||||||||||||||||||
| 150 | 0 | $self->error_message( $res_result->{'Message'} ); | |||||||||||||||||||||||||||
| 151 | } | ||||||||||||||||||||||||||||
| 152 | else { | ||||||||||||||||||||||||||||
| 153 | 0 | $self->is_success(0); | |||||||||||||||||||||||||||
| 154 | 0 | $self->error_message( $res_result->{'Message'} ); | |||||||||||||||||||||||||||
| 155 | } | ||||||||||||||||||||||||||||
| 156 | } | ||||||||||||||||||||||||||||
| 157 | |||||||||||||||||||||||||||||
| 158 | 0 | ▶ | override remap_fields => sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||
| 159 | 0 | my ( $self, %map ) = @_; | |||||||||||||||||||||||||||
| 160 | 0 | my %content = $self->content(); | |||||||||||||||||||||||||||
| 161 | 0 | foreach ( keys %map ) { | |||||||||||||||||||||||||||
| 162 | 0 | $content{ $map{$_} } = $content{$_}; | |||||||||||||||||||||||||||
| 163 | } | ||||||||||||||||||||||||||||
| 164 | 0 | $self->content(%content); | |||||||||||||||||||||||||||
| 165 | 1 | }; | |||||||||||||||||||||||||||
| 166 | |||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||
| 168 | 0 | ▶ | sub get_entry_points { confess 'Not supported yet.' } | ||||||||||||||||||||||||||
|
Subroutine
get_entry_points: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 169 | |||||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||
| 171 | 0 | ▶ | sub get_card_type { | ||||||||||||||||||||||||||
|
Subroutine
get_card_type: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||
| 172 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 173 | 0 | ▶ | return $self->is_success(0) if $self->_running_in_test_mode; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||
| 175 | 0 | $self->required_fields(qw/login password card_number/); | |||||||||||||||||||||||||||
| 176 | 0 | my %data = $self->remap_fields( $self->FIELD_MAP ); | |||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||
| 178 | my $tx = | ||||||||||||||||||||||||||||
| 179 | 0 | GetCardType->new( map { $_ => $data{$_} } | |||||||||||||||||||||||||||
| 180 | qw(MerchantID Password CardNumber) ); | ||||||||||||||||||||||||||||
| 181 | 0 | my $res = $tx->request; | |||||||||||||||||||||||||||
| 182 | 0 | $res = $res->{'soap:Body'}->{'GetCardTypeResponse'}; | |||||||||||||||||||||||||||
| 183 | 0 | my $res_result = $res->{'GetCardTypeResult'}; | |||||||||||||||||||||||||||
| 184 | 0 | my $res_data = $res->{'GetCardTypeOutputData'}; | |||||||||||||||||||||||||||
| 185 | 0 | $self->server_response($res); | |||||||||||||||||||||||||||
| 186 | 0 | $self->result_code( $res_result->{'StatusCode'} ); | |||||||||||||||||||||||||||
| 187 | |||||||||||||||||||||||||||||
| 188 | 0 | ▶ | if ( $self->result_code == 0 ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 189 | 0 | $self->is_success(1); | |||||||||||||||||||||||||||
| 190 | 0 | return $res_data->{'CardTypeData'}->{'CardType'}; | |||||||||||||||||||||||||||
| 191 | } | ||||||||||||||||||||||||||||
| 192 | else { | ||||||||||||||||||||||||||||
| 193 | 0 | $self->is_success(0); | |||||||||||||||||||||||||||
| 194 | 0 | return 'Failed: ' . $res_result->{'Message'}; | |||||||||||||||||||||||||||
| 195 | } | ||||||||||||||||||||||||||||
| 196 | } | ||||||||||||||||||||||||||||
| 197 | |||||||||||||||||||||||||||||
| 198 | |||||||||||||||||||||||||||||
| 199 | 0 | ▶ | sub submit { | ||||||||||||||||||||||||||
|
Subroutine
submit: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||
| 200 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 201 | 0 | ▶ | return $self->is_success(0) if $self->_running_in_test_mode; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 202 | |||||||||||||||||||||||||||||
| 203 | 0 | $self->required_fields( | |||||||||||||||||||||||||||
| 204 | qw/login password card_number name_on_card | ||||||||||||||||||||||||||||
| 205 | expiration invoice_number action amount/ | ||||||||||||||||||||||||||||
| 206 | ); | ||||||||||||||||||||||||||||
| 207 | 0 | my %data = $self->remap_fields( $self->FIELD_MAP ); | |||||||||||||||||||||||||||
| 208 | 0 | my $tx_type = lc( $data{'TransactionType'} ); | |||||||||||||||||||||||||||
| 209 | 0 | my %ACTION_MAP = $self->ACTION_MAP; | |||||||||||||||||||||||||||
| 210 | |||||||||||||||||||||||||||||
| 211 | croak "'expiration' is invalid, format is: MM/YY or MMYY" | ||||||||||||||||||||||||||||
| 212 | 0 | ▶ | unless $data{'Expiration'} =~ m|(\d{2})/?(\d{2})|; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 213 | 0 | my ( $expire_month, $expire_year ) = ( $1, $2 ); | |||||||||||||||||||||||||||
| 214 | |||||||||||||||||||||||||||||
| 215 | my $tx = CardDetailsTransaction->new( | ||||||||||||||||||||||||||||
| 216 | ( | ||||||||||||||||||||||||||||
| 217 | 0 | map { $_ => $data{$_} } | |||||||||||||||||||||||||||
| 218 | 0 | grep { $data{$_} } | |||||||||||||||||||||||||||
| 219 | qw/MerchantID Password CardNumber CardName OrderID OrderDescription | ||||||||||||||||||||||||||||
| 220 | EchoCardType CV2 EchoAVSCheckResult EchoCVSCheckResult EchoAmountReceived | ||||||||||||||||||||||||||||
| 221 | DuplicateDelay AVSOverridePolicy CVSOverridePolicy ThreeDSecureOverridePolicy | ||||||||||||||||||||||||||||
| 222 | Address1 Address2 Address3 Address4 City State PostCode CountryCode | ||||||||||||||||||||||||||||
| 223 | EmailAddress PhoneNumber CustomerIPAddress PassOutData/ | ||||||||||||||||||||||||||||
| 224 | ), | ||||||||||||||||||||||||||||
| 225 | TransactionType => $ACTION_MAP{$tx_type}, | ||||||||||||||||||||||||||||
| 226 | 0 | Amount => $self->_format_amount( $data{'Amount'} ), | |||||||||||||||||||||||||||
| 227 | ExpireMonth => $expire_month, | ||||||||||||||||||||||||||||
| 228 | ExpireYear => $expire_year, | ||||||||||||||||||||||||||||
| 229 | ); | ||||||||||||||||||||||||||||
| 230 | 0 | my $res = $tx->request; | |||||||||||||||||||||||||||
| 231 | 0 | $res = $res->{'soap:Body'}->{'CardDetailsTransactionResponse'}; | |||||||||||||||||||||||||||
| 232 | 0 | my $res_result = $res->{'CardDetailsTransactionResult'}; | |||||||||||||||||||||||||||
| 233 | 0 | $self->server_response($res); | |||||||||||||||||||||||||||
| 234 | 0 | $self->result_code( $res_result->{'StatusCode'} ); | |||||||||||||||||||||||||||
| 235 | |||||||||||||||||||||||||||||
| 236 | 0 | $self->_submit_callback( $res_result, $res->{'TransactionOutputData'} ); | |||||||||||||||||||||||||||
| 237 | } | ||||||||||||||||||||||||||||
| 238 | |||||||||||||||||||||||||||||
| 239 | |||||||||||||||||||||||||||||
| 240 | 0 | ▶ | sub reference_transaction { | ||||||||||||||||||||||||||
|
Subroutine
reference_transaction: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 241 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 242 | 0 | ▶ | return $self->is_success(0) if $self->_running_in_test_mode; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 243 | |||||||||||||||||||||||||||||
| 244 | 0 | $self->required_fields(qw/login password invoice_number action amount/); | |||||||||||||||||||||||||||
| 245 | 0 | my %data = $self->remap_fields( $self->FIELD_MAP ); | |||||||||||||||||||||||||||
| 246 | 0 | my $tx_type = lc( $data{'TransactionType'} ); | |||||||||||||||||||||||||||
| 247 | 0 | my %ACTION_MAP = $self->ACTION_MAP; | |||||||||||||||||||||||||||
| 248 | |||||||||||||||||||||||||||||
| 249 | my $tx = CrossReferenceTransaction->new( | ||||||||||||||||||||||||||||
| 250 | ( | ||||||||||||||||||||||||||||
| 251 | 0 | map { $_ => $data{$_} } | |||||||||||||||||||||||||||
| 252 | 0 | grep { $data{$_} } | |||||||||||||||||||||||||||
| 253 | qw(MerchantID Password OrderID OrderDescription) | ||||||||||||||||||||||||||||
| 254 | ), | ||||||||||||||||||||||||||||
| 255 | TransactionType => $ACTION_MAP{$tx_type}, | ||||||||||||||||||||||||||||
| 256 | 0 | Amount => $self->_format_amount( $data{'Amount'} ), | |||||||||||||||||||||||||||
| 257 | ); | ||||||||||||||||||||||||||||
| 258 | 0 | my $res = $tx->request; | |||||||||||||||||||||||||||
| 259 | 0 | $res = $res->{'soap:Body'}->{'CardDetailsTransactionResponse'}; | |||||||||||||||||||||||||||
| 260 | 0 | my $res_result = $res->{'CardDetailsTransactionResult'}; | |||||||||||||||||||||||||||
| 261 | 0 | $self->server_response($res); | |||||||||||||||||||||||||||
| 262 | 0 | $self->result_code( $res_result->{'StatusCode'} ); | |||||||||||||||||||||||||||
| 263 | |||||||||||||||||||||||||||||
| 264 | 0 | $self->_submit_callback( $res_result, $res->{'TransactionOutputData'} ); | |||||||||||||||||||||||||||
| 265 | } | ||||||||||||||||||||||||||||
| 266 | |||||||||||||||||||||||||||||
| 267 | |||||||||||||||||||||||||||||
| 268 | 0 | ▶ | sub submit_3d { | ||||||||||||||||||||||||||
|
Subroutine
submit_3d: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||
| 269 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 270 | 0 | ▶ | return $self->is_success(0) if $self->_running_in_test_mode; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 271 | |||||||||||||||||||||||||||||
| 272 | 0 | $self->required_fields(qw/login password cross_reference pares/); | |||||||||||||||||||||||||||
| 273 | 0 | my %data = $self->remap_fields( $self->FIELD_MAP ); | |||||||||||||||||||||||||||
| 274 | |||||||||||||||||||||||||||||
| 275 | my $tx = ThreeDSecureAuthentication->new( | ||||||||||||||||||||||||||||
| 276 | ( | ||||||||||||||||||||||||||||
| 277 | 0 | map { $_ => $data{$_} } | |||||||||||||||||||||||||||
| 278 | 0 | grep { $data{$_} } | |||||||||||||||||||||||||||
| 279 | qw(MerchantID Password CrossReference PaRES PassOutData) | ||||||||||||||||||||||||||||
| 280 | ), | ||||||||||||||||||||||||||||
| 281 | ); | ||||||||||||||||||||||||||||
| 282 | 0 | my $res = $tx->request; | |||||||||||||||||||||||||||
| 283 | 0 | $res = $res->{'soap:Body'}->{'ThreeDSecureAuthenticationResponse'}; | |||||||||||||||||||||||||||
| 284 | 0 | my $res_result = $res->{'ThreeDSecureAuthenticationResult'}; | |||||||||||||||||||||||||||
| 285 | 0 | my $res_data = $res->{'TransactionOutputData'}; | |||||||||||||||||||||||||||
| 286 | 0 | $self->server_response($res); | |||||||||||||||||||||||||||
| 287 | 0 | $self->result_code( $res_result->{'StatusCode'} ); | |||||||||||||||||||||||||||
| 288 | |||||||||||||||||||||||||||||
| 289 | 0 | ▶ | if ( $self->result_code == 0 ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 290 | carp | ||||||||||||||||||||||||||||
| 291 | "Albeit 3D secure auth didn't pass, the transaction will be processed" | ||||||||||||||||||||||||||||
| 292 | 0 | ▶ | if $res_data->{'ThreeDSecureAuthenticationCheckResult'} eq 'UNKNOWN'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 293 | 0 | $self->is_success(1); | |||||||||||||||||||||||||||
| 294 | 0 | $self->authorization( $res_data->{'AuthCode'} ); | |||||||||||||||||||||||||||
| 295 | } | ||||||||||||||||||||||||||||
| 296 | else { | ||||||||||||||||||||||||||||
| 297 | 0 | $self->is_success(0); | |||||||||||||||||||||||||||
| 298 | 0 | $self->error_message( $res_result->{'Message'} ); | |||||||||||||||||||||||||||
| 299 | } | ||||||||||||||||||||||||||||
| 300 | } | ||||||||||||||||||||||||||||
| 301 | |||||||||||||||||||||||||||||
| 302 | |||||||||||||||||||||||||||||
| 303 | 1 | 1; | |||||||||||||||||||||||||||
| 304 | |||||||||||||||||||||||||||||
| 305 | __END__ | ||||||||||||||||||||||||||||