genitrust / dash-wallet

Dash Wallet for Android
http://www.hashengineeringsolutions.com/?page_id=196
0 stars 1 forks source link

Discovery Inputs do not record publisher ID. #5

Closed rgenito closed 6 years ago

rgenito commented 6 years ago

Previously the publisher was being supplied properly to Discovery Inputs. I don't know why this is not working since about a week or 2 ago...

  1. Are you passing the data parameter publisherId=47 to all GET and POST requests?
  2. Is "Publisher-Id" specified in the header of all requests?
rgenito commented 6 years ago

This was not fixed.

viral85 commented 6 years ago

Request :

POST http://dev.geni.to:8001/api/v1/discoveryInputs/ cryptoAddress=yPY4LkPdC6Q5Exfk7rTMbSHkdHkiuXhsZ2 zipCode=34236 crypto=DASH publisherID=47 usdAmount=711.00

Response

201 CREATED http://dev.geni.to:8001/api/v1/discoveryInputs/ { "id": "1e39b39441ca2f8dcaa69cffabee24de", "usdAmount": "711.00", "cryptoAmount": "0", "crypto": "DASH", "fiat": "USD", "zipCode": "34236", "bank": null, "state": null, "cryptoAddress": "yPY4LkPdC6Q5Exfk7rTMbSHkdHkiuXhsZ2", "createdIp": "157.32.9.253", "location": { "latitude": 27.3331293, "longitude": -82.5456374 }, "browserLocation": null, "publisher": null }

I am sending publisherID in request parameter and publisher-id in the request header. Please guide me what mistake I am committing.

rgenito commented 6 years ago

Ah ok, this must be a newly-issued bug with our API. I'll have @andrewosenenko check this out.

rgenito commented 6 years ago

Andrew, the priority of this API issue is CRITICAL. Fix asap. Thank you :)

rgenito commented 6 years ago

@andrewosenenko this is also URGENT. You have 3 urgent task! :) This task is for the master branch, and we will need a PR asap.

rgenito commented 6 years ago

@andrewosenenko to be specific, we need:

  1. the API will accept the header "Publisher-Id", which will record that we are working with the Publisher and associate the publisher with the objects that the 3rd party developer is working with.
  2. Any functionality that is using the GET parameter "publisherId" will continue to use that parameter. This is for backwards-compatibility support.
andrewosenenko commented 6 years ago

@rgenito we have already this code in our API publisherId = self.request.POST.get('publisherId') (it's from this endpoint pre_save methods) but post parameter need to be publisherId, not publisherID. I think previous devs don't synchronize between themselves

rgenito commented 6 years ago

IMPORTANT: pay attention to the letting casing of "publisherId"

jaydeep82 commented 6 years ago

@rgenito this issue has been fixed.

rgenito commented 6 years ago

@jaydeep82 on your latest TestNet build, I do not see that this has been fixed. My discovery Input did not register as Publisher ID 47. Are you passing this POST parameter? publisherId: 47

Also, with the API log, I see that we are still using ?publisherId=47 as a URL argument. Are you POSTing to /api/v1/discoveryInputs/?publisherId=47 ? If so, this is invalid. publisherId:47 needs to be in the form data.

Or did you compile the wrong code?

[17/Jan/2018 01:51:19] "GET /api/v1/discoveryInputs/ab6af0acdcd8e4307a8fd43c5aa5154e/offers/?publisherId=47 HTTP/1.1" 200 5052
jaydeep82 commented 6 years ago

@rgenito It is GET method. so publisherId will be passed as URL argument and it's use for GET OFFERS

@GET("api/v1/discoveryInputs/{discoveryId}/offers/") Call getOffers(@Path("discoveryId") String discoveryId, @Query("publisherId") String publisherId);

I also verified this at STEP 1 : GET OFFERS http://woc-reference-client.rgenito.dev.geni.to/buy.html

Also In all other POST methods, publisherId is being passed in Request body.