预订失败规范
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
以下阶段可能会出现预约失败的情况:(1) 创建租借订单;(2) 创建或更新预约订单。
// Status data that conveys why (1) creating a lease or (2) creating or updating
// a booking fails.
// BookingFailure is intended to primarily capture business logic errors.
message BookingFailure {
enum Cause {
// Default value: Don't use; amounts to an "unknown error"
CAUSE_UNSPECIFIED = 0;
// The referenced availability slot is not available any longer.
SLOT_UNAVAILABLE = 1;
// The user has already booked an appointment for the referenced
// availability slot.
SLOT_ALREADY_BOOKED_BY_USER = 2;
// The lease (if provided) has expired and cannot be used any longer to
// complete the requested booking.
LEASE_EXPIRED = 3;
// The requested cancellation cannot be performed at the current time due
// to time restrictions in the merchant's cancellation policy.
OUTSIDE_CANCELLATION_WINDOW = 4;
// An error was encountered while processing the payment because the
// provided credit card type was not accepted by the merchant. The credit
// card type must be supplied in rejected_card_type.
PAYMENT_ERROR_CARD_TYPE_REJECTED = 5;
// An error was encountered while processing the payment because the
// provided credit card was declined.
PAYMENT_ERROR_CARD_DECLINED = 6;
// An error was encountered with the pack/membership used to pay for the
// booking. There could be no valid uses left, it could have expired, etc.
PAYMENT_OPTION_NOT_VALID = 7;
// An error was encountered while processing the payment for this booking.
// Use this value to indicate a general payment related error, only if the
// error does not match to a specific payment error above.
PAYMENT_ERROR = 8;
// User cannot use the given payment option (e.g. user trying to use a
// first time price for the second time).
USER_CANNOT_USE_PAYMENT_OPTION = 9;
// A booking that the user tried to cancel has already been cancelled.
BOOKING_ALREADY_CANCELLED = 10;
// A booking that the user tried to cancel is not cancellable.
BOOKING_NOT_CANCELLABLE = 11;
// User has an existing reservation too close to this time.
OVERLAPPING_RESERVATION = 12;
// Booking failed due to the user being over the aggregator's per-user
// bookings limit.
USER_OVER_BOOKING_LIMIT = 13;
// Offer (previously "Deal") is unavailable for the provided slot. If the
// slot itself is unavailable, use SLOT_UNAVAILABLE instead.
OFFER_UNAVAILABLE = 16;
DEAL_UNAVAILABLE = 14 [deprecated = true];
// Set when payment is rejected because you are requesting that the
// transaction be tried again, but this time after undergoing 3DS1
// challenge/response. Note that the current transaction's failure state
// will stay failed. The retry will be completely separate.
//
// When this is the failure reason, payment_failure.3DS1_parameters
// MUST be set. If it is not, then the current cause will be treated as
// if it were PAYMENT_ERROR.
PAYMENT_REQUIRES_3DS1 = 15;
}
// The reason why the booking failed. (required)
Cause cause = 1;
// Set if cause is PAYMENT_ERROR_CARD_TYPE_REJECTED to indicate the type of
// credit card that was rejected.
enum CreditCardType {
// Default value. Used if credit card type does not match to one below.
CREDIT_CARD_TYPE_UNSPECIFIED = 0;
VISA = 1;
MASTERCARD = 2;
AMERICAN_EXPRESS = 3;
DISCOVER = 4;
JCB = 5;
}
// (required only if cause is PAYMENT_ERROR_CARD_TYPE_REJECTED)
CreditCardType rejected_card_type = 2;
// This optional field is used for the partner to include additional
// information for debugging purpose only. (optional)
string description = 3;
// Information about payment failures.
message PaymentFailureInformation {
// Parameters requesting that RwG perform a 3DS1 challenge.
//
// The parameters are set by EMVCo's description of the 3DS1 protocol.
// See https://www.emvco.com/emv-technologies/3d-secure/
message ThreeDS1Parameters {
// The URL from which to load a form to present to the User for
// authentication (required).
string acs_url = 1;
// A PaymentAuthentication Request. To be posted to the ACSUrl form if
// supplied.
// (optional).
string pa_req = 2;
// An identifier used by the ACS provider. To be posted to the ACSUrl
// form if supplied (optional).
string transaction_id = 3;
// Merchant data used by the ACS provider. To be posted to the ACSUrl
// for if supplied (optional).
string md_merchant_data = 4;
}
// Parameters used by a RwG partner to initiate a 3DS1 authentication
// protocol with the user. Will be ignored unless BookingFailure.cause
// is set to PAYMENT_REQUIRES_3DS1.
ThreeDS1Parameters threeds1_parameters = 5;
}
// Information about payment failures.
PaymentFailureInformation payment_failure = 4;
}
// Information about payment failures.
message PaymentFailureInformation {
// Parameters requesting that RwG perform a 3DS1 challenge.
//
// The parameters are set by EMVCo's description of the 3DS1 protocol.
// See https://www.emvco.com/emv-technologies/3d-secure/
message ThreeDS1Parameters {
// The URL from which to load a form to present to the User for
// authentication (required).
string acs_url = 1;
// A PaymentAuthentication Request. To be posted to the ACSUrl form if
// supplied.
// (optional).
string pa_req = 2;
// An identifier used by the ACS provider. To be posted to the ACSUrl
// form if supplied (optional).
string transaction_id = 3;
// Merchant data used by the ACS provider. To be posted to the ACSUrl
// for if supplied (optional).
string md_merchant_data = 4;
}
// Parameters used by a RwG partner to initiate a 3DS1 authentication
// protocol with the user. Will be ignored unless BookingFailure.cause
// is set to PAYMENT_REQUIRES_3DS1.
ThreeDS1Parameters threeds1_parameters = 5;
}
// The parameters are set by EMVCo's description of the 3DS1 protocol.
// See https://www.emvco.com/emv-technologies/3d-secure/
message ThreeDS1Parameters {
// The URL from which to load a form to present to the User for
// authentication (required).
string acs_url = 1;
// A PaymentAuthentication Request. To be posted to the ACSUrl form if
// supplied.
// (optional).
string pa_req = 2;
// An identifier used by the ACS provider. To be posted to the ACSUrl
// form if supplied (optional).
string transaction_id = 3;
// Merchant data used by the ACS provider. To be posted to the ACSUrl
// for if supplied (optional).
string md_merchant_data = 4;
}
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003e\u003ccode\u003eBookingFailure\u003c/code\u003e is a message type that conveys reasons for booking or lease creation failures, primarily focusing on business logic errors.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ecause\u003c/code\u003e field within \u003ccode\u003eBookingFailure\u003c/code\u003e indicates the specific reason for the failure, like slot unavailability, payment issues, or exceeding booking limits.\u003c/p\u003e\n"],["\u003cp\u003eWhen payment requires 3DS1 authentication, \u003ccode\u003eBookingFailure\u003c/code\u003e includes \u003ccode\u003eThreeDS1Parameters\u003c/code\u003e for the partner to initiate the authentication process.\u003c/p\u003e\n"],["\u003cp\u003eIf the failure cause is related to credit card rejection, \u003ccode\u003erejected_card_type\u003c/code\u003e specifies the card type.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eBookingFailure\u003c/code\u003e can optionally include a \u003ccode\u003edescription\u003c/code\u003e field for debugging purposes, providing additional context about the failure.\u003c/p\u003e\n"]]],["Booking failures occur when creating a lease or during booking creation/update. Failures are categorized by a `Cause`, such as `SLOT_UNAVAILABLE`, `PAYMENT_ERROR`, or `LEASE_EXPIRED`. Payment failures can specify `rejected_card_type`. For 3DS1 authentication, `PAYMENT_REQUIRES_3DS1` is used, with details in `ThreeDS1Parameters`, including `acs_url`, `pa_req`, `transaction_id`, and `md_merchant_data`. Additionally, the partner can add a `description` for debugging.\n"],null,["# Booking failure specification\n\nBooking failure can happen at the stage of (1) creating a Lease, or (2) creating\nor updating a Booking. \n\n```gdscript\n// Status data that conveys why (1) creating a lease or (2) creating or updating\n// a booking fails.\n// BookingFailure is intended to primarily capture business logic errors.\nmessage BookingFailure {\n enum Cause {\n // Default value: Don't use; amounts to an \"unknown error\"\n CAUSE_UNSPECIFIED = 0;\n\n // The referenced availability slot is not available any longer.\n SLOT_UNAVAILABLE = 1;\n\n // The user has already booked an appointment for the referenced\n // availability slot.\n SLOT_ALREADY_BOOKED_BY_USER = 2;\n\n // The lease (if provided) has expired and cannot be used any longer to\n // complete the requested booking.\n LEASE_EXPIRED = 3;\n\n // The requested cancellation cannot be performed at the current time due\n // to time restrictions in the merchant's cancellation policy.\n OUTSIDE_CANCELLATION_WINDOW = 4;\n\n // An error was encountered while processing the payment because the\n // provided credit card type was not accepted by the merchant. The credit\n // card type must be supplied in rejected_card_type.\n PAYMENT_ERROR_CARD_TYPE_REJECTED = 5;\n\n // An error was encountered while processing the payment because the\n // provided credit card was declined.\n PAYMENT_ERROR_CARD_DECLINED = 6;\n\n // An error was encountered with the pack/membership used to pay for the\n // booking. There could be no valid uses left, it could have expired, etc.\n PAYMENT_OPTION_NOT_VALID = 7;\n\n // An error was encountered while processing the payment for this booking.\n // Use this value to indicate a general payment related error, only if the\n // error does not match to a specific payment error above.\n PAYMENT_ERROR = 8;\n\n // User cannot use the given payment option (e.g. user trying to use a\n // first time price for the second time).\n USER_CANNOT_USE_PAYMENT_OPTION = 9;\n\n // A booking that the user tried to cancel has already been cancelled.\n BOOKING_ALREADY_CANCELLED = 10;\n\n // A booking that the user tried to cancel is not cancellable.\n BOOKING_NOT_CANCELLABLE = 11;\n\n // User has an existing reservation too close to this time.\n OVERLAPPING_RESERVATION = 12;\n\n // Booking failed due to the user being over the aggregator's per-user\n // bookings limit.\n USER_OVER_BOOKING_LIMIT = 13;\n\n // Offer (previously \"Deal\") is unavailable for the provided slot. If the\n // slot itself is unavailable, use SLOT_UNAVAILABLE instead.\n OFFER_UNAVAILABLE = 16;\n DEAL_UNAVAILABLE = 14 [deprecated = true];\n\n // Set when payment is rejected because you are requesting that the\n // transaction be tried again, but this time after undergoing 3DS1\n // challenge/response. Note that the current transaction's failure state\n // will stay failed. The retry will be completely separate.\n //\n // When this is the failure reason, payment_failure.3DS1_parameters\n // MUST be set. If it is not, then the current cause will be treated as\n // if it were PAYMENT_ERROR.\n PAYMENT_REQUIRES_3DS1 = 15;\n }\n\n // The reason why the booking failed. (required)\n Cause cause = 1;\n\n // Set if cause is PAYMENT_ERROR_CARD_TYPE_REJECTED to indicate the type of\n // credit card that was rejected.\n enum CreditCardType {\n // Default value. Used if credit card type does not match to one below.\n CREDIT_CARD_TYPE_UNSPECIFIED = 0;\n VISA = 1;\n MASTERCARD = 2;\n AMERICAN_EXPRESS = 3;\n DISCOVER = 4;\n JCB = 5;\n }\n\n // (required only if cause is PAYMENT_ERROR_CARD_TYPE_REJECTED)\n CreditCardType rejected_card_type = 2;\n\n // This optional field is used for the partner to include additional\n // information for debugging purpose only. (optional)\n string description = 3;\n\n // Information about payment failures.\n message PaymentFailureInformation {\n // Parameters requesting that RwG perform a 3DS1 challenge.\n //\n // The parameters are set by EMVCo's description of the 3DS1 protocol.\n // See https://www.emvco.com/emv-technologies/3d-secure/\n message ThreeDS1Parameters {\n // The URL from which to load a form to present to the User for\n // authentication (required).\n string acs_url = 1;\n\n // A PaymentAuthentication Request. To be posted to the ACSUrl form if\n // supplied.\n // (optional).\n string pa_req = 2;\n\n // An identifier used by the ACS provider. To be posted to the ACSUrl\n // form if supplied (optional).\n string transaction_id = 3;\n\n // Merchant data used by the ACS provider. To be posted to the ACSUrl\n // for if supplied (optional).\n string md_merchant_data = 4;\n }\n\n\n // Parameters used by a RwG partner to initiate a 3DS1 authentication\n // protocol with the user. Will be ignored unless BookingFailure.cause\n // is set to PAYMENT_REQUIRES_3DS1.\n ThreeDS1Parameters threeds1_parameters = 5;\n }\n\n\n // Information about payment failures.\n PaymentFailureInformation payment_failure = 4;\n}\n``` \n\n```gdscript\n // Information about payment failures.\n message PaymentFailureInformation {\n // Parameters requesting that RwG perform a 3DS1 challenge.\n //\n // The parameters are set by EMVCo's description of the 3DS1 protocol.\n // See https://www.emvco.com/emv-technologies/3d-secure/\n message ThreeDS1Parameters {\n // The URL from which to load a form to present to the User for\n // authentication (required).\n string acs_url = 1;\n\n // A PaymentAuthentication Request. To be posted to the ACSUrl form if\n // supplied.\n // (optional).\n string pa_req = 2;\n\n // An identifier used by the ACS provider. To be posted to the ACSUrl\n // form if supplied (optional).\n string transaction_id = 3;\n\n // Merchant data used by the ACS provider. To be posted to the ACSUrl\n // for if supplied (optional).\n string md_merchant_data = 4;\n }\n\n\n // Parameters used by a RwG partner to initiate a 3DS1 authentication\n // protocol with the user. Will be ignored unless BookingFailure.cause\n // is set to PAYMENT_REQUIRES_3DS1.\n ThreeDS1Parameters threeds1_parameters = 5;\n }\n``` \n\n```gdscript\n // The parameters are set by EMVCo's description of the 3DS1 protocol.\n // See https://www.emvco.com/emv-technologies/3d-secure/\n message ThreeDS1Parameters {\n // The URL from which to load a form to present to the User for\n // authentication (required).\n string acs_url = 1;\n\n // A PaymentAuthentication Request. To be posted to the ACSUrl form if\n // supplied.\n // (optional).\n string pa_req = 2;\n\n // An identifier used by the ACS provider. To be posted to the ACSUrl\n // form if supplied (optional).\n string transaction_id = 3;\n\n // Merchant data used by the ACS provider. To be posted to the ACSUrl\n // for if supplied (optional).\n string md_merchant_data = 4;\n }\n```"]]