Thêm dịch vụ trực tuyến

Dịch vụ trực tuyến được định nghĩa là những dịch vụ được tổ chức hoàn toàn trực tuyến thông qua một nền tảng được lưu trữ và không yêu cầu khách hàng trực tiếp tham gia dịch vụ. Một số ví dụ về các dịch vụ trực tuyến có thể bao gồm:

  • Lớp học yoga trực tuyến qua Zoom
  • Lớp học trang điểm trực tuyến qua Google Meet
  • Ước tính video trực tuyến qua hệ thống ống nước qua Skype

Điều kiện sử dụng dịch vụ trực tuyến

Trước khi bắt đầu triển khai, vui lòng xem lại các phương pháp hay nhất và chính sách về dịch vụ trực tuyến.

Triển khai dịch vụ trực tuyến

Tích hợp dịch vụ trực tuyến là một tiện ích bổ sung cho việc tích hợp toàn diện hiện có và yêu cầu bạn thực hiện một số thay đổi đối với phương thức triển khai hiện có. Ở cấp độ cao, các thay đổi sau đây bao gồm:

  • Nguồn cấp dữ liệu: thêm type, VirtualSession, DirectMerchantPaymentCancellationPolicy (nếu bạn chưa thêm) vào nguồn cấp dữ liệu Dịch vụ.
  • Máy chủ đặt trước: thêm VirtualSessionInfo vào phương thức CreateBooking, tạo email và gửi thông tin thiết lập ảo cho người dùng
  • Cập nhật theo thời gian thực (hành vi hiện tại): xử lý các thay đổi đối với khoảng không quảng cáo ảo thông qua RTU InventoryUpdate, các sửa đổi đối với yêu cầu đặt phòng thông qua BookingNotification RTU và các thay đổi đối với dịch vụ qua RTU Service

Nguồn cấp dữ liệu

Nguồn cấp dữ liệu dịch vụ

Chúng tôi thêm các trường sau đây vào Nguồn cấp dữ liệu dịch vụ để hỗ trợ các dịch vụ trực tuyến.

Quy cách nguồn cấp dữ liệu dịch vụ

 enum ServiceType {
     SERVICE_TYPE_UNSPECIFIED = 0;
    // Service that provides dining reservation.
    SERVICE_TYPE_DINING_RESERVATION = 1;
    // Service that provides food ordering in general, could be either takeout
    // or delivery or both.
    SERVICE_TYPE_FOOD_ORDERING = 2;
    // Service that only provides food delivery.
    SERVICE_TYPE_FOOD_DELIVERY = 6;
    // Service that only provides food takeout.
    SERVICE_TYPE_FOOD_TAKEOUT = 7;

    // Service that provides appointments or classes. Recommended for (1) health
    // and fitness, (2) spa and beauty, and (3) financial consults and
    // evaluations services. Please see the supported service types:
    // https://developers.google.com/maps-booking/guides/end-to-end-integration/overview
    SERVICE_TYPE_APPOINTMENT = 5;
    // Service that provides appointment for an online class or session which
    // will be fully virtual. Must be set if enabling virtual service bookings.
    SERVICE_TYPE_ONLINE_APPOINTMENT = 8;
  }
