訪客結帳

訪客結帳功能可讓使用者透過 Google (無論是否登入 Google 帳戶)。

判斷使用者的訂單是以訪客身分提交,還是以訪客身分提交 請檢查 Google 帳戶中的 emailVerified 欄位 finalOrder.cart.extension.contactSubmitOrderRequestMessage。 登入 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
        }
      }
    }
  }
}