RIAEvangelist / node-dominos-pizza-api

This is a node.js wrapper for the dominos pizza apis
MIT License
534 stars 129 forks source link

Address doesn't correctly understand apartment/suite #s #59

Closed johnhforrest closed 3 years ago

johnhforrest commented 8 years ago

The way the address object is currently built doesn't correctly pass apartment/suite numbers along to Domino's.

I think the guidance should be to use the address returned in the response of the store-locator API. Domino's has some logic on the server to convert full names like "Apartment" or "Suite" to APT or STE, and then adds properties to the Address object returned: UnitNumber and UnitType (in addition to appending STE 123 to the Street property).

If you make a call like this to the store-locator API: https://order.dominos.com/power/store-locator?type=Delivery&c=DAYTON%2C+OH+45420&s=550+WILMINGTON+AVE+suite+123

Notice the format that it returns the Address (address is fake so no PII concerns) in:

"Address": {
  "Street":"550 WILMINGTON AVE STE 123",
  "StreetNumber":"550",
  "StreetName":"WILMINGTON AVE",
  "UnitType":"STE",
  "UnitNumber":"123",
  "City":"DAYTON",
  "Region":"OH",
  "PostalCode":"45420"
}
RIAEvangelist commented 7 years ago

will review

RIAEvangelist commented 3 years ago

This has been added into v3.x branch and will be released in the next version