BookingFailure 的定义
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
创建或更新预订时都可能会遇到预订失败的情况。
BookingFailure 的定义
// 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. In other
// words, the booking can no longer be canceled by the user.
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;
// (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.
message ThreeDS1Parameters {
// The URL from which to load a form to present to the User for
// authentication.
string acs_url = 1;
// A PaymentAuthentication Request. To be posted to the ACSUrl form if
// supplied.
string pa_req = 2;
// An identifier used by the ACS provider. To be posted to the ACSUrl
// form if supplied.
string transaction_id = 3;
// Merchant data. To be posted to the ACSUrl form if supplied.
string md_merchant_data = 4;
}
// Parameters used by a RwG aggregator 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;
}
PaymentFailureInformation payment_failure = 4;
}
CreditCardType 的定义
// Used when booking/order failure 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;
}
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eBookingFailure explains why creating or updating a booking was unsuccessful, primarily due to business logic issues.\u003c/p\u003e\n"],["\u003cp\u003eThis message includes an enum \u003ccode\u003eCause\u003c/code\u003e outlining various reasons for booking failures, such as slot unavailability, payment errors, or user restrictions.\u003c/p\u003e\n"],["\u003cp\u003eWhen the cause is \u003ccode\u003ePAYMENT_ERROR_CARD_TYPE_REJECTED\u003c/code\u003e, a corresponding \u003ccode\u003eCreditCardType\u003c/code\u003e enum specifies the rejected card type.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eBookingFailure\u003c/code\u003e also contains optional fields like \u003ccode\u003edescription\u003c/code\u003e for debugging and \u003ccode\u003epayment_failure\u003c/code\u003e for additional payment-related details.\u003c/p\u003e\n"],["\u003cp\u003eIn cases of 3D Secure 1 (3DS1) payment authentication, \u003ccode\u003epayment_failure\u003c/code\u003e includes \u003ccode\u003ethreeds1_parameters\u003c/code\u003e for initiating the process.\u003c/p\u003e\n"]]],["Booking failures occur during booking creation or updates, primarily due to business logic errors. Reasons include: unavailable or already booked slots, expired leases, missed cancellation windows, payment issues (e.g., rejected card type, declined card, invalid payment option), existing overlapping reservations, user over booking limit, already canceled or not cancellable booking and offer unavailable. Some payment failures may require a 3DS1 challenge. A rejected card type is specified using enumerated options like VISA, MASTERCARD, etc.\n"],null,["# BookingFailure definition\n\nBooking failure can happen at the stage of creating or updating a\nBooking.\n\n### BookingFailure Definition\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. In other\n // words, the booking can no longer be canceled by the user.\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 // (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 message ThreeDS1Parameters {\n // The URL from which to load a form to present to the User for\n // authentication.\n string acs_url = 1;\n\n // A PaymentAuthentication Request. To be posted to the ACSUrl form if\n // supplied.\n string pa_req = 2;\n\n // An identifier used by the ACS provider. To be posted to the ACSUrl\n // form if supplied.\n string transaction_id = 3;\n\n // Merchant data. To be posted to the ACSUrl form if supplied.\n string md_merchant_data = 4;\n }\n\n // Parameters used by a RwG aggregator 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 PaymentFailureInformation payment_failure = 4;\n}\n```\n\n### CreditCardType Definition\n\n```gdscript\n// Used when booking/order failure cause is PAYMENT_ERROR_CARD_TYPE_REJECTED to\n// indicate the type of credit card that was rejected.\nenum 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```"]]