// Information about virtual/online session. E.g. Online yoga class, virtual
// cooking class etc.
message VirtualSession {
  // Instructions on how this virtual class is set up. If the partner does not
  // include the video URL with the booking, then this text must include when
  // the video URL will be shared with the user. Eg. “Zoom url will be mailed
  // 30 minutes prior to the class”. (Recommended)
  // Only the folloiwng four tags are supported: <br>, <strong>, <em>, <i>.
  Text session_instructions = 1;

  // Requirements for the given virtual session. Eg. yoga mat,
  // cooking utensils etc. (Recommended)
  // Only the folloiwng four tags are supported: <br>, <strong>, <em>, <i>.
  Text session_requirements = 2;

  // Information about the virtual platform used in this session. (Required to
  // enable virtual services)
  message VirtualPlatformInfo {
    // Enum to indicate which virtual platform would be used by the merchant.
    enum Platform {
      PLATFORM_UNSPECIFIED = 0;
      // The merchant is flexible in which video platform they use.
      FLEXIBLE = 1;
      GOOGLE_HANGOUTS = 2;
      GOOGLE_MEET = 3;
      ZOOM = 4;
      SKYPE = 5;
      YOUTUBE = 6;
      // Should be set if the video platform used is different from the ones
      // mentioned here.
      OTHER = 7;
    }
    Platform platform = 1;
    // The name of the platform if the platform is set to OTHER. (Required if
    // platform is set to OTHER)
    Text other_platform_name = 2;
  }
  VirtualPlatformInfo virtual_platform_info = 3;

  // Set this as true if the virtual session is not live and is pre-recorded.
  // (Optional)
  bool is_session_prerecorded = 4;
}
// Information about how the user can pay directly to the merchant instead of
// pre-paying for the service via RwG.
message DirectMerchantPayment {
  // Users would be advised to pay only via the payment methods mentioned below.
  repeated Text payment_methods = 1;
}
// Cancellation policy for a service.
message CancellationPolicy {
  // Defines a single refund condition. Multiple refund conditions could be
  // used together to describe "refund steps" as various durations before the
  // service start time.
  message RefundCondition {
    // Duration in seconds before the start time, until when the customer can
    // receive a refund for part of the service's cost specified in
    // `refund_percent`.
    // When set to 0 (default), the service can be cancelled at any time.
    int64 min_duration_before_start_time_sec = 1;

    // The percent that can be refunded, as long as the service booking is
    // cancelled at least `min_duration_before_start_time` before the service
    // start time, in the range of [0, 100]. When set to 0 (default), the
    // service is not refundable. When set to 100 this service is fully
    // refundable.
    uint32 refund_percent = 2;
  }
  // Zero or more refund conditions applicable to the policy.
  repeated RefundCondition refund_condition = 1;
}

Ví dụ về nguồn cấp dữ liệu dịch vụ

