chore: add deprecated flag to soon to be deprecated fields in payment request and response (#4261)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Hrithikesh
2024-05-16 20:12:11 +05:30
committed by GitHub
parent 84cb2bcb6b
commit 9ac5d70e2e
2 changed files with 40 additions and 103 deletions

View File

@ -276,27 +276,32 @@ pub struct PaymentsRequest {
/// Passing this object creates a new customer or attaches an existing customer to the payment /// Passing this object creates a new customer or attaches an existing customer to the payment
pub customer: Option<CustomerDetails>, pub customer: Option<CustomerDetails>,
/// The identifier for the customer object. This field will be deprecated soon, use the customer object instead /// The identifier for the customer object.
#[schema(max_length = 255, example = "cus_y3oqhf46pyzuxjbcn2giaqnb44")] #[schema(max_length = 255, example = "cus_y3oqhf46pyzuxjbcn2giaqnb44")]
pub customer_id: Option<String>, pub customer_id: Option<String>,
/// The customer's email address This field will be deprecated soon, use the customer object instead /// The customer's email address.
#[schema(max_length = 255, value_type = Option<String>, example = "johntest@test.com")] /// This field will be deprecated soon, use the customer object instead
#[schema(max_length = 255, value_type = Option<String>, example = "johntest@test.com", deprecated)]
#[remove_in(PaymentsUpdateRequest, PaymentsCreateRequest, PaymentsConfirmRequest)]
pub email: Option<Email>, pub email: Option<Email>,
/// The customer's name. /// The customer's name.
/// This field will be deprecated soon, use the customer object instead. /// This field will be deprecated soon, use the customer object instead.
#[schema(value_type = Option<String>, max_length = 255, example = "John Test")] #[schema(value_type = Option<String>, max_length = 255, example = "John Test", deprecated)]
#[remove_in(PaymentsUpdateRequest, PaymentsCreateRequest, PaymentsConfirmRequest)]
pub name: Option<Secret<String>>, pub name: Option<Secret<String>>,
/// The customer's phone number /// The customer's phone number
/// This field will be deprecated soon, use the customer object instead /// This field will be deprecated soon, use the customer object instead
#[schema(value_type = Option<String>, max_length = 255, example = "3141592653")] #[schema(value_type = Option<String>, max_length = 255, example = "3141592653", deprecated)]
#[remove_in(PaymentsUpdateRequest, PaymentsCreateRequest, PaymentsConfirmRequest)]
pub phone: Option<Secret<String>>, pub phone: Option<Secret<String>>,
/// The country code for the customer phone number /// The country code for the customer phone number
/// This field will be deprecated soon, use the customer object instead /// This field will be deprecated soon, use the customer object instead
#[schema(max_length = 255, example = "+1")] #[schema(max_length = 255, example = "+1", deprecated)]
#[remove_in(PaymentsUpdateRequest, PaymentsCreateRequest, PaymentsConfirmRequest)]
pub phone_country_code: Option<String>, pub phone_country_code: Option<String>,
/// Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. When making a recurring payment by passing a mandate_id, this parameter is mandatory /// Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. When making a recurring payment by passing a mandate_id, this parameter is mandatory
@ -3157,7 +3162,12 @@ pub struct PaymentsResponse {
pub currency: String, pub currency: String,
/// The identifier for the customer object. If not provided the customer ID will be autogenerated. /// The identifier for the customer object. If not provided the customer ID will be autogenerated.
#[schema(max_length = 255, example = "cus_y3oqhf46pyzuxjbcn2giaqnb44")] /// This field will be deprecated soon. Please refer to `customer.id`
#[schema(
max_length = 255,
example = "cus_y3oqhf46pyzuxjbcn2giaqnb44",
deprecated
)]
pub customer_id: Option<String>, pub customer_id: Option<String>,
/// Details of customer attached to this payment /// Details of customer attached to this payment
@ -3241,15 +3251,18 @@ pub struct PaymentsResponse {
pub order_details: Option<Vec<pii::SecretSerdeValue>>, pub order_details: Option<Vec<pii::SecretSerdeValue>>,
/// description: The customer's email address /// description: The customer's email address
#[schema(max_length = 255, value_type = Option<String>, example = "johntest@test.com")] /// This field will be deprecated soon. Please refer to `customer.email` object
#[schema(max_length = 255, value_type = Option<String>, example = "johntest@test.com", deprecated)]
pub email: crypto::OptionalEncryptableEmail, pub email: crypto::OptionalEncryptableEmail,
/// description: The customer's name /// description: The customer's name
#[schema(value_type = Option<String>, max_length = 255, example = "John Test")] /// This field will be deprecated soon. Please refer to `customer.name` object
#[schema(value_type = Option<String>, max_length = 255, example = "John Test", deprecated)]
pub name: crypto::OptionalEncryptableName, pub name: crypto::OptionalEncryptableName,
/// The customer's phone number /// The customer's phone number
#[schema(value_type = Option<String>, max_length = 255, example = "3141592653")] /// This field will be deprecated soon. Please refer to `customer.phone` object
#[schema(value_type = Option<String>, max_length = 255, example = "3141592653", deprecated)]
pub phone: crypto::OptionalEncryptablePhone, pub phone: crypto::OptionalEncryptablePhone,
/// The URL to redirect after the completion of the operation /// The URL to redirect after the completion of the operation

View File

@ -13624,39 +13624,11 @@
}, },
"customer_id": { "customer_id": {
"type": "string", "type": "string",
"description": "The identifier for the customer object. This field will be deprecated soon, use the customer object instead", "description": "The identifier for the customer object.",
"example": "cus_y3oqhf46pyzuxjbcn2giaqnb44", "example": "cus_y3oqhf46pyzuxjbcn2giaqnb44",
"nullable": true, "nullable": true,
"maxLength": 255 "maxLength": 255
}, },
"email": {
"type": "string",
"description": "The customer's email address This field will be deprecated soon, use the customer object instead",
"example": "johntest@test.com",
"nullable": true,
"maxLength": 255
},
"name": {
"type": "string",
"description": "The customer's name.\nThis field will be deprecated soon, use the customer object instead.",
"example": "John Test",
"nullable": true,
"maxLength": 255
},
"phone": {
"type": "string",
"description": "The customer's phone number\nThis field will be deprecated soon, use the customer object instead",
"example": "3141592653",
"nullable": true,
"maxLength": 255
},
"phone_country_code": {
"type": "string",
"description": "The country code for the customer phone number\nThis field will be deprecated soon, use the customer object instead",
"example": "+1",
"nullable": true,
"maxLength": 255
},
"off_session": { "off_session": {
"type": "boolean", "type": "boolean",
"description": "Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. When making a recurring payment by passing a mandate_id, this parameter is mandatory", "description": "Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. When making a recurring payment by passing a mandate_id, this parameter is mandatory",
@ -14003,39 +13975,11 @@
}, },
"customer_id": { "customer_id": {
"type": "string", "type": "string",
"description": "The identifier for the customer object. This field will be deprecated soon, use the customer object instead", "description": "The identifier for the customer object.",
"example": "cus_y3oqhf46pyzuxjbcn2giaqnb44", "example": "cus_y3oqhf46pyzuxjbcn2giaqnb44",
"nullable": true, "nullable": true,
"maxLength": 255 "maxLength": 255
}, },
"email": {
"type": "string",
"description": "The customer's email address This field will be deprecated soon, use the customer object instead",
"example": "johntest@test.com",
"nullable": true,
"maxLength": 255
},
"name": {
"type": "string",
"description": "The customer's name.\nThis field will be deprecated soon, use the customer object instead.",
"example": "John Test",
"nullable": true,
"maxLength": 255
},
"phone": {
"type": "string",
"description": "The customer's phone number\nThis field will be deprecated soon, use the customer object instead",
"example": "3141592653",
"nullable": true,
"maxLength": 255
},
"phone_country_code": {
"type": "string",
"description": "The country code for the customer phone number\nThis field will be deprecated soon, use the customer object instead",
"example": "+1",
"nullable": true,
"maxLength": 255
},
"off_session": { "off_session": {
"type": "boolean", "type": "boolean",
"description": "Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. When making a recurring payment by passing a mandate_id, this parameter is mandatory", "description": "Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. When making a recurring payment by passing a mandate_id, this parameter is mandatory",
@ -14494,14 +14438,15 @@
}, },
"customer_id": { "customer_id": {
"type": "string", "type": "string",
"description": "The identifier for the customer object. This field will be deprecated soon, use the customer object instead", "description": "The identifier for the customer object.",
"example": "cus_y3oqhf46pyzuxjbcn2giaqnb44", "example": "cus_y3oqhf46pyzuxjbcn2giaqnb44",
"nullable": true, "nullable": true,
"maxLength": 255 "maxLength": 255
}, },
"email": { "email": {
"type": "string", "type": "string",
"description": "The customer's email address This field will be deprecated soon, use the customer object instead", "description": "The customer's email address.\nThis field will be deprecated soon, use the customer object instead",
"deprecated": true,
"example": "johntest@test.com", "example": "johntest@test.com",
"nullable": true, "nullable": true,
"maxLength": 255 "maxLength": 255
@ -14509,6 +14454,7 @@
"name": { "name": {
"type": "string", "type": "string",
"description": "The customer's name.\nThis field will be deprecated soon, use the customer object instead.", "description": "The customer's name.\nThis field will be deprecated soon, use the customer object instead.",
"deprecated": true,
"example": "John Test", "example": "John Test",
"nullable": true, "nullable": true,
"maxLength": 255 "maxLength": 255
@ -14516,6 +14462,7 @@
"phone": { "phone": {
"type": "string", "type": "string",
"description": "The customer's phone number\nThis field will be deprecated soon, use the customer object instead", "description": "The customer's phone number\nThis field will be deprecated soon, use the customer object instead",
"deprecated": true,
"example": "3141592653", "example": "3141592653",
"nullable": true, "nullable": true,
"maxLength": 255 "maxLength": 255
@ -14523,6 +14470,7 @@
"phone_country_code": { "phone_country_code": {
"type": "string", "type": "string",
"description": "The country code for the customer phone number\nThis field will be deprecated soon, use the customer object instead", "description": "The country code for the customer phone number\nThis field will be deprecated soon, use the customer object instead",
"deprecated": true,
"example": "+1", "example": "+1",
"nullable": true, "nullable": true,
"maxLength": 255 "maxLength": 255
@ -14885,7 +14833,8 @@
}, },
"customer_id": { "customer_id": {
"type": "string", "type": "string",
"description": "The identifier for the customer object. If not provided the customer ID will be autogenerated.", "description": "The identifier for the customer object. If not provided the customer ID will be autogenerated.\nThis field will be deprecated soon. Please refer to `customer.id`",
"deprecated": true,
"example": "cus_y3oqhf46pyzuxjbcn2giaqnb44", "example": "cus_y3oqhf46pyzuxjbcn2giaqnb44",
"nullable": true, "nullable": true,
"maxLength": 255 "maxLength": 255
@ -15024,21 +14973,24 @@
}, },
"email": { "email": {
"type": "string", "type": "string",
"description": "description: The customer's email address", "description": "description: The customer's email address\nThis field will be deprecated soon. Please refer to `customer.email` object",
"deprecated": true,
"example": "johntest@test.com", "example": "johntest@test.com",
"nullable": true, "nullable": true,
"maxLength": 255 "maxLength": 255
}, },
"name": { "name": {
"type": "string", "type": "string",
"description": "description: The customer's name", "description": "description: The customer's name\nThis field will be deprecated soon. Please refer to `customer.name` object",
"deprecated": true,
"example": "John Test", "example": "John Test",
"nullable": true, "nullable": true,
"maxLength": 255 "maxLength": 255
}, },
"phone": { "phone": {
"type": "string", "type": "string",
"description": "The customer's phone number", "description": "The customer's phone number\nThis field will be deprecated soon. Please refer to `customer.phone` object",
"deprecated": true,
"example": "3141592653", "example": "3141592653",
"nullable": true, "nullable": true,
"maxLength": 255 "maxLength": 255
@ -15563,39 +15515,11 @@
}, },
"customer_id": { "customer_id": {
"type": "string", "type": "string",
"description": "The identifier for the customer object. This field will be deprecated soon, use the customer object instead", "description": "The identifier for the customer object.",
"example": "cus_y3oqhf46pyzuxjbcn2giaqnb44", "example": "cus_y3oqhf46pyzuxjbcn2giaqnb44",
"nullable": true, "nullable": true,
"maxLength": 255 "maxLength": 255
}, },
"email": {
"type": "string",
"description": "The customer's email address This field will be deprecated soon, use the customer object instead",
"example": "johntest@test.com",
"nullable": true,
"maxLength": 255
},
"name": {
"type": "string",
"description": "The customer's name.\nThis field will be deprecated soon, use the customer object instead.",
"example": "John Test",
"nullable": true,
"maxLength": 255
},
"phone": {
"type": "string",
"description": "The customer's phone number\nThis field will be deprecated soon, use the customer object instead",
"example": "3141592653",
"nullable": true,
"maxLength": 255
},
"phone_country_code": {
"type": "string",
"description": "The country code for the customer phone number\nThis field will be deprecated soon, use the customer object instead",
"example": "+1",
"nullable": true,
"maxLength": 255
},
"off_session": { "off_session": {
"type": "boolean", "type": "boolean",
"description": "Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. When making a recurring payment by passing a mandate_id, this parameter is mandatory", "description": "Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. When making a recurring payment by passing a mandate_id, this parameter is mandatory",