Mẫu URL cho lệnh chuyển hướng thanh toán

Sau khi đặt chỗ còn phòng với một mức giá cụ thể, người dùng sẽ được chuyển hướng đến trang đặt trước của bạn bằng một URL mà bạn xác định trong nguồn cấp dữ liệu Dịch vụ. Sau đây là ví dụ về một mẫu URL có thể sử dụng.

Các thông số trong mẫu này được tự động thêm vào bằng cách sử dụng các giá trị được chỉ định trong nguồn cấp dữ liệu của bạn và dùng để tạo đường liên kết mà người dùng sẽ sử dụng để tiếp tục đến trang đặt phòng của bạn.

`https://reservation-provider.com/examplerestaurant/book?date={availability_slot_start_seconds}&num_guests={resources_party_size}`

Các Giá trị Có sẵn cho Mẫu URL

Tham số mẫu Bắt buộc / Không bắt buộc Nguồn cấp dữ liệu Trường Giá trị mẫu
availability_slot_availability_tag Không bắt buộc độ khả dụng availability_tag thẻ
availability_slot_duration_seconds Không bắt buộc độ khả dụng duration_sec 3600
availability_slot_start_seconds Bắt buộc độ khả dụng start_sec 4152695841
resources_party_size Bắt buộc availability.resources party_size 2
resources_room_id Không bắt buộc availability.resources room_id bar_123

Định nghĩa mẫu URL

Sau đây là mẫu URL được gửi trong nguồn cấp dữ liệu Dịch vụ của bạn.

    Message Services {

      // ..
      UriTemplate uri_template;

      // A template specifying how Google should generate URLs to external site.
      message UriTemplate {

        // The uri template must follow the RFC6570, see
        // https://datatracker.ietf.org/doc/html/rfc6570.
        // Supports Level 2 templates.
        // e.g.
        // http://example.com/book/{foo}?b={bar}
        // * foo = 2
        // * bar = abc
        // https://example.com/book/2?b=abc
        // These parameters will be resolved to their values specified in their
        // respective entities.
        // 1) {availability_slot_start_seconds} :: populated from start_sec field in
        //   availability feed
        // 2) {resources_party_size} :: populated from party_size field in
        //   availability feed
        // 3) {availability_slot_duration_seconds} :: populated from duration_sec
        //   field in availability feed
        // 4) {resources_room_id} :: populated from room_id field in the
        //   resource section of the availability feed
        // 5) {availability_slot_availability_tag} :: populated from availability_tag
        //   field of the availability feed

        string uri_template = 1;
      }
    }