{
  "service": [
    {
      "merchant_id": "100",
      "service_id": "100-1",
      "type" : "SERVICE_TYPE_ONLINE_APPOINTMENT",
      "localized_service_name": {
        "value": "Makeup masterclass",
        "localized_value": [
          {
            "locale": "en",
            "value": "Makeup masterclass"
          }
        ]
      },
      "localized_description": {
        "value": "Learn how to do runway makeup from an award winning makeup artist.",
        "localized_value": [
          {
            "locale": "en",
            "value": "Learn how to do runway makeup from an award winning makeup artist."
          }
        ]
      },
      "virtual_session": {
        "session_instructions": {
          "value": "You must have access to a computer, and a solid internet connection. Class registration link will be sent to you 15 mins before the start of the class. The class link will be accessible 1 day after the class.  ",
          "localized_value": [
            {
              "locale": "en",
              "value": "You must have access to a computer, and a solid internet connection. Class registration link will be sent to you 15 mins before the start of the class. The class link will be accessible 1 day after the class.  "
            }
          ]
        },
        "session_requirements": {
          "value": "makeup brush, makeup palette, mirror",
          "localized_value": [
            {
              "locale": "en",
              "value": "makeup brush, makeup palette, mirror"
            }
          ]
        },
        "virtual_platform_info": {
          "platform": "OTHER",
          "other_platform_name": "Susan's hosted platform"
        }
      },
      "direct_merchant_payment": {
        "payment_methods": [
          {
            "value": "Venmo",
            "localized_value": [
              {
                "locale": "en",
                "value": "Venmo"
              }
            ]
          }
        ]
      },
      "price": {
        "price_micros": 75000000,
        "currency_code": "USD"
      },
      "rules": {
        "min_advance_booking": 0,
        "min_advance_online_canceling": 86400,
        "cancellation_policy": {
          "refund_condition": [
            {
              "min_duration_before_start_time_sec": 3600,
              "refund_percent": 100
            }
          ]
        }
      },
      "prepayment_type": "NOT_SUPPORTED",
      "tax_rate": {
        "micro_percent": 7750000
      }
    },
    {
      "merchant_id": "100",
      "service_id": "100-2",
      "type" : "SERVICE_TYPE_ONLINE_APPOINTMENT",
      "localized_service_name": {
        "value": "Advanced Vinyasa Yoga",
        "localized_value": [
          {
            "locale": "en",
            "value": "Advanced Vinyasa Yoga"
          }
        ]
      },
      "localized_description": {
        "value": "Learn the advanced techniques of vinyasa yoga taught by award winning yoga instructors.",
        "localized_value": [
          {
            "locale": "en",
            "value": "Learn the advanced techniques of vinyasa yoga taught by award winning yoga instructors."
          }
        ]
      },
      "virtual_session": {
        "session_instructions": {
          "value": "You must have access to a computer, and a solid internet connection. Class registration link will be included in an email from the merchant.",
          "localized_value": [
            {
              "locale": "en",
              "value": "You must have access to a computer, and a solid internet connection. Class registration link will be included in an email from the merchant."
            }
          ]
        },
        "session_requirements": {
          "value": "yoga mat, dumbbells",
          "localized_value": [
            {
              "locale": "en",
              "value": "yoga mat, dumbbells"
            }
          ]
        },
        "virtual_platform_info": {
          "platform": "ZOOM"
        }
      },
      "price": {
        "price_micros": 40000000,
        "currency_code": "USD"
      },
      "rules": {
        "min_advance_booking": 0,
        "min_advance_online_canceling": 86400,
        "cancellation_policy": {
          "refund_condition": [
            {
              "min_duration_before_start_time_sec": 86400,
              "refund_percent": 100
            },
            {
              "min_duration_before_start_time_sec": 3600,
              "refund_percent": 50
            }
          ]
        }
      },
      "prepayment_type": "REQUIRED",
      "tax_rate": {
        "micro_percent": 7750000
      },
      "require_credit_card": "REQUIRE_CREDIT_CARD_ALWAYS"
    }
  ]
}
  • Nội dung mô tả đã bản địa hoá: Nội dung mô tả phải nêu rõ nội dung của dịch vụ. Vui lòng tham khảo hướng dẫn về các phương pháp hay nhất để tìm hiểu cách định cấu trúc nội dung dịch vụ hiệu quả nhất.
  • Hướng dẫn cho phiên: Hướng dẫn cho phiên phải mô tả tất cả các bước thiết lập cần thiết và đáp ứng những hướng dẫn trong chính sách.
    • Nếu URL video và mã cuộc họp của nền tảng không được tạo tự động trong tính năng CreateBooking (ví dụ: thông tin chi tiết không được gửi qua CreateBookingResponse), bạn nên gọi rõ trong session_instructions khi và từ người nào sẽ cho biết thông tin chi tiết về nền tảng sẽ được gửi cho họ.
  • Yêu cầu về phiên: Các yêu cầu về phiên phải mô tả tất cả thiết bị hoặc tài liệu cần thiết mà người dùng cần tham gia trong lớp một cách hiệu quả. Bạn cũng có thể bao gồm các tài liệu không bắt buộc mà người dùng có thể cần, nhưng vui lòng đánh dấu các tài liệu đó là không bắt buộc.
  • Nền tảng: Nền tảng này phải cho biết nền tảng mà người dùng sẽ sử dụng để truy cập dịch vụ trực tuyến.
    • Nếu sau đó nền tảng sẽ do người bán xác định, hãy đặt platform thành FLEXIBLE.
    • Nếu nền tảng mà người bán đang sử dụng không có trong danh sách, hãy đặt platform thành OTHER và chỉ định other_platform_name.
  • Chính sách huỷ: Có chính sách huỷ chính xác. Đặt CancellationPolicy nếu cho phép hoàn tiền và huỷ. Nếu bạn không đặt chính sách này, thì chúng tôi sẽ không cho phép hoàn tiền.

Nguồn cấp dữ liệu về tình trạng còn hàng

  • Spots Total (Tổng số điểm): Đặt con số này lên tổng số người tham gia được phép cho nền tảng (đảm bảo trừ đi nhân viên)

