Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
chore: add deprecated flag to soon to be deprecated fields in payment request and response (#4261)
Hrithikesh9ac5d70e2ed0
diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rsindex d7ba24b5a3..c0b7b69ca9 100644--- a/crates/api_models/src/payments.rs+++ b/crates/api_models/src/payments.rs@@ -276,27 +276,32 @@ pub struct PaymentsRequest {/// Passing this object creates a new customer or attaches an existing customer to the paymentpub 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 = "[email protected]")]+ /// 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 = "[email protected]", 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 = "[email protected]")]+ /// This field will be deprecated soon. Please refer to `customer.email` object+ #[schema(max_length = 255, value_type = Option<String>, example = "[email protected]", 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 operationdiff --git a/openapi/openapi_spec.json b/openapi/openapi_spec.jsonindex 91eaf35958..7b13762c50 100644--- a/openapi/openapi_spec.json+++ b/openapi/openapi_spec.json@@ -13624,39 +13624,11 @@},"customer_id": {"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","nullable": true,"maxLength": 255},- "email": {- "type": "string",- "description": "The customer's email address This field will be deprecated soon, use the customer object instead",- "example": "[email protected]",- "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": {"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",@@ -14003,39 +13975,11 @@},"customer_id": {"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","nullable": true,"maxLength": 255},- "email": {- "type": "string",- "description": "The customer's email address This field will be deprecated soon, use the customer object instead",- "example": "[email protected]",- "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": {"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",@@ -14494,14 +14438,15 @@},"customer_id": {"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","nullable": true,"maxLength": 255},"email": {"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": "[email protected]","nullable": true,"maxLength": 255@@ -14509,6 +14454,7 @@"name": {"type": "string","description": "The customer's name.\nThis field will be deprecated soon, use the customer object instead.",+ "deprecated": true,"example": "John Test","nullable": true,"maxLength": 255@@ -14516,6 +14462,7 @@"phone": {"type": "string","description": "The customer's phone number\nThis field will be deprecated soon, use the customer object instead",+ "deprecated": true,"example": "3141592653","nullable": true,"maxLength": 255@@ -14523,6 +14470,7 @@"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",+ "deprecated": true,"example": "+1","nullable": true,"maxLength": 255@@ -14885,7 +14833,8 @@},"customer_id": {"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","nullable": true,"maxLength": 255@@ -15024,21 +14973,24 @@},"email": {"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": "[email protected]","nullable": true,"maxLength": 255},"name": {"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","nullable": true,"maxLength": 255},"phone": {"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","nullable": true,"maxLength": 255@@ -15563,39 +15515,11 @@},"customer_id": {"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","nullable": true,"maxLength": 255},- "email": {- "type": "string",- "description": "The customer's email address This field will be deprecated soon, use the customer object instead",- "example": "[email protected]",- "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": {"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",