Commit graph

12 commits

Author SHA1 Message Date
Bradley M. Kuhn
5113ced7e3 Properly extract Options from PaymentItemInfo
The Options fields found in
/PaymentTransactionDetails/PaymentItemInfo/PaymentItem/Options have
never been extracted in the proper way.  In fact, I'd be surprised if
anyone found the previous method of extraction useful at all.

I discovered this bug when I needed to lookup the Options selected
during payment, and found they weren't returned by the API.

Specifically, the value inside the SOAP tags, which is what the API
previously returned, are simply not useful: they are typically empty.
The interesting data is stored in the attributes of 'name' and 'value'.

Note, BTW, that each PaymentItem can have its own set of Options.  This
code added herein properly extracts the Options data for each
PaymentItem, and places it both in the Options field for that
PaymentItem, and in the array in the PII_Options "convenience" field.

As can be seen in the accompanying changes to t/OptionsFields.t, the
return values of the Options data is now a hash rather than a list.  I
believe this API-user-visible change is appropriate since a hash is
ultimately the natural representation of this data, and since having the
Options as an array of empty strings wasn't useful, anyway.

Nevertheless, if existing user code of this API relies on Options being
an array of empty strings (which I suppose could have been usefully used
in scalar context to get the count of options in the record), this
change theoretically creates a user-visible change in the API.  I can't
imagine anyone found the previous return value useful in the past
anyway, so I'd be surprised if anyone relies on this mis-feature.  If
they did, they can simply change their code to:
       scalar keys ...{Options}
instead of:
       scalar @...{Options}

However, since this is technically an API change, I've updated the
Changes file and the module documentation to mention it.
2015-01-02 13:15:46 -05:00
Olaf Alders
cde02d0238 Adds dist.ini 2014-03-21 23:45:32 -04:00
Neil Bowers
02b046373b Reformatted as per CPAN::Changes::Spec 2013-08-18 10:27:51 +01:00
Olaf Alders
091bc52485 Bumps version to 0.70 for release. 2012-11-14 00:10:47 -05:00
Dave Lambley
2db45ef69e Massage a little more. 2011-11-11 17:37:37 +00:00
Dave Lambley
f9788b347b Correct changelog. 2011-11-11 17:33:14 +00:00
Dave Lambley
1c171555ed Bump with https://rt.cpan.org/Public/Bug/Display.html?id=70424 2011-11-11 17:32:31 +00:00
Dave Lambley
f727169dca Update changelog. 2011-11-11 17:09:49 +00:00
Dave Lambley
ea4f430f9a Bump to mention currently release version. 2011-11-11 17:06:36 +00:00
Danny Hembree
a43cf01976 Updated Change file to show changes to .62 version 2009-12-07 01:17:52 -08:00
Danny Hembree
c2bf6d6357 Modified API.pm to for looser Success test and corrected boolean test with undefined variable. 2009-12-03 13:42:54 -08:00
Daniel Hembree
925e625e76 Initial git commit of release 0.62 2009-12-02 21:57:44 -08:00