« Business/CyberSource/Request/StandAloneCredit.pm
↑ Summary
Business/CyberSource/RequestPart/BillTo.pm »
| 1 | package Business::CyberSource::Rule; | ||||||||||||
| 2 | 3 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 3 | 3 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 3 | ▶ | use namespace::autoclean; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | |||||||||||||
| 6 | 3 | our $VERSION = '0.010007'; # VERSION | |||||||||||
| 7 | |||||||||||||
| 8 | 3 | ▶ | use Moose; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 9 | 3 | ▶ | use Module::Runtime qw( use_module ); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 10 | |||||||||||||
| 11 | sub debug { | ||||||||||||
| 12 | 0 | ▶ | my ( $self, $message ) = shift; | ||||||||||
|
Subroutine
debug: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||
| 13 | |||||||||||||
| 14 | 0 | use_module 'Carp'; | |||||||||||
| 15 | 0 | our @CARP_NOT = ( __PACKAGE__, blessed( $self->client ) ); | |||||||||||
| 16 | |||||||||||||
| 17 | 0 | ▶ | $message //= blessed( $self ) . ' matched'; | ||||||||||
|
Condition0%0/2
$message //= builtin::blessed($self) . ' matched'
MC/DC0%0/1
$message //= builtin::blessed($self) . ' matched'
$message
Truth table0%0/2
A
A= $message
| |||||||||||||
| 18 | |||||||||||||
| 19 | 0 | Carp::carp( $message ); | |||||||||||
| 20 | |||||||||||||
| 21 | 0 | return 1; | |||||||||||
| 22 | } | ||||||||||||
| 23 | |||||||||||||
| 24 | 3 | has client => ( | |||||||||||
| 25 | isa => 'Business::CyberSource::Client', | ||||||||||||
| 26 | is => 'ro', | ||||||||||||
| 27 | required => 1, | ||||||||||||
| 28 | weak_ref => 1, | ||||||||||||
| 29 | ); | ||||||||||||
| 30 | |||||||||||||
| 31 | 3 | __PACKAGE__->meta->make_immutable; | |||||||||||
| 32 | 3 | 1; | |||||||||||
| 33 | |||||||||||||
| 34 | # ABSTRACT: Abstract Rule Base | ||||||||||||
| 35 | |||||||||||||
| 36 | __END__ | ||||||||||||
| 37 | |||||||||||||
| 38 | =pod | ||||||||||||
| 39 | |||||||||||||
| 40 | =encoding UTF-8 | ||||||||||||
| 41 | |||||||||||||
| 42 | =head1 NAME | ||||||||||||
| 43 | |||||||||||||
| 44 | Business::CyberSource::Rule - Abstract Rule Base | ||||||||||||
| 45 | |||||||||||||
| 46 | =head1 VERSION | ||||||||||||
| 47 | |||||||||||||
| 48 | version 0.010007 | ||||||||||||
| 49 | |||||||||||||
| 50 | =head1 METHODS | ||||||||||||
| 51 | |||||||||||||
| 52 | =head2 run | ||||||||||||
| 53 | |||||||||||||
| 54 | required by subclasses but not provided. Is executed to check your rule and | ||||||||||||
| 55 | returns a suitable mock answer. C<request_id> should be set to 0 in the answer. | ||||||||||||
| 56 | |||||||||||||
| 57 | return { result => { | ||||||||||||
| 58 | merchantReferenceCode => $request->reference_code, | ||||||||||||
| 59 | decision => 'REJECT', | ||||||||||||
| 60 | reasonCode => '202', | ||||||||||||
| 61 | requestID => 0, | ||||||||||||
| 62 | requestToken => 0, | ||||||||||||
| 63 | } | ||||||||||||
| 64 | |||||||||||||
| 65 | =head2 debug | ||||||||||||
| 66 | |||||||||||||
| 67 | carps out the rule that matched if client has debug set. | ||||||||||||
| 68 | |||||||||||||
| 69 | =head1 ATTRIBUTES | ||||||||||||
| 70 | |||||||||||||
| 71 | =head2 client | ||||||||||||
| 72 | |||||||||||||
| 73 | a weakened reference to the client, to check the clients debug state. | ||||||||||||
| 74 | |||||||||||||
| 75 | =head1 BUGS | ||||||||||||
| 76 | |||||||||||||
| 77 | Please report any bugs or feature requests on the bugtracker website | ||||||||||||
| 78 | https://github.com/xenoterracide/business-cybersource/issues | ||||||||||||
| 79 | |||||||||||||
| 80 | When submitting a bug or request, please include a test-file or a | ||||||||||||
| 81 | patch to an existing test-file that illustrates the bug or desired | ||||||||||||
| 82 | feature. | ||||||||||||
| 83 | |||||||||||||
| 84 | =head1 AUTHOR | ||||||||||||
| 85 | |||||||||||||
| 86 | Caleb Cushing <xenoterracide@gmail.com> | ||||||||||||
| 87 | |||||||||||||
| 88 | =head1 COPYRIGHT AND LICENSE | ||||||||||||
| 89 | |||||||||||||
| 90 | This software is Copyright (c) 2016 by Caleb Cushing <xenoterracide@gmail.com>. | ||||||||||||
| 91 | |||||||||||||
| 92 | This is free software, licensed under: | ||||||||||||
| 93 | |||||||||||||
| 94 | The Artistic License 2.0 (GPL Compatible) | ||||||||||||
| 95 | |||||||||||||
| 96 | =cut | ||||||||||||