| 1 | package WebService::Avalara::AvaTax::Service::Address; | ||||||||||||||
| 2 | |||||||||||||||
| 3 | # ABSTRACT: Avalara AvaTax address validation service via SOAP | ||||||||||||||
| 4 | |||||||||||||||
| 5 | 5 | ▶ | use strict; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 6 | 5 | ▶ | use warnings; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 7 | |||||||||||||||
| 8 | 5 | our $VERSION = '0.020'; # VERSION | |||||||||||||
| 9 | 5 | ▶ | use utf8; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 10 | |||||||||||||||
| 11 | #pod =head1 SYNOPSIS | ||||||||||||||
| 12 | #pod | ||||||||||||||
| 13 | #pod use WebService::Avalara::AvaTax::Service::Address; | ||||||||||||||
| 14 | #pod | ||||||||||||||
| 15 | #pod my $avatax = WebService::Avalara::AvaTax::Service::Address->new( | ||||||||||||||
| 16 | #pod username => 'avalara@example.com', | ||||||||||||||
| 17 | #pod password => 'sekrit', | ||||||||||||||
| 18 | #pod ); | ||||||||||||||
| 19 | #pod my ( $answer_ref, $trace ) = $avatax->call('Ping'); | ||||||||||||||
| 20 | #pod | ||||||||||||||
| 21 | #pod =head1 DESCRIPTION | ||||||||||||||
| 22 | #pod | ||||||||||||||
| 23 | #pod This class implements basic support for the | ||||||||||||||
| 24 | #pod Avalara AvaTax (C<http://developer.avalara.com/api-docs/soap>) | ||||||||||||||
| 25 | #pod address validation web service using SOAP. Most of its mechanics are in | ||||||||||||||
| 26 | #pod L<WebService::Avalara::AvaTax::Role::Connection|WebService::Avalara::AvaTax::Role::Connection>, | ||||||||||||||
| 27 | #pod with defaults for certain attributes as listed below. | ||||||||||||||
| 28 | #pod | ||||||||||||||
| 29 | #pod =cut | ||||||||||||||
| 30 | |||||||||||||||
| 31 | 5 | ▶ | use Moo; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 32 | 5 | ▶ | use URI; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 33 | 5 | ▶ | use XML::Compile::SOAP11; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 34 | 5 | ▶ | use XML::Compile::SOAP12; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 35 | 5 | ▶ | use namespace::clean; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 36 | 5 | with qw( | |||||||||||||
| 37 | WebService::Avalara::AvaTax::Role::Connection | ||||||||||||||
| 38 | WebService::Avalara::AvaTax::Role::Service | ||||||||||||||
| 39 | WebService::Avalara::AvaTax::Role::Dumper | ||||||||||||||
| 40 | ); | ||||||||||||||
| 41 | |||||||||||||||
| 42 | #pod =attr uri | ||||||||||||||
| 43 | #pod | ||||||||||||||
| 44 | #pod The L<URI|URI> of the WSDL file used to define the web service. | ||||||||||||||
| 45 | #pod Defaults to C</address/addresssvc.wsdl>, with the URI base either | ||||||||||||||
| 46 | #pod C<https://avatax.avalara.net/> if | ||||||||||||||
| 47 | #pod L<is_production|WebService::Avalara::AvaTax::Role::Connection/is_production> | ||||||||||||||
| 48 | #pod returns true, or C<https://development.avalara.net/> if it returns false. | ||||||||||||||
| 49 | #pod | ||||||||||||||
| 50 | #pod Note that if | ||||||||||||||
| 51 | #pod L<use_wss|WebService::Avalara::AvaTax::Role::Connection/use_wss> | ||||||||||||||
| 52 | #pod is false, the alternate security WSDL file C</address/addresssvcaltsec.wsdl> | ||||||||||||||
| 53 | #pod will be used instead. | ||||||||||||||
| 54 | #pod | ||||||||||||||
| 55 | #pod =cut | ||||||||||||||
| 56 | |||||||||||||||
| 57 | has '+uri' => ( | ||||||||||||||
| 58 | 0 | ▶ | default => sub { | ||||||||||||
|
Subroutine
__ANON__: not called CC=3 SCAR=24.8
| |||||||||||||||
| 59 | 0 | my $self = shift; | |||||||||||||
| 60 | 0 | ▶ | URI->new_abs( '/address/addresssvc' | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 61 | . ( $self->use_wss ? q{} : 'altsec' ) | ||||||||||||||
| 62 | . '.wsdl' => 'https://' | ||||||||||||||
| 63 | . ( $self->is_production ? 'avatax' : 'development' ) | ||||||||||||||
| 64 | . '.avalara.net/' ); | ||||||||||||||
| 65 | }, | ||||||||||||||
| 66 | 5 | ); | |||||||||||||
| 67 | |||||||||||||||
| 68 | #pod =attr port | ||||||||||||||
| 69 | #pod | ||||||||||||||
| 70 | #pod The SOAP port identifier (not to be confused with the TCP/IP port) used in the | ||||||||||||||
| 71 | #pod WSDL file at L</uri>. | ||||||||||||||
| 72 | #pod Defaults to C<AddressSvcSoap>. | ||||||||||||||
| 73 | #pod | ||||||||||||||
| 74 | #pod =cut | ||||||||||||||
| 75 | |||||||||||||||
| 76 | has '+port' => ( default => | ||||||||||||||
| 77 | 0 | ▶ | sub { 'AddressSvc' . ( $_[0]->use_wss ? q{} : 'AltSec' ) . 'Soap' }, | ||||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
| |||||||||||||||
| 78 | 5 | ); | |||||||||||||
| 79 | |||||||||||||||
| 80 | #pod =attr service | ||||||||||||||
| 81 | #pod | ||||||||||||||
| 82 | #pod The SOAP service name used in the WSDL file at L</uri>. | ||||||||||||||
| 83 | #pod Defaults to C<AddressSvc>. | ||||||||||||||
| 84 | #pod | ||||||||||||||
| 85 | #pod =cut | ||||||||||||||
| 86 | |||||||||||||||
| 87 | 5 | has '+service' => ( default => 'AddressSvc' ); | |||||||||||||
| 88 | |||||||||||||||
| 89 | #pod =for Pod::Coverage BUILDARGS | ||||||||||||||
| 90 | #pod | ||||||||||||||
| 91 | #pod =cut | ||||||||||||||
| 92 | |||||||||||||||
| 93 | 5 | 1; | |||||||||||||
| 94 | |||||||||||||||
| 95 | __END__ | ||||||||||||||