Subject: | Allow to use array as input paramater for 'submitRequest' method |
eBay supports methods(AddItems, EndItems) which allow to use list as input parameter.
You can find patch in attachment which allow such functionality.
Subject: | Net_eBay.patch |
--- eBay.pm 2017-03-14 14:08:57.451297959 +0200
+++ /usr/local/share/perl/5.18.2/Net/eBay.pm 2017-03-14 14:09:43.883297128 +0200
@@ -429,7 +429,7 @@
<$name"."Request xmlns=\"urn:ebay:apis:eBLBaseComponents\">
<RequesterCredentials>\n";
#if request credentials exist, use the username/password
- if(defined $request->{RequesterCredentials}) {
+ if((ref($request) eq 'HASH') && (defined $request->{RequesterCredentials})) {
#if username or password is not defined, we can't use request credentials
if(not defined $request->{RequesterCredentials}{Username} or
@@ -448,9 +448,19 @@
} else {
$xml .= " <eBayAuthToken>$this->{Token}</eBayAuthToken>\n";
}
-
+
+ my $xml_content = '';
+ if (ref($request) eq 'ARRAY') {
+ for my $item(@{$request || []}) {
+ $xml_content .= hash2xml( 2, $item );
+ }
+ }
+ else {
+ $xml_content = hash2xml( 2, $request );
+ }
+
$xml .= "</RequesterCredentials>
-" . hash2xml( 2, $request ) . "
+" . $xml_content . "
</$name"."Request>
";