signalpoint / commerce

The Drupal Commerce module for DrupalGap.
8 stars 10 forks source link

401 - Unauthorized #13

Closed ghost closed 8 years ago

ghost commented 8 years ago

Hello,

I'm a newbie with drupalgap and I want to build an app of my website with commerce drupalgap.

I've followed tutorials I've found but still this issue when I'm on a product page and I click on Add to cart, nothing happen.

When I'm not logged in > POST: https://MYWEBSITE/?q=drupalgap/cart.json - 401 - Unauthorized

When logged in > GET: https://MYWEBSITE/?q=drupalgap/cart.json - 500 - Internal Server Error (Internal Server Error : An error occurred (0): Unable to get the data property amount as the parent data structure is not set.)

I understand that you have to be logged in to start an order, but can't find what is going on wit error 500

Please I need help !

signalpoint commented 8 years ago

@Pacificip

Regarding the 401, in Drupal go to admin/people/permissions and grant permissions for Create orders of any type.

Regarding the 500, that looks like a typical error with someone(s) misuse of an Entity Metadata Wrapper. Perhaps you have custom code acting on the loading of an order, and it's assuming the amount is set on the wrapper, but in fact it isn't. If not, it's got to be with a contrib module. The Commerce DrupalGap module in Drupal doesn't (yet) use any wrappers, so it's unlikely that it's causing the problem.

Use watchdog in Drupal, which should give you the exact file/line-number that is throwing the exception (generally the entity module in Drupal). Then add this line of code right before the exception (assuming you have the devel module enabled):

dpm(debug_backtrace());

Then do a GET on cart.json, then in a new tab visit the Drupal front end to see the dpm output, and from there you can trace backwards to find the culprit, or use xDebug to remote step through.

signalpoint commented 8 years ago

@Pacificip there have been many recent updates to this project, so hopefully it fixes your problem here. If it doesn't please feel free to open a new issue.

ghost commented 8 years ago

Dear Tyler,

Thanks for your last 2 EMails. I’ve updated DrupalGap but unfortunately my 500 error still remains. It seems to come from entity.wrapper.inc file but even with your instructions I can’t reach to find what is going (I’m not a programer). Do you have a DrupalGap Commerce update which take in charge wrapper ? (If I have well understood that’s cause this issue).

Does Stripe is still the only payment module available for Drupalgap ?

Thanks a lot for your help. Best regards Loïc HARNISCH

Pacific IP Services Webmaster Rechargetonmob.nchttp://www.rechargetonmob.nc/

l.harnisch@pacificip.commailto:pe.degryse@pacificip.com Tel : +687 26 30 66 Mob : +687 93 39 72 Fax : +687 26 96 76 skype : lharnisch

8 rue de Strasbourg - BP 9036 98807 NOUMEA CEDEX NEW-CALEDONIA

Le 14 juil. 2016 à 09:50, Tyler Frankenstein notifications@github.com<mailto:notifications@github.com> a écrit :

@Pacificiphttps://github.com/Pacificip

Regarding the 401, in Drupal go to admin/people/permissions and grant permissions for Create orders of any type.

Regarding the 500, that looks like a typical error with someone(s) misuse of an Entity Metadata Wrapper. Perhaps you have custom code acting on the loading of an order, and it's assuming the amount is set on the wrapper, but in fact it isn't. If not, it's got to be with a contrib module. The Commerce DrupalGap module in Drupal doesn't (yet) use any wrappers, so it's unlikely that it's causing the problem.

Use watchdog in Drupal, which should give you the exact file/line-number that is throwing the exception (generally the entity module in Drupal). Then add this line of code right before the exception (assuming you have the devel module enabled):

dpm(debug_backtrace());

Then do a GET on cart.json, then in a new tab visit the Drupal front end to see the dpm output, and from there you can trace backwards to find the culprit, or use xDebug to remote step through.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/signalpoint/commerce/issues/13#issuecomment-232509766, or mute the threadhttps://github.com/notifications/unsubscribe/ARzsYFTcTBl2xtPP989NJcJIQL-2hOzNks5qVWvBgaJpZM4IPl6g.