--- CIM.pm 2011-12-24 02:42:30.000000000 +0100
+++ /tmp/CIM.pm 2012-08-21 15:24:30.000000000 +0200
@@ -116,8 +116,8 @@
}
$writer->endTag('profile');
- if ( $self->{test_mode} ) {
- $writer->dataElement( 'validationMode', 'testMode' );
+ if (exists $args->{validationMode}) {
+ $writer->dataElement( 'validationMode', $args->{validationMode} );
}
$writer->endTag('createCustomerProfileRequest');
@@ -191,9 +191,10 @@
$writer->endTag('payment');
$writer->endTag('paymentProfile');
- if ( $self->{test_mode} ) {
- $writer->dataElement( 'validationMode', 'testMode' );
+ if (exists $args->{validationMode}) {
+ $writer->dataElement( 'validationMode', $args->{validationMode} );
}
+
$writer->endTag('createCustomerPaymentProfileRequest');
$xml = '<?xml version="1.0" encoding="utf-8"?>' . "\n" . $xml;
@@ -236,9 +237,6 @@
$writer->endTag('address');
- if ( $self->{test_mode} ) {
- $writer->dataElement( 'validationMode', 'testMode' );
- }
$writer->endTag('createCustomerShippingAddressRequest');
$xml = '<?xml version="1.0" encoding="utf-8"?>' . "\n" . $xml;
@@ -411,9 +409,6 @@
$writer->dataElement( 'customerPaymentProfileId',
$customerPaymentProfileId );
- if ( $self->{test_mode} ) {
- $writer->dataElement( 'validationMode', 'testMode' );
- }
$writer->endTag('deleteCustomerPaymentProfileRequest');
$xml = '<?xml version="1.0" encoding="utf-8"?>' . "\n" . $xml;
@@ -441,9 +436,6 @@
$writer->dataElement( 'customerProfileId', $customerProfileId );
$writer->dataElement( 'customerAddressId', $customerAddressId );
- if ( $self->{test_mode} ) {
- $writer->dataElement( 'validationMode', 'testMode' );
- }
$writer->endTag('deleteCustomerShippingAddressRequest');
$xml = '<?xml version="1.0" encoding="utf-8"?>' . "\n" . $xml;
@@ -530,9 +522,6 @@
$writer->dataElement( 'customerPaymentProfileId',
$customerPaymentProfileId );
- if ( $self->{test_mode} ) {
- $writer->dataElement( 'validationMode', 'testMode' );
- }
$writer->endTag('getCustomerPaymentProfileRequest');
$xml = '<?xml version="1.0" encoding="utf-8"?>' . "\n" . $xml;
@@ -560,9 +549,6 @@
$writer->dataElement( 'customerProfileId', $customerProfileId );
$writer->dataElement( 'customerAddressId', $customerAddressId );
- if ( $self->{test_mode} ) {
- $writer->dataElement( 'validationMode', 'testMode' );
- }
$writer->endTag('getCustomerShippingAddressRequest');
$xml = '<?xml version="1.0" encoding="utf-8"?>' . "\n" . $xml;
@@ -672,9 +658,6 @@
$args->{customerPaymentProfileId} );
$writer->endTag('paymentProfile');
- if ( $self->{test_mode} ) {
- $writer->dataElement( 'validationMode', 'testMode' );
- }
$writer->endTag('updateCustomerPaymentProfileRequest');
$xml = '<?xml version="1.0" encoding="utf-8"?>' . "\n" . $xml;
@@ -778,12 +761,6 @@
if $args->{customerShippingAddressId};
$writer->dataElement( 'cardCode', $args->{cardCode} ) if $args->{cardCode};
- if ( $self->{test_mode} ) {
- $writer->dataElement( 'validationMode', 'testMode' );
- }
- else {
- $writer->dataElement( 'validationMode', 'liveMode' );
- }
$writer->endTag('validateCustomerPaymentProfileRequest');
$xml = '<?xml version="1.0" encoding="utf-8"?>' . "\n" . $xml;
@@ -851,7 +828,8 @@
=item * test_mode
-validationMode as testMode or liveMode
+If true, will use authorize.net's test servers; otherwise will connect
+to their live servers.
=item * ua_args
@@ -920,6 +898,9 @@
# or it uses billTo address as shipToList
use_billTo_as_shipToList => 1,
+
+ # if unset, do no credit card validation at all
+ validationMode => 'testMode',
);
=head3 createCustomerPaymentProfileRequest
@@ -958,6 +939,9 @@
echeckType => $echeckType, # Optionaal, one of CCD, PPD, TEL, WEB
bankName => $bankName, # Optional
},
+
+ # if unset, do no credit card validation at all
+ validationMode => 'liveMode',
);
=head3 createCustomerShippingAddressRequest