| 1 | # Copyright 2013 Digital River, Inc. | ||||||||||||||||||||||||||||||||||
| 2 | # | ||||||||||||||||||||||||||||||||||
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||||||||||||||||||||||||||||||||||
| 4 | # you may not use this file except in compliance with the License. | ||||||||||||||||||||||||||||||||||
| 5 | # You may obtain a copy of the License at | ||||||||||||||||||||||||||||||||||
| 6 | # | ||||||||||||||||||||||||||||||||||
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 | ||||||||||||||||||||||||||||||||||
| 8 | # | ||||||||||||||||||||||||||||||||||
| 9 | # Unless required by applicable law or agreed to in writing, software | ||||||||||||||||||||||||||||||||||
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, | ||||||||||||||||||||||||||||||||||
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||||||||||||||||||||||||||||||||
| 12 | # See the License for the specific language governing permissions and | ||||||||||||||||||||||||||||||||||
| 13 | # limitations under the License. | ||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||
| 15 | package Net::MyCommerce::API::Resource::PAR; | ||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||
| 17 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 18 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||
| 20 | 2 | ▶ | use base qw( Net::MyCommerce::API::Resource ); | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||
| 22 | =head1 NAME | ||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||
| 24 | Net::MyCommerce::API::Resource::PAR | ||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||
| 26 | =head1 VERSION | ||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||
| 28 | version 1.0.0 | ||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||
| 30 | =cut | ||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||
| 32 | 2 | our $VERSION = '1.0.0'; | |||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||
| 34 | =head1 SCHEMA | ||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||
| 36 | http://help.mycommerce.com/index.php/mycommerce-apis/TBD | ||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||
| 38 | =head1 METHODS | ||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||
| 40 | =head2 new ($args) | ||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||
| 42 | Subclass Net::MyCommerce::API::Resource | ||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||
| 44 | =cut | ||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||
| 46 | 0 | ▶ | sub new { | ||||||||||||||||||||||||||||||||
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 47 | 0 | my ($pkg, %args) = @_; | |||||||||||||||||||||||||||||||||
| 48 | 0 | return $pkg->SUPER::new( %args, scope=>'payments' ); | |||||||||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||
| 51 | =head2 request (%opts) | ||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||
| 53 | Subclass Net::MyCommerce::API::Resource::request | ||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||
| 55 | =cut | ||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||
| 57 | 0 | ▶ | sub request { | ||||||||||||||||||||||||||||||||
|
Subroutine
request: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 58 | 0 | my ($self, %opts) = @_; | |||||||||||||||||||||||||||||||||
| 59 | 0 | ▶ | $opts{params} ||= {}; | ||||||||||||||||||||||||||||||||
|
Condition0%0/2
$opts{"params"} ||= {}
MC/DC0%0/1
$opts{"params"} ||= {}
$opts{"params"}
Truth table0%0/2
A
A= $opts{"params"}
| |||||||||||||||||||||||||||||||||||
| 60 | 0 | return $self->SUPER::request(%opts); | |||||||||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||
| 63 | =head2 create_par (%opts) | ||||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||||
| 65 | Create a new Payment Account Resource | ||||||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||||||
| 67 | Examples: | ||||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||||
| 69 | http://help.mycommerce.com/index.php/mycommerce-apis/TBD | ||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||
| 71 | =cut | ||||||||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||||||||
| 73 | 0 | ▶ | sub create_par { | ||||||||||||||||||||||||||||||||
|
Subroutine
create_par: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 74 | 0 | my ($self, %opts) = @_; | |||||||||||||||||||||||||||||||||
| 75 | return $self->request( | ||||||||||||||||||||||||||||||||||
| 76 | method => 'POST', | ||||||||||||||||||||||||||||||||||
| 77 | path => '/payment-accounts', | ||||||||||||||||||||||||||||||||||
| 78 | params => $opts{params}, | ||||||||||||||||||||||||||||||||||
| 79 | data => { | ||||||||||||||||||||||||||||||||||
| 80 | billing_address => $opts{billing_address}, | ||||||||||||||||||||||||||||||||||
| 81 | cc_number => $opts{cc_number}, | ||||||||||||||||||||||||||||||||||
| 82 | exp_month => $opts{exp_month}, | ||||||||||||||||||||||||||||||||||
| 83 | exp_year => $opts{exp_year}, | ||||||||||||||||||||||||||||||||||
| 84 | payment_type => $opts{payment_type}, | ||||||||||||||||||||||||||||||||||
| 85 | currency_id => $opts{currency_id}, | ||||||||||||||||||||||||||||||||||
| 86 | cvv_code => $opts{cvv_code}, | ||||||||||||||||||||||||||||||||||
| 87 | }, | ||||||||||||||||||||||||||||||||||
| 88 | 0 | ); | |||||||||||||||||||||||||||||||||
| 89 | } | ||||||||||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||||||||
| 91 | =head2 update_par (%opts) | ||||||||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||||||
| 93 | Update Payment Account Resource | ||||||||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||||||||
| 95 | =cut | ||||||||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||||||||
| 97 | 0 | ▶ | sub update_par { | ||||||||||||||||||||||||||||||||
|
Subroutine
update_par: not called CC=8 SCAR=42.8
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 98 | 0 | my ($self, %opts) = @_; | |||||||||||||||||||||||||||||||||
| 99 | return $self->request( | ||||||||||||||||||||||||||||||||||
| 100 | method => 'POST', | ||||||||||||||||||||||||||||||||||
| 101 | path => [ '/payment-accounts', $opts{cart_id} ], | ||||||||||||||||||||||||||||||||||
| 102 | params => $opts{params}, | ||||||||||||||||||||||||||||||||||
| 103 | data => { | ||||||||||||||||||||||||||||||||||
| 104 | ( $opts{billing_address} ? (billing_address => $opts{billing_address}) : () ), | ||||||||||||||||||||||||||||||||||
| 105 | ( $opts{cc_number} ? (cc_number => $opts{cc_number}) : () ), | ||||||||||||||||||||||||||||||||||
| 106 | ( $opts{exp_month} ? (exp_month => $opts{exp_month}) : () ), | ||||||||||||||||||||||||||||||||||
| 107 | ( $opts{exp_year} ? (exp_year => $opts{exp_year}) : () ), | ||||||||||||||||||||||||||||||||||
| 108 | ( $opts{payment_type} ? (payment_type => $opts{payment_type}) : () ), | ||||||||||||||||||||||||||||||||||
| 109 | ( $opts{currency_id} ? (currency_id => $opts{currency_id}) : () ), | ||||||||||||||||||||||||||||||||||
| 110 | 0 | ▶ | ( $opts{cvv_code} ? (cvv_code => $opts{cvv_code}) : () ), | ||||||||||||||||||||||||||||||||
|
Branch: 7 branches
| |||||||||||||||||||||||||||||||||||
| 111 | }, | ||||||||||||||||||||||||||||||||||
| 112 | ); | ||||||||||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||||
| 115 | =head2 get_par (%opts) | ||||||||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||||||||
| 117 | Retrieve an existing Payment Account Resource | ||||||||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||||||||
| 119 | Examples: | ||||||||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||||||||
| 121 | http://help.mycommerce.com/index.php/mycommerce-apis/TBD | ||||||||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||||||||
| 123 | =cut | ||||||||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||||||||
| 125 | 0 | ▶ | sub get_par { | ||||||||||||||||||||||||||||||||
|
Subroutine
get_par: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 126 | 0 | my ($self, %opts) = @_; | |||||||||||||||||||||||||||||||||
| 127 | my ($error, $result) = $self->request( | ||||||||||||||||||||||||||||||||||
| 128 | method => 'GET', | ||||||||||||||||||||||||||||||||||
| 129 | path => [ '/payment-accounts', $opts{par_id} ], | ||||||||||||||||||||||||||||||||||
| 130 | params => $opts{params}, | ||||||||||||||||||||||||||||||||||
| 131 | 0 | ); | |||||||||||||||||||||||||||||||||
| 132 | 0 | return ($error, $result); | |||||||||||||||||||||||||||||||||
| 133 | } | ||||||||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||||||||
| 135 | 2 | 1; | |||||||||||||||||||||||||||||||||