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
feat(router): add payment_intent_data and modify api models of create intent request and response for v2 (#6016)
Sai Harsha Vardhan9a605afe372a
diff --git a/api-reference-v2/openapi_spec.json b/api-reference-v2/openapi_spec.jsonindex 2a32899880..fd46c76476 100644--- a/api-reference-v2/openapi_spec.json+++ b/api-reference-v2/openapi_spec.json@@ -2204,10 +2204,10 @@],"nullable": true},- "tax_details": {+ "order_tax_amount": {"allOf": [{- "$ref": "#/components/schemas/TaxDetails"+ "$ref": "#/components/schemas/MinorUnit"}],"nullable": true@@ -6400,17 +6400,6 @@}}},- "DefaultTax": {- "type": "object",- "required": [- "order_tax_amount"- ],- "properties": {- "order_tax_amount": {- "$ref": "#/components/schemas/MinorUnit"- }- }- },"DeviceChannel": {"type": "string","description": "Device Channel indicating whether request is coming from App or Browser",@@ -12344,21 +12333,6 @@"open_banking_pis"]},- "PaymentMethodTypeTax": {- "type": "object",- "required": [- "order_tax_amount",- "pmt"- ],- "properties": {- "order_tax_amount": {- "$ref": "#/components/schemas/MinorUnit"- },- "pmt": {- "$ref": "#/components/schemas/PaymentMethodType"- }- }- },"PaymentMethodUpdate": {"type": "object","properties": {@@ -12965,7 +12939,12 @@"nullable": true},"capture_method": {- "$ref": "#/components/schemas/CaptureMethod"+ "allOf": [+ {+ "$ref": "#/components/schemas/CaptureMethod"+ }+ ],+ "nullable": true},"authentication_type": {"allOf": [@@ -12973,7 +12952,8 @@"$ref": "#/components/schemas/AuthenticationType"}],- "default": "no_three_ds"+ "default": "no_three_ds",+ "nullable": true},"billing": {"allOf": [@@ -13000,7 +12980,12 @@"minLength": 1},"customer_present": {- "$ref": "#/components/schemas/PresenceOfCustomerDuringPayment"+ "allOf": [+ {+ "$ref": "#/components/schemas/PresenceOfCustomerDuringPayment"+ }+ ],+ "nullable": true},"description": {"type": "string",@@ -13015,10 +13000,20 @@"nullable": true},"setup_future_usage": {- "$ref": "#/components/schemas/FutureUsage"+ "allOf": [+ {+ "$ref": "#/components/schemas/FutureUsage"+ }+ ],+ "nullable": true},"apply_mit_exemption": {- "$ref": "#/components/schemas/MitExemptionRequest"+ "allOf": [+ {+ "$ref": "#/components/schemas/MitExemptionRequest"+ }+ ],+ "nullable": true},"statement_descriptor": {"type": "string",@@ -13066,7 +13061,12 @@"nullable": true},"payment_link_enabled": {- "$ref": "#/components/schemas/EnablePaymentLinkRequest"+ "allOf": [+ {+ "$ref": "#/components/schemas/EnablePaymentLinkRequest"+ }+ ],+ "nullable": true},"payment_link_config": {"allOf": [@@ -13077,7 +13077,12 @@"nullable": true},"request_incremental_authorization": {- "$ref": "#/components/schemas/RequestIncrementalAuthorization"+ "allOf": [+ {+ "$ref": "#/components/schemas/RequestIncrementalAuthorization"+ }+ ],+ "nullable": true},"session_expiry": {"type": "integer",@@ -13093,7 +13098,12 @@"nullable": true},"request_external_three_ds_authentication": {- "$ref": "#/components/schemas/External3dsAuthenticationRequest"+ "allOf": [+ {+ "$ref": "#/components/schemas/External3dsAuthenticationRequest"+ }+ ],+ "nullable": true}},"additionalProperties": false@@ -13101,7 +13111,16 @@"PaymentsCreateIntentResponse": {"type": "object","required": [- "amount_details"+ "amount_details",+ "client_secret",+ "capture_method",+ "authentication_type",+ "customer_present",+ "setup_future_usage",+ "apply_mit_exemption",+ "payment_link_enabled",+ "request_incremental_authorization",+ "request_external_three_ds_authentication"],"properties": {"amount_details": {@@ -13110,8 +13129,7 @@"client_secret": {"type": "string","description": "It's a token used for client side verification.",- "example": "pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo",- "nullable": true+ "example": "pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo"},"merchant_reference_id": {"type": "string",@@ -13244,7 +13262,7 @@"session_expiry": {"type": "integer","format": "int32",- "description": "Will be used to expire client secret after certain amount of time to be supplied in seconds\n(900) for 15 mins",+ "description": "Will be used to expire client secret after certain amount of time to be supplied in seconds, if not sent it will be taken from profile config\n(900) for 15 mins","example": 900,"nullable": true,"minimum": 0@@ -19288,27 +19306,6 @@"Calculate"]},- "TaxDetails": {- "type": "object",- "properties": {- "default": {- "allOf": [- {- "$ref": "#/components/schemas/DefaultTax"- }- ],- "nullable": true- },- "payment_method_type": {- "allOf": [- {- "$ref": "#/components/schemas/PaymentMethodTypeTax"- }- ],- "nullable": true- }- }- },"ThirdPartySdkSessionResponse": {"type": "object","required": [diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rsindex c1cd995b72..456bb8e43a 100644--- a/crates/api_models/src/payments.rs+++ b/crates/api_models/src/payments.rs@@ -133,15 +133,13 @@ pub struct PaymentsCreateIntentRequest {/// The routing algorithm id to be used for the payment#[schema(value_type = Option<String>)]- pub routing_algorithm_id: Option<String>,+ pub routing_algorithm_id: Option<id_type::RoutingId>,- #[schema(value_type = CaptureMethod, example = "automatic")]- #[serde(default)]- pub capture_method: api_enums::CaptureMethod,+ #[schema(value_type = Option<CaptureMethod>, example = "automatic")]+ pub capture_method: Option<api_enums::CaptureMethod>,- #[schema(value_type = AuthenticationType, example = "no_three_ds", default = "no_three_ds")]- #[serde(default)]- pub authentication_type: api_enums::AuthenticationType,+ #[schema(value_type = Option<AuthenticationType>, example = "no_three_ds", default = "no_three_ds")]+ pub authentication_type: Option<api_enums::AuthenticationType>,/// The billing details of the payment. This address will be used for invoicing.pub billing: Option<Address>,@@ -154,9 +152,8 @@ pub struct PaymentsCreateIntentRequest {pub customer_id: Option<id_type::CustomerId>,/// Set to true to indicate that the customer is in your checkout flow during this payment, and therefore is able to authenticate. This parameter should be false when merchant's doing merchant initiated payments and customer is not present while doing the payment.- #[schema(example = true, value_type = PresenceOfCustomerDuringPayment)]- #[serde(default)]- pub customer_present: common_enums::PresenceOfCustomerDuringPayment,+ #[schema(example = true, value_type = Option<PresenceOfCustomerDuringPayment>)]+ pub customer_present: Option<common_enums::PresenceOfCustomerDuringPayment>,/// A description for the payment#[schema(example = "It's my first payment request", value_type = Option<String>)]@@ -166,14 +163,12 @@ pub struct PaymentsCreateIntentRequest {#[schema(value_type = Option<String>, example = "https://hyperswitch.io")]pub return_url: Option<Url>,- #[schema(value_type = FutureUsage, example = "off_session")]- #[serde(default)]- pub setup_future_usage: api_enums::FutureUsage,+ #[schema(value_type = Option<FutureUsage>, example = "off_session")]+ pub setup_future_usage: Option<api_enums::FutureUsage>,/// Apply MIT exemption for a payment- #[schema(value_type = MitExemptionRequest)]- #[serde(default)]- pub apply_mit_exemption: common_enums::MitExemptionRequest,+ #[schema(value_type = Option<MitExemptionRequest>)]+ pub apply_mit_exemption: Option<common_enums::MitExemptionRequest>,/// For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.#[schema(max_length = 22, example = "Hyperswitch Router", value_type = Option<String>)]@@ -203,18 +198,16 @@ pub struct PaymentsCreateIntentRequest {pub feature_metadata: Option<FeatureMetadata>,/// Whether to generate the payment link for this payment or not (if applicable)- #[schema(value_type = EnablePaymentLinkRequest)]- #[serde(default)]- pub payment_link_enabled: common_enums::EnablePaymentLinkRequest,+ #[schema(value_type = Option<EnablePaymentLinkRequest>)]+ pub payment_link_enabled: Option<common_enums::EnablePaymentLinkRequest>,/// Configure a custom payment link for the particular payment#[schema(value_type = Option<PaymentCreatePaymentLinkConfig>)]pub payment_link_config: Option<PaymentCreatePaymentLinkConfig>,///Request an incremental authorization, i.e., increase the authorized amount on a confirmed payment before you capture it.- #[schema(value_type = RequestIncrementalAuthorization)]- #[serde(default)]- pub request_incremental_authorization: common_enums::RequestIncrementalAuthorization,+ #[schema(value_type = Option<RequestIncrementalAuthorization>)]+ pub request_incremental_authorization: Option<common_enums::RequestIncrementalAuthorization>,///Will be used to expire client secret after certain amount of time to be supplied in seconds, if not sent it will be taken from profile config///(900) for 15 mins@@ -226,9 +219,9 @@ pub struct PaymentsCreateIntentRequest {pub frm_metadata: Option<pii::SecretSerdeValue>,/// Whether to perform external authentication (if applicable)- #[schema(value_type = External3dsAuthenticationRequest)]- #[serde(default)]- pub request_external_three_ds_authentication: common_enums::External3dsAuthenticationRequest,+ #[schema(value_type = Option<External3dsAuthenticationRequest>)]+ pub request_external_three_ds_authentication:+ Option<common_enums::External3dsAuthenticationRequest>,}#[derive(Debug, serde::Deserialize, serde::Serialize, Clone, ToSchema)]@@ -239,8 +232,8 @@ pub struct PaymentsCreateIntentResponse {pub amount_details: AmountDetails,/// It's a token used for client side verification.- #[schema(value_type = Option<String>, example = "pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo")]- pub client_secret: Option<Secret<String>>,+ #[schema(value_type = String, example = "pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo")]+ pub client_secret: Secret<String>,/// Unique identifier for the payment. This ensures idempotency for multiple payments/// that have been done by a single merchant.@@ -254,14 +247,12 @@ pub struct PaymentsCreateIntentResponse {/// The routing algorithm id to be used for the payment#[schema(value_type = Option<String>)]- pub routing_algorithm_id: Option<String>,+ pub routing_algorithm_id: Option<id_type::RoutingId>,#[schema(value_type = CaptureMethod, example = "automatic")]- #[serde(default)]pub capture_method: api_enums::CaptureMethod,#[schema(value_type = AuthenticationType, example = "no_three_ds", default = "no_three_ds")]- #[serde(default)]pub authentication_type: api_enums::AuthenticationType,/// The billing details of the payment. This address will be used for invoicing.@@ -276,7 +267,6 @@ pub struct PaymentsCreateIntentResponse {/// Set to true to indicate that the customer is in your checkout flow during this payment, and therefore is able to authenticate. This parameter should be false when merchant's doing merchant initiated payments and customer is not present while doing the payment.#[schema(example = true, value_type = PresenceOfCustomerDuringPayment)]- #[serde(default)]pub customer_present: common_enums::PresenceOfCustomerDuringPayment,/// A description for the payment@@ -288,12 +278,10 @@ pub struct PaymentsCreateIntentResponse {pub return_url: Option<Url>,#[schema(value_type = FutureUsage, example = "off_session")]- #[serde(default)]pub setup_future_usage: api_enums::FutureUsage,/// Apply MIT exemption for a payment#[schema(value_type = MitExemptionRequest)]- #[serde(default)]pub apply_mit_exemption: common_enums::MitExemptionRequest,/// For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.@@ -325,7 +313,6 @@ pub struct PaymentsCreateIntentResponse {/// Whether to generate the payment link for this payment or not (if applicable)#[schema(value_type = EnablePaymentLinkRequest)]- #[serde(default)]pub payment_link_enabled: common_enums::EnablePaymentLinkRequest,/// Configure a custom payment link for the particular payment@@ -334,10 +321,9 @@ pub struct PaymentsCreateIntentResponse {///Request an incremental authorization, i.e., increase the authorized amount on a confirmed payment before you capture it.#[schema(value_type = RequestIncrementalAuthorization)]- #[serde(default)]pub request_incremental_authorization: common_enums::RequestIncrementalAuthorization,- ///Will be used to expire client secret after certain amount of time to be supplied in seconds+ ///Will be used to expire client secret after certain amount of time to be supplied in seconds, if not sent it will be taken from profile config///(900) for 15 mins#[schema(example = 900)]pub session_expiry: Option<u32>,@@ -348,7 +334,6 @@ pub struct PaymentsCreateIntentResponse {/// Whether to perform external authentication (if applicable)#[schema(value_type = External3dsAuthenticationRequest)]- #[serde(default)]pub request_external_three_ds_authentication: common_enums::External3dsAuthenticationRequest,}@@ -364,8 +349,8 @@ pub struct AmountDetails {currency: common_enums::Currency,/// The shipping cost of the order. This has to be collected from the merchantshipping_cost: Option<MinorUnit>,- /// Tax details related to the order. This will be calculated by the external tax provider- tax_details: Option<TaxDetails>,+ /// Tax amount related to the order. This will be calculated by the external tax provider+ order_tax_amount: Option<MinorUnit>,/// The action to whether calculate tax by calling external tax provider or not#[serde(default)]#[schema(value_type = TaxCalculationOverride)]@@ -380,32 +365,6 @@ pub struct AmountDetails {tax_on_surcharge: Option<MinorUnit>,}-#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, ToSchema)]-pub struct TaxDetails {- /// This is the tax related information that is calculated irrespective of any payment method.- /// This is calculated when the order is created with shipping details- pub default: Option<DefaultTax>,-- /// This is the tax related information that is calculated based on the payment method- /// This is calculated when calling the /calculate_tax API- pub payment_method_type: Option<PaymentMethodTypeTax>,-}--#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, ToSchema)]-pub struct PaymentMethodTypeTax {- /// The order tax amount for the payment method type- pub order_tax_amount: MinorUnit,- /// The payment method type- #[schema(value_type = PaymentMethodType, example = "google_pay")]- pub pmt: common_enums::PaymentMethodType,-}--#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, ToSchema)]-pub struct DefaultTax {- /// The order tax amount for the default tax- pub order_tax_amount: MinorUnit,-}-#[derive(Default,Debug,diff --git a/crates/hyperswitch_domain_models/src/payments.rs b/crates/hyperswitch_domain_models/src/payments.rsindex c59fb9b12f..f25ce7cad2 100644--- a/crates/hyperswitch_domain_models/src/payments.rs+++ b/crates/hyperswitch_domain_models/src/payments.rs@@ -1,3 +1,6 @@+#[cfg(feature = "v2")]+use std::marker::PhantomData;+use common_utils::{self, crypto::Encryptable, id_type, pii, types::MinorUnit};use diesel_models::payment_intent::TaxDetails;use masking::Secret;@@ -129,21 +132,21 @@ impl From<Option<bool>> for SurchargeCalculationOverride {#[derive(Clone, Debug, PartialEq, serde::Serialize)]pub struct AmountDetails {/// The amount of the order in the lowest denomination of currency- order_amount: MinorUnit,+ pub order_amount: MinorUnit,/// The currency of the order- currency: common_enums::Currency,+ pub currency: common_enums::Currency,/// The shipping cost of the order. This has to be collected from the merchant- shipping_cost: Option<MinorUnit>,+ pub shipping_cost: Option<MinorUnit>,/// Tax details related to the order. This will be calculated by the external tax provider- tax_details: Option<TaxDetails>,+ pub tax_details: Option<TaxDetails>,/// The action to whether calculate tax by calling external tax provider or not- skip_external_tax_calculation: TaxCalculationOverride,+ pub skip_external_tax_calculation: TaxCalculationOverride,/// The action to whether calculate surcharge or not- skip_surcharge_calculation: SurchargeCalculationOverride,+ pub skip_surcharge_calculation: SurchargeCalculationOverride,/// The surcharge amount to be added to the order, collected from the merchant- surcharge_amount: Option<MinorUnit>,+ pub surcharge_amount: Option<MinorUnit>,/// tax on surcharge amount- tax_on_surcharge: Option<MinorUnit>,+ pub tax_on_surcharge: Option<MinorUnit>,}#[cfg(feature = "v2")]@@ -259,3 +262,13 @@ pub struct PaymentIntent {/// The straight through routing algorithm id that is used for this payment. This overrides the default routing algorithm that is configured in business profile.pub routing_algorithm_id: Option<id_type::RoutingId>,}++#[cfg(feature = "v2")]+#[derive(Clone)]+pub struct PaymentIntentData<F>+where+ F: Clone,+{+ pub flow: PhantomData<F>,+ pub payment_intent: PaymentIntent,+}diff --git a/crates/openapi/src/openapi_v2.rs b/crates/openapi/src/openapi_v2.rsindex 64fb7a4e93..c08ea9bf7c 100644--- a/crates/openapi/src/openapi_v2.rs+++ b/crates/openapi/src/openapi_v2.rs@@ -311,9 +311,6 @@ Never share your secret api keys. Keep them guarded and secure.api_models::payments::PaymentsCreateIntentRequest,api_models::payments::PaymentsCreateIntentResponse,api_models::payments::AmountDetails,- api_models::payments::TaxDetails,- api_models::payments::DefaultTax,- api_models::payments::PaymentMethodTypeTax,api_models::payments::SessionToken,api_models::payments::ApplePaySessionResponse,api_models::payments::ThirdPartySdkSessionResponse,diff --git a/crates/router/src/core/payments.rs b/crates/router/src/core/payments.rsindex 283e02f975..1cf1264521 100644--- a/crates/router/src/core/payments.rs+++ b/crates/router/src/core/payments.rs@@ -35,6 +35,8 @@ use error_stack::{report, ResultExt};use events::EventInfo;use futures::future::join_all;use helpers::ApplePayData;+#[cfg(feature = "v2")]+use hyperswitch_domain_models::payments::PaymentIntentData;pub use hyperswitch_domain_models::{mandates::{CustomerAcceptance, MandateData},payment_address::PaymentAddress,@@ -5272,3 +5274,219 @@ impl<F: Clone> OperationSessionSetters<F> for PaymentData<F> {self.payment_attempt.connector = connector;}}++#[cfg(feature = "v2")]+impl<F: Clone> OperationSessionGetters<F> for PaymentIntentData<F> {+ fn get_payment_attempt(&self) -> &storage::PaymentAttempt {+ todo!()+ }++ fn get_payment_intent(&self) -> &storage::PaymentIntent {+ &self.payment_intent+ }++ fn get_payment_method_info(&self) -> Option<&domain::PaymentMethod> {+ todo!()+ }++ fn get_mandate_id(&self) -> Option<&payments_api::MandateIds> {+ todo!()+ }++ // what is this address find out and not required remove this+ fn get_address(&self) -> &PaymentAddress {+ todo!()+ }++ fn get_creds_identifier(&self) -> Option<&str> {+ todo!()+ }++ fn get_token(&self) -> Option<&str> {+ todo!()+ }++ fn get_multiple_capture_data(&self) -> Option<&types::MultipleCaptureData> {+ todo!()+ }++ fn get_payment_link_data(&self) -> Option<api_models::payments::PaymentLinkResponse> {+ todo!()+ }++ fn get_ephemeral_key(&self) -> Option<ephemeral_key::EphemeralKey> {+ todo!()+ }++ fn get_setup_mandate(&self) -> Option<&MandateData> {+ todo!()+ }++ fn get_poll_config(&self) -> Option<router_types::PollConfig> {+ todo!()+ }++ fn get_authentication(&self) -> Option<&storage::Authentication> {+ todo!()+ }++ fn get_frm_message(&self) -> Option<FraudCheck> {+ todo!()+ }++ fn get_refunds(&self) -> Vec<storage::Refund> {+ todo!()+ }++ fn get_disputes(&self) -> Vec<storage::Dispute> {+ todo!()+ }++ fn get_authorizations(&self) -> Vec<diesel_models::authorization::Authorization> {+ todo!()+ }++ fn get_attempts(&self) -> Option<Vec<storage::PaymentAttempt>> {+ todo!()+ }++ fn get_recurring_details(&self) -> Option<&RecurringDetails> {+ todo!()+ }++ fn get_payment_intent_profile_id(&self) -> Option<&id_type::ProfileId> {+ Some(&self.payment_intent.profile_id)+ }++ fn get_currency(&self) -> storage_enums::Currency {+ self.payment_intent.amount_details.currency+ }++ fn get_amount(&self) -> api::Amount {+ todo!()+ }++ fn get_payment_attempt_connector(&self) -> Option<&str> {+ todo!()+ }++ fn get_billing_address(&self) -> Option<api_models::payments::Address> {+ todo!()+ }++ fn get_payment_method_data(&self) -> Option<&domain::PaymentMethodData> {+ todo!()+ }++ fn get_sessions_token(&self) -> Vec<api::SessionToken> {+ todo!()+ }++ fn get_token_data(&self) -> Option<&storage::PaymentTokenData> {+ todo!()+ }++ fn get_mandate_connector(&self) -> Option<&MandateConnectorDetails> {+ todo!()+ }++ fn get_force_sync(&self) -> Option<bool> {+ todo!()+ }+}++#[cfg(feature = "v2")]+impl<F: Clone> OperationSessionSetters<F> for PaymentIntentData<F> {+ // Setters Implementation+ fn set_payment_intent(&mut self, payment_intent: storage::PaymentIntent) {+ self.payment_intent = payment_intent;+ }++ fn set_payment_attempt(&mut self, _payment_attempt: storage::PaymentAttempt) {+ todo!()+ }++ fn set_payment_method_data(&mut self, _payment_method_data: Option<domain::PaymentMethodData>) {+ todo!()+ }++ fn set_payment_method_id_in_attempt(&mut self, _payment_method_id: Option<String>) {+ todo!()+ }++ fn set_email_if_not_present(&mut self, _email: pii::Email) {+ todo!()+ }++ fn set_pm_token(&mut self, _token: String) {+ todo!()+ }++ fn set_connector_customer_id(&mut self, _customer_id: Option<String>) {+ todo!()+ }++ fn push_sessions_token(&mut self, _token: api::SessionToken) {+ todo!()+ }++ fn set_surcharge_details(&mut self, _surcharge_details: Option<types::SurchargeDetails>) {+ todo!()+ }++ fn set_merchant_connector_id_in_attempt(+ &mut self,+ _merchant_connector_id: Option<id_type::MerchantConnectorAccountId>,+ ) {+ todo!()+ }++ fn set_capture_method_in_attempt(&mut self, _capture_method: enums::CaptureMethod) {+ todo!()+ }++ fn set_frm_message(&mut self, _frm_message: FraudCheck) {+ todo!()+ }++ fn set_payment_intent_status(&mut self, status: storage_enums::IntentStatus) {+ self.payment_intent.status = status;+ }++ fn set_authentication_type_in_attempt(+ &mut self,+ _authentication_type: Option<enums::AuthenticationType>,+ ) {+ todo!()+ }++ fn set_recurring_mandate_payment_data(+ &mut self,+ _recurring_mandate_payment_data:+ hyperswitch_domain_models::router_data::RecurringMandatePaymentData,+ ) {+ todo!()+ }++ fn set_mandate_id(&mut self, _mandate_id: api_models::payments::MandateIds) {+ todo!()+ }++ fn set_setup_future_usage_in_payment_intent(+ &mut self,+ setup_future_usage: storage_enums::FutureUsage,+ ) {+ self.payment_intent.setup_future_usage = Some(setup_future_usage);+ }++ fn set_straight_through_algorithm_in_payment_attempt(+ &mut self,+ _straight_through_algorithm: serde_json::Value,+ ) {+ todo!()+ }++ fn set_connector_in_payment_attempt(&mut self, _connector: Option<String>) {+ todo!()+ }+}