bjjb / ebayr

A small library to help using the eBay Trading API with Ruby
MIT License
60 stars 49 forks source link

Not Able to add PictureURL for AddFixedPriceItem #26

Closed webdev36 closed 7 years ago

webdev36 commented 8 years ago

In this function requires like this "PictureDetails

GalleryDuration:token
  <GalleryType>GalleryType: GalleryTypeCodeType </GalleryType>
  <GalleryURL> GalleryURL:anyURI </GalleryURL>
  <PhotoDisplay>PhotoDisplay: PhotoDisplayCodeType </PhotoDisplay>
  <PictureSource>PictureSource: PictureSourceCodeType </PictureSource>
  <PictureURL> anyPictureURL1 </PictureURL>
  <PictureURL> anyPictureURL1 </PictureURL>
  <PictureURL> anyPictureURL1 </PictureURL>
  <!-- ... more PictureURL values allowed here ... -->
</PictureDetails>"

How can I add this PicturURL on calling apis option?

webdev36 commented 8 years ago

Hi

neverender commented 7 years ago

So... any ideas about this? We need multiple PictureURL's, but a Hash can't have duplicate keys. If I try an array like: PictureURL: ['url1', 'url2']

you have it doing: <PictureURL>url1url2</PictureURL>

What we need is <PictureURL>url1</PictureURL><PictureURL>url2</PictureURL>

neverender commented 7 years ago

Ah. I found a solution using Hash#compare_by_identity to allow duplicate keys.

yasuhisa1984 commented 7 years ago

Hi.I also encountered the same problem. That's the following manner, it will become a type error.

"PictureDetails"=> [{"GalleryType"=>["Gallery"], "GalleryURL"=>["http://i.ebayimg.com/00/s/NDM2WDUwMA==/z/TIsAAOSwHMJYHCQc/$_3.JPG"], "PictureURL"=>[{"url"=>"http://i.ebayimg.com/00/s/NTAwWDMzNw==/z/06EAAOSw5cNYHCQd/$_3.JPG", "url2"=>"http://i.ebayimg.com/00/s/NTAwWDMzNA==/z/lNMAAOSwKOJYHCQl/$_3.JPG"}]}]}]

bjjb commented 7 years ago

Hi @neverender, @yasuhisa1984 (sorry about the late response), is this still an issue for you folks?

yasuhisa1984 commented 7 years ago

@bjjb I am still suffering. If there is a solution, I am glad.

yasuhisa1984 commented 7 years ago

I solved it using compare_by_identity. (Hash#compare_by_identity) I should change object.id. Thank you.

bjjb commented 7 years ago

Good job, @neverender .