Máy chủ đặt phòng

Không bắt buộc: Nếu hệ thống của bạn thay mặt người bán tạo mã cuộc họp và url, vui lòng thêm thuộc tính VirtualSessionInfo vào CreateBookingResponse của bạn.

Thông số tạo mục đặt trước

message Booking {
// Information related to the virtual session which was booked.
message VirtualSessionInfo {
  // URL which was created for the virtual session. (optional)
  string session_url = 1;
  // The meeting id which was created for the virtual session. (optional)
  string meeting_id = 2;
  // Password required to access the session. (optional)
  string password = 3;
}

 VirtualSessionInfo virtual_session_info = X;
}

Tạo yêu cầu đặt trước

{
  "idempotency_token": "10000000000",
  "payment_information": {
    "prepayment_status": "PREPAYMENT_NOT_PROVIDED"
  },
  "slot": {
    "confirmation_mode": "CONFIRMATION_MODE_SYNCHRONOUS",
    "duration_sec": "3600",
    "merchant_id": "10001",
    "service_id": "10001-1",
    "start_sec": "1586829600"
  },
  "user_information": {
    "email": "john.doe@gmail.com",
    "family_name": "John",
    "given_name": "Doe",
    "telephone": "+123 456 7890",
    "user_id": "110291237"
  }
}

Tạo phản hồi đặt trước

{
  "booking": {
    "bookingId": "abcdefg-12345",
    "slot": {
      "merchantId": "10001",
      "serviceId": "10001-1",
      "startSec": "1586804400",
      "durationSec": "3600"
    },
    "userInformation": {
      "userId": "110291237",
      "givenName": "John",
      "familyName": "Doe",
      "telephone": "+123 456 7890",
      "email": "john.doe@gmail.com"
    },
    "status": "CONFIRMED",
    "virtual_session_info": {
      "video_url": "meet.google.com/abcd-efg",
      "meeting_id": "abcd-efg",
      "password" : "somepassword"
    }
  }
}

Thông tin cập nhật theo thời gian thực

Logic hiện tại của việc cập nhật quỹ phòng hoặc lượt đặt trước là nên được duy trì cho các lượt đặt trước ảo.

  • InventoryUpdate RTU: Mọi bản cập nhật cho những thay đổi đối với vị trí trên hệ thống của bạn hoặc hệ thống Đặt chỗ bằng Google, nên kích hoạt RTU InventoryUpdate để thông báo cho chúng tôi về những thay đổi đối với khe.
  • RTNotification RTU: Mọi thông tin cập nhật về lượt đặt phòng (ví dụ: thay đổi về thời gian hoặc lượt hủy) trên hệ thống của bạn hoặc hệ thống Đặt chỗ bằng Google, sẽ kích hoạt một RTU thông báo để thông báo cho chúng tôi về những thay đổi đối với một lượt đặt phòng.
    • Nếu người dùng không gửi khoản thanh toán cho người bán/đối tác, vui lòng gửi RTU huỷ cho chúng tôi. Tính năng Đặt chỗ bằng Google sẽ gửi email thông báo hủy.
  • Dịch vụ RTU: Nếu bạn đang cập nhật dịch vụ thông qua một RTU dịch vụ, hãy nhớ thêm các trường dịch vụ trực tuyến thích hợp nếu bạn cập nhật cho một dịch vụ trực tuyến.

Email

Theo mặc định, tính năng Đặt chỗ bằng Google sẽ gửi email xác nhận, đặt phòng và huỷ lượt đặt phòng tiêu chuẩn khi người dùng giao dịch trên nền tảng Đặt chỗ bằng Google.

Đối tác phải gửi thêm thông tin chi tiết về hội nghị, thông tin thanh toán và chính sách huỷ trong các email riêng cho người dùng. Bạn có thể tùy ý gửi email nhắc nhở trước khi cuộc hẹn hoặc lớp học diễn ra. Vui lòng tham khảo tài liệu chính sách để đảm bảo bạn tuân thủ các chính sách email về lớp học ảo.