Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Business-PayPal-API CPAN distribution.

Report information
The Basics
Id: 28596
Status: resolved
Worked: 15 min
Priority: 0/
Queue: Business-PayPal-API

People
Owner: Nobody in particular
Requestors: drewsimpson [...] bellsouth.net
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Business-PayPal-API-0.50 - Multiple Line Items
Date: Tue, 31 Jul 2007 16:13:57 -0500
To: <bug-Business-PayPal-API [...] rt.cpan.org>
From: "Simpson" <drewsimpson [...] bellsouth.net>
PaymentItem is an array when multiple items in cart: $VAR1 = { 'Body' => { 'GetTransactionDetailsResponse' => { 'Build' => '1.0006', 'Version' => '2.000000', 'Timestamp' => '2007-07-31T20:42:03Z', 'PaymentTransactionDetails' => bless( { 'PaymentItemInfo' => bless( { 'PaymentItem' => [ bless( { 'Number' => '20952', 'SalesTax' => '', 'Quantity' => '1', 'Name' => 'line item description for 20952' }, 'PaymentItemType' ), bless( { 'Number' => '11473', 'SalesTax' => '', 'Quantity' => '2', 'Name' => 'line item description for 11473' }, 'PaymentItemType' ) ], 'Memo' => '', Possible solution: sub getFields { my $self = shift; my $som = shift; my $path = shift; my $response = shift; my $fields = shift; return unless $som; for my $field ( keys %$fields ) { # 7/31/07 - comment out original #if( my $value = $som->valueof("$path/$fields->{$field}") ) { # $response->{$field} = $value; #} # 7/31/07 - set to array if multiple matches my @vals = (); for my $value ( $som->valueof("$path/$fields->{$field}") ) { push @vals, $value; $response->{$field} = $value; } $response->{$field} = \@vals if $#vals > 0; } }

Message body is not shown because it is too large.

This is fixed in 0.62--thanks for your patience! Scott On Tue Jul 31 17:13:14 2007, drewsimpson@bellsouth.net wrote: Show quoted text
> > PaymentItem is an array when multiple items in cart: > > > $VAR1 = { > 'Body' => { > 'GetTransactionDetailsResponse' => { > 'Build' =>
'1.0006', Show quoted text
> 'Version' => > '2.000000', > 'Timestamp' => > '2007-07-31T20:42:03Z', > > 'PaymentTransactionDetails' => bless( { > > 'PaymentItemInfo' => bless( { > > 'PaymentItem' => [ > > bless( { > > 'Number' => '20952', > > 'SalesTax' => '', > > 'Quantity' => '1', > > 'Name' => 'line item description for 20952' >
Show quoted text
> }, > 'PaymentItemType' ), > > bless( { > > 'Number' => '11473', > > 'SalesTax' => '', > > 'Quantity' => '2', > > 'Name' => 'line item description for 11473' >
Show quoted text
> }, > 'PaymentItemType' ) >
Show quoted text
> ], > > 'Memo' => '', > > Possible solution: > > sub getFields { > my $self = shift; > my $som = shift; > my $path = shift; > my $response = shift; > my $fields = shift; > return unless $som; > for my $field ( keys %$fields ) > { > # 7/31/07 - comment out original > #if( my $value = $som->valueof("$path/$fields->{$field}") ) { > # $response->{$field} = $value; > #} > > # 7/31/07 - set to array if multiple matches > my @vals = (); > for my $value ( $som->valueof("$path/$fields->{$field}") ) > { > push @vals, $value; > $response->{$field} = $value; > } > $response->{$field} = \@vals if $#vals > 0; > } > }