以访客身份结账

通过访客结账方式,无论用户是否登录了 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
        }
      }
    }
  }
}