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
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")]
pub customer_id: Option<String>,
/// The customer's email address This field will be deprecated soon, use the customer object instead
#[schema(max_length = 255, value_type = Option<String>, example = "johntest@test.com")]
/// The customer's email address.
/// 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>,
/// The customer's name.
/// 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>>,
/// The customer's phone number
/// 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>>,
/// The country code for the customer phone number
/// 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>,
/// 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,
/// 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>,
/// Details of customer attached to this payment
@ -3241,15 +3251,18 @@ pub struct PaymentsResponse {
pub order_details: Option<Vec<pii::SecretSerdeValue>>,
/// 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,
/// 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,
/// 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,
/// The URL to redirect after the completion of the operation