iaintshine / presta_shop

A library for Ruby to interact with the PrestaShop's Web Service API
MIT License
8 stars 11 forks source link

Can you upgrade the gem for v 1.5.6 #1

Closed dhirajbajaj closed 10 years ago

dhirajbajaj commented 10 years ago

Hi, Can you update the gem for 1.5.6 version.

iaintshine commented 10 years ago

Hi, I've tested the gem on v 1.5.6 of the PrestaShop and for my particular use case it works correctly. What kind of issue did you encounter ?

dhirajbajaj commented 10 years ago

I got this. "Unsupported PrestaShop web service version : 1.5.6.0." It is failing validation in headers.rb

iaintshine commented 10 years ago

Hi, I've post a fix to this issue and it will hopefully work for you.

dhirajbajaj commented 10 years ago

Hey, I forked and changed that for my usage.

While parsing customer with id = 1.

customer = PrestaShop::Customer.find 1
# customer =  PrestaShop.get resource: :customers, id: 1
render :text => customer.to_yaml

I get undefined method `xml_node_to_hash' for PrestaShop::Parser:Module

see: http://ruby-doc.org/gems/docs/h/hosemonkey-0.1.0/Hash.html#method-c-xml_node_to_hash https://gist.github.com/huy/819999

iaintshine commented 10 years ago

Yes, that's something that I don't have tests for (entity with associations). I'll post an update shortly.

dhirajbajaj commented 10 years ago

I posted a update: See : https://github.com/dhirajbajaj/presta_shop/blob/master/lib/prestashop.rb See: https://github.com/dhirajbajaj/presta_shop/blob/master/lib/core/hash_ext.rb

iaintshine commented 10 years ago

Hi, thanks for the update. I'll pull your changes into the gem.