| 1 | package Business::CyberSource::Factory::Response; | ||||||||||||||||||||||||||||
| 2 | 2 | ▶ | use 5.010; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 2 | ▶ | use namespace::autoclean; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 2 | our $VERSION = '0.010007'; # VERSION | |||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 2 | ▶ | use Moose; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 2 | ▶ | use Module::Runtime qw( use_module ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | 2 | ▶ | use Type::Params qw( compile Invocant ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | 2 | ▶ | use Types::Standard qw( HashRef Optional ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | 2 | ▶ | use Type::Utils 0.040 qw( role_type ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | sub create { ## no critic ( RequireArgUnpacking ) | ||||||||||||||||||||||||||||
| 16 | 1 | ▶ | state $traceable = role_type 'Business::CyberSource::Role::Traceable'; | ||||||||||||||||||||||||||
|
Subroutine
create: called CC=4 SCAR=15.9
Pod
documented
| |||||||||||||||||||||||||||||
| 17 | 1 | state $check = compile( Invocant, HashRef, Optional[$traceable]); | |||||||||||||||||||||||||||
| 18 | 1 | my ( $self, $result , $request ) = $check->( @_ ); | |||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | $result->{http_trace} | ||||||||||||||||||||||||||||
| 21 | 1 | ▶ | = $request->http_trace | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$request and $request->has_http_trace
MC/DC0%0/2
$request and $request->has_http_trace
$request
$request->has_http_trace
Truth table33%1/3
A and B
A= $requestB= $request->has_http_trace
| |||||||||||||||||||||||||||||
| 22 | if $request && $request->has_http_trace; | ||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | die ## no critic ( ErrorHandling::RequireCarping ) | ||||||||||||||||||||||||||||
| 25 | use_module('Business::CyberSource::Exception::Response') | ||||||||||||||||||||||||||||
| 26 | 1 | ▶ | ->new( $result ) if $result->{decision} eq 'ERROR'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | 0 | return use_module('Business::CyberSource::Response')->new( $result ); | |||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | 2 | 1; | |||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | # ABSTRACT: A Response Factory | ||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | __END__ | ||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | =pod | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | =encoding UTF-8 | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | =head1 NAME | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | Business::CyberSource::Factory::Response - A Response Factory | ||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | =head1 VERSION | ||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | version 0.010007 | ||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | =head1 METHODS | ||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | =head2 create | ||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | my $response = $factory->create( $answer->{result}, $request ); | ||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | Pass the C<answer->{result}> from L<XML::Compile::SOAP> and the original Request Data | ||||||||||||||||||||||||||||
| 56 | Transfer Object. Passing a L<Business::CyberSource::Request> is now optional. | ||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | =head1 BUGS | ||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | Please report any bugs or feature requests on the bugtracker website | ||||||||||||||||||||||||||||
| 61 | https://github.com/xenoterracide/business-cybersource/issues | ||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||
| 63 | When submitting a bug or request, please include a test-file or a | ||||||||||||||||||||||||||||
| 64 | patch to an existing test-file that illustrates the bug or desired | ||||||||||||||||||||||||||||
| 65 | feature. | ||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||
| 67 | =head1 AUTHOR | ||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||
| 69 | Caleb Cushing <xenoterracide@gmail.com> | ||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||
| 71 | =head1 COPYRIGHT AND LICENSE | ||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||
| 73 | This software is Copyright (c) 2016 by Caleb Cushing <xenoterracide@gmail.com>. | ||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||
| 75 | This is free software, licensed under: | ||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||
| 77 | The Artistic License 2.0 (GPL Compatible) | ||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||
| 79 | =cut | ||||||||||||||||||||||||||||