訪客結帳

即便使用者已登入 Google 帳戶,訪客結帳功能也能透過 Google 向合作夥伴下單。

如要判斷使用者訂單是以訪客身分提交,還是登入 Google 帳戶,請檢查 SubmitOrderRequestMessagefinalOrder.cart.extension.contact 內的 emailVerified 欄位。如果使用者登入 Google 帳戶的訂單,emailVerified 將設為 true,而訪客使用者的訂單則完全不會有 emailVerified

訪客訂單

{
  "finalOrder": {
    ...
    "cart": {
      ...
      "extension": {
        "@type": "type.googleapis.com/google.actions.v2.orders.FoodItemExtension",
        "contact": {
          "displayName": "Lovefood Ordering",
          "email": "ilovefood@example.com",
          "phoneNumber": "+16501234567",
          "firstName": "Lovefood",
          "lastName": "Ordering"
        }
      }
    }
  }
}

登入的訂單

{
  "finalOrder": {
    ...
    "cart": {
      ...
      "extension": {
        "@type": "type.googleapis.com/google.actions.v2.orders.FoodItemExtension",
        "contact": {
          "displayName": "Lovefood Ordering",
          "email": "ilovefood@example.com",
          "phoneNumber": "+16501234567",
          "firstName": "Lovefood",
          "lastName": "Ordering",
          "emailVerified": true
        }
      }
    }
  }
}