Skip to content
Docs
Get RestroPress

RestroPress - DoorDash Delivery

Updated 3 min read
On this page

RestroPress - DoorDash Delivery is intended to quote and book DoorDash Drive deliveries for delivery orders placed through RestroPress. In version 1.0.0 only part of that is wired up, and the plugin as shipped contains a code error that stops it from loading (see Troubleshooting). This page documents what the code contains, not a finished workflow.

Requirements#

  • RestroPress must be active. The plugin does not check for it, so activating it without RestroPress is not guarded.
  • A DoorDash Drive developer account. The settings ask for a Developer ID, Key ID and Signing Secret taken from the DoorDash developer portal.
  • A Google Maps API key. It is used to turn the customer's delivery coordinates into a street address.
  • The readme states WordPress 5.0 or newer.

Installation#

Install the ZIP from Plugins › Add New › Upload Plugin and activate it. The plugin has no licence field and no update mechanism of its own.

Settings#

The plugin adds a DoorDash Delivery section under RestroPress › Settings › General with a heading, DoorDash Settings, and three text fields:

SettingWhat it doesDefault
Developer IDYour DoorDash developer ID, from the DoorDash developer portal. Stored as rpress_doordash_developer_id., (a single comma)
Key IDYour DoorDash key ID. Stored as rpress_doordash_key_id.,
Signing SecretYour DoorDash signing secret. Stored as rpress_doordash_signing_secret.,

The plugin also contains markup for a "Doordash Based" delivery-fee method with its own Developer ID, Key ID, Signing Secret and Google Map API Key fields. That markup is meant to appear inside the RestroPress Delivery Fee extension, but the plugin never attaches it to any hook, so it is not displayed.

How it works#

Only one thing is hooked on the storefront: a check on the checkout form (rpress_purchase_form_required_fields).

  1. The check reads a delivery_latlng cookie holding the customer's latitude and longitude. With no cookie it does nothing.
  2. It uses the Google Maps Geocoding API (with the key stored in the Delivery Fee option rp_delivery_fee) to turn the coordinates into an address.
  3. It requests a quote from the DoorDash Drive API using the store address from the same option and a JWT signed with your Developer ID, Key ID and Signing Secret.
  4. If any step fails, checkout shows an error: the location is invalid, the address could not be validated, or delivery is not available to the location.

The code also contains functions that would add the DoorDash quote as the delivery fee, create a DoorDash delivery for an order and save _doordash_delivery_id, _doordash_delivery_status and _doordash_delivery_data on it. None of these are hooked up. The fee filter line is commented out and nothing calls the order function. Deliveries are created in USD with "return to pickup" as the action if undeliverable.

Troubleshooting#

  • Fatal error on activation or on every page. The file public/class-restropress-doordash-delivery-public.php contains unresolved merge-conflict markers (<<<<<<< HEAD), which PHP reports as a syntax error. The plugin cannot load until that file is fixed.
  • "Invalid delivery location. Please select a valid delivery address." The delivery_latlng cookie is not in lat,lng form.
  • "Could not validate delivery address. Please try again." No Google Maps API key is saved in the Delivery Fee settings, or Google's geocoder returned no result.
  • "Delivery is not available to your location. Please choose a different address or select pickup." DoorDash did not return a quote, for example because of wrong credentials or an address outside its service area.
Was this page helpful?