text
stringlengths
70
351k
source
stringclasses
4 values
<file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! default_imp_for_new_connector_integration_file_upload { ($($path:ident::$connector:ident),*) => { $( impl FileUploadV2 for $path::$connector {} impl UploadFileV2 for $path::$connector {} impl ConnectorIntegrationV2< Upload, FilesFlowData, UploadFileRequestData, UploadFileResponse, > for $path::$connector {} impl RetrieveFileV2 for $path::$connector {} impl ConnectorIntegrationV2< Retrieve, FilesFlowData, RetrieveFileRequestData, RetrieveFileResponse, > for $path::$connector {} )* }; } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! default_imp_for_new_connector_integration_file_upload { ($($path:ident::$connector:ident),*) => { $( impl FileUploadV2 for $path::$connector {} impl UploadFileV2 for $path::$connector {} impl ConnectorIntegrationV2< Upload, FilesFlowData, UploadFileRequestData, UploadFileResponse, > for $path::$connector {} impl RetrieveFileV2 for $path::$connector {} impl ConnectorIntegrationV2< Retrieve, FilesFlowData, RetrieveFileRequestData, RetrieveFileResponse, > for $path::$connector {} )* }; } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs<|crate|> hyperswitch_connectors macro=default_imp_for_new_connector_integration_file_upload roles=macro_def,use_site use=invoke item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> use hyperswitch_domain_models::{ <|fim_suffix|> <|fim_middle|> } default_imp_for_new_connector_integration_revenue_recovery!( connectors::Airwallex, connectors::Amazonpay, connectors::Bambora, connectors::Bamboraapac, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Boku, connectors::Cashtocode, connectors::Coinbase, connectors::Cryptopay, connectors::CtpMastercard, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Globepay, connectors::Gocardless, connectors::Helcim, connectors::Hipay, connectors::Inespay, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Nomupay, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Paybox, connectors::Payeezy, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mollie, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Taxjar, connectors::Thunes, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Xendit, connectors::Zen, connectors::Zsl ); <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="use_site"> <|fim_prefix|> use hyperswitch_domain_models::{ <|fim_suffix|> <|fim_middle|> } default_imp_for_new_connector_integration_revenue_recovery!( connectors::Airwallex, connectors::Amazonpay, connectors::Bambora, connectors::Bamboraapac, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Boku, connectors::Cashtocode, connectors::Coinbase, connectors::Cryptopay, connectors::CtpMastercard, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Globepay, connectors::Gocardless, connectors::Helcim, connectors::Hipay, connectors::Inespay, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Nomupay, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Paybox, connectors::Payeezy, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mollie, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Taxjar, connectors::Thunes, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Xendit, connectors::Zen, connectors::Zsl );
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="use_site"> default_imp_for_new_connector_integration_file_upload!( connectors::Aci, connectors::Adyen, connectors::Airwallex, connectors::Amazonpay, connectors::Authorizedotnet, connectors::Bambora, connectors::Bamboraapac, connectors::Bankofamerica, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Braintree, connectors::Boku, connectors::Cashtocode, connectors::Chargebee, connectors::Checkout, connectors::Coinbase, connectors::Coingate, connectors::Cryptopay, connectors::CtpMastercard, connectors::Cybersource, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Facilitapay, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Getnet, connectors::Globalpay, connectors::Globepay, connectors::Gocardless, connectors::Hipay, connectors::Helcim, connectors::Iatapay, connectors::Inespay, connectors::Itaubank, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Klarna, connectors::Nomupay, connectors::Noon, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Opayo, connectors::Opennode, connectors::Nuvei, connectors::Paybox, connectors::Payeezy, connectors::Payme, connectors::Paypal, connectors::Paystack, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mifinity, connectors::Mollie, connectors::Moneris, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Recurly, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Stripebilling, connectors::Taxjar, connectors::Thunes, connectors::Trustpay, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Wellsfargo, connectors::Xendit, connectors::Zen, connectors::Zsl ); <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="use_site"> default_imp_for_new_connector_integration_file_upload!( connectors::Aci, connectors::Adyen, connectors::Airwallex, connectors::Amazonpay, connectors::Authorizedotnet, connectors::Bambora, connectors::Bamboraapac, connectors::Bankofamerica, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Braintree, connectors::Boku, connectors::Cashtocode, connectors::Chargebee, connectors::Checkout, connectors::Coinbase, connectors::Coingate, connectors::Cryptopay, connectors::CtpMastercard, connectors::Cybersource, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Facilitapay, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Getnet, connectors::Globalpay, connectors::Globepay, connectors::Gocardless, connectors::Hipay, connectors::Helcim, connectors::Iatapay, connectors::Inespay, connectors::Itaubank, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Klarna, connectors::Nomupay, connectors::Noon, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Opayo, connectors::Opennode, connectors::Nuvei, connectors::Paybox, connectors::Payeezy, connectors::Payme, connectors::Paypal, connectors::Paystack, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mifinity, connectors::Mollie, connectors::Moneris, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Recurly, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Stripebilling, connectors::Taxjar, connectors::Thunes, connectors::Trustpay, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Wellsfargo, connectors::Xendit, connectors::Zen, connectors::Zsl ); <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs<|crate|> hyperswitch_connectors macro=default_imp_for_new_connector_integration_file_upload roles=use_site,macro_def use=invoke item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> use hyperswitch_domain_models::{ <|fim_suffix|> <|fim_middle|> } default_imp_for_new_connector_integration_revenue_recovery!( connectors::Airwallex, connectors::Amazonpay, connectors::Bambora, connectors::Bamboraapac, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Boku, connectors::Cashtocode, connectors::Coinbase, connectors::Cryptopay, connectors::CtpMastercard, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Globepay, connectors::Gocardless, connectors::Helcim, connectors::Hipay, connectors::Inespay, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Nomupay, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Paybox, connectors::Payeezy, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mollie, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Taxjar, connectors::Thunes, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Xendit, connectors::Zen, connectors::Zsl ); <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> use hyperswitch_domain_models::{ <|fim_suffix|> <|fim_middle|> } default_imp_for_new_connector_integration_revenue_recovery!( connectors::Airwallex, connectors::Amazonpay, connectors::Bambora, connectors::Bamboraapac, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Boku, connectors::Cashtocode, connectors::Coinbase, connectors::Cryptopay, connectors::CtpMastercard, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Globepay, connectors::Gocardless, connectors::Helcim, connectors::Hipay, connectors::Inespay, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Nomupay, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Paybox, connectors::Payeezy, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mollie, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Taxjar, connectors::Thunes, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Xendit, connectors::Zen, connectors::Zsl );
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! default_imp_for_new_connector_integration_defend_dispute { ($($path:ident::$connector:ident),*) => { $( impl DefendDisputeV2 for $path::$connector {} impl ConnectorIntegrationV2< Defend, DisputesFlowData, DefendDisputeRequestData, DefendDisputeResponse, > for $path::$connector {} )* }; } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! default_imp_for_new_connector_integration_defend_dispute { ($($path:ident::$connector:ident),*) => { $( impl DefendDisputeV2 for $path::$connector {} impl ConnectorIntegrationV2< Defend, DisputesFlowData, DefendDisputeRequestData, DefendDisputeResponse, > for $path::$connector {} )* }; } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs<|crate|> hyperswitch_connectors macro=default_imp_for_new_connector_integration_defend_dispute roles=macro_def,use_site use=invoke item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> use hyperswitch_domain_models::{ <|fim_suffix|> <|fim_middle|> } default_imp_for_new_connector_integration_revenue_recovery!( connectors::Airwallex, connectors::Amazonpay, connectors::Bambora, connectors::Bamboraapac, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Boku, connectors::Cashtocode, connectors::Coinbase, connectors::Cryptopay, connectors::CtpMastercard, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Globepay, connectors::Gocardless, connectors::Helcim, connectors::Hipay, connectors::Inespay, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Nomupay, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Paybox, connectors::Payeezy, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mollie, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Taxjar, connectors::Thunes, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Xendit, connectors::Zen, connectors::Zsl ); <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="use_site"> <|fim_prefix|> use hyperswitch_domain_models::{ <|fim_suffix|> <|fim_middle|> } default_imp_for_new_connector_integration_revenue_recovery!( connectors::Airwallex, connectors::Amazonpay, connectors::Bambora, connectors::Bamboraapac, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Boku, connectors::Cashtocode, connectors::Coinbase, connectors::Cryptopay, connectors::CtpMastercard, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Globepay, connectors::Gocardless, connectors::Helcim, connectors::Hipay, connectors::Inespay, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Nomupay, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Paybox, connectors::Payeezy, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mollie, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Taxjar, connectors::Thunes, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Xendit, connectors::Zen, connectors::Zsl );
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="use_site"> default_imp_for_new_connector_integration_defend_dispute!( connectors::Aci, connectors::Adyen, connectors::Airwallex, connectors::Amazonpay, connectors::Authorizedotnet, connectors::Bambora, connectors::Bamboraapac, connectors::Bankofamerica, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Braintree, connectors::Boku, connectors::Cashtocode, connectors::Chargebee, connectors::Checkout, connectors::Coinbase, connectors::Coingate, connectors::Cryptopay, connectors::CtpMastercard, connectors::Cybersource, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Facilitapay, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Getnet, connectors::Globalpay, connectors::Globepay, connectors::Gocardless, connectors::Hipay, connectors::Helcim, connectors::Iatapay, connectors::Inespay, connectors::Itaubank, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Klarna, connectors::Nomupay, connectors::Noon, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Opayo, connectors::Opennode, connectors::Nuvei, connectors::Paybox, connectors::Payeezy, connectors::Payme, connectors::Paypal, connectors::Paystack, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mifinity, connectors::Mollie, connectors::Moneris, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Recurly, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Stripebilling, connectors::Taxjar, connectors::Thunes, connectors::Trustpay, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Wellsfargo, connectors::Xendit, connectors::Zen, connectors::Zsl ); <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="use_site"> default_imp_for_new_connector_integration_defend_dispute!( connectors::Aci, connectors::Adyen, connectors::Airwallex, connectors::Amazonpay, connectors::Authorizedotnet, connectors::Bambora, connectors::Bamboraapac, connectors::Bankofamerica, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Braintree, connectors::Boku, connectors::Cashtocode, connectors::Chargebee, connectors::Checkout, connectors::Coinbase, connectors::Coingate, connectors::Cryptopay, connectors::CtpMastercard, connectors::Cybersource, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Facilitapay, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Getnet, connectors::Globalpay, connectors::Globepay, connectors::Gocardless, connectors::Hipay, connectors::Helcim, connectors::Iatapay, connectors::Inespay, connectors::Itaubank, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Klarna, connectors::Nomupay, connectors::Noon, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Opayo, connectors::Opennode, connectors::Nuvei, connectors::Paybox, connectors::Payeezy, connectors::Payme, connectors::Paypal, connectors::Paystack, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mifinity, connectors::Mollie, connectors::Moneris, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Recurly, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Stripebilling, connectors::Taxjar, connectors::Thunes, connectors::Trustpay, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Wellsfargo, connectors::Xendit, connectors::Zen, connectors::Zsl ); <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs<|crate|> hyperswitch_connectors macro=default_imp_for_new_connector_integration_defend_dispute roles=use_site,macro_def use=invoke item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> use hyperswitch_domain_models::{ <|fim_suffix|> <|fim_middle|> } default_imp_for_new_connector_integration_revenue_recovery!( connectors::Airwallex, connectors::Amazonpay, connectors::Bambora, connectors::Bamboraapac, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Boku, connectors::Cashtocode, connectors::Coinbase, connectors::Cryptopay, connectors::CtpMastercard, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Globepay, connectors::Gocardless, connectors::Helcim, connectors::Hipay, connectors::Inespay, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Nomupay, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Paybox, connectors::Payeezy, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mollie, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Taxjar, connectors::Thunes, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Xendit, connectors::Zen, connectors::Zsl ); <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> use hyperswitch_domain_models::{ <|fim_suffix|> <|fim_middle|> } default_imp_for_new_connector_integration_revenue_recovery!( connectors::Airwallex, connectors::Amazonpay, connectors::Bambora, connectors::Bamboraapac, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Boku, connectors::Cashtocode, connectors::Coinbase, connectors::Cryptopay, connectors::CtpMastercard, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Globepay, connectors::Gocardless, connectors::Helcim, connectors::Hipay, connectors::Inespay, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Nomupay, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Paybox, connectors::Payeezy, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mollie, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Taxjar, connectors::Thunes, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Xendit, connectors::Zen, connectors::Zsl );
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="use_site"> default_imp_for_new_connector_integration_submit_evidence!( connectors::Aci, connectors::Adyen, connectors::Airwallex, connectors::Amazonpay, connectors::Authorizedotnet, connectors::Bambora, connectors::Bamboraapac, connectors::Bankofamerica, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Braintree, connectors::Boku, connectors::Cashtocode, connectors::Chargebee, connectors::Checkout, connectors::Coinbase, connectors::Coingate, connectors::Cryptopay, connectors::CtpMastercard, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Facilitapay, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Getnet, connectors::Globalpay, connectors::Globepay, connectors::Gocardless, connectors::Hipay, connectors::Helcim, connectors::Iatapay, connectors::Inespay, connectors::Itaubank, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Klarna, connectors::Nomupay, connectors::Noon, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Opayo, connectors::Opennode, connectors::Nuvei, connectors::Paybox, connectors::Payeezy, connectors::Payme, connectors::Paypal, connectors::Paystack, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mifinity, connectors::Mollie, connectors::Moneris, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Recurly, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Stripebilling, connectors::Taxjar, connectors::Thunes, connectors::Trustpay, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Wellsfargo, connectors::Xendit, connectors::Zen, connectors::Zsl ); <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="use_site"> default_imp_for_new_connector_integration_submit_evidence!( connectors::Aci, connectors::Adyen, connectors::Airwallex, connectors::Amazonpay, connectors::Authorizedotnet, connectors::Bambora, connectors::Bamboraapac, connectors::Bankofamerica, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Braintree, connectors::Boku, connectors::Cashtocode, connectors::Chargebee, connectors::Checkout, connectors::Coinbase, connectors::Coingate, connectors::Cryptopay, connectors::CtpMastercard, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Facilitapay, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Getnet, connectors::Globalpay, connectors::Globepay, connectors::Gocardless, connectors::Hipay, connectors::Helcim, connectors::Iatapay, connectors::Inespay, connectors::Itaubank, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Klarna, connectors::Nomupay, connectors::Noon, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Opayo, connectors::Opennode, connectors::Nuvei, connectors::Paybox, connectors::Payeezy, connectors::Payme, connectors::Paypal, connectors::Paystack, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mifinity, connectors::Mollie, connectors::Moneris, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Recurly, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Stripebilling, connectors::Taxjar, connectors::Thunes, connectors::Trustpay, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Wellsfargo, connectors::Xendit, connectors::Zen, connectors::Zsl ); <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs<|crate|> hyperswitch_connectors macro=default_imp_for_new_connector_integration_submit_evidence roles=use_site,macro_def use=invoke item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> use hyperswitch_domain_models::{ <|fim_suffix|> <|fim_middle|> } default_imp_for_new_connector_integration_revenue_recovery!( connectors::Airwallex, connectors::Amazonpay, connectors::Bambora, connectors::Bamboraapac, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Boku, connectors::Cashtocode, connectors::Coinbase, connectors::Cryptopay, connectors::CtpMastercard, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Globepay, connectors::Gocardless, connectors::Helcim, connectors::Hipay, connectors::Inespay, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Nomupay, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Paybox, connectors::Payeezy, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mollie, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Taxjar, connectors::Thunes, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Xendit, connectors::Zen, connectors::Zsl ); <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> use hyperswitch_domain_models::{ <|fim_suffix|> <|fim_middle|> } default_imp_for_new_connector_integration_revenue_recovery!( connectors::Airwallex, connectors::Amazonpay, connectors::Bambora, connectors::Bamboraapac, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Boku, connectors::Cashtocode, connectors::Coinbase, connectors::Cryptopay, connectors::CtpMastercard, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Globepay, connectors::Gocardless, connectors::Helcim, connectors::Hipay, connectors::Inespay, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Nomupay, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Paybox, connectors::Payeezy, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mollie, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Taxjar, connectors::Thunes, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Xendit, connectors::Zen, connectors::Zsl );
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! default_imp_for_new_connector_integration_submit_evidence { ($($path:ident::$connector:ident),*) => { $( impl SubmitEvidenceV2 for $path::$connector {} impl ConnectorIntegrationV2< Evidence, DisputesFlowData, SubmitEvidenceRequestData, SubmitEvidenceResponse, > for $path::$connector {} )* }; } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! default_imp_for_new_connector_integration_submit_evidence { ($($path:ident::$connector:ident),*) => { $( impl SubmitEvidenceV2 for $path::$connector {} impl ConnectorIntegrationV2< Evidence, DisputesFlowData, SubmitEvidenceRequestData, SubmitEvidenceResponse, > for $path::$connector {} )* }; } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs<|crate|> hyperswitch_connectors macro=default_imp_for_new_connector_integration_submit_evidence roles=macro_def,use_site use=invoke item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> use hyperswitch_domain_models::{ <|fim_suffix|> <|fim_middle|> } default_imp_for_new_connector_integration_revenue_recovery!( connectors::Airwallex, connectors::Amazonpay, connectors::Bambora, connectors::Bamboraapac, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Boku, connectors::Cashtocode, connectors::Coinbase, connectors::Cryptopay, connectors::CtpMastercard, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Globepay, connectors::Gocardless, connectors::Helcim, connectors::Hipay, connectors::Inespay, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Nomupay, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Paybox, connectors::Payeezy, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mollie, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Taxjar, connectors::Thunes, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Xendit, connectors::Zen, connectors::Zsl ); <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="use_site"> <|fim_prefix|> use hyperswitch_domain_models::{ <|fim_suffix|> <|fim_middle|> } default_imp_for_new_connector_integration_revenue_recovery!( connectors::Airwallex, connectors::Amazonpay, connectors::Bambora, connectors::Bamboraapac, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Boku, connectors::Cashtocode, connectors::Coinbase, connectors::Cryptopay, connectors::CtpMastercard, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Globepay, connectors::Gocardless, connectors::Helcim, connectors::Hipay, connectors::Inespay, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Nomupay, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Paybox, connectors::Payeezy, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mollie, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Taxjar, connectors::Thunes, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Xendit, connectors::Zen, connectors::Zsl );
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! default_imp_for_new_connector_integration_accept_dispute { ($($path:ident::$connector:ident),*) => { $( impl DisputeV2 for $path::$connector {} impl AcceptDisputeV2 for $path::$connector {} impl ConnectorIntegrationV2< Accept, DisputesFlowData, AcceptDisputeRequestData, AcceptDisputeResponse, > for $path::$connector {} )* }; } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! default_imp_for_new_connector_integration_accept_dispute { ($($path:ident::$connector:ident),*) => { $( impl DisputeV2 for $path::$connector {} impl AcceptDisputeV2 for $path::$connector {} impl ConnectorIntegrationV2< Accept, DisputesFlowData, AcceptDisputeRequestData, AcceptDisputeResponse, > for $path::$connector {} )* }; } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs<|crate|> hyperswitch_connectors macro=default_imp_for_new_connector_integration_accept_dispute roles=macro_def,use_site use=invoke item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> use hyperswitch_domain_models::{ <|fim_suffix|> <|fim_middle|> } default_imp_for_new_connector_integration_revenue_recovery!( connectors::Airwallex, connectors::Amazonpay, connectors::Bambora, connectors::Bamboraapac, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Boku, connectors::Cashtocode, connectors::Coinbase, connectors::Cryptopay, connectors::CtpMastercard, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Globepay, connectors::Gocardless, connectors::Helcim, connectors::Hipay, connectors::Inespay, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Nomupay, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Paybox, connectors::Payeezy, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mollie, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Taxjar, connectors::Thunes, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Xendit, connectors::Zen, connectors::Zsl ); <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="use_site"> <|fim_prefix|> use hyperswitch_domain_models::{ <|fim_suffix|> <|fim_middle|> } default_imp_for_new_connector_integration_revenue_recovery!( connectors::Airwallex, connectors::Amazonpay, connectors::Bambora, connectors::Bamboraapac, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Boku, connectors::Cashtocode, connectors::Coinbase, connectors::Cryptopay, connectors::CtpMastercard, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Globepay, connectors::Gocardless, connectors::Helcim, connectors::Hipay, connectors::Inespay, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Nomupay, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Paybox, connectors::Payeezy, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mollie, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Taxjar, connectors::Thunes, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Xendit, connectors::Zen, connectors::Zsl );
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="use_site"> default_imp_for_new_connector_integration_accept_dispute!( connectors::Aci, connectors::Adyen, connectors::Airwallex, connectors::Amazonpay, connectors::Authorizedotnet, connectors::Bambora, connectors::Bamboraapac, connectors::Bankofamerica, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Braintree, connectors::Boku, connectors::Cashtocode, connectors::Chargebee, connectors::Checkout, connectors::Coinbase, connectors::Coingate, connectors::Cryptopay, connectors::CtpMastercard, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Facilitapay, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Getnet, connectors::Globalpay, connectors::Globepay, connectors::Gocardless, connectors::Hipay, connectors::Helcim, connectors::Iatapay, connectors::Inespay, connectors::Itaubank, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Klarna, connectors::Nomupay, connectors::Noon, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Opayo, connectors::Opennode, connectors::Nuvei, connectors::Paybox, connectors::Payeezy, connectors::Payme, connectors::Paypal, connectors::Paystack, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mifinity, connectors::Mollie, connectors::Moneris, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Recurly, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Stripebilling, connectors::Taxjar, connectors::Thunes, connectors::Trustpay, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Wellsfargo, connectors::Xendit, connectors::Zen, connectors::Zsl ); <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="use_site"> default_imp_for_new_connector_integration_accept_dispute!( connectors::Aci, connectors::Adyen, connectors::Airwallex, connectors::Amazonpay, connectors::Authorizedotnet, connectors::Bambora, connectors::Bamboraapac, connectors::Bankofamerica, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Braintree, connectors::Boku, connectors::Cashtocode, connectors::Chargebee, connectors::Checkout, connectors::Coinbase, connectors::Coingate, connectors::Cryptopay, connectors::CtpMastercard, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Facilitapay, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Getnet, connectors::Globalpay, connectors::Globepay, connectors::Gocardless, connectors::Hipay, connectors::Helcim, connectors::Iatapay, connectors::Inespay, connectors::Itaubank, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Klarna, connectors::Nomupay, connectors::Noon, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Opayo, connectors::Opennode, connectors::Nuvei, connectors::Paybox, connectors::Payeezy, connectors::Payme, connectors::Paypal, connectors::Paystack, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mifinity, connectors::Mollie, connectors::Moneris, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Recurly, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Stripebilling, connectors::Taxjar, connectors::Thunes, connectors::Trustpay, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Wellsfargo, connectors::Xendit, connectors::Zen, connectors::Zsl ); <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs<|crate|> hyperswitch_connectors macro=default_imp_for_new_connector_integration_accept_dispute roles=use_site,macro_def use=invoke item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> use hyperswitch_domain_models::{ <|fim_suffix|> <|fim_middle|> } default_imp_for_new_connector_integration_revenue_recovery!( connectors::Airwallex, connectors::Amazonpay, connectors::Bambora, connectors::Bamboraapac, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Boku, connectors::Cashtocode, connectors::Coinbase, connectors::Cryptopay, connectors::CtpMastercard, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Globepay, connectors::Gocardless, connectors::Helcim, connectors::Hipay, connectors::Inespay, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Nomupay, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Paybox, connectors::Payeezy, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mollie, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Taxjar, connectors::Thunes, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Xendit, connectors::Zen, connectors::Zsl ); <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> use hyperswitch_domain_models::{ <|fim_suffix|> <|fim_middle|> } default_imp_for_new_connector_integration_revenue_recovery!( connectors::Airwallex, connectors::Amazonpay, connectors::Bambora, connectors::Bamboraapac, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Boku, connectors::Cashtocode, connectors::Coinbase, connectors::Cryptopay, connectors::CtpMastercard, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Globepay, connectors::Gocardless, connectors::Helcim, connectors::Hipay, connectors::Inespay, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Nomupay, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Paybox, connectors::Payeezy, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mollie, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Taxjar, connectors::Thunes, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Xendit, connectors::Zen, connectors::Zsl );
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="use_site"> default_imp_for_new_connector_integration_connector_access_token!( connectors::Aci, connectors::Adyen, connectors::Airwallex, connectors::Amazonpay, connectors::Authorizedotnet, connectors::Bambora, connectors::Bamboraapac, connectors::Bankofamerica, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Braintree, connectors::Boku, connectors::Cashtocode, connectors::Chargebee, connectors::Checkout, connectors::Coinbase, connectors::Coingate, connectors::Cryptopay, connectors::CtpMastercard, connectors::Cybersource, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Facilitapay, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Getnet, connectors::Globalpay, connectors::Globepay, connectors::Gocardless, connectors::Hipay, connectors::Helcim, connectors::Iatapay, connectors::Inespay, connectors::Itaubank, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Klarna, connectors::Nomupay, connectors::Noon, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Opayo, connectors::Opennode, connectors::Nuvei, connectors::Paybox, connectors::Payeezy, connectors::Payme, connectors::Paypal, connectors::Paystack, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mifinity, connectors::Mollie, connectors::Moneris, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Recurly, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Stripebilling, connectors::Taxjar, connectors::Thunes, connectors::Trustpay, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Wellsfargo, connectors::Xendit, connectors::Zen, connectors::Zsl ); <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="use_site"> default_imp_for_new_connector_integration_connector_access_token!( connectors::Aci, connectors::Adyen, connectors::Airwallex, connectors::Amazonpay, connectors::Authorizedotnet, connectors::Bambora, connectors::Bamboraapac, connectors::Bankofamerica, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Braintree, connectors::Boku, connectors::Cashtocode, connectors::Chargebee, connectors::Checkout, connectors::Coinbase, connectors::Coingate, connectors::Cryptopay, connectors::CtpMastercard, connectors::Cybersource, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Facilitapay, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Getnet, connectors::Globalpay, connectors::Globepay, connectors::Gocardless, connectors::Hipay, connectors::Helcim, connectors::Iatapay, connectors::Inespay, connectors::Itaubank, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Klarna, connectors::Nomupay, connectors::Noon, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Opayo, connectors::Opennode, connectors::Nuvei, connectors::Paybox, connectors::Payeezy, connectors::Payme, connectors::Paypal, connectors::Paystack, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mifinity, connectors::Mollie, connectors::Moneris, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Recurly, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Stripebilling, connectors::Taxjar, connectors::Thunes, connectors::Trustpay, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Wellsfargo, connectors::Xendit, connectors::Zen, connectors::Zsl ); <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs<|crate|> hyperswitch_connectors macro=default_imp_for_new_connector_integration_connector_access_token roles=use_site,macro_def use=invoke item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> use hyperswitch_domain_models::{ <|fim_suffix|> <|fim_middle|> } default_imp_for_new_connector_integration_revenue_recovery!( connectors::Airwallex, connectors::Amazonpay, connectors::Bambora, connectors::Bamboraapac, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Boku, connectors::Cashtocode, connectors::Coinbase, connectors::Cryptopay, connectors::CtpMastercard, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Globepay, connectors::Gocardless, connectors::Helcim, connectors::Hipay, connectors::Inespay, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Nomupay, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Paybox, connectors::Payeezy, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mollie, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Taxjar, connectors::Thunes, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Xendit, connectors::Zen, connectors::Zsl ); <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> use hyperswitch_domain_models::{ <|fim_suffix|> <|fim_middle|> } default_imp_for_new_connector_integration_revenue_recovery!( connectors::Airwallex, connectors::Amazonpay, connectors::Bambora, connectors::Bamboraapac, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Boku, connectors::Cashtocode, connectors::Coinbase, connectors::Cryptopay, connectors::CtpMastercard, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Globepay, connectors::Gocardless, connectors::Helcim, connectors::Hipay, connectors::Inespay, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Nomupay, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Paybox, connectors::Payeezy, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mollie, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Taxjar, connectors::Thunes, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Xendit, connectors::Zen, connectors::Zsl );
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! default_imp_for_new_connector_integration_connector_access_token { ($($path:ident::$connector:ident),*) => { $( impl ConnectorAccessTokenV2 for $path::$connector{} impl ConnectorIntegrationV2<AccessTokenAuth, AccessTokenFlowData, AccessTokenRequestData, AccessToken> for $path::$connector{} )* }; } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! default_imp_for_new_connector_integration_connector_access_token { ($($path:ident::$connector:ident),*) => { $( impl ConnectorAccessTokenV2 for $path::$connector{} impl ConnectorIntegrationV2<AccessTokenAuth, AccessTokenFlowData, AccessTokenRequestData, AccessToken> for $path::$connector{} )* }; } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs<|crate|> hyperswitch_connectors macro=default_imp_for_new_connector_integration_connector_access_token roles=macro_def,use_site use=invoke item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> use hyperswitch_domain_models::{ <|fim_suffix|> <|fim_middle|> } default_imp_for_new_connector_integration_revenue_recovery!( connectors::Airwallex, connectors::Amazonpay, connectors::Bambora, connectors::Bamboraapac, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Boku, connectors::Cashtocode, connectors::Coinbase, connectors::Cryptopay, connectors::CtpMastercard, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Globepay, connectors::Gocardless, connectors::Helcim, connectors::Hipay, connectors::Inespay, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Nomupay, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Paybox, connectors::Payeezy, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mollie, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Taxjar, connectors::Thunes, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Xendit, connectors::Zen, connectors::Zsl ); <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="use_site"> <|fim_prefix|> use hyperswitch_domain_models::{ <|fim_suffix|> <|fim_middle|> } default_imp_for_new_connector_integration_revenue_recovery!( connectors::Airwallex, connectors::Amazonpay, connectors::Bambora, connectors::Bamboraapac, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Boku, connectors::Cashtocode, connectors::Coinbase, connectors::Cryptopay, connectors::CtpMastercard, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Globepay, connectors::Gocardless, connectors::Helcim, connectors::Hipay, connectors::Inespay, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Nomupay, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Paybox, connectors::Payeezy, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mollie, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Taxjar, connectors::Thunes, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Xendit, connectors::Zen, connectors::Zsl );
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! default_imp_for_new_connector_integration_refund { ($($path:ident::$connector:ident),*) => { $( impl RefundV2 for $path::$connector{} impl RefundExecuteV2 for $path::$connector{} impl RefundSyncV2 for $path::$connector{} impl ConnectorIntegrationV2<Execute, RefundFlowData, RefundsData, RefundsResponseData> for $path::$connector{} impl ConnectorIntegrationV2<RSync, RefundFlowData, RefundsData, RefundsResponseData> for $path::$connector{} )* }; } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! default_imp_for_new_connector_integration_refund { ($($path:ident::$connector:ident),*) => { $( impl RefundV2 for $path::$connector{} impl RefundExecuteV2 for $path::$connector{} impl RefundSyncV2 for $path::$connector{} impl ConnectorIntegrationV2<Execute, RefundFlowData, RefundsData, RefundsResponseData> for $path::$connector{} impl ConnectorIntegrationV2<RSync, RefundFlowData, RefundsData, RefundsResponseData> for $path::$connector{} )* }; } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs<|crate|> hyperswitch_connectors macro=default_imp_for_new_connector_integration_refund roles=macro_def,use_site use=invoke item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> use hyperswitch_domain_models::{ <|fim_suffix|> <|fim_middle|> } default_imp_for_new_connector_integration_revenue_recovery!( connectors::Airwallex, connectors::Amazonpay, connectors::Bambora, connectors::Bamboraapac, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Boku, connectors::Cashtocode, connectors::Coinbase, connectors::Cryptopay, connectors::CtpMastercard, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Globepay, connectors::Gocardless, connectors::Helcim, connectors::Hipay, connectors::Inespay, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Nomupay, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Paybox, connectors::Payeezy, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mollie, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Taxjar, connectors::Thunes, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Xendit, connectors::Zen, connectors::Zsl ); <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="use_site"> <|fim_prefix|> use hyperswitch_domain_models::{ <|fim_suffix|> <|fim_middle|> } default_imp_for_new_connector_integration_revenue_recovery!( connectors::Airwallex, connectors::Amazonpay, connectors::Bambora, connectors::Bamboraapac, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Boku, connectors::Cashtocode, connectors::Coinbase, connectors::Cryptopay, connectors::CtpMastercard, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Globepay, connectors::Gocardless, connectors::Helcim, connectors::Hipay, connectors::Inespay, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Nomupay, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Paybox, connectors::Payeezy, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mollie, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Taxjar, connectors::Thunes, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Xendit, connectors::Zen, connectors::Zsl );
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="use_site"> default_imp_for_new_connector_integration_refund!( connectors::Aci, connectors::Adyen, connectors::Airwallex, connectors::Amazonpay, connectors::Authorizedotnet, connectors::Bambora, connectors::Bamboraapac, connectors::Bankofamerica, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Braintree, connectors::Boku, connectors::Cashtocode, connectors::Chargebee, connectors::Checkout, connectors::Coinbase, connectors::Coingate, connectors::Cryptopay, connectors::CtpMastercard, connectors::Cybersource, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Facilitapay, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Getnet, connectors::Globalpay, connectors::Globepay, connectors::Gocardless, connectors::Hipay, connectors::Helcim, connectors::Iatapay, connectors::Inespay, connectors::Itaubank, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Klarna, connectors::Nomupay, connectors::Noon, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Opayo, connectors::Opennode, connectors::Nuvei, connectors::Paybox, connectors::Payeezy, connectors::Payme, connectors::Paypal, connectors::Paystack, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mifinity, connectors::Mollie, connectors::Moneris, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Recurly, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Stripebilling, connectors::Taxjar, connectors::Thunes, connectors::Trustpay, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Wellsfargo, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Xendit, connectors::Zen, connectors::Zsl ); <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="use_site"> default_imp_for_new_connector_integration_refund!( connectors::Aci, connectors::Adyen, connectors::Airwallex, connectors::Amazonpay, connectors::Authorizedotnet, connectors::Bambora, connectors::Bamboraapac, connectors::Bankofamerica, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Braintree, connectors::Boku, connectors::Cashtocode, connectors::Chargebee, connectors::Checkout, connectors::Coinbase, connectors::Coingate, connectors::Cryptopay, connectors::CtpMastercard, connectors::Cybersource, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Facilitapay, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Getnet, connectors::Globalpay, connectors::Globepay, connectors::Gocardless, connectors::Hipay, connectors::Helcim, connectors::Iatapay, connectors::Inespay, connectors::Itaubank, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Klarna, connectors::Nomupay, connectors::Noon, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Opayo, connectors::Opennode, connectors::Nuvei, connectors::Paybox, connectors::Payeezy, connectors::Payme, connectors::Paypal, connectors::Paystack, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mifinity, connectors::Mollie, connectors::Moneris, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Recurly, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Stripebilling, connectors::Taxjar, connectors::Thunes, connectors::Trustpay, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Wellsfargo, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Xendit, connectors::Zen, connectors::Zsl ); <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs<|crate|> hyperswitch_connectors macro=default_imp_for_new_connector_integration_refund roles=use_site,macro_def use=invoke item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> use hyperswitch_domain_models::{ <|fim_suffix|> <|fim_middle|> } default_imp_for_new_connector_integration_revenue_recovery!( connectors::Airwallex, connectors::Amazonpay, connectors::Bambora, connectors::Bamboraapac, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Boku, connectors::Cashtocode, connectors::Coinbase, connectors::Cryptopay, connectors::CtpMastercard, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Globepay, connectors::Gocardless, connectors::Helcim, connectors::Hipay, connectors::Inespay, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Nomupay, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Paybox, connectors::Payeezy, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mollie, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Taxjar, connectors::Thunes, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Xendit, connectors::Zen, connectors::Zsl ); <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> use hyperswitch_domain_models::{ <|fim_suffix|> <|fim_middle|> } default_imp_for_new_connector_integration_revenue_recovery!( connectors::Airwallex, connectors::Amazonpay, connectors::Bambora, connectors::Bamboraapac, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Boku, connectors::Cashtocode, connectors::Coinbase, connectors::Cryptopay, connectors::CtpMastercard, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Globepay, connectors::Gocardless, connectors::Helcim, connectors::Hipay, connectors::Inespay, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Nomupay, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Paybox, connectors::Payeezy, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mollie, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Taxjar, connectors::Thunes, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Xendit, connectors::Zen, connectors::Zsl );
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! default_imp_for_new_connector_integration_payment { ($($path:ident::$connector:ident),*) => { $( impl PaymentV2 for $path::$connector{} impl PaymentAuthorizeV2 for $path::$connector{} impl PaymentAuthorizeSessionTokenV2 for $path::$connector{} impl PaymentSyncV2 for $path::$connector{} impl PaymentVoidV2 for $path::$connector{} impl PaymentApproveV2 for $path::$connector{} impl PaymentRejectV2 for $path::$connector{} impl PaymentCaptureV2 for $path::$connector{} impl PaymentSessionV2 for $path::$connector{} impl MandateSetupV2 for $path::$connector{} impl PaymentIncrementalAuthorizationV2 for $path::$connector{} impl PaymentsCompleteAuthorizeV2 for $path::$connector{} impl PaymentTokenV2 for $path::$connector{} impl ConnectorCustomerV2 for $path::$connector{} impl PaymentsPreProcessingV2 for $path::$connector{} impl PaymentsPostProcessingV2 for $path::$connector{} impl TaxCalculationV2 for $path::$connector{} impl PaymentSessionUpdateV2 for $path::$connector{} impl PaymentPostSessionTokensV2 for $path::$connector{} impl ConnectorIntegrationV2<Authorize,PaymentFlowData, PaymentsAuthorizeData, PaymentsResponseData> for $path::$connector{} impl ConnectorIntegrationV2<PSync,PaymentFlowData, PaymentsSyncData, PaymentsResponseData> for $path::$connector{} impl ConnectorIntegrationV2<Void, PaymentFlowData, PaymentsCancelData, PaymentsResponseData> for $path::$connector{} impl ConnectorIntegrationV2<Approve,PaymentFlowData, PaymentsApproveData, PaymentsResponseData> for $path::$connector{} impl ConnectorIntegrationV2<Reject,PaymentFlowData, PaymentsRejectData, PaymentsResponseData> for $path::$connector{} impl ConnectorIntegrationV2<Capture,PaymentFlowData, PaymentsCaptureData, PaymentsResponseData> for $path::$connector{} impl ConnectorIntegrationV2<Session,PaymentFlowData, PaymentsSessionData, PaymentsResponseData> for $path::$connector{} impl ConnectorIntegrationV2<SetupMandate,PaymentFlowData, SetupMandateRequestData, PaymentsResponseData> for $path::$connector{} impl ConnectorIntegrationV2< IncrementalAuthorization, PaymentFlowData, PaymentsIncrementalAuthorizationData, PaymentsResponseData, > for $path::$connector{} impl ConnectorIntegrationV2< CompleteAuthorize, PaymentFlowData, CompleteAuthorizeData, PaymentsResponseData, > for $path::$connector{} impl ConnectorIntegrationV2< PaymentMethodToken, PaymentFlowData, PaymentMethodTokenizationData, PaymentsResponseData, > for $path::$connector{} impl ConnectorIntegrationV2< CreateConnectorCustomer, PaymentFlowData, ConnectorCustomerData, PaymentsResponseData, > for $path::$connector{} impl ConnectorIntegrationV2< PreProcessing, PaymentFlowData, PaymentsPreProcessingData, PaymentsResponseData, > for $path::$connector{} impl ConnectorIntegrationV2< PostProcessing, PaymentFlowData, PaymentsPostProcessingData, PaymentsResponseData, > for $path::$connector{} impl ConnectorIntegrationV2< AuthorizeSessionToken, PaymentFlowData, AuthorizeSessionTokenData, PaymentsResponseData > for $path::$connector{} impl ConnectorIntegrationV2< CalculateTax, PaymentFlowData, PaymentsTaxCalculationData, TaxCalculationResponseData, > for $path::$connector{} impl ConnectorIntegrationV2< SdkSessionUpdate, PaymentFlowData, SdkPaymentsSessionUpdateData, PaymentsResponseData, > for $path::$connector{} impl ConnectorIntegrationV2< PostSessionTokens, PaymentFlowData, PaymentsPostSessionTokensData, PaymentsResponseData, > for $path::$connector{} )* }; } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! default_imp_for_new_connector_integration_payment { ($($path:ident::$connector:ident),*) => { $( impl PaymentV2 for $path::$connector{} impl PaymentAuthorizeV2 for $path::$connector{} impl PaymentAuthorizeSessionTokenV2 for $path::$connector{} impl PaymentSyncV2 for $path::$connector{} impl PaymentVoidV2 for $path::$connector{} impl PaymentApproveV2 for $path::$connector{} impl PaymentRejectV2 for $path::$connector{} impl PaymentCaptureV2 for $path::$connector{} impl PaymentSessionV2 for $path::$connector{} impl MandateSetupV2 for $path::$connector{} impl PaymentIncrementalAuthorizationV2 for $path::$connector{} impl PaymentsCompleteAuthorizeV2 for $path::$connector{} impl PaymentTokenV2 for $path::$connector{} impl ConnectorCustomerV2 for $path::$connector{} impl PaymentsPreProcessingV2 for $path::$connector{} impl PaymentsPostProcessingV2 for $path::$connector{} impl TaxCalculationV2 for $path::$connector{} impl PaymentSessionUpdateV2 for $path::$connector{} impl PaymentPostSessionTokensV2 for $path::$connector{} impl ConnectorIntegrationV2<Authorize,PaymentFlowData, PaymentsAuthorizeData, PaymentsResponseData> for $path::$connector{} impl ConnectorIntegrationV2<PSync,PaymentFlowData, PaymentsSyncData, PaymentsResponseData> for $path::$connector{} impl ConnectorIntegrationV2<Void, PaymentFlowData, PaymentsCancelData, PaymentsResponseData> for $path::$connector{} impl ConnectorIntegrationV2<Approve,PaymentFlowData, PaymentsApproveData, PaymentsResponseData> for $path::$connector{} impl ConnectorIntegrationV2<Reject,PaymentFlowData, PaymentsRejectData, PaymentsResponseData> for $path::$connector{} impl ConnectorIntegrationV2<Capture,PaymentFlowData, PaymentsCaptureData, PaymentsResponseData> for $path::$connector{} impl ConnectorIntegrationV2<Session,PaymentFlowData, PaymentsSessionData, PaymentsResponseData> for $path::$connector{} impl ConnectorIntegrationV2<SetupMandate,PaymentFlowData, SetupMandateRequestData, PaymentsResponseData> for $path::$connector{} impl ConnectorIntegrationV2< IncrementalAuthorization, PaymentFlowData, PaymentsIncrementalAuthorizationData, PaymentsResponseData, > for $path::$connector{} impl ConnectorIntegrationV2< CompleteAuthorize, PaymentFlowData, CompleteAuthorizeData, PaymentsResponseData, > for $path::$connector{} impl ConnectorIntegrationV2< PaymentMethodToken, PaymentFlowData, PaymentMethodTokenizationData, PaymentsResponseData, > for $path::$connector{} impl ConnectorIntegrationV2< CreateConnectorCustomer, PaymentFlowData, ConnectorCustomerData, PaymentsResponseData, > for $path::$connector{} impl ConnectorIntegrationV2< PreProcessing, PaymentFlowData, PaymentsPreProcessingData, PaymentsResponseData, > for $path::$connector{} impl ConnectorIntegrationV2< PostProcessing, PaymentFlowData, PaymentsPostProcessingData, PaymentsResponseData, > for $path::$connector{} impl ConnectorIntegrationV2< AuthorizeSessionToken, PaymentFlowData, AuthorizeSessionTokenData, PaymentsResponseData > for $path::$connector{} impl ConnectorIntegrationV2< CalculateTax, PaymentFlowData, PaymentsTaxCalculationData, TaxCalculationResponseData, > for $path::$connector{} impl ConnectorIntegrationV2< SdkSessionUpdate, PaymentFlowData, SdkPaymentsSessionUpdateData, PaymentsResponseData, > for $path::$connector{} impl ConnectorIntegrationV2< PostSessionTokens, PaymentFlowData, PaymentsPostSessionTokensData, PaymentsResponseData, > for $path::$connector{} )* }; } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs<|crate|> hyperswitch_connectors macro=default_imp_for_new_connector_integration_payment roles=macro_def,use_site use=invoke item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> use hyperswitch_domain_models::{ <|fim_suffix|> <|fim_middle|> } default_imp_for_new_connector_integration_revenue_recovery!( connectors::Airwallex, connectors::Amazonpay, connectors::Bambora, connectors::Bamboraapac, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Boku, connectors::Cashtocode, connectors::Coinbase, connectors::Cryptopay, connectors::CtpMastercard, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Globepay, connectors::Gocardless, connectors::Helcim, connectors::Hipay, connectors::Inespay, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Nomupay, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Paybox, connectors::Payeezy, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mollie, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Taxjar, connectors::Thunes, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Xendit, connectors::Zen, connectors::Zsl ); <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="use_site"> <|fim_prefix|> use hyperswitch_domain_models::{ <|fim_suffix|> <|fim_middle|> } default_imp_for_new_connector_integration_revenue_recovery!( connectors::Airwallex, connectors::Amazonpay, connectors::Bambora, connectors::Bamboraapac, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Boku, connectors::Cashtocode, connectors::Coinbase, connectors::Cryptopay, connectors::CtpMastercard, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Globepay, connectors::Gocardless, connectors::Helcim, connectors::Hipay, connectors::Inespay, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Nomupay, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Paybox, connectors::Payeezy, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mollie, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Taxjar, connectors::Thunes, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Xendit, connectors::Zen, connectors::Zsl );
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="use_site"> default_imp_for_new_connector_integration_payment!( connectors::Airwallex, connectors::Amazonpay, connectors::Authorizedotnet, connectors::Bambora, connectors::Bamboraapac, connectors::Bankofamerica, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Braintree, connectors::Boku, connectors::Cashtocode, connectors::Chargebee, connectors::Checkout, connectors::Coinbase, connectors::Coingate, connectors::Cryptopay, connectors::CtpMastercard, connectors::Cybersource, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Facilitapay, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Getnet, connectors::Globalpay, connectors::Globepay, connectors::Gocardless, connectors::Hipay, connectors::Helcim, connectors::Iatapay, connectors::Inespay, connectors::Itaubank, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Klarna, connectors::Nomupay, connectors::Noon, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Opayo, connectors::Opennode, connectors::Nuvei, connectors::Paybox, connectors::Payeezy, connectors::Payme, connectors::Paypal, connectors::Paystack, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mifinity, connectors::Mollie, connectors::Moneris, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Recurly, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Stripebilling, connectors::Taxjar, connectors::Thunes, connectors::Trustpay, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Wellsfargo, connectors::Xendit, connectors::Zen, connectors::Zsl ); <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="use_site"> default_imp_for_new_connector_integration_payment!( connectors::Airwallex, connectors::Amazonpay, connectors::Authorizedotnet, connectors::Bambora, connectors::Bamboraapac, connectors::Bankofamerica, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Braintree, connectors::Boku, connectors::Cashtocode, connectors::Chargebee, connectors::Checkout, connectors::Coinbase, connectors::Coingate, connectors::Cryptopay, connectors::CtpMastercard, connectors::Cybersource, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Facilitapay, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Getnet, connectors::Globalpay, connectors::Globepay, connectors::Gocardless, connectors::Hipay, connectors::Helcim, connectors::Iatapay, connectors::Inespay, connectors::Itaubank, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Klarna, connectors::Nomupay, connectors::Noon, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Opayo, connectors::Opennode, connectors::Nuvei, connectors::Paybox, connectors::Payeezy, connectors::Payme, connectors::Paypal, connectors::Paystack, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mifinity, connectors::Mollie, connectors::Moneris, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Recurly, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Stripebilling, connectors::Taxjar, connectors::Thunes, connectors::Trustpay, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Wellsfargo, connectors::Xendit, connectors::Zen, connectors::Zsl ); <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs<|crate|> hyperswitch_connectors macro=default_imp_for_new_connector_integration_payment roles=use_site,macro_def use=invoke item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> use hyperswitch_domain_models::{ <|fim_suffix|> <|fim_middle|> } default_imp_for_new_connector_integration_revenue_recovery!( connectors::Airwallex, connectors::Amazonpay, connectors::Bambora, connectors::Bamboraapac, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Boku, connectors::Cashtocode, connectors::Coinbase, connectors::Cryptopay, connectors::CtpMastercard, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Globepay, connectors::Gocardless, connectors::Helcim, connectors::Hipay, connectors::Inespay, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Nomupay, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Paybox, connectors::Payeezy, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mollie, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Taxjar, connectors::Thunes, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Xendit, connectors::Zen, connectors::Zsl ); <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/default_implementations_v2.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> use hyperswitch_domain_models::{ <|fim_suffix|> <|fim_middle|> } default_imp_for_new_connector_integration_revenue_recovery!( connectors::Airwallex, connectors::Amazonpay, connectors::Bambora, connectors::Bamboraapac, connectors::Billwerk, connectors::Bitpay, connectors::Bluesnap, connectors::Boku, connectors::Cashtocode, connectors::Coinbase, connectors::Cryptopay, connectors::CtpMastercard, connectors::Datatrans, connectors::Deutschebank, connectors::Digitalvirgo, connectors::Dlocal, connectors::Elavon, connectors::Fiserv, connectors::Fiservemea, connectors::Fiuu, connectors::Forte, connectors::Globepay, connectors::Gocardless, connectors::Helcim, connectors::Hipay, connectors::Inespay, connectors::Jpmorgan, connectors::Juspaythreedsserver, connectors::Nomupay, connectors::Novalnet, connectors::Nexinets, connectors::Nexixpay, connectors::Paybox, connectors::Payeezy, connectors::Payu, connectors::Placetopay, connectors::Powertranz, connectors::Prophetpay, connectors::Mollie, connectors::Multisafepay, connectors::Rapyd, connectors::Razorpay, connectors::Redsys, connectors::Shift4, connectors::Stax, connectors::Square, connectors::Taxjar, connectors::Thunes, connectors::Tsys, connectors::UnifiedAuthenticationService, connectors::Worldline, connectors::Volt, connectors::Worldpay, connectors::Xendit, connectors::Zen, connectors::Zsl );
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! unimplemented_payment_method { ($payment_method:expr, $connector:expr) => { errors::ConnectorError::NotImplemented(format!( "{} through {}", $payment_method, $connector )) }; ($payment_method:expr, $flow:expr, $connector:expr) => { errors::ConnectorError::NotImplemented(format!( "{} {} through {}", $payment_method, $flow, $connector )) }; } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! unimplemented_payment_method { ($payment_method:expr, $connector:expr) => { errors::ConnectorError::NotImplemented(format!( "{} through {}", $payment_method, $connector )) }; ($payment_method:expr, $flow:expr, $connector:expr) => { errors::ConnectorError::NotImplemented(format!( "{} {} through {}", $payment_method, $flow, $connector )) }; } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/stax/transformers.rs" crate="hyperswitch_connectors" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/utils.rs<|crate|> hyperswitch_connectors macro=unimplemented_payment_method roles=macro_def,use_site use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> fn try_from( item: &StaxRouterData<&types::PaymentsAuthorizeRouterData>, ) -> Result<Self, Self::Error> { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/stax/transformers.rs" crate="hyperswitch_connectors" role="use_site"> <|fim_prefix|> fn try_from( item: &StaxRouterData<&types::PaymentsAuthorizeRouterData>, ) -> Result<Self, Self::Error> { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! unimplemented_payment_method { ($payment_method:expr, $connector:expr) => { errors::ConnectorError::NotImplemented(format!( "{} through {}", $payment_method, $connector )) }; ($payment_method:expr, $flow:expr, $connector:expr) => { errors::ConnectorError::NotImplemented(format!( "{} {} through {}", $payment_method, $flow, $connector )) }; } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! unimplemented_payment_method { ($payment_method:expr, $connector:expr) => { errors::ConnectorError::NotImplemented(format!( "{} through {}", $payment_method, $connector )) }; ($payment_method:expr, $flow:expr, $connector:expr) => { errors::ConnectorError::NotImplemented(format!( "{} {} through {}", $payment_method, $flow, $connector )) }; } <file_sep path="hyperswitch/crates/router/src/connector/stripe/transformers.rs" crate="router" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/utils.rs<|crate|> router macro=unimplemented_payment_method roles=macro_def,use_site use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> fn try_from( data: (&types::PaymentsAuthorizeRouterData, MinorUnit), ) -> Result<Self, Self::Error> { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/router/src/connector/stripe/transformers.rs" crate="router" role="use_site"> <|fim_prefix|> fn try_from( data: (&types::PaymentsAuthorizeRouterData, MinorUnit), ) -> Result<Self, Self::Error> { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/stax/transformers.rs" crate="hyperswitch_connectors" role="use_site"> unimplemented_payment_method!("Apple Pay", "Simplified", "Stax"), <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/stax/transformers.rs" crate="hyperswitch_connectors" role="use_site"> unimplemented_payment_method!("Apple Pay", "Simplified", "Stax"), <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/utils.rs<|crate|> hyperswitch_connectors macro=unimplemented_payment_method roles=use_site,macro_def use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> use std::{ <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> use std::{ <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/router/src/connector/stripe/transformers.rs" crate="router" role="use_site"> Err(crate::unimplemented_payment_method!("Google Pay", "Stripe"))? <file_sep path="hyperswitch/crates/router/src/connector/stripe/transformers.rs" crate="router" role="use_site"> Err(crate::unimplemented_payment_method!("Google Pay", "Stripe"))? <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/utils.rs<|crate|> router macro=unimplemented_payment_method roles=use_site,macro_def use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> use std::{ <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> use std::{ <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! unimplemented_payment_method { ($payment_method:expr, $connector:expr) => { errors::ConnectorError::NotImplemented(format!( "{} through {}", $payment_method, $connector )) }; ($payment_method:expr, $flow:expr, $connector:expr) => { errors::ConnectorError::NotImplemented(format!( "{} {} through {}", $payment_method, $flow, $connector )) }; } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! unimplemented_payment_method { ($payment_method:expr, $connector:expr) => { errors::ConnectorError::NotImplemented(format!( "{} through {}", $payment_method, $connector )) }; ($payment_method:expr, $flow:expr, $connector:expr) => { errors::ConnectorError::NotImplemented(format!( "{} {} through {}", $payment_method, $flow, $connector )) }; } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/stax/transformers.rs" crate="hyperswitch_connectors" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/utils.rs<|crate|> hyperswitch_connectors macro=unimplemented_payment_method roles=macro_def,use_site use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> fn try_from( item: &StaxRouterData<&types::PaymentsAuthorizeRouterData>, ) -> Result<Self, Self::Error> { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/stax/transformers.rs" crate="hyperswitch_connectors" role="use_site"> <|fim_prefix|> fn try_from( item: &StaxRouterData<&types::PaymentsAuthorizeRouterData>, ) -> Result<Self, Self::Error> { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/router/src/connector/stripe/transformers.rs" crate="router" role="use_site"> Err(crate::unimplemented_payment_method!("Paze", "Stripe"))? <file_sep path="hyperswitch/crates/router/src/connector/stripe/transformers.rs" crate="router" role="use_site"> Err(crate::unimplemented_payment_method!("Paze", "Stripe"))? <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/utils.rs<|crate|> router macro=unimplemented_payment_method roles=use_site,macro_def use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> use std::{ <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> use std::{ <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/stax/transformers.rs" crate="hyperswitch_connectors" role="use_site"> Err(unimplemented_payment_method!("Google Pay", "Stax"))? <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/stax/transformers.rs" crate="hyperswitch_connectors" role="use_site"> Err(unimplemented_payment_method!("Google Pay", "Stax"))? <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/utils.rs<|crate|> hyperswitch_connectors macro=unimplemented_payment_method roles=use_site,macro_def use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> use std::{ <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> use std::{ <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! unimplemented_payment_method { ($payment_method:expr, $connector:expr) => { errors::ConnectorError::NotImplemented(format!( "{} through {}", $payment_method, $connector )) }; ($payment_method:expr, $flow:expr, $connector:expr) => { errors::ConnectorError::NotImplemented(format!( "{} {} through {}", $payment_method, $flow, $connector )) }; } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! unimplemented_payment_method { ($payment_method:expr, $connector:expr) => { errors::ConnectorError::NotImplemented(format!( "{} through {}", $payment_method, $connector )) }; ($payment_method:expr, $flow:expr, $connector:expr) => { errors::ConnectorError::NotImplemented(format!( "{} {} through {}", $payment_method, $flow, $connector )) }; } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/stax/transformers.rs" crate="hyperswitch_connectors" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/utils.rs<|crate|> hyperswitch_connectors macro=unimplemented_payment_method roles=macro_def,use_site use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> fn try_from( item: &StaxRouterData<&types::PaymentsAuthorizeRouterData>, ) -> Result<Self, Self::Error> { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/stax/transformers.rs" crate="hyperswitch_connectors" role="use_site"> <|fim_prefix|> fn try_from( item: &StaxRouterData<&types::PaymentsAuthorizeRouterData>, ) -> Result<Self, Self::Error> { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! unimplemented_payment_method { ($payment_method:expr, $connector:expr) => { errors::ConnectorError::NotImplemented(format!( "{} through {}", $payment_method, $connector )) }; ($payment_method:expr, $flow:expr, $connector:expr) => { errors::ConnectorError::NotImplemented(format!( "{} {} through {}", $payment_method, $flow, $connector )) }; } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! unimplemented_payment_method { ($payment_method:expr, $connector:expr) => { errors::ConnectorError::NotImplemented(format!( "{} through {}", $payment_method, $connector )) }; ($payment_method:expr, $flow:expr, $connector:expr) => { errors::ConnectorError::NotImplemented(format!( "{} {} through {}", $payment_method, $flow, $connector )) }; } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/stax/transformers.rs" crate="hyperswitch_connectors" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/utils.rs<|crate|> hyperswitch_connectors macro=unimplemented_payment_method roles=macro_def,use_site use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> fn try_from( item: &StaxRouterData<&types::PaymentsAuthorizeRouterData>, ) -> Result<Self, Self::Error> { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/stax/transformers.rs" crate="hyperswitch_connectors" role="use_site"> <|fim_prefix|> fn try_from( item: &StaxRouterData<&types::PaymentsAuthorizeRouterData>, ) -> Result<Self, Self::Error> { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! unimplemented_payment_method { ($payment_method:expr, $connector:expr) => { errors::ConnectorError::NotImplemented(format!( "{} through {}", $payment_method, $connector )) }; ($payment_method:expr, $flow:expr, $connector:expr) => { errors::ConnectorError::NotImplemented(format!( "{} {} through {}", $payment_method, $flow, $connector )) }; } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! unimplemented_payment_method { ($payment_method:expr, $connector:expr) => { errors::ConnectorError::NotImplemented(format!( "{} through {}", $payment_method, $connector )) }; ($payment_method:expr, $flow:expr, $connector:expr) => { errors::ConnectorError::NotImplemented(format!( "{} {} through {}", $payment_method, $flow, $connector )) }; } <file_sep path="hyperswitch/crates/router/src/connector/stripe/transformers.rs" crate="router" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/utils.rs<|crate|> router macro=unimplemented_payment_method roles=macro_def,use_site use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> fn try_from( data: (&types::PaymentsAuthorizeRouterData, MinorUnit), ) -> Result<Self, Self::Error> { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/router/src/connector/stripe/transformers.rs" crate="router" role="use_site"> <|fim_prefix|> fn try_from( data: (&types::PaymentsAuthorizeRouterData, MinorUnit), ) -> Result<Self, Self::Error> { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/stax/transformers.rs" crate="hyperswitch_connectors" role="use_site"> Err(unimplemented_payment_method!("Paze", "Stax"))? <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/stax/transformers.rs" crate="hyperswitch_connectors" role="use_site"> Err(unimplemented_payment_method!("Paze", "Stax"))? <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/utils.rs<|crate|> hyperswitch_connectors macro=unimplemented_payment_method roles=use_site,macro_def use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> use std::{ <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> use std::{ <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! unimplemented_payment_method { ($payment_method:expr, $connector:expr) => { errors::ConnectorError::NotImplemented(format!( "{} through {}", $payment_method, $connector )) }; ($payment_method:expr, $flow:expr, $connector:expr) => { errors::ConnectorError::NotImplemented(format!( "{} {} through {}", $payment_method, $flow, $connector )) }; } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! unimplemented_payment_method { ($payment_method:expr, $connector:expr) => { errors::ConnectorError::NotImplemented(format!( "{} through {}", $payment_method, $connector )) }; ($payment_method:expr, $flow:expr, $connector:expr) => { errors::ConnectorError::NotImplemented(format!( "{} {} through {}", $payment_method, $flow, $connector )) }; } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/stax/transformers.rs" crate="hyperswitch_connectors" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/utils.rs<|crate|> hyperswitch_connectors macro=unimplemented_payment_method roles=macro_def,use_site use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> fn try_from( item: &StaxRouterData<&types::PaymentsAuthorizeRouterData>, ) -> Result<Self, Self::Error> { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/stax/transformers.rs" crate="hyperswitch_connectors" role="use_site"> <|fim_prefix|> fn try_from( item: &StaxRouterData<&types::PaymentsAuthorizeRouterData>, ) -> Result<Self, Self::Error> { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/stax/transformers.rs" crate="hyperswitch_connectors" role="use_site"> unimplemented_payment_method!("Apple Pay", "Simplified", "Stax"), <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/stax/transformers.rs" crate="hyperswitch_connectors" role="use_site"> unimplemented_payment_method!("Apple Pay", "Simplified", "Stax"), <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/utils.rs<|crate|> hyperswitch_connectors macro=unimplemented_payment_method roles=use_site,macro_def use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> use std::{ <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> use std::{ <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/stax/transformers.rs" crate="hyperswitch_connectors" role="use_site"> Err(unimplemented_payment_method!("Paze", "Stax"))? <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/stax/transformers.rs" crate="hyperswitch_connectors" role="use_site"> Err(unimplemented_payment_method!("Paze", "Stax"))? <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/utils.rs<|crate|> hyperswitch_connectors macro=unimplemented_payment_method roles=use_site,macro_def use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> use std::{ <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> use std::{ <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! capture_method_not_supported { ($connector:expr, $capture_method:expr) => { Err(errors::ConnectorError::NotSupported { message: format!("{} for selected payment method", $capture_method), connector: $connector, } .into()) }; ($connector:expr, $capture_method:expr, $payment_method_type:expr) => { Err(errors::ConnectorError::NotSupported { message: format!("{} for {}", $capture_method, $payment_method_type), connector: $connector, } .into()) }; } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! capture_method_not_supported { ($connector:expr, $capture_method:expr) => { Err(errors::ConnectorError::NotSupported { message: format!("{} for selected payment method", $capture_method), connector: $connector, } .into()) }; ($connector:expr, $capture_method:expr, $payment_method_type:expr) => { Err(errors::ConnectorError::NotSupported { message: format!("{} for {}", $capture_method, $payment_method_type), connector: $connector, } .into()) }; } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/adyen.rs" crate="hyperswitch_connectors" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/utils.rs<|crate|> hyperswitch_connectors macro=capture_method_not_supported roles=macro_def,use_site use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> fn validate_connector_against_payment_request( &self, capture_method: Option<enums::CaptureMethod>, _payment_method: enums::PaymentMethod, pmt: Option<PaymentMethodType>, ) -> CustomResult<(), errors::ConnectorError> { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/adyen.rs" crate="hyperswitch_connectors" role="use_site"> <|fim_prefix|> fn validate_connector_against_payment_request( &self, capture_method: Option<enums::CaptureMethod>, _payment_method: enums::PaymentMethod, pmt: Option<PaymentMethodType>, ) -> CustomResult<(), errors::ConnectorError> { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! capture_method_not_supported { ($connector:expr, $capture_method:expr) => { Err(errors::ConnectorError::NotSupported { message: format!("{} for selected payment method", $capture_method), connector: $connector, } .into()) }; ($connector:expr, $capture_method:expr, $payment_method_type:expr) => { Err(errors::ConnectorError::NotSupported { message: format!("{} for {}", $capture_method, $payment_method_type), connector: $connector, } .into()) }; } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! capture_method_not_supported { ($connector:expr, $capture_method:expr) => { Err(errors::ConnectorError::NotSupported { message: format!("{} for selected payment method", $capture_method), connector: $connector, } .into()) }; ($connector:expr, $capture_method:expr, $payment_method_type:expr) => { Err(errors::ConnectorError::NotSupported { message: format!("{} for {}", $capture_method, $payment_method_type), connector: $connector, } .into()) }; } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/adyen.rs" crate="hyperswitch_connectors" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/utils.rs<|crate|> hyperswitch_connectors macro=capture_method_not_supported roles=macro_def,use_site use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> fn validate_connector_against_payment_request( &self, capture_method: Option<enums::CaptureMethod>, _payment_method: enums::PaymentMethod, pmt: Option<PaymentMethodType>, ) -> CustomResult<(), errors::ConnectorError> { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/adyen.rs" crate="hyperswitch_connectors" role="use_site"> <|fim_prefix|> fn validate_connector_against_payment_request( &self, capture_method: Option<enums::CaptureMethod>, _payment_method: enums::PaymentMethod, pmt: Option<PaymentMethodType>, ) -> CustomResult<(), errors::ConnectorError> { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/adyen.rs" crate="hyperswitch_connectors" role="use_site"> capture_method_not_supported!(connector, capture_method, payment_method_type) <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/adyen.rs" crate="hyperswitch_connectors" role="use_site"> capture_method_not_supported!(connector, capture_method, payment_method_type) <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/utils.rs<|crate|> hyperswitch_connectors macro=capture_method_not_supported roles=use_site,macro_def use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> use std::{ <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> use std::{ <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/adyen.rs" crate="hyperswitch_connectors" role="use_site"> capture_method_not_supported!( connector, capture_method, payment_method_type ) <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/adyen.rs" crate="hyperswitch_connectors" role="use_site"> capture_method_not_supported!( connector, capture_method, payment_method_type ) <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/utils.rs<|crate|> hyperswitch_connectors macro=capture_method_not_supported roles=use_site,macro_def use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> use std::{ <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> use std::{ <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/adyen.rs" crate="hyperswitch_connectors" role="use_site"> capture_method_not_supported!( connector, capture_method, payment_method_type ) <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/adyen.rs" crate="hyperswitch_connectors" role="use_site"> capture_method_not_supported!( connector, capture_method, payment_method_type ) <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/utils.rs<|crate|> hyperswitch_connectors macro=capture_method_not_supported roles=use_site,macro_def use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> use std::{ <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> use std::{ <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/adyen.rs" crate="hyperswitch_connectors" role="use_site"> capture_method_not_supported!( connector, capture_method, payment_method_type ) <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/adyen.rs" crate="hyperswitch_connectors" role="use_site"> capture_method_not_supported!( connector, capture_method, payment_method_type ) <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/utils.rs<|crate|> hyperswitch_connectors macro=capture_method_not_supported roles=use_site,macro_def use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> use std::{ <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> use std::{ <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! capture_method_not_supported { ($connector:expr, $capture_method:expr) => { Err(errors::ConnectorError::NotSupported { message: format!("{} for selected payment method", $capture_method), connector: $connector, } .into()) }; ($connector:expr, $capture_method:expr, $payment_method_type:expr) => { Err(errors::ConnectorError::NotSupported { message: format!("{} for {}", $capture_method, $payment_method_type), connector: $connector, } .into()) }; } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! capture_method_not_supported { ($connector:expr, $capture_method:expr) => { Err(errors::ConnectorError::NotSupported { message: format!("{} for selected payment method", $capture_method), connector: $connector, } .into()) }; ($connector:expr, $capture_method:expr, $payment_method_type:expr) => { Err(errors::ConnectorError::NotSupported { message: format!("{} for {}", $capture_method, $payment_method_type), connector: $connector, } .into()) }; } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/adyen.rs" crate="hyperswitch_connectors" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/utils.rs<|crate|> hyperswitch_connectors macro=capture_method_not_supported roles=macro_def,use_site use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> fn validate_connector_against_payment_request( &self, capture_method: Option<enums::CaptureMethod>, _payment_method: enums::PaymentMethod, pmt: Option<PaymentMethodType>, ) -> CustomResult<(), errors::ConnectorError> { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/adyen.rs" crate="hyperswitch_connectors" role="use_site"> <|fim_prefix|> fn validate_connector_against_payment_request( &self, capture_method: Option<enums::CaptureMethod>, _payment_method: enums::PaymentMethod, pmt: Option<PaymentMethodType>, ) -> CustomResult<(), errors::ConnectorError> { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! capture_method_not_supported { ($connector:expr, $capture_method:expr) => { Err(errors::ConnectorError::NotSupported { message: format!("{} for selected payment method", $capture_method), connector: $connector, } .into()) }; ($connector:expr, $capture_method:expr, $payment_method_type:expr) => { Err(errors::ConnectorError::NotSupported { message: format!("{} for {}", $capture_method, $payment_method_type), connector: $connector, } .into()) }; } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! capture_method_not_supported { ($connector:expr, $capture_method:expr) => { Err(errors::ConnectorError::NotSupported { message: format!("{} for selected payment method", $capture_method), connector: $connector, } .into()) }; ($connector:expr, $capture_method:expr, $payment_method_type:expr) => { Err(errors::ConnectorError::NotSupported { message: format!("{} for {}", $capture_method, $payment_method_type), connector: $connector, } .into()) }; } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/adyen.rs" crate="hyperswitch_connectors" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/utils.rs<|crate|> hyperswitch_connectors macro=capture_method_not_supported roles=macro_def,use_site use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> fn validate_connector_against_payment_request( &self, capture_method: Option<enums::CaptureMethod>, _payment_method: enums::PaymentMethod, pmt: Option<PaymentMethodType>, ) -> CustomResult<(), errors::ConnectorError> { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/adyen.rs" crate="hyperswitch_connectors" role="use_site"> <|fim_prefix|> fn validate_connector_against_payment_request( &self, capture_method: Option<enums::CaptureMethod>, _payment_method: enums::PaymentMethod, pmt: Option<PaymentMethodType>, ) -> CustomResult<(), errors::ConnectorError> { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! capture_method_not_supported { ($connector:expr, $capture_method:expr) => { Err(errors::ConnectorError::NotSupported { message: format!("{} for selected payment method", $capture_method), connector: $connector, } .into()) }; ($connector:expr, $capture_method:expr, $payment_method_type:expr) => { Err(errors::ConnectorError::NotSupported { message: format!("{} for {}", $capture_method, $payment_method_type), connector: $connector, } .into()) }; } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> macro_rules! capture_method_not_supported { ($connector:expr, $capture_method:expr) => { Err(errors::ConnectorError::NotSupported { message: format!("{} for selected payment method", $capture_method), connector: $connector, } .into()) }; ($connector:expr, $capture_method:expr, $payment_method_type:expr) => { Err(errors::ConnectorError::NotSupported { message: format!("{} for {}", $capture_method, $payment_method_type), connector: $connector, } .into()) }; } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/adyen.rs" crate="hyperswitch_connectors" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/utils.rs<|crate|> hyperswitch_connectors macro=capture_method_not_supported roles=macro_def,use_site use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> fn validate_connector_against_payment_request( &self, capture_method: Option<enums::CaptureMethod>, _payment_method: enums::PaymentMethod, pmt: Option<PaymentMethodType>, ) -> CustomResult<(), errors::ConnectorError> { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/adyen.rs" crate="hyperswitch_connectors" role="use_site"> <|fim_prefix|> fn validate_connector_against_payment_request( &self, capture_method: Option<enums::CaptureMethod>, _payment_method: enums::PaymentMethod, pmt: Option<PaymentMethodType>, ) -> CustomResult<(), errors::ConnectorError> { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/adyen.rs" crate="hyperswitch_connectors" role="use_site"> capture_method_not_supported!(connector, capture_method) <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/connectors/adyen.rs" crate="hyperswitch_connectors" role="use_site"> capture_method_not_supported!(connector, capture_method) <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_connectors/src/utils.rs<|crate|> hyperswitch_connectors macro=capture_method_not_supported roles=use_site,macro_def use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> use std::{ <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/hyperswitch_connectors/src/utils.rs" crate="hyperswitch_connectors" role="macro_def"> <|fim_prefix|> use std::{ <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_constraint_graph/src/dense_map.rs" crate="hyperswitch_constraint_graph" role="macro_def"> macro_rules! impl_entity { ($name:ident) => { impl $crate::dense_map::EntityId for $name { #[inline] fn get_id(&self) -> usize { self.0 } #[inline] fn with_id(id: usize) -> Self { Self(id) } } }; } <file_sep path="hyperswitch/crates/hyperswitch_constraint_graph/src/dense_map.rs" crate="hyperswitch_constraint_graph" role="macro_def"> macro_rules! impl_entity { ($name:ident) => { impl $crate::dense_map::EntityId for $name { #[inline] fn get_id(&self) -> usize { self.0 } #[inline] fn with_id(id: usize) -> Self { Self(id) } } }; } <file_sep path="hyperswitch/crates/hyperswitch_constraint_graph/src/types.rs" crate="hyperswitch_constraint_graph" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_constraint_graph/src/dense_map.rs<|crate|> hyperswitch_constraint_graph macro=impl_entity roles=macro_def,use_site use=invoke item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub struct NodeId(usize); <|fim_suffix|> <|fim_middle|> <file_sep path="hyperswitch/crates/hyperswitch_constraint_graph/src/types.rs" crate="hyperswitch_constraint_graph" role="use_site"> <|fim_prefix|> pub struct NodeId(usize); <|fim_suffix|> <|fim_middle|>
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_constraint_graph/src/types.rs" crate="hyperswitch_constraint_graph" role="use_site"> impl_entity!(EdgeId); <file_sep path="hyperswitch/crates/hyperswitch_constraint_graph/src/types.rs" crate="hyperswitch_constraint_graph" role="use_site"> impl_entity!(EdgeId); <file_sep path="hyperswitch/crates/hyperswitch_constraint_graph/src/dense_map.rs" crate="hyperswitch_constraint_graph" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_constraint_graph/src/dense_map.rs<|crate|> hyperswitch_constraint_graph macro=impl_entity roles=use_site,macro_def use=invoke item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> use std::{ <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/hyperswitch_constraint_graph/src/dense_map.rs" crate="hyperswitch_constraint_graph" role="macro_def"> <|fim_prefix|> use std::{ <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_constraint_graph/src/dense_map.rs" crate="hyperswitch_constraint_graph" role="macro_def"> macro_rules! impl_entity { ($name:ident) => { impl $crate::dense_map::EntityId for $name { #[inline] fn get_id(&self) -> usize { self.0 } #[inline] fn with_id(id: usize) -> Self { Self(id) } } }; } <file_sep path="hyperswitch/crates/hyperswitch_constraint_graph/src/dense_map.rs" crate="hyperswitch_constraint_graph" role="macro_def"> macro_rules! impl_entity { ($name:ident) => { impl $crate::dense_map::EntityId for $name { #[inline] fn get_id(&self) -> usize { self.0 } #[inline] fn with_id(id: usize) -> Self { Self(id) } } }; } <file_sep path="hyperswitch/crates/hyperswitch_constraint_graph/src/types.rs" crate="hyperswitch_constraint_graph" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_constraint_graph/src/dense_map.rs<|crate|> hyperswitch_constraint_graph macro=impl_entity roles=macro_def,use_site use=invoke item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub struct NodeId(usize); <|fim_suffix|> <|fim_middle|> <file_sep path="hyperswitch/crates/hyperswitch_constraint_graph/src/types.rs" crate="hyperswitch_constraint_graph" role="use_site"> <|fim_prefix|> pub struct NodeId(usize); <|fim_suffix|> <|fim_middle|>
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_constraint_graph/src/types.rs" crate="hyperswitch_constraint_graph" role="use_site"> impl_entity!(DomainId); <file_sep path="hyperswitch/crates/hyperswitch_constraint_graph/src/types.rs" crate="hyperswitch_constraint_graph" role="use_site"> impl_entity!(DomainId); <file_sep path="hyperswitch/crates/hyperswitch_constraint_graph/src/dense_map.rs" crate="hyperswitch_constraint_graph" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_constraint_graph/src/dense_map.rs<|crate|> hyperswitch_constraint_graph macro=impl_entity roles=use_site,macro_def use=invoke item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> use std::{ <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/hyperswitch_constraint_graph/src/dense_map.rs" crate="hyperswitch_constraint_graph" role="macro_def"> <|fim_prefix|> use std::{ <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_constraint_graph/src/dense_map.rs" crate="hyperswitch_constraint_graph" role="macro_def"> macro_rules! impl_entity { ($name:ident) => { impl $crate::dense_map::EntityId for $name { #[inline] fn get_id(&self) -> usize { self.0 } #[inline] fn with_id(id: usize) -> Self { Self(id) } } }; } <file_sep path="hyperswitch/crates/hyperswitch_constraint_graph/src/dense_map.rs" crate="hyperswitch_constraint_graph" role="macro_def"> macro_rules! impl_entity { ($name:ident) => { impl $crate::dense_map::EntityId for $name { #[inline] fn get_id(&self) -> usize { self.0 } #[inline] fn with_id(id: usize) -> Self { Self(id) } } }; } <file_sep path="hyperswitch/crates/hyperswitch_constraint_graph/src/types.rs" crate="hyperswitch_constraint_graph" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/hyperswitch_constraint_graph/src/dense_map.rs<|crate|> hyperswitch_constraint_graph macro=impl_entity roles=macro_def,use_site use=invoke item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub struct NodeId(usize); <|fim_suffix|> <|fim_middle|> <file_sep path="hyperswitch/crates/hyperswitch_constraint_graph/src/types.rs" crate="hyperswitch_constraint_graph" role="use_site"> <|fim_prefix|> pub struct NodeId(usize); <|fim_suffix|> <|fim_middle|>
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/test_utils/tests/connectors/selenium.rs" crate="test_utils" role="macro_def"> macro_rules! tester { ($f:ident) => {{ use $crate::{function, tester_inner}; let test_name = format!("{:?}", function!()); if (should_ignore_test(&test_name)) { return; } let browser = get_browser(); let url = make_url(&browser); let caps = make_capabilities(&browser); tester_inner!($f, WebDriver::new(url, caps)); }}; } <file_sep path="hyperswitch/crates/test_utils/tests/connectors/selenium.rs" crate="test_utils" role="macro_def"> macro_rules! tester { ($f:ident) => {{ use $crate::{function, tester_inner}; let test_name = format!("{:?}", function!()); if (should_ignore_test(&test_name)) { return; } let browser = get_browser(); let url = make_url(&browser); let caps = make_capabilities(&browser); tester_inner!($f, WebDriver::new(url, caps)); }}; } <file_sep path="hyperswitch/crates/test_utils/tests/connectors/stripe_wh_ui.rs" crate="test_utils" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/test_utils/tests/connectors/selenium.rs<|crate|> test_utils macro=tester roles=macro_def,use_site use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> fn should_make_webhook_test() { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/test_utils/tests/connectors/stripe_wh_ui.rs" crate="test_utils" role="use_site"> <|fim_prefix|> fn should_make_webhook_test() { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/test_utils/tests/connectors/multisafepay_ui.rs" crate="test_utils" role="use_site"> tester!(should_make_paypal_payment); <file_sep path="hyperswitch/crates/test_utils/tests/connectors/multisafepay_ui.rs" crate="test_utils" role="use_site"> tester!(should_make_paypal_payment); <file_sep path="hyperswitch/crates/test_utils/tests/connectors/selenium.rs" crate="test_utils" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/test_utils/tests/connectors/selenium.rs<|crate|> test_utils macro=tester roles=use_site,macro_def use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> #![allow( clippy::expect_used, clippy::panic, clippy::unwrap_in_result, clippy::missing_panics_doc, clippy::unwrap_used )] use std::{ <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/test_utils/tests/connectors/selenium.rs" crate="test_utils" role="macro_def"> <|fim_prefix|> #![allow( clippy::expect_used, clippy::panic, clippy::unwrap_in_result, clippy::missing_panics_doc, clippy::unwrap_used )] use std::{ <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/test_utils/tests/connectors/selenium.rs" crate="test_utils" role="macro_def"> macro_rules! tester { ($f:ident) => {{ use $crate::{function, tester_inner}; let test_name = format!("{:?}", function!()); if (should_ignore_test(&test_name)) { return; } let browser = get_browser(); let url = make_url(&browser); let caps = make_capabilities(&browser); tester_inner!($f, WebDriver::new(url, caps)); }}; } <file_sep path="hyperswitch/crates/test_utils/tests/connectors/selenium.rs" crate="test_utils" role="macro_def"> macro_rules! tester { ($f:ident) => {{ use $crate::{function, tester_inner}; let test_name = format!("{:?}", function!()); if (should_ignore_test(&test_name)) { return; } let browser = get_browser(); let url = make_url(&browser); let caps = make_capabilities(&browser); tester_inner!($f, WebDriver::new(url, caps)); }}; } <file_sep path="hyperswitch/crates/test_utils/tests/connectors/payu_ui.rs" crate="test_utils" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/test_utils/tests/connectors/selenium.rs<|crate|> test_utils macro=tester roles=macro_def,use_site use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> fn should_make_gpay_payment_test() { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/test_utils/tests/connectors/payu_ui.rs" crate="test_utils" role="use_site"> <|fim_prefix|> fn should_make_gpay_payment_test() { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/test_utils/tests/connectors/selenium.rs" crate="test_utils" role="macro_def"> macro_rules! tester { ($f:ident) => {{ use $crate::{function, tester_inner}; let test_name = format!("{:?}", function!()); if (should_ignore_test(&test_name)) { return; } let browser = get_browser(); let url = make_url(&browser); let caps = make_capabilities(&browser); tester_inner!($f, WebDriver::new(url, caps)); }}; } <file_sep path="hyperswitch/crates/test_utils/tests/connectors/selenium.rs" crate="test_utils" role="macro_def"> macro_rules! tester { ($f:ident) => {{ use $crate::{function, tester_inner}; let test_name = format!("{:?}", function!()); if (should_ignore_test(&test_name)) { return; } let browser = get_browser(); let url = make_url(&browser); let caps = make_capabilities(&browser); tester_inner!($f, WebDriver::new(url, caps)); }}; } <file_sep path="hyperswitch/crates/test_utils/tests/connectors/multisafepay_ui.rs" crate="test_utils" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/test_utils/tests/connectors/selenium.rs<|crate|> test_utils macro=tester roles=macro_def,use_site use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> fn should_make_paypal_payment_test() { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/test_utils/tests/connectors/multisafepay_ui.rs" crate="test_utils" role="use_site"> <|fim_prefix|> fn should_make_paypal_payment_test() { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/test_utils/tests/connectors/selenium.rs" crate="test_utils" role="macro_def"> macro_rules! tester { ($f:ident) => {{ use $crate::{function, tester_inner}; let test_name = format!("{:?}", function!()); if (should_ignore_test(&test_name)) { return; } let browser = get_browser(); let url = make_url(&browser); let caps = make_capabilities(&browser); tester_inner!($f, WebDriver::new(url, caps)); }}; } <file_sep path="hyperswitch/crates/test_utils/tests/connectors/selenium.rs" crate="test_utils" role="macro_def"> macro_rules! tester { ($f:ident) => {{ use $crate::{function, tester_inner}; let test_name = format!("{:?}", function!()); if (should_ignore_test(&test_name)) { return; } let browser = get_browser(); let url = make_url(&browser); let caps = make_capabilities(&browser); tester_inner!($f, WebDriver::new(url, caps)); }}; } <file_sep path="hyperswitch/crates/test_utils/tests/connectors/multisafepay_ui.rs" crate="test_utils" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/test_utils/tests/connectors/selenium.rs<|crate|> test_utils macro=tester roles=macro_def,use_site use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> fn should_make_paypal_payment_test() { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/test_utils/tests/connectors/multisafepay_ui.rs" crate="test_utils" role="use_site"> <|fim_prefix|> fn should_make_paypal_payment_test() { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/test_utils/tests/connectors/selenium.rs" crate="test_utils" role="macro_def"> macro_rules! tester { ($f:ident) => {{ use $crate::{function, tester_inner}; let test_name = format!("{:?}", function!()); if (should_ignore_test(&test_name)) { return; } let browser = get_browser(); let url = make_url(&browser); let caps = make_capabilities(&browser); tester_inner!($f, WebDriver::new(url, caps)); }}; } <file_sep path="hyperswitch/crates/test_utils/tests/connectors/selenium.rs" crate="test_utils" role="macro_def"> macro_rules! tester { ($f:ident) => {{ use $crate::{function, tester_inner}; let test_name = format!("{:?}", function!()); if (should_ignore_test(&test_name)) { return; } let browser = get_browser(); let url = make_url(&browser); let caps = make_capabilities(&browser); tester_inner!($f, WebDriver::new(url, caps)); }}; } <file_sep path="hyperswitch/crates/test_utils/tests/connectors/multisafepay_ui.rs" crate="test_utils" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/test_utils/tests/connectors/selenium.rs<|crate|> test_utils macro=tester roles=macro_def,use_site use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> fn should_make_paypal_payment_test() { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/test_utils/tests/connectors/multisafepay_ui.rs" crate="test_utils" role="use_site"> <|fim_prefix|> fn should_make_paypal_payment_test() { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/test_utils/tests/connectors/multisafepay_ui.rs" crate="test_utils" role="use_site"> tester!(should_make_multisafepay_3ds_payment_failed); <file_sep path="hyperswitch/crates/test_utils/tests/connectors/multisafepay_ui.rs" crate="test_utils" role="use_site"> tester!(should_make_multisafepay_3ds_payment_failed); <file_sep path="hyperswitch/crates/test_utils/tests/connectors/selenium.rs" crate="test_utils" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/test_utils/tests/connectors/selenium.rs<|crate|> test_utils macro=tester roles=use_site,macro_def use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> #![allow( clippy::expect_used, clippy::panic, clippy::unwrap_in_result, clippy::missing_panics_doc, clippy::unwrap_used )] use std::{ <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/test_utils/tests/connectors/selenium.rs" crate="test_utils" role="macro_def"> <|fim_prefix|> #![allow( clippy::expect_used, clippy::panic, clippy::unwrap_in_result, clippy::missing_panics_doc, clippy::unwrap_used )] use std::{ <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/test_utils/tests/connectors/stripe_wh_ui.rs" crate="test_utils" role="use_site"> tester!(should_make_webhook); <file_sep path="hyperswitch/crates/test_utils/tests/connectors/stripe_wh_ui.rs" crate="test_utils" role="use_site"> tester!(should_make_webhook); <file_sep path="hyperswitch/crates/test_utils/tests/connectors/selenium.rs" crate="test_utils" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/test_utils/tests/connectors/selenium.rs<|crate|> test_utils macro=tester roles=use_site,macro_def use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> #![allow( clippy::expect_used, clippy::panic, clippy::unwrap_in_result, clippy::missing_panics_doc, clippy::unwrap_used )] use std::{ <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/test_utils/tests/connectors/selenium.rs" crate="test_utils" role="macro_def"> <|fim_prefix|> #![allow( clippy::expect_used, clippy::panic, clippy::unwrap_in_result, clippy::missing_panics_doc, clippy::unwrap_used )] use std::{ <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/test_utils/tests/connectors/payu_ui.rs" crate="test_utils" role="use_site"> tester!(should_make_gpay_payment); <file_sep path="hyperswitch/crates/test_utils/tests/connectors/payu_ui.rs" crate="test_utils" role="use_site"> tester!(should_make_gpay_payment); <file_sep path="hyperswitch/crates/test_utils/tests/connectors/selenium.rs" crate="test_utils" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/test_utils/tests/connectors/selenium.rs<|crate|> test_utils macro=tester roles=use_site,macro_def use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> #![allow( clippy::expect_used, clippy::panic, clippy::unwrap_in_result, clippy::missing_panics_doc, clippy::unwrap_used )] use std::{ <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/test_utils/tests/connectors/selenium.rs" crate="test_utils" role="macro_def"> <|fim_prefix|> #![allow( clippy::expect_used, clippy::panic, clippy::unwrap_in_result, clippy::missing_panics_doc, clippy::unwrap_used )] use std::{ <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/test_utils/tests/connectors/selenium.rs" crate="test_utils" role="macro_def"> macro_rules! tester { ($f:ident) => {{ use $crate::{function, tester_inner}; let test_name = format!("{:?}", function!()); if (should_ignore_test(&test_name)) { return; } let browser = get_browser(); let url = make_url(&browser); let caps = make_capabilities(&browser); tester_inner!($f, WebDriver::new(url, caps)); }}; } <file_sep path="hyperswitch/crates/test_utils/tests/connectors/selenium.rs" crate="test_utils" role="macro_def"> macro_rules! tester { ($f:ident) => {{ use $crate::{function, tester_inner}; let test_name = format!("{:?}", function!()); if (should_ignore_test(&test_name)) { return; } let browser = get_browser(); let url = make_url(&browser); let caps = make_capabilities(&browser); tester_inner!($f, WebDriver::new(url, caps)); }}; } <file_sep path="hyperswitch/crates/test_utils/tests/connectors/multisafepay_ui.rs" crate="test_utils" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/test_utils/tests/connectors/selenium.rs<|crate|> test_utils macro=tester roles=macro_def,use_site use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> fn should_make_paypal_payment_test() { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/test_utils/tests/connectors/multisafepay_ui.rs" crate="test_utils" role="use_site"> <|fim_prefix|> fn should_make_paypal_payment_test() { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/test_utils/tests/connectors/payu_ui.rs" crate="test_utils" role="use_site"> tester!(should_make_no_3ds_card_payment); <file_sep path="hyperswitch/crates/test_utils/tests/connectors/payu_ui.rs" crate="test_utils" role="use_site"> tester!(should_make_no_3ds_card_payment); <file_sep path="hyperswitch/crates/test_utils/tests/connectors/selenium.rs" crate="test_utils" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/test_utils/tests/connectors/selenium.rs<|crate|> test_utils macro=tester roles=use_site,macro_def use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> #![allow( clippy::expect_used, clippy::panic, clippy::unwrap_in_result, clippy::missing_panics_doc, clippy::unwrap_used )] use std::{ <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/test_utils/tests/connectors/selenium.rs" crate="test_utils" role="macro_def"> <|fim_prefix|> #![allow( clippy::expect_used, clippy::panic, clippy::unwrap_in_result, clippy::missing_panics_doc, clippy::unwrap_used )] use std::{ <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/test_utils/tests/connectors/selenium.rs" crate="test_utils" role="macro_def"> macro_rules! tester { ($f:ident) => {{ use $crate::{function, tester_inner}; let test_name = format!("{:?}", function!()); if (should_ignore_test(&test_name)) { return; } let browser = get_browser(); let url = make_url(&browser); let caps = make_capabilities(&browser); tester_inner!($f, WebDriver::new(url, caps)); }}; } <file_sep path="hyperswitch/crates/test_utils/tests/connectors/selenium.rs" crate="test_utils" role="macro_def"> macro_rules! tester { ($f:ident) => {{ use $crate::{function, tester_inner}; let test_name = format!("{:?}", function!()); if (should_ignore_test(&test_name)) { return; } let browser = get_browser(); let url = make_url(&browser); let caps = make_capabilities(&browser); tester_inner!($f, WebDriver::new(url, caps)); }}; } <file_sep path="hyperswitch/crates/test_utils/tests/connectors/payu_ui.rs" crate="test_utils" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/test_utils/tests/connectors/selenium.rs<|crate|> test_utils macro=tester roles=macro_def,use_site use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> fn should_make_gpay_payment_test() { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/test_utils/tests/connectors/payu_ui.rs" crate="test_utils" role="use_site"> <|fim_prefix|> fn should_make_gpay_payment_test() { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/test_utils/tests/connectors/aci_ui.rs" crate="test_utils" role="use_site"> tester!(should_make_aci_przelewy24_payment); <file_sep path="hyperswitch/crates/test_utils/tests/connectors/aci_ui.rs" crate="test_utils" role="use_site"> tester!(should_make_aci_przelewy24_payment); <file_sep path="hyperswitch/crates/test_utils/tests/connectors/selenium.rs" crate="test_utils" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/test_utils/tests/connectors/selenium.rs<|crate|> test_utils macro=tester roles=use_site,macro_def use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> #![allow( clippy::expect_used, clippy::panic, clippy::unwrap_in_result, clippy::missing_panics_doc, clippy::unwrap_used )] use std::{ <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/test_utils/tests/connectors/selenium.rs" crate="test_utils" role="macro_def"> <|fim_prefix|> #![allow( clippy::expect_used, clippy::panic, clippy::unwrap_in_result, clippy::missing_panics_doc, clippy::unwrap_used )] use std::{ <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/test_utils/tests/connectors/multisafepay_ui.rs" crate="test_utils" role="use_site"> tester!(should_make_gpay_payment); <file_sep path="hyperswitch/crates/test_utils/tests/connectors/multisafepay_ui.rs" crate="test_utils" role="use_site"> tester!(should_make_gpay_payment); <file_sep path="hyperswitch/crates/test_utils/tests/connectors/selenium.rs" crate="test_utils" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/test_utils/tests/connectors/selenium.rs<|crate|> test_utils macro=tester roles=use_site,macro_def use=invoke item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> #![allow( clippy::expect_used, clippy::panic, clippy::unwrap_in_result, clippy::missing_panics_doc, clippy::unwrap_used )] use std::{ <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/test_utils/tests/connectors/selenium.rs" crate="test_utils" role="macro_def"> <|fim_prefix|> #![allow( clippy::expect_used, clippy::panic, clippy::unwrap_in_result, clippy::missing_panics_doc, clippy::unwrap_used )] use std::{ <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="macro_def"> macro_rules! error_to_process_tracker_error { ($($path: ident)::+ < $st: ident >, $($path2:ident)::* ($($inner_path2:ident)::+ <$st2:ident>) ) => { impl From<$($path)::+ <$st>> for ProcessTrackerError { fn from(err: $($path)::+ <$st> ) -> Self { $($path2)::*(err) } } }; ($($path: ident)::+ <$($inner_path:ident)::+>, $($path2:ident)::* ($($inner_path2:ident)::+ <$st2:ident>) ) => { impl<'a> From< $($path)::+ <$($inner_path)::+> > for ProcessTrackerError { fn from(err: $($path)::+ <$($inner_path)::+> ) -> Self { $($path2)::*(err) } } }; } <file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="macro_def"> macro_rules! error_to_process_tracker_error { ($($path: ident)::+ < $st: ident >, $($path2:ident)::* ($($inner_path2:ident)::+ <$st2:ident>) ) => { impl From<$($path)::+ <$st>> for ProcessTrackerError { fn from(err: $($path)::+ <$st> ) -> Self { $($path2)::*(err) } } }; ($($path: ident)::+ <$($inner_path:ident)::+>, $($path2:ident)::* ($($inner_path2:ident)::+ <$st2:ident>) ) => { impl<'a> From< $($path)::+ <$($inner_path)::+> > for ProcessTrackerError { fn from(err: $($path)::+ <$($inner_path)::+> ) -> Self { $($path2)::*(err) } } }; } <file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/scheduler/src/errors.rs<|crate|> scheduler macro=error_to_process_tracker_error roles=macro_def,use_site use=invoke item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub enum ProcessTrackerError { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="use_site"> <|fim_prefix|> pub enum ProcessTrackerError { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="macro_def"> macro_rules! error_to_process_tracker_error { ($($path: ident)::+ < $st: ident >, $($path2:ident)::* ($($inner_path2:ident)::+ <$st2:ident>) ) => { impl From<$($path)::+ <$st>> for ProcessTrackerError { fn from(err: $($path)::+ <$st> ) -> Self { $($path2)::*(err) } } }; ($($path: ident)::+ <$($inner_path:ident)::+>, $($path2:ident)::* ($($inner_path2:ident)::+ <$st2:ident>) ) => { impl<'a> From< $($path)::+ <$($inner_path)::+> > for ProcessTrackerError { fn from(err: $($path)::+ <$($inner_path)::+> ) -> Self { $($path2)::*(err) } } }; } <file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="macro_def"> macro_rules! error_to_process_tracker_error { ($($path: ident)::+ < $st: ident >, $($path2:ident)::* ($($inner_path2:ident)::+ <$st2:ident>) ) => { impl From<$($path)::+ <$st>> for ProcessTrackerError { fn from(err: $($path)::+ <$st> ) -> Self { $($path2)::*(err) } } }; ($($path: ident)::+ <$($inner_path:ident)::+>, $($path2:ident)::* ($($inner_path2:ident)::+ <$st2:ident>) ) => { impl<'a> From< $($path)::+ <$($inner_path)::+> > for ProcessTrackerError { fn from(err: $($path)::+ <$($inner_path)::+> ) -> Self { $($path2)::*(err) } } }; } <file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/scheduler/src/errors.rs<|crate|> scheduler macro=error_to_process_tracker_error roles=macro_def,use_site use=invoke item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub enum ProcessTrackerError { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="use_site"> <|fim_prefix|> pub enum ProcessTrackerError { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="use_site"> error_to_process_tracker_error!( error_stack::Report<RecoveryError>, ProcessTrackerError::ERecoveryError(error_stack::Report<RecoveryError>) ); <file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="use_site"> error_to_process_tracker_error!( error_stack::Report<RecoveryError>, ProcessTrackerError::ERecoveryError(error_stack::Report<RecoveryError>) ); <file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/scheduler/src/errors.rs<|crate|> scheduler macro=error_to_process_tracker_error roles=use_site,macro_def use=invoke item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub use common_utils::errors::{ <|fim_suffix|> <|fim_middle|> } error_to_process_tracker_error!( error_stack::Report<StorageError>, ProcessTrackerError::EStorageError(error_stack::Report<StorageError>) ); error_to_process_tracker_error!( error_stack::Report<RedisError>, ProcessTrackerError::ERedisError(error_stack::Report<RedisError>) ); error_to_process_tracker_error!( error_stack::Report<ParsingError>, ProcessTrackerError::EParsingError(error_stack::Report<ParsingError>) ); error_to_process_tracker_error!( error_stack::Report<ValidationError>, ProcessTrackerError::EValidationError(error_stack::Report<ValidationError>) ); #[cfg(feature = "email")] error_to_process_tracker_error!( error_stack::Report<EmailError>, ProcessTrackerError::EEmailError(error_stack::Report<EmailError>) ); error_to_process_tracker_error!( error_stack::Report<RecoveryError>, ProcessTrackerError::ERecoveryError(error_stack::Report<RecoveryError>) ); <file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="macro_def"> <|fim_prefix|> pub use common_utils::errors::{ <|fim_suffix|> <|fim_middle|> } error_to_process_tracker_error!( error_stack::Report<StorageError>, ProcessTrackerError::EStorageError(error_stack::Report<StorageError>) ); error_to_process_tracker_error!( error_stack::Report<RedisError>, ProcessTrackerError::ERedisError(error_stack::Report<RedisError>) ); error_to_process_tracker_error!( error_stack::Report<ParsingError>, ProcessTrackerError::EParsingError(error_stack::Report<ParsingError>) ); error_to_process_tracker_error!( error_stack::Report<ValidationError>, ProcessTrackerError::EValidationError(error_stack::Report<ValidationError>) ); #[cfg(feature = "email")] error_to_process_tracker_error!( error_stack::Report<EmailError>, ProcessTrackerError::EEmailError(error_stack::Report<EmailError>) ); error_to_process_tracker_error!( error_stack::Report<RecoveryError>, ProcessTrackerError::ERecoveryError(error_stack::Report<RecoveryError>) );
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="macro_def"> macro_rules! error_to_process_tracker_error { ($($path: ident)::+ < $st: ident >, $($path2:ident)::* ($($inner_path2:ident)::+ <$st2:ident>) ) => { impl From<$($path)::+ <$st>> for ProcessTrackerError { fn from(err: $($path)::+ <$st> ) -> Self { $($path2)::*(err) } } }; ($($path: ident)::+ <$($inner_path:ident)::+>, $($path2:ident)::* ($($inner_path2:ident)::+ <$st2:ident>) ) => { impl<'a> From< $($path)::+ <$($inner_path)::+> > for ProcessTrackerError { fn from(err: $($path)::+ <$($inner_path)::+> ) -> Self { $($path2)::*(err) } } }; } <file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="macro_def"> macro_rules! error_to_process_tracker_error { ($($path: ident)::+ < $st: ident >, $($path2:ident)::* ($($inner_path2:ident)::+ <$st2:ident>) ) => { impl From<$($path)::+ <$st>> for ProcessTrackerError { fn from(err: $($path)::+ <$st> ) -> Self { $($path2)::*(err) } } }; ($($path: ident)::+ <$($inner_path:ident)::+>, $($path2:ident)::* ($($inner_path2:ident)::+ <$st2:ident>) ) => { impl<'a> From< $($path)::+ <$($inner_path)::+> > for ProcessTrackerError { fn from(err: $($path)::+ <$($inner_path)::+> ) -> Self { $($path2)::*(err) } } }; } <file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/scheduler/src/errors.rs<|crate|> scheduler macro=error_to_process_tracker_error roles=macro_def,use_site use=invoke item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub enum ProcessTrackerError { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="use_site"> <|fim_prefix|> pub enum ProcessTrackerError { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="use_site"> error_to_process_tracker_error!( error_stack::Report<EmailError>, ProcessTrackerError::EEmailError(error_stack::Report<EmailError>) ); <file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="use_site"> error_to_process_tracker_error!( error_stack::Report<EmailError>, ProcessTrackerError::EEmailError(error_stack::Report<EmailError>) ); <file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/scheduler/src/errors.rs<|crate|> scheduler macro=error_to_process_tracker_error roles=use_site,macro_def use=invoke item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub use common_utils::errors::{ <|fim_suffix|> <|fim_middle|> } error_to_process_tracker_error!( error_stack::Report<StorageError>, ProcessTrackerError::EStorageError(error_stack::Report<StorageError>) ); error_to_process_tracker_error!( error_stack::Report<RedisError>, ProcessTrackerError::ERedisError(error_stack::Report<RedisError>) ); error_to_process_tracker_error!( error_stack::Report<ParsingError>, ProcessTrackerError::EParsingError(error_stack::Report<ParsingError>) ); error_to_process_tracker_error!( error_stack::Report<ValidationError>, ProcessTrackerError::EValidationError(error_stack::Report<ValidationError>) ); #[cfg(feature = "email")] error_to_process_tracker_error!( error_stack::Report<EmailError>, ProcessTrackerError::EEmailError(error_stack::Report<EmailError>) ); error_to_process_tracker_error!( error_stack::Report<RecoveryError>, ProcessTrackerError::ERecoveryError(error_stack::Report<RecoveryError>) ); <file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="macro_def"> <|fim_prefix|> pub use common_utils::errors::{ <|fim_suffix|> <|fim_middle|> } error_to_process_tracker_error!( error_stack::Report<StorageError>, ProcessTrackerError::EStorageError(error_stack::Report<StorageError>) ); error_to_process_tracker_error!( error_stack::Report<RedisError>, ProcessTrackerError::ERedisError(error_stack::Report<RedisError>) ); error_to_process_tracker_error!( error_stack::Report<ParsingError>, ProcessTrackerError::EParsingError(error_stack::Report<ParsingError>) ); error_to_process_tracker_error!( error_stack::Report<ValidationError>, ProcessTrackerError::EValidationError(error_stack::Report<ValidationError>) ); #[cfg(feature = "email")] error_to_process_tracker_error!( error_stack::Report<EmailError>, ProcessTrackerError::EEmailError(error_stack::Report<EmailError>) ); error_to_process_tracker_error!( error_stack::Report<RecoveryError>, ProcessTrackerError::ERecoveryError(error_stack::Report<RecoveryError>) );
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="use_site"> error_to_process_tracker_error!( error_stack::Report<RedisError>, ProcessTrackerError::ERedisError(error_stack::Report<RedisError>) ); <file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="use_site"> error_to_process_tracker_error!( error_stack::Report<RedisError>, ProcessTrackerError::ERedisError(error_stack::Report<RedisError>) ); <file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/scheduler/src/errors.rs<|crate|> scheduler macro=error_to_process_tracker_error roles=use_site,macro_def use=invoke item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub use common_utils::errors::{ <|fim_suffix|> <|fim_middle|> } error_to_process_tracker_error!( error_stack::Report<StorageError>, ProcessTrackerError::EStorageError(error_stack::Report<StorageError>) ); error_to_process_tracker_error!( error_stack::Report<RedisError>, ProcessTrackerError::ERedisError(error_stack::Report<RedisError>) ); error_to_process_tracker_error!( error_stack::Report<ParsingError>, ProcessTrackerError::EParsingError(error_stack::Report<ParsingError>) ); error_to_process_tracker_error!( error_stack::Report<ValidationError>, ProcessTrackerError::EValidationError(error_stack::Report<ValidationError>) ); #[cfg(feature = "email")] error_to_process_tracker_error!( error_stack::Report<EmailError>, ProcessTrackerError::EEmailError(error_stack::Report<EmailError>) ); error_to_process_tracker_error!( error_stack::Report<RecoveryError>, ProcessTrackerError::ERecoveryError(error_stack::Report<RecoveryError>) ); <file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="macro_def"> <|fim_prefix|> pub use common_utils::errors::{ <|fim_suffix|> <|fim_middle|> } error_to_process_tracker_error!( error_stack::Report<StorageError>, ProcessTrackerError::EStorageError(error_stack::Report<StorageError>) ); error_to_process_tracker_error!( error_stack::Report<RedisError>, ProcessTrackerError::ERedisError(error_stack::Report<RedisError>) ); error_to_process_tracker_error!( error_stack::Report<ParsingError>, ProcessTrackerError::EParsingError(error_stack::Report<ParsingError>) ); error_to_process_tracker_error!( error_stack::Report<ValidationError>, ProcessTrackerError::EValidationError(error_stack::Report<ValidationError>) ); #[cfg(feature = "email")] error_to_process_tracker_error!( error_stack::Report<EmailError>, ProcessTrackerError::EEmailError(error_stack::Report<EmailError>) ); error_to_process_tracker_error!( error_stack::Report<RecoveryError>, ProcessTrackerError::ERecoveryError(error_stack::Report<RecoveryError>) );
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="use_site"> error_to_process_tracker_error!( error_stack::Report<StorageError>, ProcessTrackerError::EStorageError(error_stack::Report<StorageError>) ); <file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="use_site"> error_to_process_tracker_error!( error_stack::Report<StorageError>, ProcessTrackerError::EStorageError(error_stack::Report<StorageError>) ); <file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/scheduler/src/errors.rs<|crate|> scheduler macro=error_to_process_tracker_error roles=use_site,macro_def use=invoke item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub use common_utils::errors::{ <|fim_suffix|> <|fim_middle|> } error_to_process_tracker_error!( error_stack::Report<StorageError>, ProcessTrackerError::EStorageError(error_stack::Report<StorageError>) ); error_to_process_tracker_error!( error_stack::Report<RedisError>, ProcessTrackerError::ERedisError(error_stack::Report<RedisError>) ); error_to_process_tracker_error!( error_stack::Report<ParsingError>, ProcessTrackerError::EParsingError(error_stack::Report<ParsingError>) ); error_to_process_tracker_error!( error_stack::Report<ValidationError>, ProcessTrackerError::EValidationError(error_stack::Report<ValidationError>) ); #[cfg(feature = "email")] error_to_process_tracker_error!( error_stack::Report<EmailError>, ProcessTrackerError::EEmailError(error_stack::Report<EmailError>) ); error_to_process_tracker_error!( error_stack::Report<RecoveryError>, ProcessTrackerError::ERecoveryError(error_stack::Report<RecoveryError>) ); <file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="macro_def"> <|fim_prefix|> pub use common_utils::errors::{ <|fim_suffix|> <|fim_middle|> } error_to_process_tracker_error!( error_stack::Report<StorageError>, ProcessTrackerError::EStorageError(error_stack::Report<StorageError>) ); error_to_process_tracker_error!( error_stack::Report<RedisError>, ProcessTrackerError::ERedisError(error_stack::Report<RedisError>) ); error_to_process_tracker_error!( error_stack::Report<ParsingError>, ProcessTrackerError::EParsingError(error_stack::Report<ParsingError>) ); error_to_process_tracker_error!( error_stack::Report<ValidationError>, ProcessTrackerError::EValidationError(error_stack::Report<ValidationError>) ); #[cfg(feature = "email")] error_to_process_tracker_error!( error_stack::Report<EmailError>, ProcessTrackerError::EEmailError(error_stack::Report<EmailError>) ); error_to_process_tracker_error!( error_stack::Report<RecoveryError>, ProcessTrackerError::ERecoveryError(error_stack::Report<RecoveryError>) );
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="use_site"> error_to_process_tracker_error!( error_stack::Report<ParsingError>, ProcessTrackerError::EParsingError(error_stack::Report<ParsingError>) ); <file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="use_site"> error_to_process_tracker_error!( error_stack::Report<ParsingError>, ProcessTrackerError::EParsingError(error_stack::Report<ParsingError>) ); <file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/scheduler/src/errors.rs<|crate|> scheduler macro=error_to_process_tracker_error roles=use_site,macro_def use=invoke item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub use common_utils::errors::{ <|fim_suffix|> <|fim_middle|> } error_to_process_tracker_error!( error_stack::Report<StorageError>, ProcessTrackerError::EStorageError(error_stack::Report<StorageError>) ); error_to_process_tracker_error!( error_stack::Report<RedisError>, ProcessTrackerError::ERedisError(error_stack::Report<RedisError>) ); error_to_process_tracker_error!( error_stack::Report<ParsingError>, ProcessTrackerError::EParsingError(error_stack::Report<ParsingError>) ); error_to_process_tracker_error!( error_stack::Report<ValidationError>, ProcessTrackerError::EValidationError(error_stack::Report<ValidationError>) ); #[cfg(feature = "email")] error_to_process_tracker_error!( error_stack::Report<EmailError>, ProcessTrackerError::EEmailError(error_stack::Report<EmailError>) ); error_to_process_tracker_error!( error_stack::Report<RecoveryError>, ProcessTrackerError::ERecoveryError(error_stack::Report<RecoveryError>) ); <file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="macro_def"> <|fim_prefix|> pub use common_utils::errors::{ <|fim_suffix|> <|fim_middle|> } error_to_process_tracker_error!( error_stack::Report<StorageError>, ProcessTrackerError::EStorageError(error_stack::Report<StorageError>) ); error_to_process_tracker_error!( error_stack::Report<RedisError>, ProcessTrackerError::ERedisError(error_stack::Report<RedisError>) ); error_to_process_tracker_error!( error_stack::Report<ParsingError>, ProcessTrackerError::EParsingError(error_stack::Report<ParsingError>) ); error_to_process_tracker_error!( error_stack::Report<ValidationError>, ProcessTrackerError::EValidationError(error_stack::Report<ValidationError>) ); #[cfg(feature = "email")] error_to_process_tracker_error!( error_stack::Report<EmailError>, ProcessTrackerError::EEmailError(error_stack::Report<EmailError>) ); error_to_process_tracker_error!( error_stack::Report<RecoveryError>, ProcessTrackerError::ERecoveryError(error_stack::Report<RecoveryError>) );
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="macro_def"> macro_rules! error_to_process_tracker_error { ($($path: ident)::+ < $st: ident >, $($path2:ident)::* ($($inner_path2:ident)::+ <$st2:ident>) ) => { impl From<$($path)::+ <$st>> for ProcessTrackerError { fn from(err: $($path)::+ <$st> ) -> Self { $($path2)::*(err) } } }; ($($path: ident)::+ <$($inner_path:ident)::+>, $($path2:ident)::* ($($inner_path2:ident)::+ <$st2:ident>) ) => { impl<'a> From< $($path)::+ <$($inner_path)::+> > for ProcessTrackerError { fn from(err: $($path)::+ <$($inner_path)::+> ) -> Self { $($path2)::*(err) } } }; } <file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="macro_def"> macro_rules! error_to_process_tracker_error { ($($path: ident)::+ < $st: ident >, $($path2:ident)::* ($($inner_path2:ident)::+ <$st2:ident>) ) => { impl From<$($path)::+ <$st>> for ProcessTrackerError { fn from(err: $($path)::+ <$st> ) -> Self { $($path2)::*(err) } } }; ($($path: ident)::+ <$($inner_path:ident)::+>, $($path2:ident)::* ($($inner_path2:ident)::+ <$st2:ident>) ) => { impl<'a> From< $($path)::+ <$($inner_path)::+> > for ProcessTrackerError { fn from(err: $($path)::+ <$($inner_path)::+> ) -> Self { $($path2)::*(err) } } }; } <file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/scheduler/src/errors.rs<|crate|> scheduler macro=error_to_process_tracker_error roles=macro_def,use_site use=invoke item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub enum ProcessTrackerError { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="use_site"> <|fim_prefix|> pub enum ProcessTrackerError { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="macro_def"> macro_rules! error_to_process_tracker_error { ($($path: ident)::+ < $st: ident >, $($path2:ident)::* ($($inner_path2:ident)::+ <$st2:ident>) ) => { impl From<$($path)::+ <$st>> for ProcessTrackerError { fn from(err: $($path)::+ <$st> ) -> Self { $($path2)::*(err) } } }; ($($path: ident)::+ <$($inner_path:ident)::+>, $($path2:ident)::* ($($inner_path2:ident)::+ <$st2:ident>) ) => { impl<'a> From< $($path)::+ <$($inner_path)::+> > for ProcessTrackerError { fn from(err: $($path)::+ <$($inner_path)::+> ) -> Self { $($path2)::*(err) } } }; } <file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="macro_def"> macro_rules! error_to_process_tracker_error { ($($path: ident)::+ < $st: ident >, $($path2:ident)::* ($($inner_path2:ident)::+ <$st2:ident>) ) => { impl From<$($path)::+ <$st>> for ProcessTrackerError { fn from(err: $($path)::+ <$st> ) -> Self { $($path2)::*(err) } } }; ($($path: ident)::+ <$($inner_path:ident)::+>, $($path2:ident)::* ($($inner_path2:ident)::+ <$st2:ident>) ) => { impl<'a> From< $($path)::+ <$($inner_path)::+> > for ProcessTrackerError { fn from(err: $($path)::+ <$($inner_path)::+> ) -> Self { $($path2)::*(err) } } }; } <file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/scheduler/src/errors.rs<|crate|> scheduler macro=error_to_process_tracker_error roles=macro_def,use_site use=invoke item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub enum ProcessTrackerError { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/scheduler/src/errors.rs" crate="scheduler" role="use_site"> <|fim_prefix|> pub enum ProcessTrackerError { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> pub fn derive_to_encryption_attr(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input = syn::parse_macro_input!(input as syn::DeriveInput); macros::derive_to_encryption(input) .unwrap_or_else(|err| err.into_compile_error()) .into() } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> pub fn derive_to_encryption_attr(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input = syn::parse_macro_input!(input as syn::DeriveInput); macros::derive_to_encryption(input) .unwrap_or_else(|err| err.into_compile_error()) .into() } <file_sep path="hyperswitch/crates/hyperswitch_domain_models/src/payments.rs" crate="hyperswitch_domain_models" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/router_derive/src/lib.rs<|crate|> hyperswitch_domain_models macro=ToEncryption roles=macro_def,use_site use=attribute item=struct pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub struct PaymentIntent { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/hyperswitch_domain_models/src/payments.rs" crate="hyperswitch_domain_models" role="use_site"> <|fim_prefix|> pub struct PaymentIntent { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> pub fn derive_to_encryption_attr(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input = syn::parse_macro_input!(input as syn::DeriveInput); macros::derive_to_encryption(input) .unwrap_or_else(|err| err.into_compile_error()) .into() } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> pub fn derive_to_encryption_attr(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input = syn::parse_macro_input!(input as syn::DeriveInput); macros::derive_to_encryption(input) .unwrap_or_else(|err| err.into_compile_error()) .into() } <file_sep path="hyperswitch/crates/router/src/types/domain/address.rs" crate="router" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/router_derive/src/lib.rs<|crate|> router macro=ToEncryption roles=macro_def,use_site use=attribute item=struct pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub struct Address { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/router/src/types/domain/address.rs" crate="router" role="use_site"> <|fim_prefix|> pub struct Address { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> pub fn derive_to_encryption_attr(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input = syn::parse_macro_input!(input as syn::DeriveInput); macros::derive_to_encryption(input) .unwrap_or_else(|err| err.into_compile_error()) .into() } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> pub fn derive_to_encryption_attr(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input = syn::parse_macro_input!(input as syn::DeriveInput); macros::derive_to_encryption(input) .unwrap_or_else(|err| err.into_compile_error()) .into() } <file_sep path="hyperswitch/crates/router/src/types/domain/address.rs" crate="router" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/router_derive/src/lib.rs<|crate|> router macro=ToEncryption roles=macro_def,use_site use=attribute item=struct pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub struct Address { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/router/src/types/domain/address.rs" crate="router" role="use_site"> <|fim_prefix|> pub struct Address { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> pub fn derive_to_encryption_attr(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input = syn::parse_macro_input!(input as syn::DeriveInput); macros::derive_to_encryption(input) .unwrap_or_else(|err| err.into_compile_error()) .into() } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> pub fn derive_to_encryption_attr(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input = syn::parse_macro_input!(input as syn::DeriveInput); macros::derive_to_encryption(input) .unwrap_or_else(|err| err.into_compile_error()) .into() } <file_sep path="hyperswitch/crates/router/src/types/domain/address.rs" crate="router" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/router_derive/src/lib.rs<|crate|> router macro=ToEncryption roles=macro_def,use_site use=attribute item=struct pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub struct Address { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/router/src/types/domain/address.rs" crate="router" role="use_site"> <|fim_prefix|> pub struct Address { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> pub fn derive_to_encryption_attr(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input = syn::parse_macro_input!(input as syn::DeriveInput); macros::derive_to_encryption(input) .unwrap_or_else(|err| err.into_compile_error()) .into() } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> pub fn derive_to_encryption_attr(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input = syn::parse_macro_input!(input as syn::DeriveInput); macros::derive_to_encryption(input) .unwrap_or_else(|err| err.into_compile_error()) .into() } <file_sep path="hyperswitch/crates/router/src/types/domain/address.rs" crate="router" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/router_derive/src/lib.rs<|crate|> router macro=ToEncryption roles=macro_def,use_site use=attribute item=struct pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub struct Address { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/router/src/types/domain/address.rs" crate="router" role="use_site"> <|fim_prefix|> pub struct Address { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_domain_models/src/payments.rs" crate="hyperswitch_domain_models" role="use_site"> pub struct PaymentIntent { /// The global identifier for the payment intent. This is generated by the system. /// The format of the global id is `{cell_id:5}_pay_{time_ordered_uuid:32}`. pub id: id_type::GlobalPaymentId, /// The identifier for the merchant. This is automatically derived from the api key used to create the payment. pub merchant_id: id_type::MerchantId, /// The status of payment intent. pub status: storage_enums::IntentStatus, /// The amount related details of the payment pub amount_details: AmountDetails, /// The total amount captured for the order. This is the sum of all the captured amounts for the order. pub amount_captured: Option<MinorUnit>, /// The identifier for the customer. This is the identifier for the customer in the merchant's system. pub customer_id: Option<id_type::GlobalCustomerId>, /// The description of the order. This will be passed to connectors which support description. pub description: Option<common_utils::types::Description>, /// The return url for the payment. This is the url to which the user will be redirected after the payment is completed. pub return_url: Option<common_utils::types::Url>, /// The metadata for the payment intent. This is the metadata that will be passed to the connectors. pub metadata: Option<pii::SecretSerdeValue>, /// The statement descriptor for the order, this will be displayed in the user's bank statement. pub statement_descriptor: Option<common_utils::types::StatementDescriptor>, /// The time at which the order was created #[serde(with = "common_utils::custom_serde::iso8601")] pub created_at: PrimitiveDateTime, /// The time at which the order was last modified #[serde(with = "common_utils::custom_serde::iso8601")] pub modified_at: PrimitiveDateTime, #[serde(with = "common_utils::custom_serde::iso8601::option")] pub last_synced: Option<PrimitiveDateTime>, pub setup_future_usage: storage_enums::FutureUsage, /// The client secret that is generated for the payment. This is used to authenticate the payment from client facing apis. pub client_secret: common_utils::types::ClientSecret, /// The active attempt for the payment intent. This is the payment attempt that is currently active for the payment intent. pub active_attempt_id: Option<id_type::GlobalAttemptId>, /// The order details for the payment. pub order_details: Option<Vec<Secret<OrderDetailsWithAmount>>>, /// This is the list of payment method types that are allowed for the payment intent. /// This field allows the merchant to restrict the payment methods that can be used for the payment intent. pub allowed_payment_method_types: Option<Vec<common_enums::PaymentMethodType>>, /// This metadata contains details about pub connector_metadata: Option<pii::SecretSerdeValue>, pub feature_metadata: Option<FeatureMetadata>, /// Number of attempts that have been made for the order pub attempt_count: i16, /// The profile id for the payment. pub profile_id: id_type::ProfileId, /// The payment link id for the payment. This is generated only if `enable_payment_link` is set to true. pub payment_link_id: Option<String>, /// This Denotes the action(approve or reject) taken by merchant in case of manual review. /// Manual review can occur when the transaction is marked as risky by the frm_processor, payment processor or when there is underpayment/over payment incase of crypto payment pub frm_merchant_decision: Option<common_enums::MerchantDecision>, /// Denotes the last instance which updated the payment pub updated_by: String, /// Denotes whether merchant requested for incremental authorization to be enabled for this payment. pub request_incremental_authorization: storage_enums::RequestIncrementalAuthorization, /// Denotes the number of authorizations that have been made for the payment. pub authorization_count: Option<i32>, /// Denotes the client secret expiry for the payment. This is the time at which the client secret will expire. #[serde(with = "common_utils::custom_serde::iso8601")] pub session_expiry: PrimitiveDateTime, /// Denotes whether merchant requested for 3ds authentication to be enabled for this payment. pub request_external_three_ds_authentication: common_enums::External3dsAuthenticationRequest, /// Metadata related to fraud and risk management pub frm_metadata: Option<pii::SecretSerdeValue>, /// The details of the customer in a denormalized form. Only a subset of fields are stored. #[encrypt] pub customer_details: Option<Encryptable<Secret<Value>>>, /// The reference id for the order in the merchant's system. This value can be passed by the merchant. pub merchant_reference_id: Option<id_type::PaymentReferenceId>, /// The billing address for the order in a denormalized form. #[encrypt(ty = Value)] pub billing_address: Option<Encryptable<Address>>, /// The shipping address for the order in a denormalized form. #[encrypt(ty = Value)] pub shipping_address: Option<Encryptable<Address>>, /// Capture method for the payment pub capture_method: storage_enums::CaptureMethod, /// Authentication type that is requested by the merchant for this payment. pub authentication_type: Option<common_enums::AuthenticationType>, /// This contains the pre routing results that are done when routing is done during listing the payment methods. pub prerouting_algorithm: Option<routing::PaymentRoutingInfo>, /// The organization id for the payment. This is derived from the merchant account pub organization_id: id_type::OrganizationId, /// Denotes the request by the merchant whether to enable a payment link for this payment. pub enable_payment_link: common_enums::EnablePaymentLinkRequest, /// Denotes the request by the merchant whether to apply MIT exemption for this payment pub apply_mit_exemption: common_enums::MitExemptionRequest, /// Denotes whether the customer is present during the payment flow. This information may be used for 3ds authentication pub customer_present: common_enums::PresenceOfCustomerDuringPayment, /// Denotes the override for payment link configuration pub payment_link_config: Option<diesel_models::PaymentLinkConfigRequestForPayments>, /// 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>, /// Identifier for the platform merchant. pub platform_merchant_id: Option<id_type::MerchantId>, /// Split Payment Data pub split_payments: Option<common_types::payments::SplitPaymentsRequest>, pub force_3ds_challenge: Option<bool>, pub force_3ds_challenge_trigger: Option<bool>, } <file_sep path="hyperswitch/crates/hyperswitch_domain_models/src/payments.rs" crate="hyperswitch_domain_models" role="use_site"> pub struct PaymentIntent { /// The global identifier for the payment intent. This is generated by the system. /// The format of the global id is `{cell_id:5}_pay_{time_ordered_uuid:32}`. pub id: id_type::GlobalPaymentId, /// The identifier for the merchant. This is automatically derived from the api key used to create the payment. pub merchant_id: id_type::MerchantId, /// The status of payment intent. pub status: storage_enums::IntentStatus, /// The amount related details of the payment pub amount_details: AmountDetails, /// The total amount captured for the order. This is the sum of all the captured amounts for the order. pub amount_captured: Option<MinorUnit>, /// The identifier for the customer. This is the identifier for the customer in the merchant's system. pub customer_id: Option<id_type::GlobalCustomerId>, /// The description of the order. This will be passed to connectors which support description. pub description: Option<common_utils::types::Description>, /// The return url for the payment. This is the url to which the user will be redirected after the payment is completed. pub return_url: Option<common_utils::types::Url>, /// The metadata for the payment intent. This is the metadata that will be passed to the connectors. pub metadata: Option<pii::SecretSerdeValue>, /// The statement descriptor for the order, this will be displayed in the user's bank statement. pub statement_descriptor: Option<common_utils::types::StatementDescriptor>, /// The time at which the order was created #[serde(with = "common_utils::custom_serde::iso8601")] pub created_at: PrimitiveDateTime, /// The time at which the order was last modified #[serde(with = "common_utils::custom_serde::iso8601")] pub modified_at: PrimitiveDateTime, #[serde(with = "common_utils::custom_serde::iso8601::option")] pub last_synced: Option<PrimitiveDateTime>, pub setup_future_usage: storage_enums::FutureUsage, /// The client secret that is generated for the payment. This is used to authenticate the payment from client facing apis. pub client_secret: common_utils::types::ClientSecret, /// The active attempt for the payment intent. This is the payment attempt that is currently active for the payment intent. pub active_attempt_id: Option<id_type::GlobalAttemptId>, /// The order details for the payment. pub order_details: Option<Vec<Secret<OrderDetailsWithAmount>>>, /// This is the list of payment method types that are allowed for the payment intent. /// This field allows the merchant to restrict the payment methods that can be used for the payment intent. pub allowed_payment_method_types: Option<Vec<common_enums::PaymentMethodType>>, /// This metadata contains details about pub connector_metadata: Option<pii::SecretSerdeValue>, pub feature_metadata: Option<FeatureMetadata>, /// Number of attempts that have been made for the order pub attempt_count: i16, /// The profile id for the payment. pub profile_id: id_type::ProfileId, /// The payment link id for the payment. This is generated only if `enable_payment_link` is set to true. pub payment_link_id: Option<String>, /// This Denotes the action(approve or reject) taken by merchant in case of manual review. /// Manual review can occur when the transaction is marked as risky by the frm_processor, payment processor or when there is underpayment/over payment incase of crypto payment pub frm_merchant_decision: Option<common_enums::MerchantDecision>, /// Denotes the last instance which updated the payment pub updated_by: String, /// Denotes whether merchant requested for incremental authorization to be enabled for this payment. pub request_incremental_authorization: storage_enums::RequestIncrementalAuthorization, /// Denotes the number of authorizations that have been made for the payment. pub authorization_count: Option<i32>, /// Denotes the client secret expiry for the payment. This is the time at which the client secret will expire. #[serde(with = "common_utils::custom_serde::iso8601")] pub session_expiry: PrimitiveDateTime, /// Denotes whether merchant requested for 3ds authentication to be enabled for this payment. pub request_external_three_ds_authentication: common_enums::External3dsAuthenticationRequest, /// Metadata related to fraud and risk management pub frm_metadata: Option<pii::SecretSerdeValue>, /// The details of the customer in a denormalized form. Only a subset of fields are stored. #[encrypt] pub customer_details: Option<Encryptable<Secret<Value>>>, /// The reference id for the order in the merchant's system. This value can be passed by the merchant. pub merchant_reference_id: Option<id_type::PaymentReferenceId>, /// The billing address for the order in a denormalized form. #[encrypt(ty = Value)] pub billing_address: Option<Encryptable<Address>>, /// The shipping address for the order in a denormalized form. #[encrypt(ty = Value)] pub shipping_address: Option<Encryptable<Address>>, /// Capture method for the payment pub capture_method: storage_enums::CaptureMethod, /// Authentication type that is requested by the merchant for this payment. pub authentication_type: Option<common_enums::AuthenticationType>, /// This contains the pre routing results that are done when routing is done during listing the payment methods. pub prerouting_algorithm: Option<routing::PaymentRoutingInfo>, /// The organization id for the payment. This is derived from the merchant account pub organization_id: id_type::OrganizationId, /// Denotes the request by the merchant whether to enable a payment link for this payment. pub enable_payment_link: common_enums::EnablePaymentLinkRequest, /// Denotes the request by the merchant whether to apply MIT exemption for this payment pub apply_mit_exemption: common_enums::MitExemptionRequest, /// Denotes whether the customer is present during the payment flow. This information may be used for 3ds authentication pub customer_present: common_enums::PresenceOfCustomerDuringPayment, /// Denotes the override for payment link configuration pub payment_link_config: Option<diesel_models::PaymentLinkConfigRequestForPayments>, /// 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>, /// Identifier for the platform merchant. pub platform_merchant_id: Option<id_type::MerchantId>, /// Split Payment Data pub split_payments: Option<common_types::payments::SplitPaymentsRequest>, pub force_3ds_challenge: Option<bool>, pub force_3ds_challenge_trigger: Option<bool>, } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/router_derive/src/lib.rs<|crate|> hyperswitch_domain_models macro=ToEncryption roles=use_site,macro_def use=attribute item=struct pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub fn derive_to_encryption_attr(input: proc_macro::TokenStream) -> proc_macro::TokenStream { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> <|fim_prefix|> pub fn derive_to_encryption_attr(input: proc_macro::TokenStream) -> proc_macro::TokenStream { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_domain_models/src/payments.rs" crate="hyperswitch_domain_models" role="use_site"> pub struct PaymentIntent { /// The global identifier for the payment intent. This is generated by the system. /// The format of the global id is `{cell_id:5}_pay_{time_ordered_uuid:32}`. pub id: id_type::GlobalPaymentId, /// The identifier for the merchant. This is automatically derived from the api key used to create the payment. pub merchant_id: id_type::MerchantId, /// The status of payment intent. pub status: storage_enums::IntentStatus, /// The amount related details of the payment pub amount_details: AmountDetails, /// The total amount captured for the order. This is the sum of all the captured amounts for the order. pub amount_captured: Option<MinorUnit>, /// The identifier for the customer. This is the identifier for the customer in the merchant's system. pub customer_id: Option<id_type::GlobalCustomerId>, /// The description of the order. This will be passed to connectors which support description. pub description: Option<common_utils::types::Description>, /// The return url for the payment. This is the url to which the user will be redirected after the payment is completed. pub return_url: Option<common_utils::types::Url>, /// The metadata for the payment intent. This is the metadata that will be passed to the connectors. pub metadata: Option<pii::SecretSerdeValue>, /// The statement descriptor for the order, this will be displayed in the user's bank statement. pub statement_descriptor: Option<common_utils::types::StatementDescriptor>, /// The time at which the order was created #[serde(with = "common_utils::custom_serde::iso8601")] pub created_at: PrimitiveDateTime, /// The time at which the order was last modified #[serde(with = "common_utils::custom_serde::iso8601")] pub modified_at: PrimitiveDateTime, #[serde(with = "common_utils::custom_serde::iso8601::option")] pub last_synced: Option<PrimitiveDateTime>, pub setup_future_usage: storage_enums::FutureUsage, /// The client secret that is generated for the payment. This is used to authenticate the payment from client facing apis. pub client_secret: common_utils::types::ClientSecret, /// The active attempt for the payment intent. This is the payment attempt that is currently active for the payment intent. pub active_attempt_id: Option<id_type::GlobalAttemptId>, /// The order details for the payment. pub order_details: Option<Vec<Secret<OrderDetailsWithAmount>>>, /// This is the list of payment method types that are allowed for the payment intent. /// This field allows the merchant to restrict the payment methods that can be used for the payment intent. pub allowed_payment_method_types: Option<Vec<common_enums::PaymentMethodType>>, /// This metadata contains details about pub connector_metadata: Option<pii::SecretSerdeValue>, pub feature_metadata: Option<FeatureMetadata>, /// Number of attempts that have been made for the order pub attempt_count: i16, /// The profile id for the payment. pub profile_id: id_type::ProfileId, /// The payment link id for the payment. This is generated only if `enable_payment_link` is set to true. pub payment_link_id: Option<String>, /// This Denotes the action(approve or reject) taken by merchant in case of manual review. /// Manual review can occur when the transaction is marked as risky by the frm_processor, payment processor or when there is underpayment/over payment incase of crypto payment pub frm_merchant_decision: Option<common_enums::MerchantDecision>, /// Denotes the last instance which updated the payment pub updated_by: String, /// Denotes whether merchant requested for incremental authorization to be enabled for this payment. pub request_incremental_authorization: storage_enums::RequestIncrementalAuthorization, /// Denotes the number of authorizations that have been made for the payment. pub authorization_count: Option<i32>, /// Denotes the client secret expiry for the payment. This is the time at which the client secret will expire. #[serde(with = "common_utils::custom_serde::iso8601")] pub session_expiry: PrimitiveDateTime, /// Denotes whether merchant requested for 3ds authentication to be enabled for this payment. pub request_external_three_ds_authentication: common_enums::External3dsAuthenticationRequest, /// Metadata related to fraud and risk management pub frm_metadata: Option<pii::SecretSerdeValue>, /// The details of the customer in a denormalized form. Only a subset of fields are stored. #[encrypt] pub customer_details: Option<Encryptable<Secret<Value>>>, /// The reference id for the order in the merchant's system. This value can be passed by the merchant. pub merchant_reference_id: Option<id_type::PaymentReferenceId>, /// The billing address for the order in a denormalized form. #[encrypt(ty = Value)] pub billing_address: Option<Encryptable<Address>>, /// The shipping address for the order in a denormalized form. #[encrypt(ty = Value)] pub shipping_address: Option<Encryptable<Address>>, /// Capture method for the payment pub capture_method: storage_enums::CaptureMethod, /// Authentication type that is requested by the merchant for this payment. pub authentication_type: Option<common_enums::AuthenticationType>, /// This contains the pre routing results that are done when routing is done during listing the payment methods. pub prerouting_algorithm: Option<routing::PaymentRoutingInfo>, /// The organization id for the payment. This is derived from the merchant account pub organization_id: id_type::OrganizationId, /// Denotes the request by the merchant whether to enable a payment link for this payment. pub enable_payment_link: common_enums::EnablePaymentLinkRequest, /// Denotes the request by the merchant whether to apply MIT exemption for this payment pub apply_mit_exemption: common_enums::MitExemptionRequest, /// Denotes whether the customer is present during the payment flow. This information may be used for 3ds authentication pub customer_present: common_enums::PresenceOfCustomerDuringPayment, /// Denotes the override for payment link configuration pub payment_link_config: Option<diesel_models::PaymentLinkConfigRequestForPayments>, /// 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>, /// Identifier for the platform merchant. pub platform_merchant_id: Option<id_type::MerchantId>, /// Split Payment Data pub split_payments: Option<common_types::payments::SplitPaymentsRequest>, pub force_3ds_challenge: Option<bool>, pub force_3ds_challenge_trigger: Option<bool>, } <file_sep path="hyperswitch/crates/hyperswitch_domain_models/src/payments.rs" crate="hyperswitch_domain_models" role="use_site"> pub struct PaymentIntent { /// The global identifier for the payment intent. This is generated by the system. /// The format of the global id is `{cell_id:5}_pay_{time_ordered_uuid:32}`. pub id: id_type::GlobalPaymentId, /// The identifier for the merchant. This is automatically derived from the api key used to create the payment. pub merchant_id: id_type::MerchantId, /// The status of payment intent. pub status: storage_enums::IntentStatus, /// The amount related details of the payment pub amount_details: AmountDetails, /// The total amount captured for the order. This is the sum of all the captured amounts for the order. pub amount_captured: Option<MinorUnit>, /// The identifier for the customer. This is the identifier for the customer in the merchant's system. pub customer_id: Option<id_type::GlobalCustomerId>, /// The description of the order. This will be passed to connectors which support description. pub description: Option<common_utils::types::Description>, /// The return url for the payment. This is the url to which the user will be redirected after the payment is completed. pub return_url: Option<common_utils::types::Url>, /// The metadata for the payment intent. This is the metadata that will be passed to the connectors. pub metadata: Option<pii::SecretSerdeValue>, /// The statement descriptor for the order, this will be displayed in the user's bank statement. pub statement_descriptor: Option<common_utils::types::StatementDescriptor>, /// The time at which the order was created #[serde(with = "common_utils::custom_serde::iso8601")] pub created_at: PrimitiveDateTime, /// The time at which the order was last modified #[serde(with = "common_utils::custom_serde::iso8601")] pub modified_at: PrimitiveDateTime, #[serde(with = "common_utils::custom_serde::iso8601::option")] pub last_synced: Option<PrimitiveDateTime>, pub setup_future_usage: storage_enums::FutureUsage, /// The client secret that is generated for the payment. This is used to authenticate the payment from client facing apis. pub client_secret: common_utils::types::ClientSecret, /// The active attempt for the payment intent. This is the payment attempt that is currently active for the payment intent. pub active_attempt_id: Option<id_type::GlobalAttemptId>, /// The order details for the payment. pub order_details: Option<Vec<Secret<OrderDetailsWithAmount>>>, /// This is the list of payment method types that are allowed for the payment intent. /// This field allows the merchant to restrict the payment methods that can be used for the payment intent. pub allowed_payment_method_types: Option<Vec<common_enums::PaymentMethodType>>, /// This metadata contains details about pub connector_metadata: Option<pii::SecretSerdeValue>, pub feature_metadata: Option<FeatureMetadata>, /// Number of attempts that have been made for the order pub attempt_count: i16, /// The profile id for the payment. pub profile_id: id_type::ProfileId, /// The payment link id for the payment. This is generated only if `enable_payment_link` is set to true. pub payment_link_id: Option<String>, /// This Denotes the action(approve or reject) taken by merchant in case of manual review. /// Manual review can occur when the transaction is marked as risky by the frm_processor, payment processor or when there is underpayment/over payment incase of crypto payment pub frm_merchant_decision: Option<common_enums::MerchantDecision>, /// Denotes the last instance which updated the payment pub updated_by: String, /// Denotes whether merchant requested for incremental authorization to be enabled for this payment. pub request_incremental_authorization: storage_enums::RequestIncrementalAuthorization, /// Denotes the number of authorizations that have been made for the payment. pub authorization_count: Option<i32>, /// Denotes the client secret expiry for the payment. This is the time at which the client secret will expire. #[serde(with = "common_utils::custom_serde::iso8601")] pub session_expiry: PrimitiveDateTime, /// Denotes whether merchant requested for 3ds authentication to be enabled for this payment. pub request_external_three_ds_authentication: common_enums::External3dsAuthenticationRequest, /// Metadata related to fraud and risk management pub frm_metadata: Option<pii::SecretSerdeValue>, /// The details of the customer in a denormalized form. Only a subset of fields are stored. #[encrypt] pub customer_details: Option<Encryptable<Secret<Value>>>, /// The reference id for the order in the merchant's system. This value can be passed by the merchant. pub merchant_reference_id: Option<id_type::PaymentReferenceId>, /// The billing address for the order in a denormalized form. #[encrypt(ty = Value)] pub billing_address: Option<Encryptable<Address>>, /// The shipping address for the order in a denormalized form. #[encrypt(ty = Value)] pub shipping_address: Option<Encryptable<Address>>, /// Capture method for the payment pub capture_method: storage_enums::CaptureMethod, /// Authentication type that is requested by the merchant for this payment. pub authentication_type: Option<common_enums::AuthenticationType>, /// This contains the pre routing results that are done when routing is done during listing the payment methods. pub prerouting_algorithm: Option<routing::PaymentRoutingInfo>, /// The organization id for the payment. This is derived from the merchant account pub organization_id: id_type::OrganizationId, /// Denotes the request by the merchant whether to enable a payment link for this payment. pub enable_payment_link: common_enums::EnablePaymentLinkRequest, /// Denotes the request by the merchant whether to apply MIT exemption for this payment pub apply_mit_exemption: common_enums::MitExemptionRequest, /// Denotes whether the customer is present during the payment flow. This information may be used for 3ds authentication pub customer_present: common_enums::PresenceOfCustomerDuringPayment, /// Denotes the override for payment link configuration pub payment_link_config: Option<diesel_models::PaymentLinkConfigRequestForPayments>, /// 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>, /// Identifier for the platform merchant. pub platform_merchant_id: Option<id_type::MerchantId>, /// Split Payment Data pub split_payments: Option<common_types::payments::SplitPaymentsRequest>, pub force_3ds_challenge: Option<bool>, pub force_3ds_challenge_trigger: Option<bool>, } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/router_derive/src/lib.rs<|crate|> hyperswitch_domain_models macro=ToEncryption roles=use_site,macro_def use=attribute item=struct pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub fn derive_to_encryption_attr(input: proc_macro::TokenStream) -> proc_macro::TokenStream { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> <|fim_prefix|> pub fn derive_to_encryption_attr(input: proc_macro::TokenStream) -> proc_macro::TokenStream { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_domain_models/src/payments.rs" crate="hyperswitch_domain_models" role="use_site"> pub struct PaymentIntent { /// The global identifier for the payment intent. This is generated by the system. /// The format of the global id is `{cell_id:5}_pay_{time_ordered_uuid:32}`. pub id: id_type::GlobalPaymentId, /// The identifier for the merchant. This is automatically derived from the api key used to create the payment. pub merchant_id: id_type::MerchantId, /// The status of payment intent. pub status: storage_enums::IntentStatus, /// The amount related details of the payment pub amount_details: AmountDetails, /// The total amount captured for the order. This is the sum of all the captured amounts for the order. pub amount_captured: Option<MinorUnit>, /// The identifier for the customer. This is the identifier for the customer in the merchant's system. pub customer_id: Option<id_type::GlobalCustomerId>, /// The description of the order. This will be passed to connectors which support description. pub description: Option<common_utils::types::Description>, /// The return url for the payment. This is the url to which the user will be redirected after the payment is completed. pub return_url: Option<common_utils::types::Url>, /// The metadata for the payment intent. This is the metadata that will be passed to the connectors. pub metadata: Option<pii::SecretSerdeValue>, /// The statement descriptor for the order, this will be displayed in the user's bank statement. pub statement_descriptor: Option<common_utils::types::StatementDescriptor>, /// The time at which the order was created #[serde(with = "common_utils::custom_serde::iso8601")] pub created_at: PrimitiveDateTime, /// The time at which the order was last modified #[serde(with = "common_utils::custom_serde::iso8601")] pub modified_at: PrimitiveDateTime, #[serde(with = "common_utils::custom_serde::iso8601::option")] pub last_synced: Option<PrimitiveDateTime>, pub setup_future_usage: storage_enums::FutureUsage, /// The client secret that is generated for the payment. This is used to authenticate the payment from client facing apis. pub client_secret: common_utils::types::ClientSecret, /// The active attempt for the payment intent. This is the payment attempt that is currently active for the payment intent. pub active_attempt_id: Option<id_type::GlobalAttemptId>, /// The order details for the payment. pub order_details: Option<Vec<Secret<OrderDetailsWithAmount>>>, /// This is the list of payment method types that are allowed for the payment intent. /// This field allows the merchant to restrict the payment methods that can be used for the payment intent. pub allowed_payment_method_types: Option<Vec<common_enums::PaymentMethodType>>, /// This metadata contains details about pub connector_metadata: Option<pii::SecretSerdeValue>, pub feature_metadata: Option<FeatureMetadata>, /// Number of attempts that have been made for the order pub attempt_count: i16, /// The profile id for the payment. pub profile_id: id_type::ProfileId, /// The payment link id for the payment. This is generated only if `enable_payment_link` is set to true. pub payment_link_id: Option<String>, /// This Denotes the action(approve or reject) taken by merchant in case of manual review. /// Manual review can occur when the transaction is marked as risky by the frm_processor, payment processor or when there is underpayment/over payment incase of crypto payment pub frm_merchant_decision: Option<common_enums::MerchantDecision>, /// Denotes the last instance which updated the payment pub updated_by: String, /// Denotes whether merchant requested for incremental authorization to be enabled for this payment. pub request_incremental_authorization: storage_enums::RequestIncrementalAuthorization, /// Denotes the number of authorizations that have been made for the payment. pub authorization_count: Option<i32>, /// Denotes the client secret expiry for the payment. This is the time at which the client secret will expire. #[serde(with = "common_utils::custom_serde::iso8601")] pub session_expiry: PrimitiveDateTime, /// Denotes whether merchant requested for 3ds authentication to be enabled for this payment. pub request_external_three_ds_authentication: common_enums::External3dsAuthenticationRequest, /// Metadata related to fraud and risk management pub frm_metadata: Option<pii::SecretSerdeValue>, /// The details of the customer in a denormalized form. Only a subset of fields are stored. #[encrypt] pub customer_details: Option<Encryptable<Secret<Value>>>, /// The reference id for the order in the merchant's system. This value can be passed by the merchant. pub merchant_reference_id: Option<id_type::PaymentReferenceId>, /// The billing address for the order in a denormalized form. #[encrypt(ty = Value)] pub billing_address: Option<Encryptable<Address>>, /// The shipping address for the order in a denormalized form. #[encrypt(ty = Value)] pub shipping_address: Option<Encryptable<Address>>, /// Capture method for the payment pub capture_method: storage_enums::CaptureMethod, /// Authentication type that is requested by the merchant for this payment. pub authentication_type: Option<common_enums::AuthenticationType>, /// This contains the pre routing results that are done when routing is done during listing the payment methods. pub prerouting_algorithm: Option<routing::PaymentRoutingInfo>, /// The organization id for the payment. This is derived from the merchant account pub organization_id: id_type::OrganizationId, /// Denotes the request by the merchant whether to enable a payment link for this payment. pub enable_payment_link: common_enums::EnablePaymentLinkRequest, /// Denotes the request by the merchant whether to apply MIT exemption for this payment pub apply_mit_exemption: common_enums::MitExemptionRequest, /// Denotes whether the customer is present during the payment flow. This information may be used for 3ds authentication pub customer_present: common_enums::PresenceOfCustomerDuringPayment, /// Denotes the override for payment link configuration pub payment_link_config: Option<diesel_models::PaymentLinkConfigRequestForPayments>, /// 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>, /// Identifier for the platform merchant. pub platform_merchant_id: Option<id_type::MerchantId>, /// Split Payment Data pub split_payments: Option<common_types::payments::SplitPaymentsRequest>, pub force_3ds_challenge: Option<bool>, pub force_3ds_challenge_trigger: Option<bool>, } <file_sep path="hyperswitch/crates/hyperswitch_domain_models/src/payments.rs" crate="hyperswitch_domain_models" role="use_site"> pub struct PaymentIntent { /// The global identifier for the payment intent. This is generated by the system. /// The format of the global id is `{cell_id:5}_pay_{time_ordered_uuid:32}`. pub id: id_type::GlobalPaymentId, /// The identifier for the merchant. This is automatically derived from the api key used to create the payment. pub merchant_id: id_type::MerchantId, /// The status of payment intent. pub status: storage_enums::IntentStatus, /// The amount related details of the payment pub amount_details: AmountDetails, /// The total amount captured for the order. This is the sum of all the captured amounts for the order. pub amount_captured: Option<MinorUnit>, /// The identifier for the customer. This is the identifier for the customer in the merchant's system. pub customer_id: Option<id_type::GlobalCustomerId>, /// The description of the order. This will be passed to connectors which support description. pub description: Option<common_utils::types::Description>, /// The return url for the payment. This is the url to which the user will be redirected after the payment is completed. pub return_url: Option<common_utils::types::Url>, /// The metadata for the payment intent. This is the metadata that will be passed to the connectors. pub metadata: Option<pii::SecretSerdeValue>, /// The statement descriptor for the order, this will be displayed in the user's bank statement. pub statement_descriptor: Option<common_utils::types::StatementDescriptor>, /// The time at which the order was created #[serde(with = "common_utils::custom_serde::iso8601")] pub created_at: PrimitiveDateTime, /// The time at which the order was last modified #[serde(with = "common_utils::custom_serde::iso8601")] pub modified_at: PrimitiveDateTime, #[serde(with = "common_utils::custom_serde::iso8601::option")] pub last_synced: Option<PrimitiveDateTime>, pub setup_future_usage: storage_enums::FutureUsage, /// The client secret that is generated for the payment. This is used to authenticate the payment from client facing apis. pub client_secret: common_utils::types::ClientSecret, /// The active attempt for the payment intent. This is the payment attempt that is currently active for the payment intent. pub active_attempt_id: Option<id_type::GlobalAttemptId>, /// The order details for the payment. pub order_details: Option<Vec<Secret<OrderDetailsWithAmount>>>, /// This is the list of payment method types that are allowed for the payment intent. /// This field allows the merchant to restrict the payment methods that can be used for the payment intent. pub allowed_payment_method_types: Option<Vec<common_enums::PaymentMethodType>>, /// This metadata contains details about pub connector_metadata: Option<pii::SecretSerdeValue>, pub feature_metadata: Option<FeatureMetadata>, /// Number of attempts that have been made for the order pub attempt_count: i16, /// The profile id for the payment. pub profile_id: id_type::ProfileId, /// The payment link id for the payment. This is generated only if `enable_payment_link` is set to true. pub payment_link_id: Option<String>, /// This Denotes the action(approve or reject) taken by merchant in case of manual review. /// Manual review can occur when the transaction is marked as risky by the frm_processor, payment processor or when there is underpayment/over payment incase of crypto payment pub frm_merchant_decision: Option<common_enums::MerchantDecision>, /// Denotes the last instance which updated the payment pub updated_by: String, /// Denotes whether merchant requested for incremental authorization to be enabled for this payment. pub request_incremental_authorization: storage_enums::RequestIncrementalAuthorization, /// Denotes the number of authorizations that have been made for the payment. pub authorization_count: Option<i32>, /// Denotes the client secret expiry for the payment. This is the time at which the client secret will expire. #[serde(with = "common_utils::custom_serde::iso8601")] pub session_expiry: PrimitiveDateTime, /// Denotes whether merchant requested for 3ds authentication to be enabled for this payment. pub request_external_three_ds_authentication: common_enums::External3dsAuthenticationRequest, /// Metadata related to fraud and risk management pub frm_metadata: Option<pii::SecretSerdeValue>, /// The details of the customer in a denormalized form. Only a subset of fields are stored. #[encrypt] pub customer_details: Option<Encryptable<Secret<Value>>>, /// The reference id for the order in the merchant's system. This value can be passed by the merchant. pub merchant_reference_id: Option<id_type::PaymentReferenceId>, /// The billing address for the order in a denormalized form. #[encrypt(ty = Value)] pub billing_address: Option<Encryptable<Address>>, /// The shipping address for the order in a denormalized form. #[encrypt(ty = Value)] pub shipping_address: Option<Encryptable<Address>>, /// Capture method for the payment pub capture_method: storage_enums::CaptureMethod, /// Authentication type that is requested by the merchant for this payment. pub authentication_type: Option<common_enums::AuthenticationType>, /// This contains the pre routing results that are done when routing is done during listing the payment methods. pub prerouting_algorithm: Option<routing::PaymentRoutingInfo>, /// The organization id for the payment. This is derived from the merchant account pub organization_id: id_type::OrganizationId, /// Denotes the request by the merchant whether to enable a payment link for this payment. pub enable_payment_link: common_enums::EnablePaymentLinkRequest, /// Denotes the request by the merchant whether to apply MIT exemption for this payment pub apply_mit_exemption: common_enums::MitExemptionRequest, /// Denotes whether the customer is present during the payment flow. This information may be used for 3ds authentication pub customer_present: common_enums::PresenceOfCustomerDuringPayment, /// Denotes the override for payment link configuration pub payment_link_config: Option<diesel_models::PaymentLinkConfigRequestForPayments>, /// 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>, /// Identifier for the platform merchant. pub platform_merchant_id: Option<id_type::MerchantId>, /// Split Payment Data pub split_payments: Option<common_types::payments::SplitPaymentsRequest>, pub force_3ds_challenge: Option<bool>, pub force_3ds_challenge_trigger: Option<bool>, } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/router_derive/src/lib.rs<|crate|> hyperswitch_domain_models macro=ToEncryption roles=use_site,macro_def use=attribute item=struct pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub fn derive_to_encryption_attr(input: proc_macro::TokenStream) -> proc_macro::TokenStream { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> <|fim_prefix|> pub fn derive_to_encryption_attr(input: proc_macro::TokenStream) -> proc_macro::TokenStream { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/router/src/types/domain/address.rs" crate="router" role="use_site"> pub struct Address { pub address_id: String, pub city: Option<String>, pub country: Option<enums::CountryAlpha2>, #[encrypt] pub line1: Option<Encryptable<Secret<String>>>, #[encrypt] pub line2: Option<Encryptable<Secret<String>>>, #[encrypt] pub line3: Option<Encryptable<Secret<String>>>, #[encrypt] pub state: Option<Encryptable<Secret<String>>>, #[encrypt] pub zip: Option<Encryptable<Secret<String>>>, #[encrypt] pub first_name: Option<Encryptable<Secret<String>>>, #[encrypt] pub last_name: Option<Encryptable<Secret<String>>>, #[encrypt] pub phone_number: Option<Encryptable<Secret<String>>>, pub country_code: Option<String>, #[serde(skip_serializing)] #[serde(with = "custom_serde::iso8601")] pub created_at: PrimitiveDateTime, #[serde(skip_serializing)] #[serde(with = "custom_serde::iso8601")] pub modified_at: PrimitiveDateTime, pub merchant_id: id_type::MerchantId, pub updated_by: String, #[encrypt] pub email: Option<Encryptable<Secret<String, pii::EmailStrategy>>>, } <file_sep path="hyperswitch/crates/router/src/types/domain/address.rs" crate="router" role="use_site"> pub struct Address { pub address_id: String, pub city: Option<String>, pub country: Option<enums::CountryAlpha2>, #[encrypt] pub line1: Option<Encryptable<Secret<String>>>, #[encrypt] pub line2: Option<Encryptable<Secret<String>>>, #[encrypt] pub line3: Option<Encryptable<Secret<String>>>, #[encrypt] pub state: Option<Encryptable<Secret<String>>>, #[encrypt] pub zip: Option<Encryptable<Secret<String>>>, #[encrypt] pub first_name: Option<Encryptable<Secret<String>>>, #[encrypt] pub last_name: Option<Encryptable<Secret<String>>>, #[encrypt] pub phone_number: Option<Encryptable<Secret<String>>>, pub country_code: Option<String>, #[serde(skip_serializing)] #[serde(with = "custom_serde::iso8601")] pub created_at: PrimitiveDateTime, #[serde(skip_serializing)] #[serde(with = "custom_serde::iso8601")] pub modified_at: PrimitiveDateTime, pub merchant_id: id_type::MerchantId, pub updated_by: String, #[encrypt] pub email: Option<Encryptable<Secret<String, pii::EmailStrategy>>>, } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/router_derive/src/lib.rs<|crate|> router macro=ToEncryption roles=use_site,macro_def use=attribute item=struct pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub fn derive_to_encryption_attr(input: proc_macro::TokenStream) -> proc_macro::TokenStream { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> <|fim_prefix|> pub fn derive_to_encryption_attr(input: proc_macro::TokenStream) -> proc_macro::TokenStream { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/router/src/types/domain/address.rs" crate="router" role="use_site"> pub struct Address { pub address_id: String, pub city: Option<String>, pub country: Option<enums::CountryAlpha2>, #[encrypt] pub line1: Option<Encryptable<Secret<String>>>, #[encrypt] pub line2: Option<Encryptable<Secret<String>>>, #[encrypt] pub line3: Option<Encryptable<Secret<String>>>, #[encrypt] pub state: Option<Encryptable<Secret<String>>>, #[encrypt] pub zip: Option<Encryptable<Secret<String>>>, #[encrypt] pub first_name: Option<Encryptable<Secret<String>>>, #[encrypt] pub last_name: Option<Encryptable<Secret<String>>>, #[encrypt] pub phone_number: Option<Encryptable<Secret<String>>>, pub country_code: Option<String>, #[serde(skip_serializing)] #[serde(with = "custom_serde::iso8601")] pub created_at: PrimitiveDateTime, #[serde(skip_serializing)] #[serde(with = "custom_serde::iso8601")] pub modified_at: PrimitiveDateTime, pub merchant_id: id_type::MerchantId, pub updated_by: String, #[encrypt] pub email: Option<Encryptable<Secret<String, pii::EmailStrategy>>>, } <file_sep path="hyperswitch/crates/router/src/types/domain/address.rs" crate="router" role="use_site"> pub struct Address { pub address_id: String, pub city: Option<String>, pub country: Option<enums::CountryAlpha2>, #[encrypt] pub line1: Option<Encryptable<Secret<String>>>, #[encrypt] pub line2: Option<Encryptable<Secret<String>>>, #[encrypt] pub line3: Option<Encryptable<Secret<String>>>, #[encrypt] pub state: Option<Encryptable<Secret<String>>>, #[encrypt] pub zip: Option<Encryptable<Secret<String>>>, #[encrypt] pub first_name: Option<Encryptable<Secret<String>>>, #[encrypt] pub last_name: Option<Encryptable<Secret<String>>>, #[encrypt] pub phone_number: Option<Encryptable<Secret<String>>>, pub country_code: Option<String>, #[serde(skip_serializing)] #[serde(with = "custom_serde::iso8601")] pub created_at: PrimitiveDateTime, #[serde(skip_serializing)] #[serde(with = "custom_serde::iso8601")] pub modified_at: PrimitiveDateTime, pub merchant_id: id_type::MerchantId, pub updated_by: String, #[encrypt] pub email: Option<Encryptable<Secret<String, pii::EmailStrategy>>>, } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/router_derive/src/lib.rs<|crate|> router macro=ToEncryption roles=use_site,macro_def use=attribute item=struct pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub fn derive_to_encryption_attr(input: proc_macro::TokenStream) -> proc_macro::TokenStream { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> <|fim_prefix|> pub fn derive_to_encryption_attr(input: proc_macro::TokenStream) -> proc_macro::TokenStream { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/router/src/types/domain/address.rs" crate="router" role="use_site"> pub struct Address { pub address_id: String, pub city: Option<String>, pub country: Option<enums::CountryAlpha2>, #[encrypt] pub line1: Option<Encryptable<Secret<String>>>, #[encrypt] pub line2: Option<Encryptable<Secret<String>>>, #[encrypt] pub line3: Option<Encryptable<Secret<String>>>, #[encrypt] pub state: Option<Encryptable<Secret<String>>>, #[encrypt] pub zip: Option<Encryptable<Secret<String>>>, #[encrypt] pub first_name: Option<Encryptable<Secret<String>>>, #[encrypt] pub last_name: Option<Encryptable<Secret<String>>>, #[encrypt] pub phone_number: Option<Encryptable<Secret<String>>>, pub country_code: Option<String>, #[serde(skip_serializing)] #[serde(with = "custom_serde::iso8601")] pub created_at: PrimitiveDateTime, #[serde(skip_serializing)] #[serde(with = "custom_serde::iso8601")] pub modified_at: PrimitiveDateTime, pub merchant_id: id_type::MerchantId, pub updated_by: String, #[encrypt] pub email: Option<Encryptable<Secret<String, pii::EmailStrategy>>>, } <file_sep path="hyperswitch/crates/router/src/types/domain/address.rs" crate="router" role="use_site"> pub struct Address { pub address_id: String, pub city: Option<String>, pub country: Option<enums::CountryAlpha2>, #[encrypt] pub line1: Option<Encryptable<Secret<String>>>, #[encrypt] pub line2: Option<Encryptable<Secret<String>>>, #[encrypt] pub line3: Option<Encryptable<Secret<String>>>, #[encrypt] pub state: Option<Encryptable<Secret<String>>>, #[encrypt] pub zip: Option<Encryptable<Secret<String>>>, #[encrypt] pub first_name: Option<Encryptable<Secret<String>>>, #[encrypt] pub last_name: Option<Encryptable<Secret<String>>>, #[encrypt] pub phone_number: Option<Encryptable<Secret<String>>>, pub country_code: Option<String>, #[serde(skip_serializing)] #[serde(with = "custom_serde::iso8601")] pub created_at: PrimitiveDateTime, #[serde(skip_serializing)] #[serde(with = "custom_serde::iso8601")] pub modified_at: PrimitiveDateTime, pub merchant_id: id_type::MerchantId, pub updated_by: String, #[encrypt] pub email: Option<Encryptable<Secret<String, pii::EmailStrategy>>>, } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/router_derive/src/lib.rs<|crate|> router macro=ToEncryption roles=use_site,macro_def use=attribute item=struct pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub fn derive_to_encryption_attr(input: proc_macro::TokenStream) -> proc_macro::TokenStream { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> <|fim_prefix|> pub fn derive_to_encryption_attr(input: proc_macro::TokenStream) -> proc_macro::TokenStream { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/router/src/types/domain/address.rs" crate="router" role="use_site"> pub struct Address { pub address_id: String, pub city: Option<String>, pub country: Option<enums::CountryAlpha2>, #[encrypt] pub line1: Option<Encryptable<Secret<String>>>, #[encrypt] pub line2: Option<Encryptable<Secret<String>>>, #[encrypt] pub line3: Option<Encryptable<Secret<String>>>, #[encrypt] pub state: Option<Encryptable<Secret<String>>>, #[encrypt] pub zip: Option<Encryptable<Secret<String>>>, #[encrypt] pub first_name: Option<Encryptable<Secret<String>>>, #[encrypt] pub last_name: Option<Encryptable<Secret<String>>>, #[encrypt] pub phone_number: Option<Encryptable<Secret<String>>>, pub country_code: Option<String>, #[serde(skip_serializing)] #[serde(with = "custom_serde::iso8601")] pub created_at: PrimitiveDateTime, #[serde(skip_serializing)] #[serde(with = "custom_serde::iso8601")] pub modified_at: PrimitiveDateTime, pub merchant_id: id_type::MerchantId, pub updated_by: String, #[encrypt] pub email: Option<Encryptable<Secret<String, pii::EmailStrategy>>>, } <file_sep path="hyperswitch/crates/router/src/types/domain/address.rs" crate="router" role="use_site"> pub struct Address { pub address_id: String, pub city: Option<String>, pub country: Option<enums::CountryAlpha2>, #[encrypt] pub line1: Option<Encryptable<Secret<String>>>, #[encrypt] pub line2: Option<Encryptable<Secret<String>>>, #[encrypt] pub line3: Option<Encryptable<Secret<String>>>, #[encrypt] pub state: Option<Encryptable<Secret<String>>>, #[encrypt] pub zip: Option<Encryptable<Secret<String>>>, #[encrypt] pub first_name: Option<Encryptable<Secret<String>>>, #[encrypt] pub last_name: Option<Encryptable<Secret<String>>>, #[encrypt] pub phone_number: Option<Encryptable<Secret<String>>>, pub country_code: Option<String>, #[serde(skip_serializing)] #[serde(with = "custom_serde::iso8601")] pub created_at: PrimitiveDateTime, #[serde(skip_serializing)] #[serde(with = "custom_serde::iso8601")] pub modified_at: PrimitiveDateTime, pub merchant_id: id_type::MerchantId, pub updated_by: String, #[encrypt] pub email: Option<Encryptable<Secret<String, pii::EmailStrategy>>>, } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/router_derive/src/lib.rs<|crate|> router macro=ToEncryption roles=use_site,macro_def use=attribute item=struct pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub fn derive_to_encryption_attr(input: proc_macro::TokenStream) -> proc_macro::TokenStream { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> <|fim_prefix|> pub fn derive_to_encryption_attr(input: proc_macro::TokenStream) -> proc_macro::TokenStream { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs" crate="hyperswitch_domain_models" role="use_site"> pub struct PaymentAttempt { /// Payment id for the payment attempt pub payment_id: id_type::GlobalPaymentId, /// Merchant id for the payment attempt pub merchant_id: id_type::MerchantId, /// Amount details for the payment attempt pub amount_details: AttemptAmountDetails, /// Status of the payment attempt. This is the status that is updated by the connector. /// The intent status is updated by the AttemptStatus. pub status: storage_enums::AttemptStatus, /// Name of the connector that was used for the payment attempt. The connector is either decided by /// either running the routing algorithm or by straight through processing request. /// This will be updated before calling the connector // TODO: use connector enum, this should be done in v1 as well as a part of moving to domain types wherever possible pub connector: Option<String>, /// Error details in case the payment attempt failed pub error: Option<ErrorDetails>, /// The authentication type that was requested for the payment attempt. /// This authentication type maybe decided by step up 3ds or by running the decision engine. pub authentication_type: storage_enums::AuthenticationType, /// The time at which the payment attempt was created pub created_at: PrimitiveDateTime, /// The time at which the payment attempt was last modified pub modified_at: PrimitiveDateTime, pub last_synced: Option<PrimitiveDateTime>, /// The reason for the cancellation of the payment attempt. Some connectors will have strict rules regarding the values this can have /// Cancellation reason will be validated at the connector level when building the request pub cancellation_reason: Option<String>, /// Browser information required for 3DS authentication pub browser_info: Option<common_utils::types::BrowserInformation>, /// Payment token is the token used for temporary use in case the payment method is stored in vault pub payment_token: Option<String>, /// Metadata that is returned by the connector. pub connector_metadata: Option<pii::SecretSerdeValue>, pub payment_experience: Option<storage_enums::PaymentExperience>, /// The insensitive data of the payment method data is stored here pub payment_method_data: Option<pii::SecretSerdeValue>, /// The result of the routing algorithm. /// This will store the list of connectors and other related information that was used to route the payment. // TODO: change this to type instead of serde_json::Value pub routing_result: Option<Value>, pub preprocessing_step_id: Option<String>, /// Number of captures that have happened for the payment attempt pub multiple_capture_count: Option<i16>, /// A reference to the payment at connector side. This is returned by the connector pub connector_response_reference_id: Option<String>, /// Whether the payment was updated by postgres or redis pub updated_by: String, /// The authentication data which is used for external authentication pub redirection_data: Option<router_response_types::RedirectForm>, pub encoded_data: Option<Secret<String>>, pub merchant_connector_id: Option<id_type::MerchantConnectorAccountId>, /// Whether external 3DS authentication was attempted for this payment. /// This is based on the configuration of the merchant in the business profile pub external_three_ds_authentication_attempted: Option<bool>, /// The connector that was used for external authentication pub authentication_connector: Option<String>, /// The foreign key reference to the authentication details pub authentication_id: Option<String>, pub fingerprint_id: Option<String>, pub client_source: Option<String>, pub client_version: Option<String>, // TODO: use a type here instead of value pub customer_acceptance: Option<pii::SecretSerdeValue>, /// The profile id for the payment attempt. This will be derived from payment intent. pub profile_id: id_type::ProfileId, /// The organization id for the payment attempt. This will be derived from payment intent. pub organization_id: id_type::OrganizationId, /// Payment method type for the payment attempt pub payment_method_type: storage_enums::PaymentMethod, /// Foreig key reference of Payment method id in case the payment instrument was stored pub payment_method_id: Option<id_type::GlobalPaymentMethodId>, /// The reference to the payment at the connector side pub connector_payment_id: Option<String>, /// The payment method subtype for the payment attempt. pub payment_method_subtype: storage_enums::PaymentMethodType, /// The authentication type that was applied for the payment attempt. pub authentication_applied: Option<common_enums::AuthenticationType>, /// A reference to the payment at connector side. This is returned by the connector pub external_reference_id: Option<String>, /// The billing address for the payment method #[encrypt(ty = Value)] pub payment_method_billing_address: Option<Encryptable<Address>>, /// The global identifier for the payment attempt pub id: id_type::GlobalAttemptId, /// Connector token information that can be used to make payments directly by the merchant. pub connector_token_details: Option<diesel_models::ConnectorTokenDetails>, /// Indicates the method by which a card is discovered during a payment pub card_discovery: Option<common_enums::CardDiscovery>, /// Split payment data pub charges: Option<common_types::payments::ConnectorChargeResponseData>, /// Additional data that might be required by hyperswitch, to enable some specific features. pub feature_metadata: Option<PaymentAttemptFeatureMetadata>, } <file_sep path="hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs" crate="hyperswitch_domain_models" role="use_site"> pub struct PaymentAttempt { /// Payment id for the payment attempt pub payment_id: id_type::GlobalPaymentId, /// Merchant id for the payment attempt pub merchant_id: id_type::MerchantId, /// Amount details for the payment attempt pub amount_details: AttemptAmountDetails, /// Status of the payment attempt. This is the status that is updated by the connector. /// The intent status is updated by the AttemptStatus. pub status: storage_enums::AttemptStatus, /// Name of the connector that was used for the payment attempt. The connector is either decided by /// either running the routing algorithm or by straight through processing request. /// This will be updated before calling the connector // TODO: use connector enum, this should be done in v1 as well as a part of moving to domain types wherever possible pub connector: Option<String>, /// Error details in case the payment attempt failed pub error: Option<ErrorDetails>, /// The authentication type that was requested for the payment attempt. /// This authentication type maybe decided by step up 3ds or by running the decision engine. pub authentication_type: storage_enums::AuthenticationType, /// The time at which the payment attempt was created pub created_at: PrimitiveDateTime, /// The time at which the payment attempt was last modified pub modified_at: PrimitiveDateTime, pub last_synced: Option<PrimitiveDateTime>, /// The reason for the cancellation of the payment attempt. Some connectors will have strict rules regarding the values this can have /// Cancellation reason will be validated at the connector level when building the request pub cancellation_reason: Option<String>, /// Browser information required for 3DS authentication pub browser_info: Option<common_utils::types::BrowserInformation>, /// Payment token is the token used for temporary use in case the payment method is stored in vault pub payment_token: Option<String>, /// Metadata that is returned by the connector. pub connector_metadata: Option<pii::SecretSerdeValue>, pub payment_experience: Option<storage_enums::PaymentExperience>, /// The insensitive data of the payment method data is stored here pub payment_method_data: Option<pii::SecretSerdeValue>, /// The result of the routing algorithm. /// This will store the list of connectors and other related information that was used to route the payment. // TODO: change this to type instead of serde_json::Value pub routing_result: Option<Value>, pub preprocessing_step_id: Option<String>, /// Number of captures that have happened for the payment attempt pub multiple_capture_count: Option<i16>, /// A reference to the payment at connector side. This is returned by the connector pub connector_response_reference_id: Option<String>, /// Whether the payment was updated by postgres or redis pub updated_by: String, /// The authentication data which is used for external authentication pub redirection_data: Option<router_response_types::RedirectForm>, pub encoded_data: Option<Secret<String>>, pub merchant_connector_id: Option<id_type::MerchantConnectorAccountId>, /// Whether external 3DS authentication was attempted for this payment. /// This is based on the configuration of the merchant in the business profile pub external_three_ds_authentication_attempted: Option<bool>, /// The connector that was used for external authentication pub authentication_connector: Option<String>, /// The foreign key reference to the authentication details pub authentication_id: Option<String>, pub fingerprint_id: Option<String>, pub client_source: Option<String>, pub client_version: Option<String>, // TODO: use a type here instead of value pub customer_acceptance: Option<pii::SecretSerdeValue>, /// The profile id for the payment attempt. This will be derived from payment intent. pub profile_id: id_type::ProfileId, /// The organization id for the payment attempt. This will be derived from payment intent. pub organization_id: id_type::OrganizationId, /// Payment method type for the payment attempt pub payment_method_type: storage_enums::PaymentMethod, /// Foreig key reference of Payment method id in case the payment instrument was stored pub payment_method_id: Option<id_type::GlobalPaymentMethodId>, /// The reference to the payment at the connector side pub connector_payment_id: Option<String>, /// The payment method subtype for the payment attempt. pub payment_method_subtype: storage_enums::PaymentMethodType, /// The authentication type that was applied for the payment attempt. pub authentication_applied: Option<common_enums::AuthenticationType>, /// A reference to the payment at connector side. This is returned by the connector pub external_reference_id: Option<String>, /// The billing address for the payment method #[encrypt(ty = Value)] pub payment_method_billing_address: Option<Encryptable<Address>>, /// The global identifier for the payment attempt pub id: id_type::GlobalAttemptId, /// Connector token information that can be used to make payments directly by the merchant. pub connector_token_details: Option<diesel_models::ConnectorTokenDetails>, /// Indicates the method by which a card is discovered during a payment pub card_discovery: Option<common_enums::CardDiscovery>, /// Split payment data pub charges: Option<common_types::payments::ConnectorChargeResponseData>, /// Additional data that might be required by hyperswitch, to enable some specific features. pub feature_metadata: Option<PaymentAttemptFeatureMetadata>, } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/router_derive/src/lib.rs<|crate|> hyperswitch_domain_models macro=ToEncryption roles=use_site,macro_def use=attribute item=struct pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub fn derive_to_encryption_attr(input: proc_macro::TokenStream) -> proc_macro::TokenStream { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> <|fim_prefix|> pub fn derive_to_encryption_attr(input: proc_macro::TokenStream) -> proc_macro::TokenStream { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> pub fn derive_to_encryption_attr(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input = syn::parse_macro_input!(input as syn::DeriveInput); macros::derive_to_encryption(input) .unwrap_or_else(|err| err.into_compile_error()) .into() } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> pub fn derive_to_encryption_attr(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input = syn::parse_macro_input!(input as syn::DeriveInput); macros::derive_to_encryption(input) .unwrap_or_else(|err| err.into_compile_error()) .into() } <file_sep path="hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs" crate="hyperswitch_domain_models" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/router_derive/src/lib.rs<|crate|> hyperswitch_domain_models macro=ToEncryption roles=macro_def,use_site use=attribute item=struct pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub struct AttemptAmountDetails { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs" crate="hyperswitch_domain_models" role="use_site"> <|fim_prefix|> pub struct AttemptAmountDetails { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> pub fn generate_permissions(input: proc_macro::TokenStream) -> proc_macro::TokenStream { macros::generate_permissions_inner(input) } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> pub fn generate_permissions(input: proc_macro::TokenStream) -> proc_macro::TokenStream { macros::generate_permissions_inner(input) } <file_sep path="hyperswitch/crates/router/src/services/authorization/permissions.rs" crate="router" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/router_derive/src/lib.rs<|crate|> router macro=generate_permissions roles=macro_def,use_site use=invoke item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub fn get_resource_name(resource: Resource, entity_type: EntityType) -> &'static str { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/router/src/services/authorization/permissions.rs" crate="router" role="use_site"> <|fim_prefix|> pub fn get_resource_name(resource: Resource, entity_type: EntityType) -> &'static str { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/router/src/services/authorization/permissions.rs" crate="router" role="use_site"> generate_permissions! { permissions: [ Payment: { scopes: [Read, Write], entities: [Profile, Merchant] }, Refund: { scopes: [Read, Write], entities: [Profile, Merchant] }, Dispute: { scopes: [Read, Write], entities: [Profile, Merchant] }, Mandate: { scopes: [Read, Write], entities: [Merchant] }, Customer: { scopes: [Read, Write], entities: [Merchant] }, Payout: { scopes: [Read], entities: [Profile, Merchant] }, ApiKey: { scopes: [Read, Write], entities: [Merchant] }, Account: { scopes: [Read, Write], entities: [Profile, Merchant, Organization, Tenant] }, Connector: { scopes: [Read, Write], entities: [Profile, Merchant] }, Routing: { scopes: [Read, Write], entities: [Profile, Merchant] }, ThreeDsDecisionManager: { scopes: [Read, Write], entities: [Merchant, Profile] }, SurchargeDecisionManager: { scopes: [Read, Write], entities: [Merchant] }, Analytics: { scopes: [Read], entities: [Profile, Merchant, Organization] }, Report: { scopes: [Read], entities: [Profile, Merchant, Organization] }, User: { scopes: [Read, Write], entities: [Profile, Merchant] }, WebhookEvent: { scopes: [Read, Write], entities: [Profile, Merchant] }, ReconToken: { scopes: [Read], entities: [Merchant] }, ReconFiles: { scopes: [Read, Write], entities: [Merchant] }, ReconAndSettlementAnalytics: { scopes: [Read], entities: [Merchant] }, ReconUpload: { scopes: [Read, Write], entities: [Merchant] }, ReconReports: { scopes: [Read, Write], entities: [Merchant] }, RunRecon: { scopes: [Read, Write], entities: [Merchant] }, ReconConfig: { scopes: [Read, Write], entities: [Merchant] }, RevenueRecovery: { scopes: [Read], entities: [Profile] } ] } <file_sep path="hyperswitch/crates/router/src/services/authorization/permissions.rs" crate="router" role="use_site"> generate_permissions! { permissions: [ Payment: { scopes: [Read, Write], entities: [Profile, Merchant] }, Refund: { scopes: [Read, Write], entities: [Profile, Merchant] }, Dispute: { scopes: [Read, Write], entities: [Profile, Merchant] }, Mandate: { scopes: [Read, Write], entities: [Merchant] }, Customer: { scopes: [Read, Write], entities: [Merchant] }, Payout: { scopes: [Read], entities: [Profile, Merchant] }, ApiKey: { scopes: [Read, Write], entities: [Merchant] }, Account: { scopes: [Read, Write], entities: [Profile, Merchant, Organization, Tenant] }, Connector: { scopes: [Read, Write], entities: [Profile, Merchant] }, Routing: { scopes: [Read, Write], entities: [Profile, Merchant] }, ThreeDsDecisionManager: { scopes: [Read, Write], entities: [Merchant, Profile] }, SurchargeDecisionManager: { scopes: [Read, Write], entities: [Merchant] }, Analytics: { scopes: [Read], entities: [Profile, Merchant, Organization] }, Report: { scopes: [Read], entities: [Profile, Merchant, Organization] }, User: { scopes: [Read, Write], entities: [Profile, Merchant] }, WebhookEvent: { scopes: [Read, Write], entities: [Profile, Merchant] }, ReconToken: { scopes: [Read], entities: [Merchant] }, ReconFiles: { scopes: [Read, Write], entities: [Merchant] }, ReconAndSettlementAnalytics: { scopes: [Read], entities: [Merchant] }, ReconUpload: { scopes: [Read, Write], entities: [Merchant] }, ReconReports: { scopes: [Read, Write], entities: [Merchant] }, RunRecon: { scopes: [Read, Write], entities: [Merchant] }, ReconConfig: { scopes: [Read, Write], entities: [Merchant] }, RevenueRecovery: { scopes: [Read], entities: [Profile] } ] } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/router_derive/src/lib.rs<|crate|> router macro=generate_permissions roles=use_site,macro_def use=invoke item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub fn generate_permissions(input: proc_macro::TokenStream) -> proc_macro::TokenStream { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> <|fim_prefix|> pub fn generate_permissions(input: proc_macro::TokenStream) -> proc_macro::TokenStream { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/router/tests/macros.rs" crate="router" role="use_site"> fn test_flat_struct() { #[derive(FlatStruct, Serialize)] struct User { address: Address, } #[derive(Serialize)] struct Address { line1: String, zip: String, city: String, } let line1 = "1397".to_string(); let zip = "Some street".to_string(); let city = "941222".to_string(); let address = Address { line1: line1.clone(), zip: zip.clone(), city: city.clone(), }; let user = User { address }; let flat_user_map = user.flat_struct(); let mut required_map = HashMap::new(); required_map.insert("address.line1".to_string(), line1); required_map.insert("address.zip".to_string(), zip); required_map.insert("address.city".to_string(), city); assert_eq!(flat_user_map, required_map); } <file_sep path="hyperswitch/crates/router/tests/macros.rs" crate="router" role="use_site"> fn test_flat_struct() { #[derive(FlatStruct, Serialize)] struct User { address: Address, } #[derive(Serialize)] struct Address { line1: String, zip: String, city: String, } let line1 = "1397".to_string(); let zip = "Some street".to_string(); let city = "941222".to_string(); let address = Address { line1: line1.clone(), zip: zip.clone(), city: city.clone(), }; let user = User { address }; let flat_user_map = user.flat_struct(); let mut required_map = HashMap::new(); required_map.insert("address.line1".to_string(), line1); required_map.insert("address.zip".to_string(), zip); required_map.insert("address.city".to_string(), city); assert_eq!(flat_user_map, required_map); } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/router_derive/src/lib.rs<|crate|> router macro=FlatStruct roles=use_site,macro_def use=derive item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub fn flat_struct_derive(input: proc_macro::TokenStream) -> proc_macro::TokenStream { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> <|fim_prefix|> pub fn flat_struct_derive(input: proc_macro::TokenStream) -> proc_macro::TokenStream { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> pub fn flat_struct_derive(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input = parse_macro_input!(input as syn::DeriveInput); let name = &input.ident; let expanded = quote::quote! { impl #name { pub fn flat_struct(&self) -> std::collections::HashMap<String, String> { use serde_json::Value; use std::collections::HashMap; fn flatten_value( value: &Value, prefix: &str, result: &mut HashMap<String, String> ) { match value { Value::Object(map) => { for (key, val) in map { let new_key = if prefix.is_empty() { key.to_string() } else { format!("{}.{}", prefix, key) }; flatten_value(val, &new_key, result); } } Value::String(s) => { result.insert(prefix.to_string(), s.clone()); } Value::Number(n) => { result.insert(prefix.to_string(), n.to_string()); } Value::Bool(b) => { result.insert(prefix.to_string(), b.to_string()); } _ => {} } } let mut result = HashMap::new(); let value = serde_json::to_value(self).unwrap(); flatten_value(&value, "", &mut result); result } } }; proc_macro::TokenStream::from(expanded) } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> pub fn flat_struct_derive(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input = parse_macro_input!(input as syn::DeriveInput); let name = &input.ident; let expanded = quote::quote! { impl #name { pub fn flat_struct(&self) -> std::collections::HashMap<String, String> { use serde_json::Value; use std::collections::HashMap; fn flatten_value( value: &Value, prefix: &str, result: &mut HashMap<String, String> ) { match value { Value::Object(map) => { for (key, val) in map { let new_key = if prefix.is_empty() { key.to_string() } else { format!("{}.{}", prefix, key) }; flatten_value(val, &new_key, result); } } Value::String(s) => { result.insert(prefix.to_string(), s.clone()); } Value::Number(n) => { result.insert(prefix.to_string(), n.to_string()); } Value::Bool(b) => { result.insert(prefix.to_string(), b.to_string()); } _ => {} } } let mut result = HashMap::new(); let value = serde_json::to_value(self).unwrap(); flatten_value(&value, "", &mut result); result } } }; proc_macro::TokenStream::from(expanded) } <file_sep path="hyperswitch/crates/router/tests/macros.rs" crate="router" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/router_derive/src/lib.rs<|crate|> router macro=FlatStruct roles=macro_def,use_site use=derive item=fn pack=proc_macro_neighborhoods lang=rust<|meta_end|> fn test_flat_struct() { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/router/tests/macros.rs" crate="router" role="use_site"> <|fim_prefix|> fn test_flat_struct() { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<|meta_start|><|file|> hyperswitch/crates/router_derive/src/lib.rs<|crate|> api_models macro=FlatStruct roles=use_site,macro_def use=derive item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> <file_sep path="hyperswitch/crates/api_models/src/payouts.rs" crate="api_models" role="use_site"> use std::collections::HashMap; use cards::CardNumber; use common_utils::{ consts::default_payouts_list_limit, crypto, id_type, link_utils, payout_method_utils, pii::{self, Email}, transformers::ForeignFrom, types::{UnifiedCode, UnifiedMessage}, }; use masking::Secret; use router_derive::FlatStruct; use serde::{Deserialize, Serialize}; use time::PrimitiveDateTime; use utoipa::ToSchema; use crate::{enums as api_enums, payment_methods::RequiredFieldInfo, payments}; #[derive(Debug, Deserialize, Serialize, Clone, ToSchema)] pub enum PayoutRequest { PayoutActionRequest(PayoutActionRequest), PayoutCreateRequest(Box<PayoutCreateRequest>), PayoutRetrieveRequest(PayoutRetrieveRequest), } #[derive( Default, Debug, Deserialize, Serialize, Clone, ToSchema, router_derive::PolymorphicSchema, )] #[generate_schemas(PayoutsCreateRequest, PayoutUpdateRequest, PayoutConfirmRequest)] #[serde(deny_unknown_fields)] pub struct PayoutCreateRequest { /// Unique identifier for the payout. This ensures idempotency for multiple payouts that have been done by a single merchant. This field is auto generated and is returned in the API response, **not required to be included in the Payout Create/Update Request.** #[schema( value_type = Option<String>, min_length = 30, max_length = 30, example = "187282ab-40ef-47a9-9206-5099ba31e432" )] #[remove_in(PayoutsCreateRequest, PayoutUpdateRequest, PayoutConfirmRequest)] pub payout_id: Option<String>, // TODO: #1321 https://github.com/juspay/hyperswitch/issues/1321 /// This is an identifier for the merchant account. This is inferred from the API key provided during the request, **not required to be included in the Payout Create/Update Request.** #[schema(max_length = 255, value_type = Option<String>, example = "merchant_1668273825")] #[remove_in(PayoutsCreateRequest, PayoutUpdateRequest, PayoutConfirmRequest)] pub merchant_id: Option<id_type::MerchantId>, /// The payout amount. Amount for the payout in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc., #[schema(value_type = Option<u64>, example = 1000)] #[mandatory_in(PayoutsCreateRequest = u64)] #[remove_in(PayoutsConfirmRequest)] #[serde(default, deserialize_with = "payments::amount::deserialize_option")] pub amount: Option<payments::Amount>, /// The currency of the payout request can be specified here #[schema(value_type = Option<Currency>, example = "USD")] #[mandatory_in(PayoutsCreateRequest = Currency)] #[remove_in(PayoutsConfirmRequest)] pub currency: Option<api_enums::Currency>, /// Specifies routing algorithm for selecting a connector #[schema(value_type = Option<RoutingAlgorithm>, example = json!({ "type": "single", "data": "adyen" }))] pub routing: Option<serde_json::Value>, /// This field allows the merchant to manually select a connector with which the payout can go through. #[schema(value_type = Option<Vec<PayoutConnectors>>, max_length = 255, example = json!(["wise", "adyen"]))] pub connector: Option<Vec<api_enums::PayoutConnectors>>, /// This field is used when merchant wants to confirm the payout, thus useful for the payout _Confirm_ request. Ideally merchants should _Create_ a payout, _Update_ it (if required), then _Confirm_ it. #[schema(value_type = Option<bool>, example = true, default = false)] #[remove_in(PayoutConfirmRequest)] pub confirm: Option<bool>, /// The payout_type of the payout request can be specified here, this is a mandatory field to _Confirm_ the payout, i.e., should be passed in _Create_ request, if not then should be updated in the payout _Update_ request, then only it can be confirmed. #[schema(value_type = Option<PayoutType>, example = "card")] pub payout_type: Option<api_enums::PayoutType>, /// The payout method information required for carrying out a payout #[schema(value_type = Option<PayoutMethodData>)] pub payout_method_data: Option<PayoutMethodData>, /// The billing address for the payout #[schema(value_type = Option<Address>, example = json!(r#"{ "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Francisco", "state": "CA", "zip": "94122", "country": "US", "first_name": "John", "last_name": "Doe" }, "phone": { "number": "9123456789", "country_code": "+1" } }"#))] pub billing: Option<payments::Address>, /// Set to true to confirm the payout without review, no further action required #[schema(value_type = Option<bool>, example = true, default = false)] pub auto_fulfill: Option<bool>, /// The identifier for the customer object. If not provided the customer ID will be autogenerated. _Deprecated: Use customer_id instead._ #[schema(deprecated, value_type = Option<String>, max_length = 255, example = "cus_y3oqhf46pyzuxjbcn2giaqnb44")] pub customer_id: Option<id_type::CustomerId>, /// Passing this object creates a new customer or attaches an existing customer to the payout #[schema(value_type = Option<CustomerDetails>)] pub customer: Option<payments::CustomerDetails>, /// It's a token used for client side verification. #[schema(value_type = Option<String>, example = "pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo")] #[remove_in(PayoutsCreateRequest)] #[mandatory_in(PayoutConfirmRequest = String)] pub client_secret: Option<String>, /// The URL to redirect after the completion of the operation #[schema(value_type = Option<String>, example = "https://hyperswitch.io")] pub return_url: Option<String>, /// Business country of the merchant for this payout. _Deprecated: Use profile_id instead._ #[schema(deprecated, example = "US", value_type = Option<CountryAlpha2>)] pub business_country: Option<api_enums::CountryAlpha2>, /// Business label of the merchant for this payout. _Deprecated: Use profile_id instead._ #[schema(deprecated, example = "food", value_type = Option<String>)] pub business_label: Option<String>, /// A description of the payout #[schema(example = "It's my first payout request", value_type = Option<String>)] pub description: Option<String>, /// Type of entity to whom the payout is being carried out to, select from the given list of options #[schema(value_type = Option<PayoutEntityType>, example = "Individual")] pub entity_type: Option<api_enums::PayoutEntityType>, /// Specifies whether or not the payout request is recurring #[schema(value_type = Option<bool>, default = false)] pub recurring: Option<bool>, /// You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object. #[schema(value_type = Option<Object>, example = r#"{ "udf1": "some-value", "udf2": "some-value" }"#)] pub metadata: Option<pii::SecretSerdeValue>, /// Provide a reference to a stored payout method, used to process the payout. #[schema(example = "187282ab-40ef-47a9-9206-5099ba31e432", value_type = Option<String>)] pub payout_token: Option<String>, /// The business profile to use for this payout, especially if there are multiple business profiles associated with the account, otherwise default business profile associated with the merchant account will be used. #[schema(value_type = Option<String>)] pub profile_id: Option<id_type::ProfileId>, /// The send method which will be required for processing payouts, check options for better understanding. #[schema(value_type = Option<PayoutSendPriority>, example = "instant")] pub priority: Option<api_enums::PayoutSendPriority>, /// Whether to get the payout link (if applicable). Merchant need to specify this during the Payout _Create_, this field can not be updated during Payout _Update_. #[schema(default = false, example = true, value_type = Option<bool>)] pub payout_link: Option<bool>, /// Custom payout link config for the particular payout, if payout link is to be generated. #[schema(value_type = Option<PayoutCreatePayoutLinkConfig>)] pub payout_link_config: Option<PayoutCreatePayoutLinkConfig>, /// Will be used to expire client secret after certain amount of time to be supplied in seconds /// (900) for 15 mins #[schema(value_type = Option<u32>, example = 900)] pub session_expiry: Option<u32>, /// Customer's email. _Deprecated: Use customer object instead._ #[schema(deprecated, max_length = 255, value_type = Option<String>, example = "johntest@test.com")] pub email: Option<Email>, /// Customer's name. _Deprecated: Use customer object instead._ #[schema(deprecated, value_type = Option<String>, max_length = 255, example = "John Test")] pub name: Option<Secret<String>>, /// Customer's phone. _Deprecated: Use customer object instead._ #[schema(deprecated, value_type = Option<String>, max_length = 255, example = "9123456789")] pub phone: Option<Secret<String>>, /// Customer's phone country code. _Deprecated: Use customer object instead._ #[schema(deprecated, max_length = 255, example = "+1")] pub phone_country_code: Option<String>, /// Identifier for payout method pub payout_method_id: Option<String>, } impl PayoutCreateRequest { pub fn get_customer_id(&self) -> Option<&id_type::CustomerId> { self.customer_id .as_ref() .or(self.customer.as_ref().map(|customer| &customer.id)) } } /// Custom payout link config for the particular payout, if payout link is to be generated. #[derive(Default, Debug, Deserialize, Serialize, Clone, ToSchema)] pub struct PayoutCreatePayoutLinkConfig { /// The unique identifier for the collect link. #[schema(value_type = Option<String>, example = "pm_collect_link_2bdacf398vwzq5n422S1")] pub payout_link_id: Option<String>, #[serde(flatten)] #[schema(value_type = Option<GenericLinkUiConfig>)] pub ui_config: Option<link_utils::GenericLinkUiConfig>, /// List of payout methods shown on collect UI #[schema(value_type = Option<Vec<EnabledPaymentMethod>>, example = r#"[{"payment_method": "bank_transfer", "payment_method_types": ["ach", "bacs"]}]"#)] pub enabled_payment_methods: Option<Vec<link_utils::EnabledPaymentMethod>>, /// Form layout of the payout link #[schema(value_type = Option<UIWidgetFormLayout>, max_length = 255, example = "tabs")] pub form_layout: Option<api_enums::UIWidgetFormLayout>, /// `test_mode` allows for opening payout links without any restrictions. This removes /// - domain name validations /// - check for making sure link is accessed within an iframe #[schema(value_type = Option<bool>, example = false)] pub test_mode: Option<bool>, } /// The payout method information required for carrying out a payout #[derive(Debug, Clone, Deserialize, Serialize, ToSchema)] #[serde(rename_all = "snake_case")] pub enum PayoutMethodData { Card(CardPayout), Bank(Bank), Wallet(Wallet), } impl Default for PayoutMethodData { fn default() -> Self { Self::Card(CardPayout::default()) } } #[derive(Default, Eq, PartialEq, Clone, Debug, Deserialize, Serialize, ToSchema)] pub struct CardPayout { /// The card number #[schema(value_type = String, example = "4242424242424242")] pub card_number: CardNumber, /// The card's expiry month #[schema(value_type = String)] pub expiry_month: Secret<String>, /// The card's expiry year #[schema(value_type = String)] pub expiry_year: Secret<String>, /// The card holder's name #[schema(value_type = String, example = "John Doe")] pub card_holder_name: Option<Secret<String>>, } #[derive(Eq, PartialEq, Clone, Debug, Deserialize, Serialize, ToSchema)] #[serde(untagged)] pub enum Bank { Ach(AchBankTransfer), Bacs(BacsBankTransfer), Sepa(SepaBankTransfer), Pix(PixBankTransfer), } #[derive(Default, Eq, PartialEq, Clone, Debug, Deserialize, Serialize, ToSchema)] pub struct AchBankTransfer { /// Bank name #[schema(value_type = Option<String>, example = "Deutsche Bank")] pub bank_name: Option<String>, /// Bank country code #[schema(value_type = Option<CountryAlpha2>, example = "US")] pub bank_country_code: Option<api_enums::CountryAlpha2>, /// Bank city #[schema(value_type = Option<String>, example = "California")] pub bank_city: Option<String>, /// Bank account number is an unique identifier assigned by a bank to a customer. #[schema(value_type = String, example = "000123456")] pub bank_account_number: Secret<String>, /// [9 digits] Routing number - used in USA for identifying a specific bank. #[schema(value_type = String, example = "110000000")] pub bank_routing_number: Secret<String>, } #[derive(Default, Eq, PartialEq, Clone, Debug, Deserialize, Serialize, ToSchema)] pub struct BacsBankTransfer { /// Bank name #[schema(value_type = Option<String>, example = "Deutsche Bank")] pub bank_name: Option<String>, /// Bank country code #[schema(value_type = Option<CountryAlpha2>, example = "US")] pub bank_country_code: Option<api_enums::CountryAlpha2>, /// Bank city #[schema(value_type = Option<String>, example = "California")] pub bank_city: Option<String>, /// Bank account number is an unique identifier assigned by a bank to a customer. #[schema(value_type = String, example = "000123456")] pub bank_account_number: Secret<String>, /// [6 digits] Sort Code - used in UK and Ireland for identifying a bank and it's branches. #[schema(value_type = String, example = "98-76-54")] pub bank_sort_code: Secret<String>, } #[derive(Default, Eq, PartialEq, Clone, Debug, Deserialize, Serialize, ToSchema)] // The SEPA (Single Euro Payments Area) is a pan-European network that allows you to send and receive payments in euros between two cross-border bank accounts in the eurozone. pub struct SepaBankTransfer { /// Bank name #[schema(value_type = Option<String>, example = "Deutsche Bank")] pub bank_name: Option<String>, /// Bank country code #[schema(value_type = Option<CountryAlpha2>, example = "US")] pub bank_country_code: Option<api_enums::CountryAlpha2>, /// Bank city #[schema(value_type = Option<String>, example = "California")] pub bank_city: Option<String>, /// International Bank Account Number (iban) - used in many countries for identifying a bank along with it's customer. #[schema(value_type = String, example = "DE89370400440532013000")] pub iban: Secret<String>, /// [8 / 11 digits] Bank Identifier Code (bic) / Swift Code - used in many countries for identifying a bank and it's branches #[schema(value_type = String, example = "HSBCGB2LXXX")] pub bic: Option<Secret<String>>, } #[derive(Default, Eq, PartialEq, Clone, Debug, Deserialize, Serialize, ToSchema)] pub struct PixBankTransfer { /// Bank name #[schema(value_type = Option<String>, example = "Deutsche Bank")] pub bank_name: Option<String>, /// Bank branch #[schema(value_type = Option<String>, example = "3707")] pub bank_branch: Option<String>, /// Bank account number is an unique identifier assigned by a bank to a customer. #[schema(value_type = String, example = "000123456")] pub bank_account_number: Secret<String>, /// Unique key for pix customer #[schema(value_type = String, example = "000123456")] pub pix_key: Secret<String>, /// Individual taxpayer identification number #[schema(value_type = Option<String>, example = "000123456")] pub tax_id: Option<Secret<String>>, } #[derive(Eq, PartialEq, Clone, Debug, Deserialize, Serialize, ToSchema)] #[serde(rename_all = "snake_case")] pub enum Wallet { Paypal(Paypal), Venmo(Venmo), } #[derive(Default, Eq, PartialEq, Clone, Debug, Deserialize, Serialize, ToSchema)] pub struct Paypal { /// Email linked with paypal account #[schema(value_type = String, example = "john.doe@example.com")] pub email: Option<Email>, /// mobile number linked to paypal account #[schema(value_type = String, example = "16608213349")] pub telephone_number: Option<Secret<String>>, /// id of the paypal account #[schema(value_type = String, example = "G83KXTJ5EHCQ2")] pub paypal_id: Option<Secret<String>>, } #[derive(Default, Eq, PartialEq, Clone, Debug, Deserialize, Serialize, ToSchema)] pub struct Venmo { /// mobile number linked to venmo account #[schema(value_type = String, example = "16608213349")] pub telephone_number: Option<Secret<String>>, } #[derive(Debug, ToSchema, Clone, Serialize, router_derive::PolymorphicSchema)] #[serde(deny_unknown_fields)] pub struct PayoutCreateResponse { /// Unique identifier for the payout. This ensures idempotency for multiple payouts /// that have been done by a single merchant. This field is auto generated and is returned in the API response. #[schema( value_type = String, min_length = 30, max_length = 30, example = "187282ab-40ef-47a9-9206-5099ba31e432" )] pub payout_id: String, // TODO: Update this to PayoutIdType similar to PaymentIdType /// This is an identifier for the merchant account. This is inferred from the API key /// provided during the request #[schema(max_length = 255, value_type = String, example = "merchant_1668273825")] pub merchant_id: id_type::MerchantId, /// The payout amount. Amount for the payout in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc., #[schema(value_type = i64, example = 1000)] pub amount: common_utils::types::MinorUnit, /// Recipient's currency for the payout request #[schema(value_type = Currency, example = "USD")] pub currency: api_enums::Currency, /// The connector used for the payout #[schema(example = "wise")] pub connector: Option<String>, /// The payout method that is to be used #[schema(value_type = Option<PayoutType>, example = "bank")] pub payout_type: Option<api_enums::PayoutType>, /// The payout method details for the payout #[schema(value_type = Option<PayoutMethodDataResponse>, example = json!(r#"{ "card": { "last4": "2503", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "400000", "card_extended_bin": null, "card_exp_month": "08", "card_exp_year": "25", "card_holder_name": null, "payment_checks": null, "authentication_data": null } }"#))] pub payout_method_data: Option<PayoutMethodDataResponse>, /// The billing address for the payout #[schema(value_type = Option<Address>, example = json!(r#"{ "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Francisco", "state": "CA", "zip": "94122", "country": "US", "first_name": "John", "last_name": "Doe" }, "phone": { "number": "9123456789", "country_code": "+1" } }"#))] pub billing: Option<payments::Address>, /// Set to true to confirm the payout without review, no further action required #[schema(value_type = bool, example = true, default = false)] pub auto_fulfill: bool, /// The identifier for the customer object. If not provided the customer ID will be autogenerated. #[schema(value_type = String, max_length = 255, example = "cus_y3oqhf46pyzuxjbcn2giaqnb44")] pub customer_id: Option<id_type::CustomerId>, /// Passing this object creates a new customer or attaches an existing customer to the payout #[schema(value_type = Option<CustomerDetailsResponse>)] pub customer: Option<payments::CustomerDetailsResponse>, /// It's a token used for client side verification. #[schema(value_type = String, example = "pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo")] pub client_secret: Option<String>, /// The URL to redirect after the completion of the operation #[schema(value_type = String, example = "https://hyperswitch.io")] pub return_url: Option<String>, /// Business country of the merchant for this payout #[schema(example = "US", value_type = CountryAlpha2)] pub business_country: Option<api_enums::CountryAlpha2>, /// Business label of the merchant for this payout #[schema(example = "food", value_type = Option<String>)] pub business_label: Option<String>, /// A description of the payout #[schema(example = "It's my first payout request", value_type = Option<String>)] pub description: Option<String>, /// Type of entity to whom the payout is being carried out to #[schema(value_type = PayoutEntityType, example = "Individual")] pub entity_type: api_enums::PayoutEntityType, /// Specifies whether or not the payout request is recurring #[schema(value_type = bool, default = false)] pub recurring: bool, /// You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object. #[schema(value_type = Option<Object>, example = r#"{ "udf1": "some-value", "udf2": "some-value" }"#)] pub metadata: Option<pii::SecretSerdeValue>, /// Unique identifier of the merchant connector account #[schema(value_type = Option<String>, example = "mca_sAD3OZLATetvjLOYhUSy")] pub merchant_connector_id: Option<id_type::MerchantConnectorAccountId>, /// Current status of the Payout #[schema(value_type = PayoutStatus, example = RequiresConfirmation)] pub status: api_enums::PayoutStatus, /// If there was an error while calling the connector the error message is received here #[schema(value_type = Option<String>, example = "Failed while verifying the card")] pub error_message: Option<String>, /// If there was an error while calling the connectors the code is received here #[schema(value_type = Option<String>, example = "E0001")] pub error_code: Option<String>, /// The business profile that is associated with this payout #[schema(value_type = String)] pub profile_id: id_type::ProfileId, /// Time when the payout was created #[schema(example = "2022-09-10T10:11:12Z")] #[serde(with = "common_utils::custom_serde::iso8601::option")] pub created: Option<PrimitiveDateTime>, /// Underlying processor's payout resource ID #[schema(value_type = Option<String>, example = "S3FC9G9M2MVFDXT5")] pub connector_transaction_id: Option<String>, /// Payout's send priority (if applicable) #[schema(value_type = Option<PayoutSendPriority>, example = "instant")] pub priority: Option<api_enums::PayoutSendPriority>, /// List of attempts #[schema(value_type = Option<Vec<PayoutAttemptResponse>>)] #[serde(skip_serializing_if = "Option::is_none")] pub attempts: Option<Vec<PayoutAttemptResponse>>, /// If payout link was requested, this contains the link's ID and the URL to render the payout widget #[schema(value_type = Option<PayoutLinkResponse>)] pub payout_link: Option<PayoutLinkResponse>, /// Customer's email. _Deprecated: Use customer object instead._ #[schema(deprecated, max_length = 255, value_type = Option<String>, example = "johntest@test.com")] pub email: crypto::OptionalEncryptableEmail, /// Customer's name. _Deprecated: Use customer object instead._ #[schema(deprecated, value_type = Option<String>, max_length = 255, example = "John Test")] pub name: crypto::OptionalEncryptableName, /// Customer's phone. _Deprecated: Use customer object instead._ #[schema(deprecated, value_type = Option<String>, max_length = 255, example = "9123456789")] pub phone: crypto::OptionalEncryptablePhone, /// Customer's phone country code. _Deprecated: Use customer object instead._ #[schema(deprecated, max_length = 255, example = "+1")] pub phone_country_code: Option<String>, /// (This field is not live yet) /// Error code unified across the connectors is received here in case of errors while calling the underlying connector #[remove_in(PayoutCreateResponse)] #[schema(value_type = Option<String>, max_length = 255, example = "UE_000")] pub unified_code: Option<UnifiedCode>, /// (This field is not live yet) /// Error message unified across the connectors is received here in case of errors while calling the underlying connector #[remove_in(PayoutCreateResponse)] #[schema(value_type = Option<String>, max_length = 1024, example = "Invalid card details")] pub unified_message: Option<UnifiedMessage>, /// Identifier for payout method pub payout_method_id: Option<String>, } /// The payout method information for response #[derive(Debug, Clone, Deserialize, Serialize, ToSchema)] #[serde(rename_all = "snake_case")] pub enum PayoutMethodDataResponse { #[schema(value_type = CardAdditionalData)] Card(Box<payout_method_utils::CardAdditionalData>), #[schema(value_type = BankAdditionalData)] Bank(Box<payout_method_utils::BankAdditionalData>), #[schema(value_type = WalletAdditionalData)] Wallet(Box<payout_method_utils::WalletAdditionalData>), } #[derive( Default, Debug, serde::Serialize, Clone, PartialEq, ToSchema, router_derive::PolymorphicSchema, )] pub struct PayoutAttemptResponse { /// Unique identifier for the attempt pub attempt_id: String, /// The status of the attempt #[schema(value_type = PayoutStatus, example = "failed")] pub status: api_enums::PayoutStatus, /// The payout attempt amount. Amount for the payout in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc., #[schema(value_type = i64, example = 6583)] pub amount: common_utils::types::MinorUnit, /// The currency of the amount of the payout attempt #[schema(value_type = Option<Currency>, example = "USD")] pub currency: Option<api_enums::Currency>, /// The connector used for the payout pub connector: Option<String>, /// Connector's error code in case of failures pub error_code: Option<String>, /// Connector's error message in case of failures pub error_message: Option<String>, /// The payout method that was used #[schema(value_type = Option<PayoutType>, example = "bank")] pub payment_method: Option<api_enums::PayoutType>, /// Payment Method Type #[schema(value_type = Option<PaymentMethodType>, example = "bacs")] pub payout_method_type: Option<api_enums::PaymentMethodType>, /// A unique identifier for a payout provided by the connector pub connector_transaction_id: Option<String>, /// If the payout was cancelled the reason provided here pub cancellation_reason: Option<String>, /// (This field is not live yet) /// Error code unified across the connectors is received here in case of errors while calling the underlying connector #[remove_in(PayoutAttemptResponse)] #[schema(value_type = Option<String>, max_length = 255, example = "UE_000")] pub unified_code: Option<UnifiedCode>, /// (This field is not live yet) /// Error message unified across the connectors is received here in case of errors while calling the underlying connector #[remove_in(PayoutAttemptResponse)] #[schema(value_type = Option<String>, max_length = 1024, example = "Invalid card details")] pub unified_message: Option<UnifiedMessage>, } #[derive(Default, Debug, Clone, Deserialize, ToSchema)] pub struct PayoutRetrieveBody { pub force_sync: Option<bool>, #[schema(value_type = Option<String>)] pub merchant_id: Option<id_type::MerchantId>, } #[derive(Default, Debug, Serialize, ToSchema, Clone, Deserialize)] pub struct PayoutRetrieveRequest { /// Unique identifier for the payout. This ensures idempotency for multiple payouts /// that have been done by a single merchant. This field is auto generated and is returned in the API response. #[schema( value_type = String, min_length = 30, max_length = 30, example = "187282ab-40ef-47a9-9206-5099ba31e432" )] pub payout_id: String, /// `force_sync` with the connector to get payout details /// (defaults to false) #[schema(value_type = Option<bool>, default = false, example = true)] pub force_sync: Option<bool>, /// The identifier for the Merchant Account. #[schema(value_type = Option<String>)] pub merchant_id: Option<id_type::MerchantId>, } #[derive( Default, Debug, Deserialize, Serialize, Clone, ToSchema, router_derive::PolymorphicSchema, )] #[generate_schemas(PayoutCancelRequest, PayoutFulfillRequest)] pub struct PayoutActionRequest { /// Unique identifier for the payout. This ensures idempotency for multiple payouts /// that have been done by a single merchant. This field is auto generated and is returned in the API response. #[schema( value_type = String, min_length = 30, max_length = 30, example = "187282ab-40ef-47a9-9206-5099ba31e432" )] #[serde(skip_deserializing)] pub payout_id: String, } #[derive(Default, Debug, ToSchema, Clone, Deserialize)] pub struct PayoutVendorAccountDetails { pub vendor_details: PayoutVendorDetails, pub individual_details: PayoutIndividualDetails, } #[derive(Default, Debug, Serialize, ToSchema, Clone, Deserialize)] pub struct PayoutVendorDetails { pub account_type: String, pub business_type: String, pub business_profile_mcc: Option<i32>, pub business_profile_url: Option<String>, pub business_profile_name: Option<Secret<String>>, pub company_address_line1: Option<Secret<String>>, pub company_address_line2: Option<Secret<String>>, pub company_address_postal_code: Option<Secret<String>>, pub company_address_city: Option<Secret<String>>, pub company_address_state: Option<Secret<String>>, pub company_phone: Option<Secret<String>>, pub company_tax_id: Option<Secret<String>>, pub company_owners_provided: Option<bool>, pub capabilities_card_payments: Option<bool>, pub capabilities_transfers: Option<bool>, } #[derive(Default, Debug, Serialize, ToSchema, Clone, Deserialize)] pub struct PayoutIndividualDetails { pub tos_acceptance_date: Option<i64>, pub tos_acceptance_ip: Option<Secret<String>>, pub individual_dob_day: Option<Secret<String>>, pub individual_dob_month: Option<Secret<String>>, pub individual_dob_year: Option<Secret<String>>, pub individual_id_number: Option<Secret<String>>, pub individual_ssn_last_4: Option<Secret<String>>, pub external_account_account_holder_type: Option<String>, } #[derive(Clone, Debug, serde::Deserialize, ToSchema, serde::Serialize)] #[serde(deny_unknown_fields)] pub struct PayoutListConstraints { /// The identifier for customer #[schema(value_type = Option<String>, example = "cus_y3oqhf46pyzuxjbcn2giaqnb44")] pub customer_id: Option<id_type::CustomerId>, /// A cursor for use in pagination, fetch the next list after some object #[schema(example = "pay_fafa124123")] pub starting_after: Option<String>, /// A cursor for use in pagination, fetch the previous list before some object #[schema(example = "pay_fafa124123")] pub ending_before: Option<String>, /// limit on the number of objects to return #[schema(default = 10, maximum = 100)] #[serde(default = "default_payouts_list_limit")] pub limit: u32, /// The time at which payout is created #[schema(example = "2022-09-10T10:11:12Z")] #[serde(default, with = "common_utils::custom_serde::iso8601::option")] pub created: Option<PrimitiveDateTime>, /// The time range for which objects are needed. TimeRange has two fields start_time and end_time from which objects can be filtered as per required scenarios (created_at, time less than, greater than etc). #[serde(flatten)] #[schema(value_type = Option<TimeRange>)] pub time_range: Option<common_utils::types::TimeRange>, } #[derive(Clone, Debug, serde::Deserialize, ToSchema, serde::Serialize)] #[serde(deny_unknown_fields)] pub struct PayoutListFilterConstraints { /// The identifier for payout #[schema( value_type = Option<String>, min_length = 30, max_length = 30, example = "187282ab-40ef-47a9-9206-5099ba31e432" )] pub payout_id: Option<String>, /// The identifier for business profile #[schema(value_type = Option<String>)] pub profile_id: Option<id_type::ProfileId>, /// The identifier for customer #[schema(value_type = Option<String>,example = "cus_y3oqhf46pyzuxjbcn2giaqnb44")] pub customer_id: Option<id_type::CustomerId>, /// The limit on the number of objects. The default limit is 10 and max limit is 20 #[serde(default = "default_payouts_list_limit")] pub limit: u32, /// The starting point within a list of objects pub offset: Option<u32>, /// The time range for which objects are needed. TimeRange has two fields start_time and end_time from which objects can be filtered as per required scenarios (created_at, time less than, greater than etc). #[serde(flatten)] #[schema(value_type = Option<TimeRange>)] pub time_range: Option<common_utils::types::TimeRange>, /// The list of connectors to filter payouts list #[schema(value_type = Option<Vec<PayoutConnectors>>, max_length = 255, example = json!(["wise", "adyen"]))] pub connector: Option<Vec<api_enums::PayoutConnectors>>, /// The list of currencies to filter payouts list #[schema(value_type = Currency, example = "USD")] pub currency: Option<Vec<api_enums::Currency>>, /// The list of payout status to filter payouts list #[schema(value_type = Option<Vec<PayoutStatus>>, example = json!(["pending", "failed"]))] pub status: Option<Vec<api_enums::PayoutStatus>>, /// The list of payout methods to filter payouts list #[schema(value_type = Option<Vec<PayoutType>>, example = json!(["bank", "card"]))] pub payout_method: Option<Vec<common_enums::PayoutType>>, /// Type of recipient #[schema(value_type = PayoutEntityType, example = "Individual")] pub entity_type: Option<common_enums::PayoutEntityType>, } #[derive(Clone, Debug, serde::Serialize, ToSchema)] pub struct PayoutListResponse { /// The number of payouts included in the list pub size: usize, /// The list of payouts response objects pub data: Vec<PayoutCreateResponse>, /// The total number of available payouts for given constraints #[serde(skip_serializing_if = "Option::is_none")] pub total_count: Option<i64>, } #[derive(Clone, Debug, serde::Serialize, ToSchema)] pub struct PayoutListFilters { /// The list of available connector filters #[schema(value_type = Vec<PayoutConnectors>)] pub connector: Vec<api_enums::PayoutConnectors>, /// The list of available currency filters #[schema(value_type = Vec<Currency>)] pub currency: Vec<common_enums::Currency>, /// The list of available payout status filters #[schema(value_type = Vec<PayoutStatus>)] pub status: Vec<common_enums::PayoutStatus>, /// The list of available payout method filters #[schema(value_type = Vec<PayoutType>)] pub payout_method: Vec<common_enums::PayoutType>, } #[derive(Clone, Debug, serde::Serialize, ToSchema)] pub struct PayoutLinkResponse { pub payout_link_id: String, #[schema(value_type = String)] pub link: Secret<url::Url>, } #[derive(Clone, Debug, serde::Deserialize, ToSchema, serde::Serialize)] pub struct PayoutLinkInitiateRequest { #[schema(value_type = String)] pub merchant_id: id_type::MerchantId, pub payout_id: String, } #[derive(Clone, Debug, serde::Serialize)] pub struct PayoutLinkDetails { pub publishable_key: Secret<String>, pub client_secret: Secret<String>, pub payout_link_id: String, pub payout_id: String, pub customer_id: id_type::CustomerId, #[serde(with = "common_utils::custom_serde::iso8601")] pub session_expiry: PrimitiveDateTime, pub return_url: Option<url::Url>, #[serde(flatten)] pub ui_config: link_utils::GenericLinkUiConfigFormData, pub enabled_payment_methods: Vec<link_utils::EnabledPaymentMethod>, pub enabled_payment_methods_with_required_fields: Vec<PayoutEnabledPaymentMethodsInfo>, pub amount: common_utils::types::StringMajorUnit, pub currency: common_enums::Currency, pub locale: String, pub form_layout: Option<common_enums::UIWidgetFormLayout>, pub test_mode: bool, } #[derive(Clone, Debug, serde::Serialize)] pub struct PayoutEnabledPaymentMethodsInfo { pub payment_method: common_enums::PaymentMethod, pub payment_method_types_info: Vec<PaymentMethodTypeInfo>, } #[derive(Clone, Debug, serde::Serialize)] pub struct PaymentMethodTypeInfo { pub payment_method_type: common_enums::PaymentMethodType, pub required_fields: Option<HashMap<String, RequiredFieldInfo>>, } #[derive(Clone, Debug, serde::Serialize, FlatStruct)] pub struct RequiredFieldsOverrideRequest { pub billing: Option<payments::Address>, } #[derive(Clone, Debug, serde::Serialize)] pub struct PayoutLinkStatusDetails { pub payout_link_id: String, pub payout_id: String, pub customer_id: id_type::CustomerId, #[serde(with = "common_utils::custom_serde::iso8601")] pub session_expiry: PrimitiveDateTime, pub return_url: Option<url::Url>, pub status: api_enums::PayoutStatus, pub error_code: Option<UnifiedCode>, pub error_message: Option<UnifiedMessage>, #[serde(flatten)] pub ui_config: link_utils::GenericLinkUiConfigFormData, pub test_mode: bool, } impl From<Bank> for payout_method_utils::BankAdditionalData { fn from(bank_data: Bank) -> Self { match bank_data { Bank::Ach(AchBankTransfer { bank_name, bank_country_code, bank_city, bank_account_number, bank_routing_number, }) => Self::Ach(Box::new( payout_method_utils::AchBankTransferAdditionalData { bank_name, bank_country_code, bank_city, bank_account_number: bank_account_number.into(), bank_routing_number: bank_routing_number.into(), }, )), Bank::Bacs(BacsBankTransfer { bank_name, bank_country_code, bank_city, bank_account_number, bank_sort_code, }) => Self::Bacs(Box::new( payout_method_utils::BacsBankTransferAdditionalData { bank_name, bank_country_code, bank_city, bank_account_number: bank_account_number.into(), bank_sort_code: bank_sort_code.into(), }, )), Bank::Sepa(SepaBankTransfer { bank_name, bank_country_code, bank_city, iban, bic, }) => Self::Sepa(Box::new( payout_method_utils::SepaBankTransferAdditionalData { bank_name, bank_country_code, bank_city, iban: iban.into(), bic: bic.map(From::from), }, )), Bank::Pix(PixBankTransfer { bank_name, bank_branch, bank_account_number, pix_key, tax_id, }) => Self::Pix(Box::new( payout_method_utils::PixBankTransferAdditionalData { bank_name, bank_branch, bank_account_number: bank_account_number.into(), pix_key: pix_key.into(), tax_id: tax_id.map(From::from), }, )), } } } impl From<Wallet> for payout_method_utils::WalletAdditionalData { fn from(wallet_data: Wallet) -> Self { match wallet_data { Wallet::Paypal(Paypal { email, telephone_number, paypal_id, }) => Self::Paypal(Box::new(payout_method_utils::PaypalAdditionalData { email: email.map(ForeignFrom::foreign_from), telephone_number: telephone_number.map(From::from), paypal_id: paypal_id.map(From::from), })), Wallet::Venmo(Venmo { telephone_number }) => { Self::Venmo(Box::new(payout_method_utils::VenmoAdditionalData { telephone_number: telephone_number.map(From::from), })) } } } } impl From<payout_method_utils::AdditionalPayoutMethodData> for PayoutMethodDataResponse { fn from(additional_data: payout_method_utils::AdditionalPayoutMethodData) -> Self { match additional_data { payout_method_utils::AdditionalPayoutMethodData::Card(card_data) => { Self::Card(card_data) } payout_method_utils::AdditionalPayoutMethodData::Bank(bank_data) => { Self::Bank(bank_data) } payout_method_utils::AdditionalPayoutMethodData::Wallet(wallet_data) => { Self::Wallet(wallet_data) } } } }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/api_models/src/payouts.rs" crate="api_models" role="use_site"> use std::collections::HashMap; use cards::CardNumber; use common_utils::{ consts::default_payouts_list_limit, crypto, id_type, link_utils, payout_method_utils, pii::{self, Email}, transformers::ForeignFrom, types::{UnifiedCode, UnifiedMessage}, }; use masking::Secret; use router_derive::FlatStruct; use serde::{Deserialize, Serialize}; use time::PrimitiveDateTime; use utoipa::ToSchema; use crate::{enums as api_enums, payment_methods::RequiredFieldInfo, payments}; #[derive(Debug, Deserialize, Serialize, Clone, ToSchema)] pub enum PayoutRequest { PayoutActionRequest(PayoutActionRequest), PayoutCreateRequest(Box<PayoutCreateRequest>), PayoutRetrieveRequest(PayoutRetrieveRequest), } #[derive( Default, Debug, Deserialize, Serialize, Clone, ToSchema, router_derive::PolymorphicSchema, )] #[generate_schemas(PayoutsCreateRequest, PayoutUpdateRequest, PayoutConfirmRequest)] #[serde(deny_unknown_fields)] pub struct PayoutCreateRequest { /// Unique identifier for the payout. This ensures idempotency for multiple payouts that have been done by a single merchant. This field is auto generated and is returned in the API response, **not required to be included in the Payout Create/Update Request.** #[schema( value_type = Option<String>, min_length = 30, max_length = 30, example = "187282ab-40ef-47a9-9206-5099ba31e432" )] #[remove_in(PayoutsCreateRequest, PayoutUpdateRequest, PayoutConfirmRequest)] pub payout_id: Option<String>, // TODO: #1321 https://github.com/juspay/hyperswitch/issues/1321 /// This is an identifier for the merchant account. This is inferred from the API key provided during the request, **not required to be included in the Payout Create/Update Request.** #[schema(max_length = 255, value_type = Option<String>, example = "merchant_1668273825")] #[remove_in(PayoutsCreateRequest, PayoutUpdateRequest, PayoutConfirmRequest)] pub merchant_id: Option<id_type::MerchantId>, /// The payout amount. Amount for the payout in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc., #[schema(value_type = Option<u64>, example = 1000)] #[mandatory_in(PayoutsCreateRequest = u64)] #[remove_in(PayoutsConfirmRequest)] #[serde(default, deserialize_with = "payments::amount::deserialize_option")] pub amount: Option<payments::Amount>, /// The currency of the payout request can be specified here #[schema(value_type = Option<Currency>, example = "USD")] #[mandatory_in(PayoutsCreateRequest = Currency)] #[remove_in(PayoutsConfirmRequest)] pub currency: Option<api_enums::Currency>, /// Specifies routing algorithm for selecting a connector #[schema(value_type = Option<RoutingAlgorithm>, example = json!({ "type": "single", "data": "adyen" }))] pub routing: Option<serde_json::Value>, /// This field allows the merchant to manually select a connector with which the payout can go through. #[schema(value_type = Option<Vec<PayoutConnectors>>, max_length = 255, example = json!(["wise", "adyen"]))] pub connector: Option<Vec<api_enums::PayoutConnectors>>, /// This field is used when merchant wants to confirm the payout, thus useful for the payout _Confirm_ request. Ideally merchants should _Create_ a payout, _Update_ it (if required), then _Confirm_ it. #[schema(value_type = Option<bool>, example = true, default = false)] #[remove_in(PayoutConfirmRequest)] pub confirm: Option<bool>, /// The payout_type of the payout request can be specified here, this is a mandatory field to _Confirm_ the payout, i.e., should be passed in _Create_ request, if not then should be updated in the payout _Update_ request, then only it can be confirmed. #[schema(value_type = Option<PayoutType>, example = "card")] pub payout_type: Option<api_enums::PayoutType>, /// The payout method information required for carrying out a payout #[schema(value_type = Option<PayoutMethodData>)] pub payout_method_data: Option<PayoutMethodData>, /// The billing address for the payout #[schema(value_type = Option<Address>, example = json!(r#"{ "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Francisco", "state": "CA", "zip": "94122", "country": "US", "first_name": "John", "last_name": "Doe" }, "phone": { "number": "9123456789", "country_code": "+1" } }"#))] pub billing: Option<payments::Address>, /// Set to true to confirm the payout without review, no further action required #[schema(value_type = Option<bool>, example = true, default = false)] pub auto_fulfill: Option<bool>, /// The identifier for the customer object. If not provided the customer ID will be autogenerated. _Deprecated: Use customer_id instead._ #[schema(deprecated, value_type = Option<String>, max_length = 255, example = "cus_y3oqhf46pyzuxjbcn2giaqnb44")] pub customer_id: Option<id_type::CustomerId>, /// Passing this object creates a new customer or attaches an existing customer to the payout #[schema(value_type = Option<CustomerDetails>)] pub customer: Option<payments::CustomerDetails>, /// It's a token used for client side verification. #[schema(value_type = Option<String>, example = "pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo")] #[remove_in(PayoutsCreateRequest)] #[mandatory_in(PayoutConfirmRequest = String)] pub client_secret: Option<String>, /// The URL to redirect after the completion of the operation #[schema(value_type = Option<String>, example = "https://hyperswitch.io")] pub return_url: Option<String>, /// Business country of the merchant for this payout. _Deprecated: Use profile_id instead._ #[schema(deprecated, example = "US", value_type = Option<CountryAlpha2>)] pub business_country: Option<api_enums::CountryAlpha2>, /// Business label of the merchant for this payout. _Deprecated: Use profile_id instead._ #[schema(deprecated, example = "food", value_type = Option<String>)] pub business_label: Option<String>, /// A description of the payout #[schema(example = "It's my first payout request", value_type = Option<String>)] pub description: Option<String>, /// Type of entity to whom the payout is being carried out to, select from the given list of options #[schema(value_type = Option<PayoutEntityType>, example = "Individual")] pub entity_type: Option<api_enums::PayoutEntityType>, /// Specifies whether or not the payout request is recurring #[schema(value_type = Option<bool>, default = false)] pub recurring: Option<bool>, /// You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object. #[schema(value_type = Option<Object>, example = r#"{ "udf1": "some-value", "udf2": "some-value" }"#)] pub metadata: Option<pii::SecretSerdeValue>, /// Provide a reference to a stored payout method, used to process the payout. #[schema(example = "187282ab-40ef-47a9-9206-5099ba31e432", value_type = Option<String>)] pub payout_token: Option<String>, /// The business profile to use for this payout, especially if there are multiple business profiles associated with the account, otherwise default business profile associated with the merchant account will be used. #[schema(value_type = Option<String>)] pub profile_id: Option<id_type::ProfileId>, /// The send method which will be required for processing payouts, check options for better understanding. #[schema(value_type = Option<PayoutSendPriority>, example = "instant")] pub priority: Option<api_enums::PayoutSendPriority>, /// Whether to get the payout link (if applicable). Merchant need to specify this during the Payout _Create_, this field can not be updated during Payout _Update_. #[schema(default = false, example = true, value_type = Option<bool>)] pub payout_link: Option<bool>, /// Custom payout link config for the particular payout, if payout link is to be generated. #[schema(value_type = Option<PayoutCreatePayoutLinkConfig>)] pub payout_link_config: Option<PayoutCreatePayoutLinkConfig>, /// Will be used to expire client secret after certain amount of time to be supplied in seconds /// (900) for 15 mins #[schema(value_type = Option<u32>, example = 900)] pub session_expiry: Option<u32>, /// Customer's email. _Deprecated: Use customer object instead._ #[schema(deprecated, max_length = 255, value_type = Option<String>, example = "johntest@test.com")] pub email: Option<Email>, /// Customer's name. _Deprecated: Use customer object instead._ #[schema(deprecated, value_type = Option<String>, max_length = 255, example = "John Test")] pub name: Option<Secret<String>>, /// Customer's phone. _Deprecated: Use customer object instead._ #[schema(deprecated, value_type = Option<String>, max_length = 255, example = "9123456789")] pub phone: Option<Secret<String>>, /// Customer's phone country code. _Deprecated: Use customer object instead._ #[schema(deprecated, max_length = 255, example = "+1")] pub phone_country_code: Option<String>, /// Identifier for payout method pub payout_method_id: Option<String>, } impl PayoutCreateRequest { pub fn get_customer_id(&self) -> Option<&id_type::CustomerId> { self.customer_id .as_ref() .or(self.customer.as_ref().map(|customer| &customer.id)) } } /// Custom payout link config for the particular payout, if payout link is to be generated. #[derive(Default, Debug, Deserialize, Serialize, Clone, ToSchema)] pub struct PayoutCreatePayoutLinkConfig { /// The unique identifier for the collect link. #[schema(value_type = Option<String>, example = "pm_collect_link_2bdacf398vwzq5n422S1")] pub payout_link_id: Option<String>, #[serde(flatten)] #[schema(value_type = Option<GenericLinkUiConfig>)] pub ui_config: Option<link_utils::GenericLinkUiConfig>, /// List of payout methods shown on collect UI #[schema(value_type = Option<Vec<EnabledPaymentMethod>>, example = r#"[{"payment_method": "bank_transfer", "payment_method_types": ["ach", "bacs"]}]"#)] pub enabled_payment_methods: Option<Vec<link_utils::EnabledPaymentMethod>>, /// Form layout of the payout link #[schema(value_type = Option<UIWidgetFormLayout>, max_length = 255, example = "tabs")] pub form_layout: Option<api_enums::UIWidgetFormLayout>, /// `test_mode` allows for opening payout links without any restrictions. This removes /// - domain name validations /// - check for making sure link is accessed within an iframe #[schema(value_type = Option<bool>, example = false)] pub test_mode: Option<bool>, } /// The payout method information required for carrying out a payout #[derive(Debug, Clone, Deserialize, Serialize, ToSchema)] #[serde(rename_all = "snake_case")] pub enum PayoutMethodData { Card(CardPayout), Bank(Bank), Wallet(Wallet), } impl Default for PayoutMethodData { fn default() -> Self { Self::Card(CardPayout::default()) } } #[derive(Default, Eq, PartialEq, Clone, Debug, Deserialize, Serialize, ToSchema)] pub struct CardPayout { /// The card number #[schema(value_type = String, example = "4242424242424242")] pub card_number: CardNumber, /// The card's expiry month #[schema(value_type = String)] pub expiry_month: Secret<String>, /// The card's expiry year #[schema(value_type = String)] pub expiry_year: Secret<String>, /// The card holder's name #[schema(value_type = String, example = "John Doe")] pub card_holder_name: Option<Secret<String>>, } #[derive(Eq, PartialEq, Clone, Debug, Deserialize, Serialize, ToSchema)] #[serde(untagged)] pub enum Bank { Ach(AchBankTransfer), Bacs(BacsBankTransfer), Sepa(SepaBankTransfer), Pix(PixBankTransfer), } #[derive(Default, Eq, PartialEq, Clone, Debug, Deserialize, Serialize, ToSchema)] pub struct AchBankTransfer { /// Bank name #[schema(value_type = Option<String>, example = "Deutsche Bank")] pub bank_name: Option<String>, /// Bank country code #[schema(value_type = Option<CountryAlpha2>, example = "US")] pub bank_country_code: Option<api_enums::CountryAlpha2>, /// Bank city #[schema(value_type = Option<String>, example = "California")] pub bank_city: Option<String>, /// Bank account number is an unique identifier assigned by a bank to a customer. #[schema(value_type = String, example = "000123456")] pub bank_account_number: Secret<String>, /// [9 digits] Routing number - used in USA for identifying a specific bank. #[schema(value_type = String, example = "110000000")] pub bank_routing_number: Secret<String>, } #[derive(Default, Eq, PartialEq, Clone, Debug, Deserialize, Serialize, ToSchema)] pub struct BacsBankTransfer { /// Bank name #[schema(value_type = Option<String>, example = "Deutsche Bank")] pub bank_name: Option<String>, /// Bank country code #[schema(value_type = Option<CountryAlpha2>, example = "US")] pub bank_country_code: Option<api_enums::CountryAlpha2>, /// Bank city #[schema(value_type = Option<String>, example = "California")] pub bank_city: Option<String>, /// Bank account number is an unique identifier assigned by a bank to a customer. #[schema(value_type = String, example = "000123456")] pub bank_account_number: Secret<String>, /// [6 digits] Sort Code - used in UK and Ireland for identifying a bank and it's branches. #[schema(value_type = String, example = "98-76-54")] pub bank_sort_code: Secret<String>, } #[derive(Default, Eq, PartialEq, Clone, Debug, Deserialize, Serialize, ToSchema)] // The SEPA (Single Euro Payments Area) is a pan-European network that allows you to send and receive payments in euros between two cross-border bank accounts in the eurozone. pub struct SepaBankTransfer { /// Bank name #[schema(value_type = Option<String>, example = "Deutsche Bank")] pub bank_name: Option<String>, /// Bank country code #[schema(value_type = Option<CountryAlpha2>, example = "US")] pub bank_country_code: Option<api_enums::CountryAlpha2>, /// Bank city #[schema(value_type = Option<String>, example = "California")] pub bank_city: Option<String>, /// International Bank Account Number (iban) - used in many countries for identifying a bank along with it's customer. #[schema(value_type = String, example = "DE89370400440532013000")] pub iban: Secret<String>, /// [8 / 11 digits] Bank Identifier Code (bic) / Swift Code - used in many countries for identifying a bank and it's branches #[schema(value_type = String, example = "HSBCGB2LXXX")] pub bic: Option<Secret<String>>, } #[derive(Default, Eq, PartialEq, Clone, Debug, Deserialize, Serialize, ToSchema)] pub struct PixBankTransfer { /// Bank name #[schema(value_type = Option<String>, example = "Deutsche Bank")] pub bank_name: Option<String>, /// Bank branch #[schema(value_type = Option<String>, example = "3707")] pub bank_branch: Option<String>, /// Bank account number is an unique identifier assigned by a bank to a customer. #[schema(value_type = String, example = "000123456")] pub bank_account_number: Secret<String>, /// Unique key for pix customer #[schema(value_type = String, example = "000123456")] pub pix_key: Secret<String>, /// Individual taxpayer identification number #[schema(value_type = Option<String>, example = "000123456")] pub tax_id: Option<Secret<String>>, } #[derive(Eq, PartialEq, Clone, Debug, Deserialize, Serialize, ToSchema)] #[serde(rename_all = "snake_case")] pub enum Wallet { Paypal(Paypal), Venmo(Venmo), } #[derive(Default, Eq, PartialEq, Clone, Debug, Deserialize, Serialize, ToSchema)] pub struct Paypal { /// Email linked with paypal account #[schema(value_type = String, example = "john.doe@example.com")] pub email: Option<Email>, /// mobile number linked to paypal account #[schema(value_type = String, example = "16608213349")] pub telephone_number: Option<Secret<String>>, /// id of the paypal account #[schema(value_type = String, example = "G83KXTJ5EHCQ2")] pub paypal_id: Option<Secret<String>>, } #[derive(Default, Eq, PartialEq, Clone, Debug, Deserialize, Serialize, ToSchema)] pub struct Venmo { /// mobile number linked to venmo account #[schema(value_type = String, example = "16608213349")] pub telephone_number: Option<Secret<String>>, } #[derive(Debug, ToSchema, Clone, Serialize, router_derive::PolymorphicSchema)] #[serde(deny_unknown_fields)] pub struct PayoutCreateResponse { /// Unique identifier for the payout. This ensures idempotency for multiple payouts /// that have been done by a single merchant. This field is auto generated and is returned in the API response. #[schema( value_type = String, min_length = 30, max_length = 30, example = "187282ab-40ef-47a9-9206-5099ba31e432" )] pub payout_id: String, // TODO: Update this to PayoutIdType similar to PaymentIdType /// This is an identifier for the merchant account. This is inferred from the API key /// provided during the request #[schema(max_length = 255, value_type = String, example = "merchant_1668273825")] pub merchant_id: id_type::MerchantId, /// The payout amount. Amount for the payout in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc., #[schema(value_type = i64, example = 1000)] pub amount: common_utils::types::MinorUnit, /// Recipient's currency for the payout request #[schema(value_type = Currency, example = "USD")] pub currency: api_enums::Currency, /// The connector used for the payout #[schema(example = "wise")] pub connector: Option<String>, /// The payout method that is to be used #[schema(value_type = Option<PayoutType>, example = "bank")] pub payout_type: Option<api_enums::PayoutType>, /// The payout method details for the payout #[schema(value_type = Option<PayoutMethodDataResponse>, example = json!(r#"{ "card": { "last4": "2503", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "400000", "card_extended_bin": null, "card_exp_month": "08", "card_exp_year": "25", "card_holder_name": null, "payment_checks": null, "authentication_data": null } }"#))] pub payout_method_data: Option<PayoutMethodDataResponse>, /// The billing address for the payout #[schema(value_type = Option<Address>, example = json!(r#"{ "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Francisco", "state": "CA", "zip": "94122", "country": "US", "first_name": "John", "last_name": "Doe" }, "phone": { "number": "9123456789", "country_code": "+1" } }"#))] pub billing: Option<payments::Address>, /// Set to true to confirm the payout without review, no further action required #[schema(value_type = bool, example = true, default = false)] pub auto_fulfill: bool, /// The identifier for the customer object. If not provided the customer ID will be autogenerated. #[schema(value_type = String, max_length = 255, example = "cus_y3oqhf46pyzuxjbcn2giaqnb44")] pub customer_id: Option<id_type::CustomerId>, /// Passing this object creates a new customer or attaches an existing customer to the payout #[schema(value_type = Option<CustomerDetailsResponse>)] pub customer: Option<payments::CustomerDetailsResponse>, /// It's a token used for client side verification. #[schema(value_type = String, example = "pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo")] pub client_secret: Option<String>, /// The URL to redirect after the completion of the operation #[schema(value_type = String, example = "https://hyperswitch.io")] pub return_url: Option<String>, /// Business country of the merchant for this payout #[schema(example = "US", value_type = CountryAlpha2)] pub business_country: Option<api_enums::CountryAlpha2>, /// Business label of the merchant for this payout #[schema(example = "food", value_type = Option<String>)] pub business_label: Option<String>, /// A description of the payout #[schema(example = "It's my first payout request", value_type = Option<String>)] pub description: Option<String>, /// Type of entity to whom the payout is being carried out to #[schema(value_type = PayoutEntityType, example = "Individual")] pub entity_type: api_enums::PayoutEntityType, /// Specifies whether or not the payout request is recurring #[schema(value_type = bool, default = false)] pub recurring: bool, /// You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object. #[schema(value_type = Option<Object>, example = r#"{ "udf1": "some-value", "udf2": "some-value" }"#)] pub metadata: Option<pii::SecretSerdeValue>, /// Unique identifier of the merchant connector account #[schema(value_type = Option<String>, example = "mca_sAD3OZLATetvjLOYhUSy")] pub merchant_connector_id: Option<id_type::MerchantConnectorAccountId>, /// Current status of the Payout #[schema(value_type = PayoutStatus, example = RequiresConfirmation)] pub status: api_enums::PayoutStatus, /// If there was an error while calling the connector the error message is received here #[schema(value_type = Option<String>, example = "Failed while verifying the card")] pub error_message: Option<String>, /// If there was an error while calling the connectors the code is received here #[schema(value_type = Option<String>, example = "E0001")] pub error_code: Option<String>, /// The business profile that is associated with this payout #[schema(value_type = String)] pub profile_id: id_type::ProfileId, /// Time when the payout was created #[schema(example = "2022-09-10T10:11:12Z")] #[serde(with = "common_utils::custom_serde::iso8601::option")] pub created: Option<PrimitiveDateTime>, /// Underlying processor's payout resource ID #[schema(value_type = Option<String>, example = "S3FC9G9M2MVFDXT5")] pub connector_transaction_id: Option<String>, /// Payout's send priority (if applicable) #[schema(value_type = Option<PayoutSendPriority>, example = "instant")] pub priority: Option<api_enums::PayoutSendPriority>, /// List of attempts #[schema(value_type = Option<Vec<PayoutAttemptResponse>>)] #[serde(skip_serializing_if = "Option::is_none")] pub attempts: Option<Vec<PayoutAttemptResponse>>, /// If payout link was requested, this contains the link's ID and the URL to render the payout widget #[schema(value_type = Option<PayoutLinkResponse>)] pub payout_link: Option<PayoutLinkResponse>, /// Customer's email. _Deprecated: Use customer object instead._ #[schema(deprecated, max_length = 255, value_type = Option<String>, example = "johntest@test.com")] pub email: crypto::OptionalEncryptableEmail, /// Customer's name. _Deprecated: Use customer object instead._ #[schema(deprecated, value_type = Option<String>, max_length = 255, example = "John Test")] pub name: crypto::OptionalEncryptableName, /// Customer's phone. _Deprecated: Use customer object instead._ #[schema(deprecated, value_type = Option<String>, max_length = 255, example = "9123456789")] pub phone: crypto::OptionalEncryptablePhone, /// Customer's phone country code. _Deprecated: Use customer object instead._ #[schema(deprecated, max_length = 255, example = "+1")] pub phone_country_code: Option<String>, /// (This field is not live yet) /// Error code unified across the connectors is received here in case of errors while calling the underlying connector #[remove_in(PayoutCreateResponse)] #[schema(value_type = Option<String>, max_length = 255, example = "UE_000")] pub unified_code: Option<UnifiedCode>, /// (This field is not live yet) /// Error message unified across the connectors is received here in case of errors while calling the underlying connector #[remove_in(PayoutCreateResponse)] #[schema(value_type = Option<String>, max_length = 1024, example = "Invalid card details")] pub unified_message: Option<UnifiedMessage>, /// Identifier for payout method pub payout_method_id: Option<String>, } /// The payout method information for response #[derive(Debug, Clone, Deserialize, Serialize, ToSchema)] #[serde(rename_all = "snake_case")] pub enum PayoutMethodDataResponse { #[schema(value_type = CardAdditionalData)] Card(Box<payout_method_utils::CardAdditionalData>), #[schema(value_type = BankAdditionalData)] Bank(Box<payout_method_utils::BankAdditionalData>), #[schema(value_type = WalletAdditionalData)] Wallet(Box<payout_method_utils::WalletAdditionalData>), } #[derive( Default, Debug, serde::Serialize, Clone, PartialEq, ToSchema, router_derive::PolymorphicSchema, )] pub struct PayoutAttemptResponse { /// Unique identifier for the attempt pub attempt_id: String, /// The status of the attempt #[schema(value_type = PayoutStatus, example = "failed")] pub status: api_enums::PayoutStatus, /// The payout attempt amount. Amount for the payout in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc., #[schema(value_type = i64, example = 6583)] pub amount: common_utils::types::MinorUnit, /// The currency of the amount of the payout attempt #[schema(value_type = Option<Currency>, example = "USD")] pub currency: Option<api_enums::Currency>, /// The connector used for the payout pub connector: Option<String>, /// Connector's error code in case of failures pub error_code: Option<String>, /// Connector's error message in case of failures pub error_message: Option<String>, /// The payout method that was used #[schema(value_type = Option<PayoutType>, example = "bank")] pub payment_method: Option<api_enums::PayoutType>, /// Payment Method Type #[schema(value_type = Option<PaymentMethodType>, example = "bacs")] pub payout_method_type: Option<api_enums::PaymentMethodType>, /// A unique identifier for a payout provided by the connector pub connector_transaction_id: Option<String>, /// If the payout was cancelled the reason provided here pub cancellation_reason: Option<String>, /// (This field is not live yet) /// Error code unified across the connectors is received here in case of errors while calling the underlying connector #[remove_in(PayoutAttemptResponse)] #[schema(value_type = Option<String>, max_length = 255, example = "UE_000")] pub unified_code: Option<UnifiedCode>, /// (This field is not live yet) /// Error message unified across the connectors is received here in case of errors while calling the underlying connector #[remove_in(PayoutAttemptResponse)] #[schema(value_type = Option<String>, max_length = 1024, example = "Invalid card details")] pub unified_message: Option<UnifiedMessage>, } #[derive(Default, Debug, Clone, Deserialize, ToSchema)] pub struct PayoutRetrieveBody { pub force_sync: Option<bool>, #[schema(value_type = Option<String>)] pub merchant_id: Option<id_type::MerchantId>, } #[derive(Default, Debug, Serialize, ToSchema, Clone, Deserialize)] pub struct PayoutRetrieveRequest { /// Unique identifier for the payout. This ensures idempotency for multiple payouts /// that have been done by a single merchant. This field is auto generated and is returned in the API response. #[schema( value_type = String, min_length = 30, max_length = 30, example = "187282ab-40ef-47a9-9206-5099ba31e432" )] pub payout_id: String, /// `force_sync` with the connector to get payout details /// (defaults to false) #[schema(value_type = Option<bool>, default = false, example = true)] pub force_sync: Option<bool>, /// The identifier for the Merchant Account. #[schema(value_type = Option<String>)] pub merchant_id: Option<id_type::MerchantId>, } #[derive( Default, Debug, Deserialize, Serialize, Clone, ToSchema, router_derive::PolymorphicSchema, )] #[generate_schemas(PayoutCancelRequest, PayoutFulfillRequest)] pub struct PayoutActionRequest { /// Unique identifier for the payout. This ensures idempotency for multiple payouts /// that have been done by a single merchant. This field is auto generated and is returned in the API response. #[schema( value_type = String, min_length = 30, max_length = 30, example = "187282ab-40ef-47a9-9206-5099ba31e432" )] #[serde(skip_deserializing)] pub payout_id: String, } #[derive(Default, Debug, ToSchema, Clone, Deserialize)] pub struct PayoutVendorAccountDetails { pub vendor_details: PayoutVendorDetails, pub individual_details: PayoutIndividualDetails, } #[derive(Default, Debug, Serialize, ToSchema, Clone, Deserialize)] pub struct PayoutVendorDetails { pub account_type: String, pub business_type: String, pub business_profile_mcc: Option<i32>, pub business_profile_url: Option<String>, pub business_profile_name: Option<Secret<String>>, pub company_address_line1: Option<Secret<String>>, pub company_address_line2: Option<Secret<String>>, pub company_address_postal_code: Option<Secret<String>>, pub company_address_city: Option<Secret<String>>, pub company_address_state: Option<Secret<String>>, pub company_phone: Option<Secret<String>>, pub company_tax_id: Option<Secret<String>>, pub company_owners_provided: Option<bool>, pub capabilities_card_payments: Option<bool>, pub capabilities_transfers: Option<bool>, } #[derive(Default, Debug, Serialize, ToSchema, Clone, Deserialize)] pub struct PayoutIndividualDetails { pub tos_acceptance_date: Option<i64>, pub tos_acceptance_ip: Option<Secret<String>>, pub individual_dob_day: Option<Secret<String>>, pub individual_dob_month: Option<Secret<String>>, pub individual_dob_year: Option<Secret<String>>, pub individual_id_number: Option<Secret<String>>, pub individual_ssn_last_4: Option<Secret<String>>, pub external_account_account_holder_type: Option<String>, } #[derive(Clone, Debug, serde::Deserialize, ToSchema, serde::Serialize)] #[serde(deny_unknown_fields)] pub struct PayoutListConstraints { /// The identifier for customer #[schema(value_type = Option<String>, example = "cus_y3oqhf46pyzuxjbcn2giaqnb44")] pub customer_id: Option<id_type::CustomerId>, /// A cursor for use in pagination, fetch the next list after some object #[schema(example = "pay_fafa124123")] pub starting_after: Option<String>, /// A cursor for use in pagination, fetch the previous list before some object #[schema(example = "pay_fafa124123")] pub ending_before: Option<String>, /// limit on the number of objects to return #[schema(default = 10, maximum = 100)] #[serde(default = "default_payouts_list_limit")] pub limit: u32, /// The time at which payout is created #[schema(example = "2022-09-10T10:11:12Z")] #[serde(default, with = "common_utils::custom_serde::iso8601::option")] pub created: Option<PrimitiveDateTime>, /// The time range for which objects are needed. TimeRange has two fields start_time and end_time from which objects can be filtered as per required scenarios (created_at, time less than, greater than etc). #[serde(flatten)] #[schema(value_type = Option<TimeRange>)] pub time_range: Option<common_utils::types::TimeRange>, } #[derive(Clone, Debug, serde::Deserialize, ToSchema, serde::Serialize)] #[serde(deny_unknown_fields)] pub struct PayoutListFilterConstraints { /// The identifier for payout #[schema( value_type = Option<String>, min_length = 30, max_length = 30, example = "187282ab-40ef-47a9-9206-5099ba31e432" )] pub payout_id: Option<String>, /// The identifier for business profile #[schema(value_type = Option<String>)] pub profile_id: Option<id_type::ProfileId>, /// The identifier for customer #[schema(value_type = Option<String>,example = "cus_y3oqhf46pyzuxjbcn2giaqnb44")] pub customer_id: Option<id_type::CustomerId>, /// The limit on the number of objects. The default limit is 10 and max limit is 20 #[serde(default = "default_payouts_list_limit")] pub limit: u32, /// The starting point within a list of objects pub offset: Option<u32>, /// The time range for which objects are needed. TimeRange has two fields start_time and end_time from which objects can be filtered as per required scenarios (created_at, time less than, greater than etc). #[serde(flatten)] #[schema(value_type = Option<TimeRange>)] pub time_range: Option<common_utils::types::TimeRange>, /// The list of connectors to filter payouts list #[schema(value_type = Option<Vec<PayoutConnectors>>, max_length = 255, example = json!(["wise", "adyen"]))] pub connector: Option<Vec<api_enums::PayoutConnectors>>, /// The list of currencies to filter payouts list #[schema(value_type = Currency, example = "USD")] pub currency: Option<Vec<api_enums::Currency>>, /// The list of payout status to filter payouts list #[schema(value_type = Option<Vec<PayoutStatus>>, example = json!(["pending", "failed"]))] pub status: Option<Vec<api_enums::PayoutStatus>>, /// The list of payout methods to filter payouts list #[schema(value_type = Option<Vec<PayoutType>>, example = json!(["bank", "card"]))] pub payout_method: Option<Vec<common_enums::PayoutType>>, /// Type of recipient #[schema(value_type = PayoutEntityType, example = "Individual")] pub entity_type: Option<common_enums::PayoutEntityType>, } #[derive(Clone, Debug, serde::Serialize, ToSchema)] pub struct PayoutListResponse { /// The number of payouts included in the list pub size: usize, /// The list of payouts response objects pub data: Vec<PayoutCreateResponse>, /// The total number of available payouts for given constraints #[serde(skip_serializing_if = "Option::is_none")] pub total_count: Option<i64>, } #[derive(Clone, Debug, serde::Serialize, ToSchema)] pub struct PayoutListFilters { /// The list of available connector filters #[schema(value_type = Vec<PayoutConnectors>)] pub connector: Vec<api_enums::PayoutConnectors>, /// The list of available currency filters #[schema(value_type = Vec<Currency>)] pub currency: Vec<common_enums::Currency>, /// The list of available payout status filters #[schema(value_type = Vec<PayoutStatus>)] pub status: Vec<common_enums::PayoutStatus>, /// The list of available payout method filters #[schema(value_type = Vec<PayoutType>)] pub payout_method: Vec<common_enums::PayoutType>, } #[derive(Clone, Debug, serde::Serialize, ToSchema)] pub struct PayoutLinkResponse { pub payout_link_id: String, #[schema(value_type = String)] pub link: Secret<url::Url>, } #[derive(Clone, Debug, serde::Deserialize, ToSchema, serde::Serialize)] pub struct PayoutLinkInitiateRequest { #[schema(value_type = String)] pub merchant_id: id_type::MerchantId, pub payout_id: String, } #[derive(Clone, Debug, serde::Serialize)] pub struct PayoutLinkDetails { pub publishable_key: Secret<String>, pub client_secret: Secret<String>, pub payout_link_id: String, pub payout_id: String, pub customer_id: id_type::CustomerId, #[serde(with = "common_utils::custom_serde::iso8601")] pub session_expiry: PrimitiveDateTime, pub return_url: Option<url::Url>, #[serde(flatten)] pub ui_config: link_utils::GenericLinkUiConfigFormData, pub enabled_payment_methods: Vec<link_utils::EnabledPaymentMethod>, pub enabled_payment_methods_with_required_fields: Vec<PayoutEnabledPaymentMethodsInfo>, pub amount: common_utils::types::StringMajorUnit, pub currency: common_enums::Currency, pub locale: String, pub form_layout: Option<common_enums::UIWidgetFormLayout>, pub test_mode: bool, } #[derive(Clone, Debug, serde::Serialize)] pub struct PayoutEnabledPaymentMethodsInfo { pub payment_method: common_enums::PaymentMethod, pub payment_method_types_info: Vec<PaymentMethodTypeInfo>, } #[derive(Clone, Debug, serde::Serialize)] pub struct PaymentMethodTypeInfo { pub payment_method_type: common_enums::PaymentMethodType, pub required_fields: Option<HashMap<String, RequiredFieldInfo>>, } #[derive(Clone, Debug, serde::Serialize, FlatStruct)] pub struct RequiredFieldsOverrideRequest { pub billing: Option<payments::Address>, } #[derive(Clone, Debug, serde::Serialize)] pub struct PayoutLinkStatusDetails { pub payout_link_id: String, pub payout_id: String, pub customer_id: id_type::CustomerId, #[serde(with = "common_utils::custom_serde::iso8601")] pub session_expiry: PrimitiveDateTime, pub return_url: Option<url::Url>, pub status: api_enums::PayoutStatus, pub error_code: Option<UnifiedCode>, pub error_message: Option<UnifiedMessage>, #[serde(flatten)] pub ui_config: link_utils::GenericLinkUiConfigFormData, pub test_mode: bool, } impl From<Bank> for payout_method_utils::BankAdditionalData { fn from(bank_data: Bank) -> Self { match bank_data { Bank::Ach(AchBankTransfer { bank_name, bank_country_code, bank_city, bank_account_number, bank_routing_number, }) => Self::Ach(Box::new( payout_method_utils::AchBankTransferAdditionalData { bank_name, bank_country_code, bank_city, bank_account_number: bank_account_number.into(), bank_routing_number: bank_routing_number.into(), }, )), Bank::Bacs(BacsBankTransfer { bank_name, bank_country_code, bank_city, bank_account_number, bank_sort_code, }) => Self::Bacs(Box::new( payout_method_utils::BacsBankTransferAdditionalData { bank_name, bank_country_code, bank_city, bank_account_number: bank_account_number.into(), bank_sort_code: bank_sort_code.into(), }, )), Bank::Sepa(SepaBankTransfer { bank_name, bank_country_code, bank_city, iban, bic, }) => Self::Sepa(Box::new( payout_method_utils::SepaBankTransferAdditionalData { bank_name, bank_country_code, bank_city, iban: iban.into(), bic: bic.map(From::from), }, )), Bank::Pix(PixBankTransfer { bank_name, bank_branch, bank_account_number, pix_key, tax_id, }) => Self::Pix(Box::new( payout_method_utils::PixBankTransferAdditionalData { bank_name, bank_branch, bank_account_number: bank_account_number.into(), pix_key: pix_key.into(), tax_id: tax_id.map(From::from), }, )), } } } impl From<Wallet> for payout_method_utils::WalletAdditionalData { fn from(wallet_data: Wallet) -> Self { match wallet_data { Wallet::Paypal(Paypal { email, telephone_number, paypal_id, }) => Self::Paypal(Box::new(payout_method_utils::PaypalAdditionalData { email: email.map(ForeignFrom::foreign_from), telephone_number: telephone_number.map(From::from), paypal_id: paypal_id.map(From::from), })), Wallet::Venmo(Venmo { telephone_number }) => { Self::Venmo(Box::new(payout_method_utils::VenmoAdditionalData { telephone_number: telephone_number.map(From::from), })) } } } } impl From<payout_method_utils::AdditionalPayoutMethodData> for PayoutMethodDataResponse { fn from(additional_data: payout_method_utils::AdditionalPayoutMethodData) -> Self { match additional_data { payout_method_utils::AdditionalPayoutMethodData::Card(card_data) => { Self::Card(card_data) } payout_method_utils::AdditionalPayoutMethodData::Bank(bank_data) => { Self::Bank(bank_data) } payout_method_utils::AdditionalPayoutMethodData::Wallet(wallet_data) => { Self::Wallet(wallet_data) } } } } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/router_derive/src/lib.rs<|crate|> api_models macro=FlatStruct roles=use_site,macro_def use=derive item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub fn flat_struct_derive(input: proc_macro::TokenStream) -> proc_macro::TokenStream { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> <|fim_prefix|> pub fn flat_struct_derive(input: proc_macro::TokenStream) -> proc_macro::TokenStream { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/storage_impl/src/redis/kv_store.rs" crate="storage_impl" role="use_site"> use std::{fmt::Debug, sync::Arc}; use common_utils::errors::CustomResult; use diesel_models::enums::MerchantStorageScheme; use error_stack::report; use redis_interface::errors::RedisError; use router_derive::TryGetEnumVariant; use router_env::logger; use serde::de; use crate::{kv_router_store::KVRouterStore, metrics, store::kv::TypedSql, UniqueConstraints}; pub trait KvStorePartition { fn partition_number(key: PartitionKey<'_>, num_partitions: u8) -> u32 { crc32fast::hash(key.to_string().as_bytes()) % u32::from(num_partitions) } fn shard_key(key: PartitionKey<'_>, num_partitions: u8) -> String { format!("shard_{}", Self::partition_number(key, num_partitions)) } } #[allow(unused)] #[derive(Clone)] pub enum PartitionKey<'a> { MerchantIdPaymentId { merchant_id: &'a common_utils::id_type::MerchantId, payment_id: &'a common_utils::id_type::PaymentId, }, CombinationKey { combination: &'a str, }, MerchantIdCustomerId { merchant_id: &'a common_utils::id_type::MerchantId, customer_id: &'a common_utils::id_type::CustomerId, }, #[cfg(all(feature = "v2", feature = "customer_v2"))] MerchantIdMerchantReferenceId { merchant_id: &'a common_utils::id_type::MerchantId, merchant_reference_id: &'a str, }, MerchantIdPayoutId { merchant_id: &'a common_utils::id_type::MerchantId, payout_id: &'a str, }, MerchantIdPayoutAttemptId { merchant_id: &'a common_utils::id_type::MerchantId, payout_attempt_id: &'a str, }, MerchantIdMandateId { merchant_id: &'a common_utils::id_type::MerchantId, mandate_id: &'a str, }, #[cfg(all(feature = "v2", feature = "customer_v2"))] GlobalId { id: &'a str, }, } // PartitionKey::MerchantIdPaymentId {merchant_id, payment_id} impl std::fmt::Display for PartitionKey<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match *self { PartitionKey::MerchantIdPaymentId { merchant_id, payment_id, } => f.write_str(&format!( "mid_{}_pid_{}", merchant_id.get_string_repr(), payment_id.get_string_repr() )), PartitionKey::CombinationKey { combination } => f.write_str(combination), PartitionKey::MerchantIdCustomerId { merchant_id, customer_id, } => f.write_str(&format!( "mid_{}_cust_{}", merchant_id.get_string_repr(), customer_id.get_string_repr() )), #[cfg(all(feature = "v2", feature = "customer_v2"))] PartitionKey::MerchantIdMerchantReferenceId { merchant_id, merchant_reference_id, } => f.write_str(&format!( "mid_{}_cust_{merchant_reference_id}", merchant_id.get_string_repr() )), PartitionKey::MerchantIdPayoutId { merchant_id, payout_id, } => f.write_str(&format!( "mid_{}_po_{payout_id}", merchant_id.get_string_repr() )), PartitionKey::MerchantIdPayoutAttemptId { merchant_id, payout_attempt_id, } => f.write_str(&format!( "mid_{}_poa_{payout_attempt_id}", merchant_id.get_string_repr() )), PartitionKey::MerchantIdMandateId { merchant_id, mandate_id, } => f.write_str(&format!( "mid_{}_mandate_{mandate_id}", merchant_id.get_string_repr() )), #[cfg(all(feature = "v2", feature = "customer_v2"))] PartitionKey::GlobalId { id } => f.write_str(&format!("cust_{id}",)), } } } pub trait RedisConnInterface { fn get_redis_conn( &self, ) -> error_stack::Result<Arc<redis_interface::RedisConnectionPool>, RedisError>; } /// An enum to represent what operation to do on pub enum KvOperation<'a, S: serde::Serialize + Debug> { Hset((&'a str, String), TypedSql), SetNx(&'a S, TypedSql), HSetNx(&'a str, &'a S, TypedSql), HGet(&'a str), Get, Scan(&'a str), } #[derive(TryGetEnumVariant)] #[error(RedisError::UnknownResult)] pub enum KvResult<T: de::DeserializeOwned> { HGet(T), Get(T), Hset(()), SetNx(redis_interface::SetnxReply), HSetNx(redis_interface::HsetnxReply), Scan(Vec<T>), } impl<T> std::fmt::Display for KvOperation<'_, T> where T: serde::Serialize + Debug, { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { KvOperation::Hset(_, _) => f.write_str("Hset"), KvOperation::SetNx(_, _) => f.write_str("Setnx"), KvOperation::HSetNx(_, _, _) => f.write_str("HSetNx"), KvOperation::HGet(_) => f.write_str("Hget"), KvOperation::Get => f.write_str("Get"), KvOperation::Scan(_) => f.write_str("Scan"), } } } pub async fn kv_wrapper<'a, T, D, S>( store: &KVRouterStore<D>, op: KvOperation<'a, S>, partition_key: PartitionKey<'a>, ) -> CustomResult<KvResult<T>, RedisError> where T: de::DeserializeOwned, D: crate::database::store::DatabaseStore, S: serde::Serialize + Debug + KvStorePartition + UniqueConstraints + Sync, { let redis_conn = store.get_redis_conn()?; let key = format!("{}", partition_key); let type_name = std::any::type_name::<T>(); let operation = op.to_string(); let ttl = store.ttl_for_kv; let result = async { match op { KvOperation::Hset(value, sql) => { logger::debug!(kv_operation= %operation, value = ?value); redis_conn .set_hash_fields(&key.into(), value, Some(ttl.into())) .await?; store .push_to_drainer_stream::<S>(sql, partition_key) .await?; Ok(KvResult::Hset(())) } KvOperation::HGet(field) => { let result = redis_conn .get_hash_field_and_deserialize(&key.into(), field, type_name) .await?; Ok(KvResult::HGet(result)) } KvOperation::Scan(pattern) => { let result: Vec<T> = redis_conn .hscan_and_deserialize(&key.into(), pattern, None) .await .and_then(|result| { if result.is_empty() { Err(report!(RedisError::NotFound)) } else { Ok(result) } })?; Ok(KvResult::Scan(result)) } KvOperation::HSetNx(field, value, sql) => { logger::debug!(kv_operation= %operation, value = ?value); value.check_for_constraints(&redis_conn).await?; let result = redis_conn .serialize_and_set_hash_field_if_not_exist(&key.into(), field, value, Some(ttl)) .await?; if matches!(result, redis_interface::HsetnxReply::KeySet) { store .push_to_drainer_stream::<S>(sql, partition_key) .await?; Ok(KvResult::HSetNx(result)) } else { Err(report!(RedisError::SetNxFailed)) } } KvOperation::SetNx(value, sql) => { logger::debug!(kv_operation= %operation, value = ?value); let result = redis_conn .serialize_and_set_key_if_not_exist(&key.into(), value, Some(ttl.into())) .await?; value.check_for_constraints(&redis_conn).await?; if matches!(result, redis_interface::SetnxReply::KeySet) { store .push_to_drainer_stream::<S>(sql, partition_key) .await?; Ok(KvResult::SetNx(result)) } else { Err(report!(RedisError::SetNxFailed)) } } KvOperation::Get => { let result = redis_conn .get_and_deserialize_key(&key.into(), type_name) .await?; Ok(KvResult::Get(result)) } } }; let attributes = router_env::metric_attributes!(("operation", operation.clone())); result .await .inspect(|_| { logger::debug!(kv_operation= %operation, status="success"); metrics::KV_OPERATION_SUCCESSFUL.add(1, attributes); }) .inspect_err(|err| { logger::error!(kv_operation = %operation, status="error", error = ?err); metrics::KV_OPERATION_FAILED.add(1, attributes); }) } pub enum Op<'a> { Insert, Update(PartitionKey<'a>, &'a str, Option<&'a str>), Find, } impl std::fmt::Display for Op<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { Op::Insert => f.write_str("insert"), Op::Find => f.write_str("find"), Op::Update(p_key, _, updated_by) => { f.write_str(&format!("update_{} for updated_by_{:?}", p_key, updated_by)) } } } } pub async fn decide_storage_scheme<T, D>( store: &KVRouterStore<T>, storage_scheme: MerchantStorageScheme, operation: Op<'_>, ) -> MerchantStorageScheme where D: de::DeserializeOwned + serde::Serialize + Debug + KvStorePartition + UniqueConstraints + Sync, T: crate::database::store::DatabaseStore, { if store.soft_kill_mode { let ops = operation.to_string(); let updated_scheme = match operation { Op::Insert => MerchantStorageScheme::PostgresOnly, Op::Find => MerchantStorageScheme::RedisKv, Op::Update(_, _, Some("postgres_only")) => MerchantStorageScheme::PostgresOnly, Op::Update(partition_key, field, Some(_updated_by)) => { match Box::pin(kv_wrapper::<D, _, _>( store, KvOperation::<D>::HGet(field), partition_key, )) .await { Ok(_) => { metrics::KV_SOFT_KILL_ACTIVE_UPDATE.add(1, &[]); MerchantStorageScheme::RedisKv } Err(_) => MerchantStorageScheme::PostgresOnly, } } Op::Update(_, _, None) => MerchantStorageScheme::PostgresOnly, }; let type_name = std::any::type_name::<D>(); logger::info!(soft_kill_mode = "decide_storage_scheme", decided_scheme = %updated_scheme, configured_scheme = %storage_scheme,entity = %type_name, operation = %ops); updated_scheme } else { storage_scheme } } <file_sep path="hyperswitch/crates/storage_impl/src/redis/kv_store.rs" crate="storage_impl" role="use_site"> use std::{fmt::Debug, sync::Arc}; use common_utils::errors::CustomResult; use diesel_models::enums::MerchantStorageScheme; use error_stack::report; use redis_interface::errors::RedisError; use router_derive::TryGetEnumVariant; use router_env::logger; use serde::de; use crate::{kv_router_store::KVRouterStore, metrics, store::kv::TypedSql, UniqueConstraints}; pub trait KvStorePartition { fn partition_number(key: PartitionKey<'_>, num_partitions: u8) -> u32 { crc32fast::hash(key.to_string().as_bytes()) % u32::from(num_partitions) } fn shard_key(key: PartitionKey<'_>, num_partitions: u8) -> String { format!("shard_{}", Self::partition_number(key, num_partitions)) } } #[allow(unused)] #[derive(Clone)] pub enum PartitionKey<'a> { MerchantIdPaymentId { merchant_id: &'a common_utils::id_type::MerchantId, payment_id: &'a common_utils::id_type::PaymentId, }, CombinationKey { combination: &'a str, }, MerchantIdCustomerId { merchant_id: &'a common_utils::id_type::MerchantId, customer_id: &'a common_utils::id_type::CustomerId, }, #[cfg(all(feature = "v2", feature = "customer_v2"))] MerchantIdMerchantReferenceId { merchant_id: &'a common_utils::id_type::MerchantId, merchant_reference_id: &'a str, }, MerchantIdPayoutId { merchant_id: &'a common_utils::id_type::MerchantId, payout_id: &'a str, }, MerchantIdPayoutAttemptId { merchant_id: &'a common_utils::id_type::MerchantId, payout_attempt_id: &'a str, }, MerchantIdMandateId { merchant_id: &'a common_utils::id_type::MerchantId, mandate_id: &'a str, }, #[cfg(all(feature = "v2", feature = "customer_v2"))] GlobalId { id: &'a str, }, } // PartitionKey::MerchantIdPaymentId {merchant_id, payment_id} impl std::fmt::Display for PartitionKey<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match *self { PartitionKey::MerchantIdPaymentId { merchant_id, payment_id, } => f.write_str(&format!( "mid_{}_pid_{}", merchant_id.get_string_repr(), payment_id.get_string_repr() )), PartitionKey::CombinationKey { combination } => f.write_str(combination), PartitionKey::MerchantIdCustomerId { merchant_id, customer_id, } => f.write_str(&format!( "mid_{}_cust_{}", merchant_id.get_string_repr(), customer_id.get_string_repr() )), #[cfg(all(feature = "v2", feature = "customer_v2"))] PartitionKey::MerchantIdMerchantReferenceId { merchant_id, merchant_reference_id, } => f.write_str(&format!( "mid_{}_cust_{merchant_reference_id}", merchant_id.get_string_repr() )), PartitionKey::MerchantIdPayoutId { merchant_id, payout_id, } => f.write_str(&format!( "mid_{}_po_{payout_id}", merchant_id.get_string_repr() )), PartitionKey::MerchantIdPayoutAttemptId { merchant_id, payout_attempt_id, } => f.write_str(&format!( "mid_{}_poa_{payout_attempt_id}", merchant_id.get_string_repr() )), PartitionKey::MerchantIdMandateId { merchant_id, mandate_id, } => f.write_str(&format!( "mid_{}_mandate_{mandate_id}", merchant_id.get_string_repr() )), #[cfg(all(feature = "v2", feature = "customer_v2"))] PartitionKey::GlobalId { id } => f.write_str(&format!("cust_{id}",)), } } } pub trait RedisConnInterface { fn get_redis_conn( &self, ) -> error_stack::Result<Arc<redis_interface::RedisConnectionPool>, RedisError>; } /// An enum to represent what operation to do on pub enum KvOperation<'a, S: serde::Serialize + Debug> { Hset((&'a str, String), TypedSql), SetNx(&'a S, TypedSql), HSetNx(&'a str, &'a S, TypedSql), HGet(&'a str), Get, Scan(&'a str), } #[derive(TryGetEnumVariant)] #[error(RedisError::UnknownResult)] pub enum KvResult<T: de::DeserializeOwned> { HGet(T), Get(T), Hset(()), SetNx(redis_interface::SetnxReply), HSetNx(redis_interface::HsetnxReply), Scan(Vec<T>), } impl<T> std::fmt::Display for KvOperation<'_, T> where T: serde::Serialize + Debug, { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { KvOperation::Hset(_, _) => f.write_str("Hset"), KvOperation::SetNx(_, _) => f.write_str("Setnx"), KvOperation::HSetNx(_, _, _) => f.write_str("HSetNx"), KvOperation::HGet(_) => f.write_str("Hget"), KvOperation::Get => f.write_str("Get"), KvOperation::Scan(_) => f.write_str("Scan"), } } } pub async fn kv_wrapper<'a, T, D, S>( store: &KVRouterStore<D>, op: KvOperation<'a, S>, partition_key: PartitionKey<'a>, ) -> CustomResult<KvResult<T>, RedisError> where T: de::DeserializeOwned, D: crate::database::store::DatabaseStore, S: serde::Serialize + Debug + KvStorePartition + UniqueConstraints + Sync, { let redis_conn = store.get_redis_conn()?; let key = format!("{}", partition_key); let type_name = std::any::type_name::<T>(); let operation = op.to_string(); let ttl = store.ttl_for_kv; let result = async { match op { KvOperation::Hset(value, sql) => { logger::debug!(kv_operation= %operation, value = ?value); redis_conn .set_hash_fields(&key.into(), value, Some(ttl.into())) .await?; store .push_to_drainer_stream::<S>(sql, partition_key) .await?; Ok(KvResult::Hset(())) } KvOperation::HGet(field) => { let result = redis_conn .get_hash_field_and_deserialize(&key.into(), field, type_name) .await?; Ok(KvResult::HGet(result)) } KvOperation::Scan(pattern) => { let result: Vec<T> = redis_conn .hscan_and_deserialize(&key.into(), pattern, None) .await .and_then(|result| { if result.is_empty() { Err(report!(RedisError::NotFound)) } else { Ok(result) } })?; Ok(KvResult::Scan(result)) } KvOperation::HSetNx(field, value, sql) => { logger::debug!(kv_operation= %operation, value = ?value); value.check_for_constraints(&redis_conn).await?; let result = redis_conn .serialize_and_set_hash_field_if_not_exist(&key.into(), field, value, Some(ttl)) .await?; if matches!(result, redis_interface::HsetnxReply::KeySet) { store .push_to_drainer_stream::<S>(sql, partition_key) .await?; Ok(KvResult::HSetNx(result)) } else { Err(report!(RedisError::SetNxFailed)) } } KvOperation::SetNx(value, sql) => { logger::debug!(kv_operation= %operation, value = ?value); let result = redis_conn .serialize_and_set_key_if_not_exist(&key.into(), value, Some(ttl.into())) .await?; value.check_for_constraints(&redis_conn).await?; if matches!(result, redis_interface::SetnxReply::KeySet) { store .push_to_drainer_stream::<S>(sql, partition_key) .await?; Ok(KvResult::SetNx(result)) } else { Err(report!(RedisError::SetNxFailed)) } } KvOperation::Get => { let result = redis_conn .get_and_deserialize_key(&key.into(), type_name) .await?; Ok(KvResult::Get(result)) } } }; let attributes = router_env::metric_attributes!(("operation", operation.clone())); result .await .inspect(|_| { logger::debug!(kv_operation= %operation, status="success"); metrics::KV_OPERATION_SUCCESSFUL.add(1, attributes); }) .inspect_err(|err| { logger::error!(kv_operation = %operation, status="error", error = ?err); metrics::KV_OPERATION_FAILED.add(1, attributes); }) } pub enum Op<'a> { Insert, Update(PartitionKey<'a>, &'a str, Option<&'a str>), Find, } impl std::fmt::Display for Op<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { Op::Insert => f.write_str("insert"), Op::Find => f.write_str("find"), Op::Update(p_key, _, updated_by) => { f.write_str(&format!("update_{} for updated_by_{:?}", p_key, updated_by)) } } } } pub async fn decide_storage_scheme<T, D>( store: &KVRouterStore<T>, storage_scheme: MerchantStorageScheme, operation: Op<'_>, ) -> MerchantStorageScheme where D: de::DeserializeOwned + serde::Serialize + Debug + KvStorePartition + UniqueConstraints + Sync, T: crate::database::store::DatabaseStore, { if store.soft_kill_mode { let ops = operation.to_string(); let updated_scheme = match operation { Op::Insert => MerchantStorageScheme::PostgresOnly, Op::Find => MerchantStorageScheme::RedisKv, Op::Update(_, _, Some("postgres_only")) => MerchantStorageScheme::PostgresOnly, Op::Update(partition_key, field, Some(_updated_by)) => { match Box::pin(kv_wrapper::<D, _, _>( store, KvOperation::<D>::HGet(field), partition_key, )) .await { Ok(_) => { metrics::KV_SOFT_KILL_ACTIVE_UPDATE.add(1, &[]); MerchantStorageScheme::RedisKv } Err(_) => MerchantStorageScheme::PostgresOnly, } } Op::Update(_, _, None) => MerchantStorageScheme::PostgresOnly, }; let type_name = std::any::type_name::<D>(); logger::info!(soft_kill_mode = "decide_storage_scheme", decided_scheme = %updated_scheme, configured_scheme = %storage_scheme,entity = %type_name, operation = %ops); updated_scheme } else { storage_scheme } } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/router_derive/src/lib.rs<|crate|> storage_impl macro=TryGetEnumVariant roles=use_site,macro_def use=derive item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub fn try_get_enum_variant(input: proc_macro::TokenStream) -> proc_macro::TokenStream { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> <|fim_prefix|> pub fn try_get_enum_variant(input: proc_macro::TokenStream) -> proc_macro::TokenStream { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> pub fn try_get_enum_variant(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input = syn::parse_macro_input!(input as syn::DeriveInput); macros::try_get_enum::try_get_enum_variant(input) .unwrap_or_else(|error| error.into_compile_error()) .into() } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> pub fn try_get_enum_variant(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input = syn::parse_macro_input!(input as syn::DeriveInput); macros::try_get_enum::try_get_enum_variant(input) .unwrap_or_else(|error| error.into_compile_error()) .into() } <file_sep path="hyperswitch/crates/storage_impl/src/redis/kv_store.rs" crate="storage_impl" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/router_derive/src/lib.rs<|crate|> storage_impl macro=TryGetEnumVariant roles=macro_def,use_site use=derive item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub enum PartitionKey<'a> { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/storage_impl/src/redis/kv_store.rs" crate="storage_impl" role="use_site"> <|fim_prefix|> pub enum PartitionKey<'a> { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<|meta_start|><|file|> hyperswitch/crates/router_derive/src/lib.rs<|crate|> hyperswitch_domain_models macro=TryGetEnumVariant roles=use_site,macro_def use=derive item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> <file_sep path="hyperswitch/crates/hyperswitch_domain_models/src/type_encryption.rs" crate="hyperswitch_domain_models" role="use_site"> use async_trait::async_trait; use common_utils::{ crypto, encryption::Encryption, errors::{self, CustomResult}, ext_traits::AsyncExt, metrics::utils::record_operation_time, types::keymanager::{Identifier, KeyManagerState}, }; use encrypt::TypeEncryption; use masking::Secret; use router_env::{instrument, tracing}; use rustc_hash::FxHashMap; mod encrypt { use async_trait::async_trait; use common_utils::{ crypto, encryption::Encryption, errors::{self, CustomResult}, ext_traits::ByteSliceExt, keymanager::call_encryption_service, transformers::{ForeignFrom, ForeignTryFrom}, types::keymanager::{ BatchDecryptDataResponse, BatchEncryptDataRequest, BatchEncryptDataResponse, DecryptDataResponse, EncryptDataRequest, EncryptDataResponse, Identifier, KeyManagerState, TransientBatchDecryptDataRequest, TransientDecryptDataRequest, }, }; use error_stack::ResultExt; use http::Method; use masking::{PeekInterface, Secret}; use router_env::{instrument, logger, tracing}; use rustc_hash::FxHashMap; use super::{metrics, EncryptedJsonType}; #[async_trait] pub trait TypeEncryption< T, V: crypto::EncodeMessage + crypto::DecodeMessage, S: masking::Strategy<T>, >: Sized { async fn encrypt_via_api( state: &KeyManagerState, masked_data: Secret<T, S>, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError>; async fn decrypt_via_api( state: &KeyManagerState, encrypted_data: Encryption, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError>; async fn encrypt( masked_data: Secret<T, S>, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError>; async fn decrypt( encrypted_data: Encryption, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError>; async fn batch_encrypt_via_api( state: &KeyManagerState, masked_data: FxHashMap<String, Secret<T, S>>, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError>; async fn batch_decrypt_via_api( state: &KeyManagerState, encrypted_data: FxHashMap<String, Encryption>, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError>; async fn batch_encrypt( masked_data: FxHashMap<String, Secret<T, S>>, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError>; async fn batch_decrypt( encrypted_data: FxHashMap<String, Encryption>, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError>; } fn is_encryption_service_enabled(_state: &KeyManagerState) -> bool { #[cfg(feature = "encryption_service")] { _state.enabled } #[cfg(not(feature = "encryption_service"))] { false } } #[async_trait] impl< V: crypto::DecodeMessage + crypto::EncodeMessage + Send + 'static, S: masking::Strategy<String> + Send + Sync, > TypeEncryption<String, V, S> for crypto::Encryptable<Secret<String, S>> { // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn encrypt_via_api( state: &KeyManagerState, masked_data: Secret<String, S>, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError> { // If encryption service is not enabled, fall back to application encryption or else call encryption service if !is_encryption_service_enabled(state) { Self::encrypt(masked_data, key, crypt_algo).await } else { let result: Result< EncryptDataResponse, error_stack::Report<errors::KeyManagerClientError>, > = call_encryption_service( state, Method::POST, "data/encrypt", EncryptDataRequest::from((masked_data.clone(), identifier)), ) .await; match result { Ok(response) => Ok(ForeignFrom::foreign_from((masked_data.clone(), response))), Err(err) => { logger::error!("Encryption error {:?}", err); metrics::ENCRYPTION_API_FAILURES.add(1, &[]); logger::info!("Fall back to Application Encryption"); Self::encrypt(masked_data, key, crypt_algo).await } } } } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn decrypt_via_api( state: &KeyManagerState, encrypted_data: Encryption, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError> { // If encryption service is not enabled, fall back to application encryption or else call encryption service if !is_encryption_service_enabled(state) { Self::decrypt(encrypted_data, key, crypt_algo).await } else { let result: Result< DecryptDataResponse, error_stack::Report<errors::KeyManagerClientError>, > = call_encryption_service( state, Method::POST, "data/decrypt", TransientDecryptDataRequest::from((encrypted_data.clone(), identifier)), ) .await; let decrypted = match result { Ok(decrypted_data) => { ForeignTryFrom::foreign_try_from((encrypted_data.clone(), decrypted_data)) } Err(err) => { logger::error!("Decryption error {:?}", err); Err(err.change_context(errors::CryptoError::DecodingFailed)) } }; match decrypted { Ok(de) => Ok(de), Err(_) => { metrics::DECRYPTION_API_FAILURES.add(1, &[]); logger::info!("Fall back to Application Decryption"); Self::decrypt(encrypted_data, key, crypt_algo).await } } } } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn encrypt( masked_data: Secret<String, S>, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError> { metrics::APPLICATION_ENCRYPTION_COUNT.add(1, &[]); let encrypted_data = crypt_algo.encode_message(key, masked_data.peek().as_bytes())?; Ok(Self::new(masked_data, encrypted_data.into())) } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn decrypt( encrypted_data: Encryption, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError> { metrics::APPLICATION_DECRYPTION_COUNT.add(1, &[]); let encrypted = encrypted_data.into_inner(); let data = crypt_algo.decode_message(key, encrypted.clone())?; let value: String = std::str::from_utf8(&data) .change_context(errors::CryptoError::DecodingFailed)? .to_string(); Ok(Self::new(value.into(), encrypted)) } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn batch_encrypt_via_api( state: &KeyManagerState, masked_data: FxHashMap<String, Secret<String, S>>, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError> { // If encryption service is not enabled, fall back to application encryption or else call encryption service if !is_encryption_service_enabled(state) { Self::batch_encrypt(masked_data, key, crypt_algo).await } else { let result: Result< BatchEncryptDataResponse, error_stack::Report<errors::KeyManagerClientError>, > = call_encryption_service( state, Method::POST, "data/encrypt", BatchEncryptDataRequest::from((masked_data.clone(), identifier)), ) .await; match result { Ok(response) => Ok(ForeignFrom::foreign_from((masked_data, response))), Err(err) => { metrics::ENCRYPTION_API_FAILURES.add(1, &[]); logger::error!("Encryption error {:?}", err); logger::info!("Fall back to Application Encryption"); Self::batch_encrypt(masked_data, key, crypt_algo).await } } } } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn batch_decrypt_via_api( state: &KeyManagerState, encrypted_data: FxHashMap<String, Encryption>, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError> { // If encryption service is not enabled, fall back to application encryption or else call encryption service if !is_encryption_service_enabled(state) { Self::batch_decrypt(encrypted_data, key, crypt_algo).await } else { let result: Result< BatchDecryptDataResponse, error_stack::Report<errors::KeyManagerClientError>, > = call_encryption_service( state, Method::POST, "data/decrypt", TransientBatchDecryptDataRequest::from((encrypted_data.clone(), identifier)), ) .await; let decrypted = match result { Ok(decrypted_data) => { ForeignTryFrom::foreign_try_from((encrypted_data.clone(), decrypted_data)) } Err(err) => { logger::error!("Decryption error {:?}", err); Err(err.change_context(errors::CryptoError::DecodingFailed)) } }; match decrypted { Ok(de) => Ok(de), Err(_) => { metrics::DECRYPTION_API_FAILURES.add(1, &[]); logger::info!("Fall back to Application Decryption"); Self::batch_decrypt(encrypted_data, key, crypt_algo).await } } } } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn batch_encrypt( masked_data: FxHashMap<String, Secret<String, S>>, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError> { metrics::APPLICATION_ENCRYPTION_COUNT.add(1, &[]); masked_data .into_iter() .map(|(k, v)| { Ok(( k, Self::new( v.clone(), crypt_algo.encode_message(key, v.peek().as_bytes())?.into(), ), )) }) .collect() } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn batch_decrypt( encrypted_data: FxHashMap<String, Encryption>, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError> { metrics::APPLICATION_DECRYPTION_COUNT.add(1, &[]); encrypted_data .into_iter() .map(|(k, v)| { let data = crypt_algo.decode_message(key, v.clone().into_inner())?; let value: String = std::str::from_utf8(&data) .change_context(errors::CryptoError::DecodingFailed)? .to_string(); Ok((k, Self::new(value.into(), v.into_inner()))) }) .collect() } } #[async_trait] impl< V: crypto::DecodeMessage + crypto::EncodeMessage + Send + 'static, S: masking::Strategy<serde_json::Value> + Send + Sync, > TypeEncryption<serde_json::Value, V, S> for crypto::Encryptable<Secret<serde_json::Value, S>> { // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn encrypt_via_api( state: &KeyManagerState, masked_data: Secret<serde_json::Value, S>, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError> { // If encryption service is not enabled, fall back to application encryption or else call encryption service if !is_encryption_service_enabled(state) { Self::encrypt(masked_data, key, crypt_algo).await } else { let result: Result< EncryptDataResponse, error_stack::Report<errors::KeyManagerClientError>, > = call_encryption_service( state, Method::POST, "data/encrypt", EncryptDataRequest::from((masked_data.clone(), identifier)), ) .await; match result { Ok(response) => Ok(ForeignFrom::foreign_from((masked_data.clone(), response))), Err(err) => { logger::error!("Encryption error {:?}", err); metrics::ENCRYPTION_API_FAILURES.add(1, &[]); logger::info!("Fall back to Application Encryption"); Self::encrypt(masked_data, key, crypt_algo).await } } } } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn decrypt_via_api( state: &KeyManagerState, encrypted_data: Encryption, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError> { // If encryption service is not enabled, fall back to application encryption or else call encryption service if !is_encryption_service_enabled(state) { Self::decrypt(encrypted_data, key, crypt_algo).await } else { let result: Result< DecryptDataResponse, error_stack::Report<errors::KeyManagerClientError>, > = call_encryption_service( state, Method::POST, "data/decrypt", TransientDecryptDataRequest::from((encrypted_data.clone(), identifier)), ) .await; let decrypted = match result { Ok(decrypted_data) => { ForeignTryFrom::foreign_try_from((encrypted_data.clone(), decrypted_data)) } Err(err) => { logger::error!("Decryption error {:?}", err); Err(err.change_context(errors::CryptoError::EncodingFailed)) } }; match decrypted { Ok(de) => Ok(de), Err(_) => { metrics::DECRYPTION_API_FAILURES.add(1, &[]); logger::info!("Fall back to Application Decryption"); Self::decrypt(encrypted_data, key, crypt_algo).await } } } } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn encrypt( masked_data: Secret<serde_json::Value, S>, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError> { metrics::APPLICATION_ENCRYPTION_COUNT.add(1, &[]); let data = serde_json::to_vec(&masked_data.peek()) .change_context(errors::CryptoError::DecodingFailed)?; let encrypted_data = crypt_algo.encode_message(key, &data)?; Ok(Self::new(masked_data, encrypted_data.into())) } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn decrypt( encrypted_data: Encryption, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError> { metrics::APPLICATION_DECRYPTION_COUNT.add(1, &[]); let encrypted = encrypted_data.into_inner(); let data = crypt_algo.decode_message(key, encrypted.clone())?; let value: serde_json::Value = serde_json::from_slice(&data) .change_context(errors::CryptoError::DecodingFailed)?; Ok(Self::new(value.into(), encrypted)) } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn batch_encrypt_via_api( state: &KeyManagerState, masked_data: FxHashMap<String, Secret<serde_json::Value, S>>, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError> { // If encryption service is not enabled, fall back to application encryption or else call encryption service if !is_encryption_service_enabled(state) { Self::batch_encrypt(masked_data, key, crypt_algo).await } else { let result: Result< BatchEncryptDataResponse, error_stack::Report<errors::KeyManagerClientError>, > = call_encryption_service( state, Method::POST, "data/encrypt", BatchEncryptDataRequest::from((masked_data.clone(), identifier)), ) .await; match result { Ok(response) => Ok(ForeignFrom::foreign_from((masked_data, response))), Err(err) => { metrics::ENCRYPTION_API_FAILURES.add(1, &[]); logger::error!("Encryption error {:?}", err); logger::info!("Fall back to Application Encryption"); Self::batch_encrypt(masked_data, key, crypt_algo).await } } } } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn batch_decrypt_via_api( state: &KeyManagerState, encrypted_data: FxHashMap<String, Encryption>, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError> { // If encryption service is not enabled, fall back to application encryption or else call encryption service if !is_encryption_service_enabled(state) { Self::batch_decrypt(encrypted_data, key, crypt_algo).await } else { let result: Result< BatchDecryptDataResponse, error_stack::Report<errors::KeyManagerClientError>, > = call_encryption_service( state, Method::POST, "data/decrypt", TransientBatchDecryptDataRequest::from((encrypted_data.clone(), identifier)), ) .await; let decrypted = match result { Ok(decrypted_data) => { ForeignTryFrom::foreign_try_from((encrypted_data.clone(), decrypted_data)) } Err(err) => { logger::error!("Decryption error {:?}", err); Err(err.change_context(errors::CryptoError::DecodingFailed)) } }; match decrypted { Ok(de) => Ok(de), Err(_) => { metrics::DECRYPTION_API_FAILURES.add(1, &[]); logger::info!("Fall back to Application Decryption"); Self::batch_decrypt(encrypted_data, key, crypt_algo).await } } } } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn batch_encrypt( masked_data: FxHashMap<String, Secret<serde_json::Value, S>>, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError> { metrics::APPLICATION_ENCRYPTION_COUNT.add(1, &[]); masked_data .into_iter() .map(|(k, v)| { let data = serde_json::to_vec(v.peek()) .change_context(errors::CryptoError::DecodingFailed)?; Ok(( k, Self::new(v, crypt_algo.encode_message(key, &data)?.into()), )) }) .collect() } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn batch_decrypt( encrypted_data: FxHashMap<String, Encryption>, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError> { metrics::APPLICATION_DECRYPTION_COUNT.add(1, &[]); encrypted_data .into_iter() .map(|(k, v)| { let data = crypt_algo.decode_message(key, v.clone().into_inner().clone())?; let value: serde_json::Value = serde_json::from_slice(&data) .change_context(errors::CryptoError::DecodingFailed)?; Ok((k, Self::new(value.into(), v.into_inner()))) }) .collect() } } impl<T> EncryptedJsonType<T> where T: std::fmt::Debug + Clone + serde::Serialize + serde::de::DeserializeOwned, { fn serialize_json_bytes(&self) -> CustomResult<Secret<Vec<u8>>, errors::CryptoError> { common_utils::ext_traits::Encode::encode_to_vec(self.inner()) .change_context(errors::CryptoError::EncodingFailed) .attach_printable("Failed to JSON serialize data before encryption") .map(Secret::new) } fn deserialize_json_bytes<S>( bytes: Secret<Vec<u8>>, ) -> CustomResult<Secret<Self, S>, errors::ParsingError> where S: masking::Strategy<Self>, { bytes .peek() .as_slice() .parse_struct::<T>(std::any::type_name::<T>()) .map(|result| Secret::new(Self::from(result))) .attach_printable("Failed to JSON deserialize data after decryption") } } #[async_trait] impl< T: std::fmt::Debug + Clone + serde::Serialize + serde::de::DeserializeOwned + Send, V: crypto::DecodeMessage + crypto::EncodeMessage + Send + 'static, S: masking::Strategy<EncryptedJsonType<T>> + Send + Sync, > TypeEncryption<EncryptedJsonType<T>, V, S> for crypto::Encryptable<Secret<EncryptedJsonType<T>, S>> { // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn encrypt_via_api( state: &KeyManagerState, masked_data: Secret<EncryptedJsonType<T>, S>, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError> { let data_bytes = EncryptedJsonType::serialize_json_bytes(masked_data.peek())?; let result: crypto::Encryptable<Secret<Vec<u8>>> = TypeEncryption::encrypt_via_api(state, data_bytes, identifier, key, crypt_algo) .await?; Ok(Self::new(masked_data, result.into_encrypted())) } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn decrypt_via_api( state: &KeyManagerState, encrypted_data: Encryption, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError> { let result: crypto::Encryptable<Secret<Vec<u8>>> = TypeEncryption::decrypt_via_api(state, encrypted_data, identifier, key, crypt_algo) .await?; result .deserialize_inner_value(EncryptedJsonType::deserialize_json_bytes) .change_context(errors::CryptoError::DecodingFailed) } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn encrypt( masked_data: Secret<EncryptedJsonType<T>, S>, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError> { let data_bytes = EncryptedJsonType::serialize_json_bytes(masked_data.peek())?; let result: crypto::Encryptable<Secret<Vec<u8>>> = TypeEncryption::encrypt(data_bytes, key, crypt_algo).await?; Ok(Self::new(masked_data, result.into_encrypted())) } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn decrypt( encrypted_data: Encryption, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError> { let result: crypto::Encryptable<Secret<Vec<u8>>> = TypeEncryption::decrypt(encrypted_data, key, crypt_algo).await?; result .deserialize_inner_value(EncryptedJsonType::deserialize_json_bytes) .change_context(errors::CryptoError::DecodingFailed) } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn batch_encrypt_via_api( state: &KeyManagerState, masked_data: FxHashMap<String, Secret<EncryptedJsonType<T>, S>>, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError> { let hashmap_capacity = masked_data.len(); let data_bytes = masked_data.iter().try_fold( FxHashMap::with_capacity_and_hasher(hashmap_capacity, Default::default()), |mut map, (key, value)| { let value_bytes = EncryptedJsonType::serialize_json_bytes(value.peek())?; map.insert(key.to_owned(), value_bytes); Ok::<_, error_stack::Report<errors::CryptoError>>(map) }, )?; let result: FxHashMap<String, crypto::Encryptable<Secret<Vec<u8>>>> = TypeEncryption::batch_encrypt_via_api( state, data_bytes, identifier, key, crypt_algo, ) .await?; let result_hashmap = result.into_iter().try_fold( FxHashMap::with_capacity_and_hasher(hashmap_capacity, Default::default()), |mut map, (key, value)| { let original_value = masked_data .get(&key) .ok_or(errors::CryptoError::EncodingFailed) .attach_printable_lazy(|| { format!("Failed to find {key} in input hashmap") })?; map.insert( key, Self::new(original_value.clone(), value.into_encrypted()), ); Ok::<_, error_stack::Report<errors::CryptoError>>(map) }, )?; Ok(result_hashmap) } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn batch_decrypt_via_api( state: &KeyManagerState, encrypted_data: FxHashMap<String, Encryption>, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError> { let result: FxHashMap<String, crypto::Encryptable<Secret<Vec<u8>>>> = TypeEncryption::batch_decrypt_via_api( state, encrypted_data, identifier, key, crypt_algo, ) .await?; let hashmap_capacity = result.len(); let result_hashmap = result.into_iter().try_fold( FxHashMap::with_capacity_and_hasher(hashmap_capacity, Default::default()), |mut map, (key, value)| { let deserialized_value = value .deserialize_inner_value(EncryptedJsonType::deserialize_json_bytes) .change_context(errors::CryptoError::DecodingFailed)?; map.insert(key, deserialized_value); Ok::<_, error_stack::Report<errors::CryptoError>>(map) }, )?; Ok(result_hashmap) } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn batch_encrypt( masked_data: FxHashMap<String, Secret<EncryptedJsonType<T>, S>>, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError> { let hashmap_capacity = masked_data.len(); let data_bytes = masked_data.iter().try_fold( FxHashMap::with_capacity_and_hasher(hashmap_capacity, Default::default()), |mut map, (key, value)| { let value_bytes = EncryptedJsonType::serialize_json_bytes(value.peek())?; map.insert(key.to_owned(), value_bytes); Ok::<_, error_stack::Report<errors::CryptoError>>(map) }, )?; let result: FxHashMap<String, crypto::Encryptable<Secret<Vec<u8>>>> = TypeEncryption::batch_encrypt(data_bytes, key, crypt_algo).await?; let result_hashmap = result.into_iter().try_fold( FxHashMap::with_capacity_and_hasher(hashmap_capacity, Default::default()), |mut map, (key, value)| { let original_value = masked_data .get(&key) .ok_or(errors::CryptoError::EncodingFailed) .attach_printable_lazy(|| { format!("Failed to find {key} in input hashmap") })?; map.insert( key, Self::new(original_value.clone(), value.into_encrypted()), ); Ok::<_, error_stack::Report<errors::CryptoError>>(map) }, )?; Ok(result_hashmap) } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn batch_decrypt( encrypted_data: FxHashMap<String, Encryption>, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError> { let result: FxHashMap<String, crypto::Encryptable<Secret<Vec<u8>>>> = TypeEncryption::batch_decrypt(encrypted_data, key, crypt_algo).await?; let hashmap_capacity = result.len(); let result_hashmap = result.into_iter().try_fold( FxHashMap::with_capacity_and_hasher(hashmap_capacity, Default::default()), |mut map, (key, value)| { let deserialized_value = value .deserialize_inner_value(EncryptedJsonType::deserialize_json_bytes) .change_context(errors::CryptoError::DecodingFailed)?; map.insert(key, deserialized_value); Ok::<_, error_stack::Report<errors::CryptoError>>(map) }, )?; Ok(result_hashmap) } } #[async_trait] impl< V: crypto::DecodeMessage + crypto::EncodeMessage + Send + 'static, S: masking::Strategy<Vec<u8>> + Send + Sync, > TypeEncryption<Vec<u8>, V, S> for crypto::Encryptable<Secret<Vec<u8>, S>> { // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn encrypt_via_api( state: &KeyManagerState, masked_data: Secret<Vec<u8>, S>, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError> { // If encryption service is not enabled, fall back to application encryption or else call encryption service if !is_encryption_service_enabled(state) { Self::encrypt(masked_data, key, crypt_algo).await } else { let result: Result< EncryptDataResponse, error_stack::Report<errors::KeyManagerClientError>, > = call_encryption_service( state, Method::POST, "data/encrypt", EncryptDataRequest::from((masked_data.clone(), identifier)), ) .await; match result { Ok(response) => Ok(ForeignFrom::foreign_from((masked_data.clone(), response))), Err(err) => { logger::error!("Encryption error {:?}", err); metrics::ENCRYPTION_API_FAILURES.add(1, &[]); logger::info!("Fall back to Application Encryption"); Self::encrypt(masked_data, key, crypt_algo).await } } } } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn decrypt_via_api( state: &KeyManagerState, encrypted_data: Encryption, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError> { // If encryption service is not enabled, fall back to application encryption or else call encryption service if !is_encryption_service_enabled(state) { Self::decrypt(encrypted_data, key, crypt_algo).await } else { let result: Result< DecryptDataResponse, error_stack::Report<errors::KeyManagerClientError>, > = call_encryption_service( state, Method::POST, "data/decrypt", TransientDecryptDataRequest::from((encrypted_data.clone(), identifier)), ) .await; let decrypted = match result { Ok(decrypted_data) => { ForeignTryFrom::foreign_try_from((encrypted_data.clone(), decrypted_data)) } Err(err) => { logger::error!("Decryption error {:?}", err); Err(err.change_context(errors::CryptoError::DecodingFailed)) } }; match decrypted { Ok(de) => Ok(de), Err(_) => { metrics::DECRYPTION_API_FAILURES.add(1, &[]); logger::info!("Fall back to Application Decryption"); Self::decrypt(encrypted_data, key, crypt_algo).await } } } } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn encrypt( masked_data: Secret<Vec<u8>, S>, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError> { metrics::APPLICATION_ENCRYPTION_COUNT.add(1, &[]); let encrypted_data = crypt_algo.encode_message(key, masked_data.peek())?; Ok(Self::new(masked_data, encrypted_data.into())) } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn decrypt( encrypted_data: Encryption, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError> { metrics::APPLICATION_DECRYPTION_COUNT.add(1, &[]); let encrypted = encrypted_data.into_inner(); let data = crypt_algo.decode_message(key, encrypted.clone())?; Ok(Self::new(data.into(), encrypted)) } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn batch_encrypt_via_api( state: &KeyManagerState, masked_data: FxHashMap<String, Secret<Vec<u8>, S>>, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError> { // If encryption service is not enabled, fall back to application encryption or else call encryption service if !is_encryption_service_enabled(state) { Self::batch_encrypt(masked_data, key, crypt_algo).await } else { let result: Result< BatchEncryptDataResponse, error_stack::Report<errors::KeyManagerClientError>, > = call_encryption_service( state, Method::POST, "data/encrypt", BatchEncryptDataRequest::from((masked_data.clone(), identifier)), ) .await; match result { Ok(response) => Ok(ForeignFrom::foreign_from((masked_data, response))), Err(err) => { metrics::ENCRYPTION_API_FAILURES.add(1, &[]); logger::error!("Encryption error {:?}", err); logger::info!("Fall back to Application Encryption"); Self::batch_encrypt(masked_data, key, crypt_algo).await } } } } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn batch_decrypt_via_api( state: &KeyManagerState, encrypted_data: FxHashMap<String, Encryption>, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError> { // If encryption service is not enabled, fall back to application encryption or else call encryption service if !is_encryption_service_enabled(state) { Self::batch_decrypt(encrypted_data, key, crypt_algo).await } else { let result: Result< BatchDecryptDataResponse, error_stack::Report<errors::KeyManagerClientError>, > = call_encryption_service( state, Method::POST, "data/decrypt", TransientBatchDecryptDataRequest::from((encrypted_data.clone(), identifier)), ) .await; let decrypted = match result { Ok(response) => { ForeignTryFrom::foreign_try_from((encrypted_data.clone(), response)) } Err(err) => { logger::error!("Decryption error {:?}", err); Err(err.change_context(errors::CryptoError::DecodingFailed)) } }; match decrypted { Ok(de) => Ok(de), Err(_) => { metrics::DECRYPTION_API_FAILURES.add(1, &[]); logger::info!("Fall back to Application Decryption"); Self::batch_decrypt(encrypted_data, key, crypt_algo).await } } } } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn batch_encrypt( masked_data: FxHashMap<String, Secret<Vec<u8>, S>>, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError> { metrics::APPLICATION_ENCRYPTION_COUNT.add(1, &[]); masked_data .into_iter() .map(|(k, v)| { Ok(( k, Self::new(v.clone(), crypt_algo.encode_message(key, v.peek())?.into()), )) }) .collect() } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn batch_decrypt( encrypted_data: FxHashMap<String, Encryption>, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError> { metrics::APPLICATION_DECRYPTION_COUNT.add(1, &[]); encrypted_data .into_iter() .map(|(k, v)| { Ok(( k, Self::new( crypt_algo .decode_message(key, v.clone().into_inner().clone())? .into(), v.into_inner(), ), )) }) .collect() } } } #[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] pub struct EncryptedJsonType<T>(T); impl<T> EncryptedJsonType<T> { pub fn inner(&self) -> &T { &self.0 } pub fn into_inner(self) -> T { self.0 } } impl<T> From<T> for EncryptedJsonType<T> { fn from(value: T) -> Self { Self(value) } } impl<T> std::ops::Deref for EncryptedJsonType<T> { type Target = T; fn deref(&self) -> &Self::Target { self.inner() } } /// Type alias for `Option<Encryptable<Secret<EncryptedJsonType<T>>>>` pub type OptionalEncryptableJsonType<T> = Option<crypto::Encryptable<Secret<EncryptedJsonType<T>>>>; pub trait Lift<U> { type SelfWrapper<T>; type OtherWrapper<T, E>; fn lift<Func, E, V>(self, func: Func) -> Self::OtherWrapper<V, E> where Func: Fn(Self::SelfWrapper<U>) -> Self::OtherWrapper<V, E>; } impl<U> Lift<U> for Option<U> { type SelfWrapper<T> = Option<T>; type OtherWrapper<T, E> = CustomResult<Option<T>, E>; fn lift<Func, E, V>(self, func: Func) -> Self::OtherWrapper<V, E> where Func: Fn(Self::SelfWrapper<U>) -> Self::OtherWrapper<V, E>, { func(self) } } #[async_trait] pub trait AsyncLift<U> { type SelfWrapper<T>; type OtherWrapper<T, E>; async fn async_lift<Func, F, E, V>(self, func: Func) -> Self::OtherWrapper<V, E> where Func: Fn(Self::SelfWrapper<U>) -> F + Send + Sync, F: futures::Future<Output = Self::OtherWrapper<V, E>> + Send; } #[async_trait] impl<U, V: Lift<U> + Lift<U, SelfWrapper<U> = V> + Send> AsyncLift<U> for V { type SelfWrapper<T> = <V as Lift<U>>::SelfWrapper<T>; type OtherWrapper<T, E> = <V as Lift<U>>::OtherWrapper<T, E>; async fn async_lift<Func, F, E, W>(self, func: Func) -> Self::OtherWrapper<W, E> where Func: Fn(Self::SelfWrapper<U>) -> F + Send + Sync, F: futures::Future<Output = Self::OtherWrapper<W, E>> + Send, { func(self).await } } #[inline] async fn encrypt<E: Clone, S>( state: &KeyManagerState, inner: Secret<E, S>, identifier: Identifier, key: &[u8], ) -> CustomResult<crypto::Encryptable<Secret<E, S>>, CryptoError> where S: masking::Strategy<E>, crypto::Encryptable<Secret<E, S>>: TypeEncryption<E, crypto::GcmAes256, S>, { record_operation_time( crypto::Encryptable::encrypt_via_api(state, inner, identifier, key, crypto::GcmAes256), &metrics::ENCRYPTION_TIME, &[], ) .await } #[inline] async fn batch_encrypt<E: Clone, S>( state: &KeyManagerState, inner: FxHashMap<String, Secret<E, S>>, identifier: Identifier, key: &[u8], ) -> CustomResult<FxHashMap<String, crypto::Encryptable<Secret<E, S>>>, CryptoError> where S: masking::Strategy<E>, crypto::Encryptable<Secret<E, S>>: TypeEncryption<E, crypto::GcmAes256, S>, { if !inner.is_empty() { record_operation_time( crypto::Encryptable::batch_encrypt_via_api( state, inner, identifier, key, crypto::GcmAes256, ), &metrics::ENCRYPTION_TIME, &[], ) .await } else { Ok(FxHashMap::default()) } } #[inline] async fn encrypt_optional<E: Clone, S>( state: &KeyManagerState, inner: Option<Secret<E, S>>, identifier: Identifier, key: &[u8], ) -> CustomResult<Option<crypto::Encryptable<Secret<E, S>>>, CryptoError> where Secret<E, S>: Send, S: masking::Strategy<E>, crypto::Encryptable<Secret<E, S>>: TypeEncryption<E, crypto::GcmAes256, S>, { inner .async_map(|f| encrypt(state, f, identifier, key)) .await .transpose() } #[inline] async fn decrypt_optional<T: Clone, S: masking::Strategy<T>>( state: &KeyManagerState, inner: Option<Encryption>, identifier: Identifier, key: &[u8], ) -> CustomResult<Option<crypto::Encryptable<Secret<T, S>>>, CryptoError> where crypto::Encryptable<Secret<T, S>>: TypeEncryption<T, crypto::GcmAes256, S>, { inner .async_map(|item| decrypt(state, item, identifier, key)) .await .transpose() } #[inline] async fn decrypt<T: Clone, S: masking::Strategy<T>>( state: &KeyManagerState, inner: Encryption, identifier: Identifier, key: &[u8], ) -> CustomResult<crypto::Encryptable<Secret<T, S>>, CryptoError> where crypto::Encryptable<Secret<T, S>>: TypeEncryption<T, crypto::GcmAes256, S>, { record_operation_time( crypto::Encryptable::decrypt_via_api(state, inner, identifier, key, crypto::GcmAes256), &metrics::DECRYPTION_TIME, &[], ) .await } #[inline] async fn batch_decrypt<E: Clone, S>( state: &KeyManagerState, inner: FxHashMap<String, Encryption>, identifier: Identifier, key: &[u8], ) -> CustomResult<FxHashMap<String, crypto::Encryptable<Secret<E, S>>>, CryptoError> where S: masking::Strategy<E>, crypto::Encryptable<Secret<E, S>>: TypeEncryption<E, crypto::GcmAes256, S>, { if !inner.is_empty() { record_operation_time( crypto::Encryptable::batch_decrypt_via_api( state, inner, identifier, key, crypto::GcmAes256, ), &metrics::ENCRYPTION_TIME, &[], ) .await } else { Ok(FxHashMap::default()) } } pub enum CryptoOperation<T: Clone, S: masking::Strategy<T>> { Encrypt(Secret<T, S>), EncryptOptional(Option<Secret<T, S>>), Decrypt(Encryption), DecryptOptional(Option<Encryption>), BatchEncrypt(FxHashMap<String, Secret<T, S>>), BatchDecrypt(FxHashMap<String, Encryption>), } use errors::CryptoError; #[derive(router_derive::TryGetEnumVariant)] #[error(CryptoError::EncodingFailed)] pub enum CryptoOutput<T: Clone, S: masking::Strategy<T>> { Operation(crypto::Encryptable<Secret<T, S>>), OptionalOperation(Option<crypto::Encryptable<Secret<T, S>>>), BatchOperation(FxHashMap<String, crypto::Encryptable<Secret<T, S>>>), } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all, fields(table = table_name))] pub async fn crypto_operation<T: Clone + Send, S: masking::Strategy<T>>( state: &KeyManagerState, table_name: &str, operation: CryptoOperation<T, S>, identifier: Identifier, key: &[u8], ) -> CustomResult<CryptoOutput<T, S>, CryptoError> where Secret<T, S>: Send, crypto::Encryptable<Secret<T, S>>: TypeEncryption<T, crypto::GcmAes256, S>, { match operation { CryptoOperation::Encrypt(data) => { let data = encrypt(state, data, identifier, key).await?; Ok(CryptoOutput::Operation(data)) } CryptoOperation::EncryptOptional(data) => { let data = encrypt_optional(state, data, identifier, key).await?; Ok(CryptoOutput::OptionalOperation(data)) } CryptoOperation::Decrypt(data) => { let data = decrypt(state, data, identifier, key).await?; Ok(CryptoOutput::Operation(data)) } CryptoOperation::DecryptOptional(data) => { let data = decrypt_optional(state, data, identifier, key).await?; Ok(CryptoOutput::OptionalOperation(data)) } CryptoOperation::BatchEncrypt(data) => { let data = batch_encrypt(state, data, identifier, key).await?; Ok(CryptoOutput::BatchOperation(data)) } CryptoOperation::BatchDecrypt(data) => { let data = batch_decrypt(state, data, identifier, key).await?; Ok(CryptoOutput::BatchOperation(data)) } } } pub(crate) mod metrics { use router_env::{counter_metric, global_meter, histogram_metric_f64, once_cell}; global_meter!(GLOBAL_METER, "ROUTER_API"); // Encryption and Decryption metrics histogram_metric_f64!(ENCRYPTION_TIME, GLOBAL_METER); histogram_metric_f64!(DECRYPTION_TIME, GLOBAL_METER); counter_metric!(ENCRYPTION_API_FAILURES, GLOBAL_METER); counter_metric!(DECRYPTION_API_FAILURES, GLOBAL_METER); counter_metric!(APPLICATION_ENCRYPTION_COUNT, GLOBAL_METER); counter_metric!(APPLICATION_DECRYPTION_COUNT, GLOBAL_METER); }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_domain_models/src/type_encryption.rs" crate="hyperswitch_domain_models" role="use_site"> use async_trait::async_trait; use common_utils::{ crypto, encryption::Encryption, errors::{self, CustomResult}, ext_traits::AsyncExt, metrics::utils::record_operation_time, types::keymanager::{Identifier, KeyManagerState}, }; use encrypt::TypeEncryption; use masking::Secret; use router_env::{instrument, tracing}; use rustc_hash::FxHashMap; mod encrypt { use async_trait::async_trait; use common_utils::{ crypto, encryption::Encryption, errors::{self, CustomResult}, ext_traits::ByteSliceExt, keymanager::call_encryption_service, transformers::{ForeignFrom, ForeignTryFrom}, types::keymanager::{ BatchDecryptDataResponse, BatchEncryptDataRequest, BatchEncryptDataResponse, DecryptDataResponse, EncryptDataRequest, EncryptDataResponse, Identifier, KeyManagerState, TransientBatchDecryptDataRequest, TransientDecryptDataRequest, }, }; use error_stack::ResultExt; use http::Method; use masking::{PeekInterface, Secret}; use router_env::{instrument, logger, tracing}; use rustc_hash::FxHashMap; use super::{metrics, EncryptedJsonType}; #[async_trait] pub trait TypeEncryption< T, V: crypto::EncodeMessage + crypto::DecodeMessage, S: masking::Strategy<T>, >: Sized { async fn encrypt_via_api( state: &KeyManagerState, masked_data: Secret<T, S>, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError>; async fn decrypt_via_api( state: &KeyManagerState, encrypted_data: Encryption, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError>; async fn encrypt( masked_data: Secret<T, S>, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError>; async fn decrypt( encrypted_data: Encryption, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError>; async fn batch_encrypt_via_api( state: &KeyManagerState, masked_data: FxHashMap<String, Secret<T, S>>, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError>; async fn batch_decrypt_via_api( state: &KeyManagerState, encrypted_data: FxHashMap<String, Encryption>, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError>; async fn batch_encrypt( masked_data: FxHashMap<String, Secret<T, S>>, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError>; async fn batch_decrypt( encrypted_data: FxHashMap<String, Encryption>, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError>; } fn is_encryption_service_enabled(_state: &KeyManagerState) -> bool { #[cfg(feature = "encryption_service")] { _state.enabled } #[cfg(not(feature = "encryption_service"))] { false } } #[async_trait] impl< V: crypto::DecodeMessage + crypto::EncodeMessage + Send + 'static, S: masking::Strategy<String> + Send + Sync, > TypeEncryption<String, V, S> for crypto::Encryptable<Secret<String, S>> { // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn encrypt_via_api( state: &KeyManagerState, masked_data: Secret<String, S>, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError> { // If encryption service is not enabled, fall back to application encryption or else call encryption service if !is_encryption_service_enabled(state) { Self::encrypt(masked_data, key, crypt_algo).await } else { let result: Result< EncryptDataResponse, error_stack::Report<errors::KeyManagerClientError>, > = call_encryption_service( state, Method::POST, "data/encrypt", EncryptDataRequest::from((masked_data.clone(), identifier)), ) .await; match result { Ok(response) => Ok(ForeignFrom::foreign_from((masked_data.clone(), response))), Err(err) => { logger::error!("Encryption error {:?}", err); metrics::ENCRYPTION_API_FAILURES.add(1, &[]); logger::info!("Fall back to Application Encryption"); Self::encrypt(masked_data, key, crypt_algo).await } } } } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn decrypt_via_api( state: &KeyManagerState, encrypted_data: Encryption, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError> { // If encryption service is not enabled, fall back to application encryption or else call encryption service if !is_encryption_service_enabled(state) { Self::decrypt(encrypted_data, key, crypt_algo).await } else { let result: Result< DecryptDataResponse, error_stack::Report<errors::KeyManagerClientError>, > = call_encryption_service( state, Method::POST, "data/decrypt", TransientDecryptDataRequest::from((encrypted_data.clone(), identifier)), ) .await; let decrypted = match result { Ok(decrypted_data) => { ForeignTryFrom::foreign_try_from((encrypted_data.clone(), decrypted_data)) } Err(err) => { logger::error!("Decryption error {:?}", err); Err(err.change_context(errors::CryptoError::DecodingFailed)) } }; match decrypted { Ok(de) => Ok(de), Err(_) => { metrics::DECRYPTION_API_FAILURES.add(1, &[]); logger::info!("Fall back to Application Decryption"); Self::decrypt(encrypted_data, key, crypt_algo).await } } } } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn encrypt( masked_data: Secret<String, S>, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError> { metrics::APPLICATION_ENCRYPTION_COUNT.add(1, &[]); let encrypted_data = crypt_algo.encode_message(key, masked_data.peek().as_bytes())?; Ok(Self::new(masked_data, encrypted_data.into())) } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn decrypt( encrypted_data: Encryption, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError> { metrics::APPLICATION_DECRYPTION_COUNT.add(1, &[]); let encrypted = encrypted_data.into_inner(); let data = crypt_algo.decode_message(key, encrypted.clone())?; let value: String = std::str::from_utf8(&data) .change_context(errors::CryptoError::DecodingFailed)? .to_string(); Ok(Self::new(value.into(), encrypted)) } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn batch_encrypt_via_api( state: &KeyManagerState, masked_data: FxHashMap<String, Secret<String, S>>, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError> { // If encryption service is not enabled, fall back to application encryption or else call encryption service if !is_encryption_service_enabled(state) { Self::batch_encrypt(masked_data, key, crypt_algo).await } else { let result: Result< BatchEncryptDataResponse, error_stack::Report<errors::KeyManagerClientError>, > = call_encryption_service( state, Method::POST, "data/encrypt", BatchEncryptDataRequest::from((masked_data.clone(), identifier)), ) .await; match result { Ok(response) => Ok(ForeignFrom::foreign_from((masked_data, response))), Err(err) => { metrics::ENCRYPTION_API_FAILURES.add(1, &[]); logger::error!("Encryption error {:?}", err); logger::info!("Fall back to Application Encryption"); Self::batch_encrypt(masked_data, key, crypt_algo).await } } } } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn batch_decrypt_via_api( state: &KeyManagerState, encrypted_data: FxHashMap<String, Encryption>, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError> { // If encryption service is not enabled, fall back to application encryption or else call encryption service if !is_encryption_service_enabled(state) { Self::batch_decrypt(encrypted_data, key, crypt_algo).await } else { let result: Result< BatchDecryptDataResponse, error_stack::Report<errors::KeyManagerClientError>, > = call_encryption_service( state, Method::POST, "data/decrypt", TransientBatchDecryptDataRequest::from((encrypted_data.clone(), identifier)), ) .await; let decrypted = match result { Ok(decrypted_data) => { ForeignTryFrom::foreign_try_from((encrypted_data.clone(), decrypted_data)) } Err(err) => { logger::error!("Decryption error {:?}", err); Err(err.change_context(errors::CryptoError::DecodingFailed)) } }; match decrypted { Ok(de) => Ok(de), Err(_) => { metrics::DECRYPTION_API_FAILURES.add(1, &[]); logger::info!("Fall back to Application Decryption"); Self::batch_decrypt(encrypted_data, key, crypt_algo).await } } } } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn batch_encrypt( masked_data: FxHashMap<String, Secret<String, S>>, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError> { metrics::APPLICATION_ENCRYPTION_COUNT.add(1, &[]); masked_data .into_iter() .map(|(k, v)| { Ok(( k, Self::new( v.clone(), crypt_algo.encode_message(key, v.peek().as_bytes())?.into(), ), )) }) .collect() } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn batch_decrypt( encrypted_data: FxHashMap<String, Encryption>, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError> { metrics::APPLICATION_DECRYPTION_COUNT.add(1, &[]); encrypted_data .into_iter() .map(|(k, v)| { let data = crypt_algo.decode_message(key, v.clone().into_inner())?; let value: String = std::str::from_utf8(&data) .change_context(errors::CryptoError::DecodingFailed)? .to_string(); Ok((k, Self::new(value.into(), v.into_inner()))) }) .collect() } } #[async_trait] impl< V: crypto::DecodeMessage + crypto::EncodeMessage + Send + 'static, S: masking::Strategy<serde_json::Value> + Send + Sync, > TypeEncryption<serde_json::Value, V, S> for crypto::Encryptable<Secret<serde_json::Value, S>> { // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn encrypt_via_api( state: &KeyManagerState, masked_data: Secret<serde_json::Value, S>, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError> { // If encryption service is not enabled, fall back to application encryption or else call encryption service if !is_encryption_service_enabled(state) { Self::encrypt(masked_data, key, crypt_algo).await } else { let result: Result< EncryptDataResponse, error_stack::Report<errors::KeyManagerClientError>, > = call_encryption_service( state, Method::POST, "data/encrypt", EncryptDataRequest::from((masked_data.clone(), identifier)), ) .await; match result { Ok(response) => Ok(ForeignFrom::foreign_from((masked_data.clone(), response))), Err(err) => { logger::error!("Encryption error {:?}", err); metrics::ENCRYPTION_API_FAILURES.add(1, &[]); logger::info!("Fall back to Application Encryption"); Self::encrypt(masked_data, key, crypt_algo).await } } } } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn decrypt_via_api( state: &KeyManagerState, encrypted_data: Encryption, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError> { // If encryption service is not enabled, fall back to application encryption or else call encryption service if !is_encryption_service_enabled(state) { Self::decrypt(encrypted_data, key, crypt_algo).await } else { let result: Result< DecryptDataResponse, error_stack::Report<errors::KeyManagerClientError>, > = call_encryption_service( state, Method::POST, "data/decrypt", TransientDecryptDataRequest::from((encrypted_data.clone(), identifier)), ) .await; let decrypted = match result { Ok(decrypted_data) => { ForeignTryFrom::foreign_try_from((encrypted_data.clone(), decrypted_data)) } Err(err) => { logger::error!("Decryption error {:?}", err); Err(err.change_context(errors::CryptoError::EncodingFailed)) } }; match decrypted { Ok(de) => Ok(de), Err(_) => { metrics::DECRYPTION_API_FAILURES.add(1, &[]); logger::info!("Fall back to Application Decryption"); Self::decrypt(encrypted_data, key, crypt_algo).await } } } } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn encrypt( masked_data: Secret<serde_json::Value, S>, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError> { metrics::APPLICATION_ENCRYPTION_COUNT.add(1, &[]); let data = serde_json::to_vec(&masked_data.peek()) .change_context(errors::CryptoError::DecodingFailed)?; let encrypted_data = crypt_algo.encode_message(key, &data)?; Ok(Self::new(masked_data, encrypted_data.into())) } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn decrypt( encrypted_data: Encryption, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError> { metrics::APPLICATION_DECRYPTION_COUNT.add(1, &[]); let encrypted = encrypted_data.into_inner(); let data = crypt_algo.decode_message(key, encrypted.clone())?; let value: serde_json::Value = serde_json::from_slice(&data) .change_context(errors::CryptoError::DecodingFailed)?; Ok(Self::new(value.into(), encrypted)) } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn batch_encrypt_via_api( state: &KeyManagerState, masked_data: FxHashMap<String, Secret<serde_json::Value, S>>, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError> { // If encryption service is not enabled, fall back to application encryption or else call encryption service if !is_encryption_service_enabled(state) { Self::batch_encrypt(masked_data, key, crypt_algo).await } else { let result: Result< BatchEncryptDataResponse, error_stack::Report<errors::KeyManagerClientError>, > = call_encryption_service( state, Method::POST, "data/encrypt", BatchEncryptDataRequest::from((masked_data.clone(), identifier)), ) .await; match result { Ok(response) => Ok(ForeignFrom::foreign_from((masked_data, response))), Err(err) => { metrics::ENCRYPTION_API_FAILURES.add(1, &[]); logger::error!("Encryption error {:?}", err); logger::info!("Fall back to Application Encryption"); Self::batch_encrypt(masked_data, key, crypt_algo).await } } } } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn batch_decrypt_via_api( state: &KeyManagerState, encrypted_data: FxHashMap<String, Encryption>, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError> { // If encryption service is not enabled, fall back to application encryption or else call encryption service if !is_encryption_service_enabled(state) { Self::batch_decrypt(encrypted_data, key, crypt_algo).await } else { let result: Result< BatchDecryptDataResponse, error_stack::Report<errors::KeyManagerClientError>, > = call_encryption_service( state, Method::POST, "data/decrypt", TransientBatchDecryptDataRequest::from((encrypted_data.clone(), identifier)), ) .await; let decrypted = match result { Ok(decrypted_data) => { ForeignTryFrom::foreign_try_from((encrypted_data.clone(), decrypted_data)) } Err(err) => { logger::error!("Decryption error {:?}", err); Err(err.change_context(errors::CryptoError::DecodingFailed)) } }; match decrypted { Ok(de) => Ok(de), Err(_) => { metrics::DECRYPTION_API_FAILURES.add(1, &[]); logger::info!("Fall back to Application Decryption"); Self::batch_decrypt(encrypted_data, key, crypt_algo).await } } } } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn batch_encrypt( masked_data: FxHashMap<String, Secret<serde_json::Value, S>>, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError> { metrics::APPLICATION_ENCRYPTION_COUNT.add(1, &[]); masked_data .into_iter() .map(|(k, v)| { let data = serde_json::to_vec(v.peek()) .change_context(errors::CryptoError::DecodingFailed)?; Ok(( k, Self::new(v, crypt_algo.encode_message(key, &data)?.into()), )) }) .collect() } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn batch_decrypt( encrypted_data: FxHashMap<String, Encryption>, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError> { metrics::APPLICATION_DECRYPTION_COUNT.add(1, &[]); encrypted_data .into_iter() .map(|(k, v)| { let data = crypt_algo.decode_message(key, v.clone().into_inner().clone())?; let value: serde_json::Value = serde_json::from_slice(&data) .change_context(errors::CryptoError::DecodingFailed)?; Ok((k, Self::new(value.into(), v.into_inner()))) }) .collect() } } impl<T> EncryptedJsonType<T> where T: std::fmt::Debug + Clone + serde::Serialize + serde::de::DeserializeOwned, { fn serialize_json_bytes(&self) -> CustomResult<Secret<Vec<u8>>, errors::CryptoError> { common_utils::ext_traits::Encode::encode_to_vec(self.inner()) .change_context(errors::CryptoError::EncodingFailed) .attach_printable("Failed to JSON serialize data before encryption") .map(Secret::new) } fn deserialize_json_bytes<S>( bytes: Secret<Vec<u8>>, ) -> CustomResult<Secret<Self, S>, errors::ParsingError> where S: masking::Strategy<Self>, { bytes .peek() .as_slice() .parse_struct::<T>(std::any::type_name::<T>()) .map(|result| Secret::new(Self::from(result))) .attach_printable("Failed to JSON deserialize data after decryption") } } #[async_trait] impl< T: std::fmt::Debug + Clone + serde::Serialize + serde::de::DeserializeOwned + Send, V: crypto::DecodeMessage + crypto::EncodeMessage + Send + 'static, S: masking::Strategy<EncryptedJsonType<T>> + Send + Sync, > TypeEncryption<EncryptedJsonType<T>, V, S> for crypto::Encryptable<Secret<EncryptedJsonType<T>, S>> { // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn encrypt_via_api( state: &KeyManagerState, masked_data: Secret<EncryptedJsonType<T>, S>, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError> { let data_bytes = EncryptedJsonType::serialize_json_bytes(masked_data.peek())?; let result: crypto::Encryptable<Secret<Vec<u8>>> = TypeEncryption::encrypt_via_api(state, data_bytes, identifier, key, crypt_algo) .await?; Ok(Self::new(masked_data, result.into_encrypted())) } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn decrypt_via_api( state: &KeyManagerState, encrypted_data: Encryption, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError> { let result: crypto::Encryptable<Secret<Vec<u8>>> = TypeEncryption::decrypt_via_api(state, encrypted_data, identifier, key, crypt_algo) .await?; result .deserialize_inner_value(EncryptedJsonType::deserialize_json_bytes) .change_context(errors::CryptoError::DecodingFailed) } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn encrypt( masked_data: Secret<EncryptedJsonType<T>, S>, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError> { let data_bytes = EncryptedJsonType::serialize_json_bytes(masked_data.peek())?; let result: crypto::Encryptable<Secret<Vec<u8>>> = TypeEncryption::encrypt(data_bytes, key, crypt_algo).await?; Ok(Self::new(masked_data, result.into_encrypted())) } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn decrypt( encrypted_data: Encryption, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError> { let result: crypto::Encryptable<Secret<Vec<u8>>> = TypeEncryption::decrypt(encrypted_data, key, crypt_algo).await?; result .deserialize_inner_value(EncryptedJsonType::deserialize_json_bytes) .change_context(errors::CryptoError::DecodingFailed) } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn batch_encrypt_via_api( state: &KeyManagerState, masked_data: FxHashMap<String, Secret<EncryptedJsonType<T>, S>>, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError> { let hashmap_capacity = masked_data.len(); let data_bytes = masked_data.iter().try_fold( FxHashMap::with_capacity_and_hasher(hashmap_capacity, Default::default()), |mut map, (key, value)| { let value_bytes = EncryptedJsonType::serialize_json_bytes(value.peek())?; map.insert(key.to_owned(), value_bytes); Ok::<_, error_stack::Report<errors::CryptoError>>(map) }, )?; let result: FxHashMap<String, crypto::Encryptable<Secret<Vec<u8>>>> = TypeEncryption::batch_encrypt_via_api( state, data_bytes, identifier, key, crypt_algo, ) .await?; let result_hashmap = result.into_iter().try_fold( FxHashMap::with_capacity_and_hasher(hashmap_capacity, Default::default()), |mut map, (key, value)| { let original_value = masked_data .get(&key) .ok_or(errors::CryptoError::EncodingFailed) .attach_printable_lazy(|| { format!("Failed to find {key} in input hashmap") })?; map.insert( key, Self::new(original_value.clone(), value.into_encrypted()), ); Ok::<_, error_stack::Report<errors::CryptoError>>(map) }, )?; Ok(result_hashmap) } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn batch_decrypt_via_api( state: &KeyManagerState, encrypted_data: FxHashMap<String, Encryption>, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError> { let result: FxHashMap<String, crypto::Encryptable<Secret<Vec<u8>>>> = TypeEncryption::batch_decrypt_via_api( state, encrypted_data, identifier, key, crypt_algo, ) .await?; let hashmap_capacity = result.len(); let result_hashmap = result.into_iter().try_fold( FxHashMap::with_capacity_and_hasher(hashmap_capacity, Default::default()), |mut map, (key, value)| { let deserialized_value = value .deserialize_inner_value(EncryptedJsonType::deserialize_json_bytes) .change_context(errors::CryptoError::DecodingFailed)?; map.insert(key, deserialized_value); Ok::<_, error_stack::Report<errors::CryptoError>>(map) }, )?; Ok(result_hashmap) } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn batch_encrypt( masked_data: FxHashMap<String, Secret<EncryptedJsonType<T>, S>>, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError> { let hashmap_capacity = masked_data.len(); let data_bytes = masked_data.iter().try_fold( FxHashMap::with_capacity_and_hasher(hashmap_capacity, Default::default()), |mut map, (key, value)| { let value_bytes = EncryptedJsonType::serialize_json_bytes(value.peek())?; map.insert(key.to_owned(), value_bytes); Ok::<_, error_stack::Report<errors::CryptoError>>(map) }, )?; let result: FxHashMap<String, crypto::Encryptable<Secret<Vec<u8>>>> = TypeEncryption::batch_encrypt(data_bytes, key, crypt_algo).await?; let result_hashmap = result.into_iter().try_fold( FxHashMap::with_capacity_and_hasher(hashmap_capacity, Default::default()), |mut map, (key, value)| { let original_value = masked_data .get(&key) .ok_or(errors::CryptoError::EncodingFailed) .attach_printable_lazy(|| { format!("Failed to find {key} in input hashmap") })?; map.insert( key, Self::new(original_value.clone(), value.into_encrypted()), ); Ok::<_, error_stack::Report<errors::CryptoError>>(map) }, )?; Ok(result_hashmap) } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn batch_decrypt( encrypted_data: FxHashMap<String, Encryption>, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError> { let result: FxHashMap<String, crypto::Encryptable<Secret<Vec<u8>>>> = TypeEncryption::batch_decrypt(encrypted_data, key, crypt_algo).await?; let hashmap_capacity = result.len(); let result_hashmap = result.into_iter().try_fold( FxHashMap::with_capacity_and_hasher(hashmap_capacity, Default::default()), |mut map, (key, value)| { let deserialized_value = value .deserialize_inner_value(EncryptedJsonType::deserialize_json_bytes) .change_context(errors::CryptoError::DecodingFailed)?; map.insert(key, deserialized_value); Ok::<_, error_stack::Report<errors::CryptoError>>(map) }, )?; Ok(result_hashmap) } } #[async_trait] impl< V: crypto::DecodeMessage + crypto::EncodeMessage + Send + 'static, S: masking::Strategy<Vec<u8>> + Send + Sync, > TypeEncryption<Vec<u8>, V, S> for crypto::Encryptable<Secret<Vec<u8>, S>> { // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn encrypt_via_api( state: &KeyManagerState, masked_data: Secret<Vec<u8>, S>, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError> { // If encryption service is not enabled, fall back to application encryption or else call encryption service if !is_encryption_service_enabled(state) { Self::encrypt(masked_data, key, crypt_algo).await } else { let result: Result< EncryptDataResponse, error_stack::Report<errors::KeyManagerClientError>, > = call_encryption_service( state, Method::POST, "data/encrypt", EncryptDataRequest::from((masked_data.clone(), identifier)), ) .await; match result { Ok(response) => Ok(ForeignFrom::foreign_from((masked_data.clone(), response))), Err(err) => { logger::error!("Encryption error {:?}", err); metrics::ENCRYPTION_API_FAILURES.add(1, &[]); logger::info!("Fall back to Application Encryption"); Self::encrypt(masked_data, key, crypt_algo).await } } } } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn decrypt_via_api( state: &KeyManagerState, encrypted_data: Encryption, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError> { // If encryption service is not enabled, fall back to application encryption or else call encryption service if !is_encryption_service_enabled(state) { Self::decrypt(encrypted_data, key, crypt_algo).await } else { let result: Result< DecryptDataResponse, error_stack::Report<errors::KeyManagerClientError>, > = call_encryption_service( state, Method::POST, "data/decrypt", TransientDecryptDataRequest::from((encrypted_data.clone(), identifier)), ) .await; let decrypted = match result { Ok(decrypted_data) => { ForeignTryFrom::foreign_try_from((encrypted_data.clone(), decrypted_data)) } Err(err) => { logger::error!("Decryption error {:?}", err); Err(err.change_context(errors::CryptoError::DecodingFailed)) } }; match decrypted { Ok(de) => Ok(de), Err(_) => { metrics::DECRYPTION_API_FAILURES.add(1, &[]); logger::info!("Fall back to Application Decryption"); Self::decrypt(encrypted_data, key, crypt_algo).await } } } } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn encrypt( masked_data: Secret<Vec<u8>, S>, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError> { metrics::APPLICATION_ENCRYPTION_COUNT.add(1, &[]); let encrypted_data = crypt_algo.encode_message(key, masked_data.peek())?; Ok(Self::new(masked_data, encrypted_data.into())) } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn decrypt( encrypted_data: Encryption, key: &[u8], crypt_algo: V, ) -> CustomResult<Self, errors::CryptoError> { metrics::APPLICATION_DECRYPTION_COUNT.add(1, &[]); let encrypted = encrypted_data.into_inner(); let data = crypt_algo.decode_message(key, encrypted.clone())?; Ok(Self::new(data.into(), encrypted)) } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn batch_encrypt_via_api( state: &KeyManagerState, masked_data: FxHashMap<String, Secret<Vec<u8>, S>>, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError> { // If encryption service is not enabled, fall back to application encryption or else call encryption service if !is_encryption_service_enabled(state) { Self::batch_encrypt(masked_data, key, crypt_algo).await } else { let result: Result< BatchEncryptDataResponse, error_stack::Report<errors::KeyManagerClientError>, > = call_encryption_service( state, Method::POST, "data/encrypt", BatchEncryptDataRequest::from((masked_data.clone(), identifier)), ) .await; match result { Ok(response) => Ok(ForeignFrom::foreign_from((masked_data, response))), Err(err) => { metrics::ENCRYPTION_API_FAILURES.add(1, &[]); logger::error!("Encryption error {:?}", err); logger::info!("Fall back to Application Encryption"); Self::batch_encrypt(masked_data, key, crypt_algo).await } } } } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn batch_decrypt_via_api( state: &KeyManagerState, encrypted_data: FxHashMap<String, Encryption>, identifier: Identifier, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError> { // If encryption service is not enabled, fall back to application encryption or else call encryption service if !is_encryption_service_enabled(state) { Self::batch_decrypt(encrypted_data, key, crypt_algo).await } else { let result: Result< BatchDecryptDataResponse, error_stack::Report<errors::KeyManagerClientError>, > = call_encryption_service( state, Method::POST, "data/decrypt", TransientBatchDecryptDataRequest::from((encrypted_data.clone(), identifier)), ) .await; let decrypted = match result { Ok(response) => { ForeignTryFrom::foreign_try_from((encrypted_data.clone(), response)) } Err(err) => { logger::error!("Decryption error {:?}", err); Err(err.change_context(errors::CryptoError::DecodingFailed)) } }; match decrypted { Ok(de) => Ok(de), Err(_) => { metrics::DECRYPTION_API_FAILURES.add(1, &[]); logger::info!("Fall back to Application Decryption"); Self::batch_decrypt(encrypted_data, key, crypt_algo).await } } } } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn batch_encrypt( masked_data: FxHashMap<String, Secret<Vec<u8>, S>>, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError> { metrics::APPLICATION_ENCRYPTION_COUNT.add(1, &[]); masked_data .into_iter() .map(|(k, v)| { Ok(( k, Self::new(v.clone(), crypt_algo.encode_message(key, v.peek())?.into()), )) }) .collect() } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all)] async fn batch_decrypt( encrypted_data: FxHashMap<String, Encryption>, key: &[u8], crypt_algo: V, ) -> CustomResult<FxHashMap<String, Self>, errors::CryptoError> { metrics::APPLICATION_DECRYPTION_COUNT.add(1, &[]); encrypted_data .into_iter() .map(|(k, v)| { Ok(( k, Self::new( crypt_algo .decode_message(key, v.clone().into_inner().clone())? .into(), v.into_inner(), ), )) }) .collect() } } } #[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] pub struct EncryptedJsonType<T>(T); impl<T> EncryptedJsonType<T> { pub fn inner(&self) -> &T { &self.0 } pub fn into_inner(self) -> T { self.0 } } impl<T> From<T> for EncryptedJsonType<T> { fn from(value: T) -> Self { Self(value) } } impl<T> std::ops::Deref for EncryptedJsonType<T> { type Target = T; fn deref(&self) -> &Self::Target { self.inner() } } /// Type alias for `Option<Encryptable<Secret<EncryptedJsonType<T>>>>` pub type OptionalEncryptableJsonType<T> = Option<crypto::Encryptable<Secret<EncryptedJsonType<T>>>>; pub trait Lift<U> { type SelfWrapper<T>; type OtherWrapper<T, E>; fn lift<Func, E, V>(self, func: Func) -> Self::OtherWrapper<V, E> where Func: Fn(Self::SelfWrapper<U>) -> Self::OtherWrapper<V, E>; } impl<U> Lift<U> for Option<U> { type SelfWrapper<T> = Option<T>; type OtherWrapper<T, E> = CustomResult<Option<T>, E>; fn lift<Func, E, V>(self, func: Func) -> Self::OtherWrapper<V, E> where Func: Fn(Self::SelfWrapper<U>) -> Self::OtherWrapper<V, E>, { func(self) } } #[async_trait] pub trait AsyncLift<U> { type SelfWrapper<T>; type OtherWrapper<T, E>; async fn async_lift<Func, F, E, V>(self, func: Func) -> Self::OtherWrapper<V, E> where Func: Fn(Self::SelfWrapper<U>) -> F + Send + Sync, F: futures::Future<Output = Self::OtherWrapper<V, E>> + Send; } #[async_trait] impl<U, V: Lift<U> + Lift<U, SelfWrapper<U> = V> + Send> AsyncLift<U> for V { type SelfWrapper<T> = <V as Lift<U>>::SelfWrapper<T>; type OtherWrapper<T, E> = <V as Lift<U>>::OtherWrapper<T, E>; async fn async_lift<Func, F, E, W>(self, func: Func) -> Self::OtherWrapper<W, E> where Func: Fn(Self::SelfWrapper<U>) -> F + Send + Sync, F: futures::Future<Output = Self::OtherWrapper<W, E>> + Send, { func(self).await } } #[inline] async fn encrypt<E: Clone, S>( state: &KeyManagerState, inner: Secret<E, S>, identifier: Identifier, key: &[u8], ) -> CustomResult<crypto::Encryptable<Secret<E, S>>, CryptoError> where S: masking::Strategy<E>, crypto::Encryptable<Secret<E, S>>: TypeEncryption<E, crypto::GcmAes256, S>, { record_operation_time( crypto::Encryptable::encrypt_via_api(state, inner, identifier, key, crypto::GcmAes256), &metrics::ENCRYPTION_TIME, &[], ) .await } #[inline] async fn batch_encrypt<E: Clone, S>( state: &KeyManagerState, inner: FxHashMap<String, Secret<E, S>>, identifier: Identifier, key: &[u8], ) -> CustomResult<FxHashMap<String, crypto::Encryptable<Secret<E, S>>>, CryptoError> where S: masking::Strategy<E>, crypto::Encryptable<Secret<E, S>>: TypeEncryption<E, crypto::GcmAes256, S>, { if !inner.is_empty() { record_operation_time( crypto::Encryptable::batch_encrypt_via_api( state, inner, identifier, key, crypto::GcmAes256, ), &metrics::ENCRYPTION_TIME, &[], ) .await } else { Ok(FxHashMap::default()) } } #[inline] async fn encrypt_optional<E: Clone, S>( state: &KeyManagerState, inner: Option<Secret<E, S>>, identifier: Identifier, key: &[u8], ) -> CustomResult<Option<crypto::Encryptable<Secret<E, S>>>, CryptoError> where Secret<E, S>: Send, S: masking::Strategy<E>, crypto::Encryptable<Secret<E, S>>: TypeEncryption<E, crypto::GcmAes256, S>, { inner .async_map(|f| encrypt(state, f, identifier, key)) .await .transpose() } #[inline] async fn decrypt_optional<T: Clone, S: masking::Strategy<T>>( state: &KeyManagerState, inner: Option<Encryption>, identifier: Identifier, key: &[u8], ) -> CustomResult<Option<crypto::Encryptable<Secret<T, S>>>, CryptoError> where crypto::Encryptable<Secret<T, S>>: TypeEncryption<T, crypto::GcmAes256, S>, { inner .async_map(|item| decrypt(state, item, identifier, key)) .await .transpose() } #[inline] async fn decrypt<T: Clone, S: masking::Strategy<T>>( state: &KeyManagerState, inner: Encryption, identifier: Identifier, key: &[u8], ) -> CustomResult<crypto::Encryptable<Secret<T, S>>, CryptoError> where crypto::Encryptable<Secret<T, S>>: TypeEncryption<T, crypto::GcmAes256, S>, { record_operation_time( crypto::Encryptable::decrypt_via_api(state, inner, identifier, key, crypto::GcmAes256), &metrics::DECRYPTION_TIME, &[], ) .await } #[inline] async fn batch_decrypt<E: Clone, S>( state: &KeyManagerState, inner: FxHashMap<String, Encryption>, identifier: Identifier, key: &[u8], ) -> CustomResult<FxHashMap<String, crypto::Encryptable<Secret<E, S>>>, CryptoError> where S: masking::Strategy<E>, crypto::Encryptable<Secret<E, S>>: TypeEncryption<E, crypto::GcmAes256, S>, { if !inner.is_empty() { record_operation_time( crypto::Encryptable::batch_decrypt_via_api( state, inner, identifier, key, crypto::GcmAes256, ), &metrics::ENCRYPTION_TIME, &[], ) .await } else { Ok(FxHashMap::default()) } } pub enum CryptoOperation<T: Clone, S: masking::Strategy<T>> { Encrypt(Secret<T, S>), EncryptOptional(Option<Secret<T, S>>), Decrypt(Encryption), DecryptOptional(Option<Encryption>), BatchEncrypt(FxHashMap<String, Secret<T, S>>), BatchDecrypt(FxHashMap<String, Encryption>), } use errors::CryptoError; #[derive(router_derive::TryGetEnumVariant)] #[error(CryptoError::EncodingFailed)] pub enum CryptoOutput<T: Clone, S: masking::Strategy<T>> { Operation(crypto::Encryptable<Secret<T, S>>), OptionalOperation(Option<crypto::Encryptable<Secret<T, S>>>), BatchOperation(FxHashMap<String, crypto::Encryptable<Secret<T, S>>>), } // Do not remove the `skip_all` as the key would be logged otherwise #[instrument(skip_all, fields(table = table_name))] pub async fn crypto_operation<T: Clone + Send, S: masking::Strategy<T>>( state: &KeyManagerState, table_name: &str, operation: CryptoOperation<T, S>, identifier: Identifier, key: &[u8], ) -> CustomResult<CryptoOutput<T, S>, CryptoError> where Secret<T, S>: Send, crypto::Encryptable<Secret<T, S>>: TypeEncryption<T, crypto::GcmAes256, S>, { match operation { CryptoOperation::Encrypt(data) => { let data = encrypt(state, data, identifier, key).await?; Ok(CryptoOutput::Operation(data)) } CryptoOperation::EncryptOptional(data) => { let data = encrypt_optional(state, data, identifier, key).await?; Ok(CryptoOutput::OptionalOperation(data)) } CryptoOperation::Decrypt(data) => { let data = decrypt(state, data, identifier, key).await?; Ok(CryptoOutput::Operation(data)) } CryptoOperation::DecryptOptional(data) => { let data = decrypt_optional(state, data, identifier, key).await?; Ok(CryptoOutput::OptionalOperation(data)) } CryptoOperation::BatchEncrypt(data) => { let data = batch_encrypt(state, data, identifier, key).await?; Ok(CryptoOutput::BatchOperation(data)) } CryptoOperation::BatchDecrypt(data) => { let data = batch_decrypt(state, data, identifier, key).await?; Ok(CryptoOutput::BatchOperation(data)) } } } pub(crate) mod metrics { use router_env::{counter_metric, global_meter, histogram_metric_f64, once_cell}; global_meter!(GLOBAL_METER, "ROUTER_API"); // Encryption and Decryption metrics histogram_metric_f64!(ENCRYPTION_TIME, GLOBAL_METER); histogram_metric_f64!(DECRYPTION_TIME, GLOBAL_METER); counter_metric!(ENCRYPTION_API_FAILURES, GLOBAL_METER); counter_metric!(DECRYPTION_API_FAILURES, GLOBAL_METER); counter_metric!(APPLICATION_ENCRYPTION_COUNT, GLOBAL_METER); counter_metric!(APPLICATION_DECRYPTION_COUNT, GLOBAL_METER); } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/router_derive/src/lib.rs<|crate|> hyperswitch_domain_models macro=TryGetEnumVariant roles=use_site,macro_def use=derive item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub fn try_get_enum_variant(input: proc_macro::TokenStream) -> proc_macro::TokenStream { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> <|fim_prefix|> pub fn try_get_enum_variant(input: proc_macro::TokenStream) -> proc_macro::TokenStream { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> pub fn validate_config(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input = syn::parse_macro_input!(input as syn::DeriveInput); macros::misc::validate_config(input) .unwrap_or_else(|error| error.into_compile_error()) .into() } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> pub fn validate_config(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input = syn::parse_macro_input!(input as syn::DeriveInput); macros::misc::validate_config(input) .unwrap_or_else(|error| error.into_compile_error()) .into() } <file_sep path="hyperswitch/crates/hyperswitch_domain_models/src/configs.rs" crate="hyperswitch_domain_models" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/router_derive/src/lib.rs<|crate|> hyperswitch_domain_models macro=ConfigValidate roles=macro_def,use_site use=derive item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub struct Connectors { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/hyperswitch_domain_models/src/configs.rs" crate="hyperswitch_domain_models" role="use_site"> <|fim_prefix|> pub struct Connectors { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> pub fn validate_config(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input = syn::parse_macro_input!(input as syn::DeriveInput); macros::misc::validate_config(input) .unwrap_or_else(|error| error.into_compile_error()) .into() } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> pub fn validate_config(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input = syn::parse_macro_input!(input as syn::DeriveInput); macros::misc::validate_config(input) .unwrap_or_else(|error| error.into_compile_error()) .into() } <file_sep path="hyperswitch/crates/hyperswitch_domain_models/src/configs.rs" crate="hyperswitch_domain_models" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/router_derive/src/lib.rs<|crate|> hyperswitch_domain_models macro=ConfigValidate roles=macro_def,use_site use=derive item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub struct Connectors { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/hyperswitch_domain_models/src/configs.rs" crate="hyperswitch_domain_models" role="use_site"> <|fim_prefix|> pub struct Connectors { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> pub fn validate_config(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input = syn::parse_macro_input!(input as syn::DeriveInput); macros::misc::validate_config(input) .unwrap_or_else(|error| error.into_compile_error()) .into() } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> pub fn validate_config(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input = syn::parse_macro_input!(input as syn::DeriveInput); macros::misc::validate_config(input) .unwrap_or_else(|error| error.into_compile_error()) .into() } <file_sep path="hyperswitch/crates/hyperswitch_domain_models/src/configs.rs" crate="hyperswitch_domain_models" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/router_derive/src/lib.rs<|crate|> hyperswitch_domain_models macro=ConfigValidate roles=macro_def,use_site use=derive item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub struct Connectors { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/hyperswitch_domain_models/src/configs.rs" crate="hyperswitch_domain_models" role="use_site"> <|fim_prefix|> pub struct Connectors { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> pub fn validate_config(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input = syn::parse_macro_input!(input as syn::DeriveInput); macros::misc::validate_config(input) .unwrap_or_else(|error| error.into_compile_error()) .into() } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> pub fn validate_config(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input = syn::parse_macro_input!(input as syn::DeriveInput); macros::misc::validate_config(input) .unwrap_or_else(|error| error.into_compile_error()) .into() } <file_sep path="hyperswitch/crates/hyperswitch_domain_models/src/configs.rs" crate="hyperswitch_domain_models" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/router_derive/src/lib.rs<|crate|> hyperswitch_domain_models macro=ConfigValidate roles=macro_def,use_site use=derive item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub struct Connectors { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/hyperswitch_domain_models/src/configs.rs" crate="hyperswitch_domain_models" role="use_site"> <|fim_prefix|> pub struct Connectors { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> pub fn validate_config(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input = syn::parse_macro_input!(input as syn::DeriveInput); macros::misc::validate_config(input) .unwrap_or_else(|error| error.into_compile_error()) .into() } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> pub fn validate_config(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input = syn::parse_macro_input!(input as syn::DeriveInput); macros::misc::validate_config(input) .unwrap_or_else(|error| error.into_compile_error()) .into() } <file_sep path="hyperswitch/crates/hyperswitch_domain_models/src/configs.rs" crate="hyperswitch_domain_models" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/router_derive/src/lib.rs<|crate|> hyperswitch_domain_models macro=ConfigValidate roles=macro_def,use_site use=derive item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub struct Connectors { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/hyperswitch_domain_models/src/configs.rs" crate="hyperswitch_domain_models" role="use_site"> <|fim_prefix|> pub struct Connectors { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> pub fn validate_config(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input = syn::parse_macro_input!(input as syn::DeriveInput); macros::misc::validate_config(input) .unwrap_or_else(|error| error.into_compile_error()) .into() } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> pub fn validate_config(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input = syn::parse_macro_input!(input as syn::DeriveInput); macros::misc::validate_config(input) .unwrap_or_else(|error| error.into_compile_error()) .into() } <file_sep path="hyperswitch/crates/hyperswitch_domain_models/src/configs.rs" crate="hyperswitch_domain_models" role="use_site"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/router_derive/src/lib.rs<|crate|> hyperswitch_domain_models macro=ConfigValidate roles=macro_def,use_site use=derive item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub struct Connectors { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/hyperswitch_domain_models/src/configs.rs" crate="hyperswitch_domain_models" role="use_site"> <|fim_prefix|> pub struct Connectors { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_domain_models/src/configs.rs" crate="hyperswitch_domain_models" role="use_site"> //! Configs interface use common_enums::ApplicationError; use masking::Secret; use router_derive; use serde::Deserialize; // struct Connectors #[allow(missing_docs, missing_debug_implementations)] #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct Connectors { pub aci: ConnectorParams, pub adyen: AdyenParamsWithThreeBaseUrls, pub adyenplatform: ConnectorParams, pub airwallex: ConnectorParams, pub amazonpay: ConnectorParams, pub applepay: ConnectorParams, pub authorizedotnet: ConnectorParams, pub bambora: ConnectorParams, pub bamboraapac: ConnectorParams, pub bankofamerica: ConnectorParams, pub billwerk: ConnectorParams, pub bitpay: ConnectorParams, pub bluesnap: ConnectorParamsWithSecondaryBaseUrl, pub boku: ConnectorParams, pub braintree: ConnectorParams, pub cashtocode: ConnectorParams, pub chargebee: ConnectorParams, pub checkout: ConnectorParams, pub coinbase: ConnectorParams, pub coingate: ConnectorParams, pub cryptopay: ConnectorParams, pub ctp_mastercard: NoParams, pub ctp_visa: NoParams, pub cybersource: ConnectorParams, pub datatrans: ConnectorParamsWithSecondaryBaseUrl, pub deutschebank: ConnectorParams, pub digitalvirgo: ConnectorParams, pub dlocal: ConnectorParams, #[cfg(feature = "dummy_connector")] pub dummyconnector: ConnectorParams, pub ebanx: ConnectorParams, pub elavon: ConnectorParams, pub facilitapay: ConnectorParams, pub fiserv: ConnectorParams, pub fiservemea: ConnectorParams, pub fiuu: ConnectorParamsWithThreeUrls, pub forte: ConnectorParams, pub getnet: ConnectorParams, pub globalpay: ConnectorParams, pub globepay: ConnectorParams, pub gocardless: ConnectorParams, pub gpayments: ConnectorParams, pub helcim: ConnectorParams, pub hipay: ConnectorParamsWithThreeUrls, pub iatapay: ConnectorParams, pub inespay: ConnectorParams, pub itaubank: ConnectorParams, pub jpmorgan: ConnectorParams, pub juspaythreedsserver: ConnectorParams, pub klarna: ConnectorParams, pub mifinity: ConnectorParams, pub mollie: ConnectorParams, pub moneris: ConnectorParams, pub multisafepay: ConnectorParams, pub netcetera: ConnectorParams, pub nexinets: ConnectorParams, pub nexixpay: ConnectorParams, pub nmi: ConnectorParams, pub nomupay: ConnectorParams, pub noon: ConnectorParamsWithModeType, pub novalnet: ConnectorParams, pub nuvei: ConnectorParams, pub opayo: ConnectorParams, pub opennode: ConnectorParams, pub paybox: ConnectorParamsWithSecondaryBaseUrl, pub payeezy: ConnectorParams, pub payme: ConnectorParams, pub payone: ConnectorParams, pub paypal: ConnectorParams, pub paystack: ConnectorParams, pub payu: ConnectorParams, pub placetopay: ConnectorParams, pub plaid: ConnectorParams, pub powertranz: ConnectorParams, pub prophetpay: ConnectorParams, pub rapyd: ConnectorParams, pub razorpay: ConnectorParamsWithKeys, pub recurly: ConnectorParams, pub redsys: ConnectorParams, pub riskified: ConnectorParams, pub shift4: ConnectorParams, pub signifyd: ConnectorParams, pub square: ConnectorParams, pub stax: ConnectorParams, pub stripe: ConnectorParamsWithFileUploadUrl, pub stripebilling: ConnectorParams, pub taxjar: ConnectorParams, pub threedsecureio: ConnectorParams, pub thunes: ConnectorParams, pub trustpay: ConnectorParamsWithMoreUrls, pub tsys: ConnectorParams, pub unified_authentication_service: ConnectorParams, pub volt: ConnectorParams, pub wellsfargo: ConnectorParams, pub wellsfargopayout: ConnectorParams, pub wise: ConnectorParams, pub worldline: ConnectorParams, pub worldpay: ConnectorParams, pub xendit: ConnectorParams, pub zen: ConnectorParams, pub zsl: ConnectorParams, } /// struct ConnectorParams #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParams { /// base url pub base_url: String, /// secondary base url pub secondary_base_url: Option<String>, } ///struct No Param for connectors with no params #[derive(Debug, Deserialize, Clone, Default)] pub struct NoParams; impl NoParams { /// function to satisfy connector param validation macro pub fn validate(&self, _parent_field: &str) -> Result<(), ApplicationError> { Ok(()) } } /// struct ConnectorParamsWithKeys #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParamsWithKeys { /// base url pub base_url: String, /// api key pub api_key: Secret<String>, /// merchant ID pub merchant_id: Secret<String>, } /// struct ConnectorParamsWithModeType #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParamsWithModeType { /// base url pub base_url: String, /// secondary base url pub secondary_base_url: Option<String>, /// Can take values like Test or Live for Noon pub key_mode: String, } /// struct ConnectorParamsWithMoreUrls #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParamsWithMoreUrls { /// base url pub base_url: String, /// base url for bank redirects pub base_url_bank_redirects: String, } /// struct ConnectorParamsWithFileUploadUrl #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParamsWithFileUploadUrl { /// base url pub base_url: String, /// base url for file upload pub base_url_file_upload: String, } /// struct ConnectorParamsWithThreeBaseUrls #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct AdyenParamsWithThreeBaseUrls { /// base url pub base_url: String, /// secondary base url #[cfg(feature = "payouts")] pub payout_base_url: String, /// third base url pub dispute_base_url: String, } /// struct ConnectorParamsWithSecondaryBaseUrl #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParamsWithSecondaryBaseUrl { /// base url pub base_url: String, /// secondary base url pub secondary_base_url: String, } /// struct ConnectorParamsWithThreeUrls #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParamsWithThreeUrls { /// base url pub base_url: String, /// secondary base url pub secondary_base_url: String, /// third base url pub third_base_url: String, } <file_sep path="hyperswitch/crates/hyperswitch_domain_models/src/configs.rs" crate="hyperswitch_domain_models" role="use_site"> //! Configs interface use common_enums::ApplicationError; use masking::Secret; use router_derive; use serde::Deserialize; // struct Connectors #[allow(missing_docs, missing_debug_implementations)] #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct Connectors { pub aci: ConnectorParams, pub adyen: AdyenParamsWithThreeBaseUrls, pub adyenplatform: ConnectorParams, pub airwallex: ConnectorParams, pub amazonpay: ConnectorParams, pub applepay: ConnectorParams, pub authorizedotnet: ConnectorParams, pub bambora: ConnectorParams, pub bamboraapac: ConnectorParams, pub bankofamerica: ConnectorParams, pub billwerk: ConnectorParams, pub bitpay: ConnectorParams, pub bluesnap: ConnectorParamsWithSecondaryBaseUrl, pub boku: ConnectorParams, pub braintree: ConnectorParams, pub cashtocode: ConnectorParams, pub chargebee: ConnectorParams, pub checkout: ConnectorParams, pub coinbase: ConnectorParams, pub coingate: ConnectorParams, pub cryptopay: ConnectorParams, pub ctp_mastercard: NoParams, pub ctp_visa: NoParams, pub cybersource: ConnectorParams, pub datatrans: ConnectorParamsWithSecondaryBaseUrl, pub deutschebank: ConnectorParams, pub digitalvirgo: ConnectorParams, pub dlocal: ConnectorParams, #[cfg(feature = "dummy_connector")] pub dummyconnector: ConnectorParams, pub ebanx: ConnectorParams, pub elavon: ConnectorParams, pub facilitapay: ConnectorParams, pub fiserv: ConnectorParams, pub fiservemea: ConnectorParams, pub fiuu: ConnectorParamsWithThreeUrls, pub forte: ConnectorParams, pub getnet: ConnectorParams, pub globalpay: ConnectorParams, pub globepay: ConnectorParams, pub gocardless: ConnectorParams, pub gpayments: ConnectorParams, pub helcim: ConnectorParams, pub hipay: ConnectorParamsWithThreeUrls, pub iatapay: ConnectorParams, pub inespay: ConnectorParams, pub itaubank: ConnectorParams, pub jpmorgan: ConnectorParams, pub juspaythreedsserver: ConnectorParams, pub klarna: ConnectorParams, pub mifinity: ConnectorParams, pub mollie: ConnectorParams, pub moneris: ConnectorParams, pub multisafepay: ConnectorParams, pub netcetera: ConnectorParams, pub nexinets: ConnectorParams, pub nexixpay: ConnectorParams, pub nmi: ConnectorParams, pub nomupay: ConnectorParams, pub noon: ConnectorParamsWithModeType, pub novalnet: ConnectorParams, pub nuvei: ConnectorParams, pub opayo: ConnectorParams, pub opennode: ConnectorParams, pub paybox: ConnectorParamsWithSecondaryBaseUrl, pub payeezy: ConnectorParams, pub payme: ConnectorParams, pub payone: ConnectorParams, pub paypal: ConnectorParams, pub paystack: ConnectorParams, pub payu: ConnectorParams, pub placetopay: ConnectorParams, pub plaid: ConnectorParams, pub powertranz: ConnectorParams, pub prophetpay: ConnectorParams, pub rapyd: ConnectorParams, pub razorpay: ConnectorParamsWithKeys, pub recurly: ConnectorParams, pub redsys: ConnectorParams, pub riskified: ConnectorParams, pub shift4: ConnectorParams, pub signifyd: ConnectorParams, pub square: ConnectorParams, pub stax: ConnectorParams, pub stripe: ConnectorParamsWithFileUploadUrl, pub stripebilling: ConnectorParams, pub taxjar: ConnectorParams, pub threedsecureio: ConnectorParams, pub thunes: ConnectorParams, pub trustpay: ConnectorParamsWithMoreUrls, pub tsys: ConnectorParams, pub unified_authentication_service: ConnectorParams, pub volt: ConnectorParams, pub wellsfargo: ConnectorParams, pub wellsfargopayout: ConnectorParams, pub wise: ConnectorParams, pub worldline: ConnectorParams, pub worldpay: ConnectorParams, pub xendit: ConnectorParams, pub zen: ConnectorParams, pub zsl: ConnectorParams, } /// struct ConnectorParams #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParams { /// base url pub base_url: String, /// secondary base url pub secondary_base_url: Option<String>, } ///struct No Param for connectors with no params #[derive(Debug, Deserialize, Clone, Default)] pub struct NoParams; impl NoParams { /// function to satisfy connector param validation macro pub fn validate(&self, _parent_field: &str) -> Result<(), ApplicationError> { Ok(()) } } /// struct ConnectorParamsWithKeys #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParamsWithKeys { /// base url pub base_url: String, /// api key pub api_key: Secret<String>, /// merchant ID pub merchant_id: Secret<String>, } /// struct ConnectorParamsWithModeType #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParamsWithModeType { /// base url pub base_url: String, /// secondary base url pub secondary_base_url: Option<String>, /// Can take values like Test or Live for Noon pub key_mode: String, } /// struct ConnectorParamsWithMoreUrls #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParamsWithMoreUrls { /// base url pub base_url: String, /// base url for bank redirects pub base_url_bank_redirects: String, } /// struct ConnectorParamsWithFileUploadUrl #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParamsWithFileUploadUrl { /// base url pub base_url: String, /// base url for file upload pub base_url_file_upload: String, } /// struct ConnectorParamsWithThreeBaseUrls #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct AdyenParamsWithThreeBaseUrls { /// base url pub base_url: String, /// secondary base url #[cfg(feature = "payouts")] pub payout_base_url: String, /// third base url pub dispute_base_url: String, } /// struct ConnectorParamsWithSecondaryBaseUrl #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParamsWithSecondaryBaseUrl { /// base url pub base_url: String, /// secondary base url pub secondary_base_url: String, } /// struct ConnectorParamsWithThreeUrls #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParamsWithThreeUrls { /// base url pub base_url: String, /// secondary base url pub secondary_base_url: String, /// third base url pub third_base_url: String, } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/router_derive/src/lib.rs<|crate|> hyperswitch_domain_models macro=ConfigValidate roles=use_site,macro_def use=derive item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub fn validate_config(input: proc_macro::TokenStream) -> proc_macro::TokenStream { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> <|fim_prefix|> pub fn validate_config(input: proc_macro::TokenStream) -> proc_macro::TokenStream { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_domain_models/src/configs.rs" crate="hyperswitch_domain_models" role="use_site"> //! Configs interface use common_enums::ApplicationError; use masking::Secret; use router_derive; use serde::Deserialize; // struct Connectors #[allow(missing_docs, missing_debug_implementations)] #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct Connectors { pub aci: ConnectorParams, pub adyen: AdyenParamsWithThreeBaseUrls, pub adyenplatform: ConnectorParams, pub airwallex: ConnectorParams, pub amazonpay: ConnectorParams, pub applepay: ConnectorParams, pub authorizedotnet: ConnectorParams, pub bambora: ConnectorParams, pub bamboraapac: ConnectorParams, pub bankofamerica: ConnectorParams, pub billwerk: ConnectorParams, pub bitpay: ConnectorParams, pub bluesnap: ConnectorParamsWithSecondaryBaseUrl, pub boku: ConnectorParams, pub braintree: ConnectorParams, pub cashtocode: ConnectorParams, pub chargebee: ConnectorParams, pub checkout: ConnectorParams, pub coinbase: ConnectorParams, pub coingate: ConnectorParams, pub cryptopay: ConnectorParams, pub ctp_mastercard: NoParams, pub ctp_visa: NoParams, pub cybersource: ConnectorParams, pub datatrans: ConnectorParamsWithSecondaryBaseUrl, pub deutschebank: ConnectorParams, pub digitalvirgo: ConnectorParams, pub dlocal: ConnectorParams, #[cfg(feature = "dummy_connector")] pub dummyconnector: ConnectorParams, pub ebanx: ConnectorParams, pub elavon: ConnectorParams, pub facilitapay: ConnectorParams, pub fiserv: ConnectorParams, pub fiservemea: ConnectorParams, pub fiuu: ConnectorParamsWithThreeUrls, pub forte: ConnectorParams, pub getnet: ConnectorParams, pub globalpay: ConnectorParams, pub globepay: ConnectorParams, pub gocardless: ConnectorParams, pub gpayments: ConnectorParams, pub helcim: ConnectorParams, pub hipay: ConnectorParamsWithThreeUrls, pub iatapay: ConnectorParams, pub inespay: ConnectorParams, pub itaubank: ConnectorParams, pub jpmorgan: ConnectorParams, pub juspaythreedsserver: ConnectorParams, pub klarna: ConnectorParams, pub mifinity: ConnectorParams, pub mollie: ConnectorParams, pub moneris: ConnectorParams, pub multisafepay: ConnectorParams, pub netcetera: ConnectorParams, pub nexinets: ConnectorParams, pub nexixpay: ConnectorParams, pub nmi: ConnectorParams, pub nomupay: ConnectorParams, pub noon: ConnectorParamsWithModeType, pub novalnet: ConnectorParams, pub nuvei: ConnectorParams, pub opayo: ConnectorParams, pub opennode: ConnectorParams, pub paybox: ConnectorParamsWithSecondaryBaseUrl, pub payeezy: ConnectorParams, pub payme: ConnectorParams, pub payone: ConnectorParams, pub paypal: ConnectorParams, pub paystack: ConnectorParams, pub payu: ConnectorParams, pub placetopay: ConnectorParams, pub plaid: ConnectorParams, pub powertranz: ConnectorParams, pub prophetpay: ConnectorParams, pub rapyd: ConnectorParams, pub razorpay: ConnectorParamsWithKeys, pub recurly: ConnectorParams, pub redsys: ConnectorParams, pub riskified: ConnectorParams, pub shift4: ConnectorParams, pub signifyd: ConnectorParams, pub square: ConnectorParams, pub stax: ConnectorParams, pub stripe: ConnectorParamsWithFileUploadUrl, pub stripebilling: ConnectorParams, pub taxjar: ConnectorParams, pub threedsecureio: ConnectorParams, pub thunes: ConnectorParams, pub trustpay: ConnectorParamsWithMoreUrls, pub tsys: ConnectorParams, pub unified_authentication_service: ConnectorParams, pub volt: ConnectorParams, pub wellsfargo: ConnectorParams, pub wellsfargopayout: ConnectorParams, pub wise: ConnectorParams, pub worldline: ConnectorParams, pub worldpay: ConnectorParams, pub xendit: ConnectorParams, pub zen: ConnectorParams, pub zsl: ConnectorParams, } /// struct ConnectorParams #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParams { /// base url pub base_url: String, /// secondary base url pub secondary_base_url: Option<String>, } ///struct No Param for connectors with no params #[derive(Debug, Deserialize, Clone, Default)] pub struct NoParams; impl NoParams { /// function to satisfy connector param validation macro pub fn validate(&self, _parent_field: &str) -> Result<(), ApplicationError> { Ok(()) } } /// struct ConnectorParamsWithKeys #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParamsWithKeys { /// base url pub base_url: String, /// api key pub api_key: Secret<String>, /// merchant ID pub merchant_id: Secret<String>, } /// struct ConnectorParamsWithModeType #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParamsWithModeType { /// base url pub base_url: String, /// secondary base url pub secondary_base_url: Option<String>, /// Can take values like Test or Live for Noon pub key_mode: String, } /// struct ConnectorParamsWithMoreUrls #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParamsWithMoreUrls { /// base url pub base_url: String, /// base url for bank redirects pub base_url_bank_redirects: String, } /// struct ConnectorParamsWithFileUploadUrl #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParamsWithFileUploadUrl { /// base url pub base_url: String, /// base url for file upload pub base_url_file_upload: String, } /// struct ConnectorParamsWithThreeBaseUrls #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct AdyenParamsWithThreeBaseUrls { /// base url pub base_url: String, /// secondary base url #[cfg(feature = "payouts")] pub payout_base_url: String, /// third base url pub dispute_base_url: String, } /// struct ConnectorParamsWithSecondaryBaseUrl #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParamsWithSecondaryBaseUrl { /// base url pub base_url: String, /// secondary base url pub secondary_base_url: String, } /// struct ConnectorParamsWithThreeUrls #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParamsWithThreeUrls { /// base url pub base_url: String, /// secondary base url pub secondary_base_url: String, /// third base url pub third_base_url: String, } <file_sep path="hyperswitch/crates/hyperswitch_domain_models/src/configs.rs" crate="hyperswitch_domain_models" role="use_site"> //! Configs interface use common_enums::ApplicationError; use masking::Secret; use router_derive; use serde::Deserialize; // struct Connectors #[allow(missing_docs, missing_debug_implementations)] #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct Connectors { pub aci: ConnectorParams, pub adyen: AdyenParamsWithThreeBaseUrls, pub adyenplatform: ConnectorParams, pub airwallex: ConnectorParams, pub amazonpay: ConnectorParams, pub applepay: ConnectorParams, pub authorizedotnet: ConnectorParams, pub bambora: ConnectorParams, pub bamboraapac: ConnectorParams, pub bankofamerica: ConnectorParams, pub billwerk: ConnectorParams, pub bitpay: ConnectorParams, pub bluesnap: ConnectorParamsWithSecondaryBaseUrl, pub boku: ConnectorParams, pub braintree: ConnectorParams, pub cashtocode: ConnectorParams, pub chargebee: ConnectorParams, pub checkout: ConnectorParams, pub coinbase: ConnectorParams, pub coingate: ConnectorParams, pub cryptopay: ConnectorParams, pub ctp_mastercard: NoParams, pub ctp_visa: NoParams, pub cybersource: ConnectorParams, pub datatrans: ConnectorParamsWithSecondaryBaseUrl, pub deutschebank: ConnectorParams, pub digitalvirgo: ConnectorParams, pub dlocal: ConnectorParams, #[cfg(feature = "dummy_connector")] pub dummyconnector: ConnectorParams, pub ebanx: ConnectorParams, pub elavon: ConnectorParams, pub facilitapay: ConnectorParams, pub fiserv: ConnectorParams, pub fiservemea: ConnectorParams, pub fiuu: ConnectorParamsWithThreeUrls, pub forte: ConnectorParams, pub getnet: ConnectorParams, pub globalpay: ConnectorParams, pub globepay: ConnectorParams, pub gocardless: ConnectorParams, pub gpayments: ConnectorParams, pub helcim: ConnectorParams, pub hipay: ConnectorParamsWithThreeUrls, pub iatapay: ConnectorParams, pub inespay: ConnectorParams, pub itaubank: ConnectorParams, pub jpmorgan: ConnectorParams, pub juspaythreedsserver: ConnectorParams, pub klarna: ConnectorParams, pub mifinity: ConnectorParams, pub mollie: ConnectorParams, pub moneris: ConnectorParams, pub multisafepay: ConnectorParams, pub netcetera: ConnectorParams, pub nexinets: ConnectorParams, pub nexixpay: ConnectorParams, pub nmi: ConnectorParams, pub nomupay: ConnectorParams, pub noon: ConnectorParamsWithModeType, pub novalnet: ConnectorParams, pub nuvei: ConnectorParams, pub opayo: ConnectorParams, pub opennode: ConnectorParams, pub paybox: ConnectorParamsWithSecondaryBaseUrl, pub payeezy: ConnectorParams, pub payme: ConnectorParams, pub payone: ConnectorParams, pub paypal: ConnectorParams, pub paystack: ConnectorParams, pub payu: ConnectorParams, pub placetopay: ConnectorParams, pub plaid: ConnectorParams, pub powertranz: ConnectorParams, pub prophetpay: ConnectorParams, pub rapyd: ConnectorParams, pub razorpay: ConnectorParamsWithKeys, pub recurly: ConnectorParams, pub redsys: ConnectorParams, pub riskified: ConnectorParams, pub shift4: ConnectorParams, pub signifyd: ConnectorParams, pub square: ConnectorParams, pub stax: ConnectorParams, pub stripe: ConnectorParamsWithFileUploadUrl, pub stripebilling: ConnectorParams, pub taxjar: ConnectorParams, pub threedsecureio: ConnectorParams, pub thunes: ConnectorParams, pub trustpay: ConnectorParamsWithMoreUrls, pub tsys: ConnectorParams, pub unified_authentication_service: ConnectorParams, pub volt: ConnectorParams, pub wellsfargo: ConnectorParams, pub wellsfargopayout: ConnectorParams, pub wise: ConnectorParams, pub worldline: ConnectorParams, pub worldpay: ConnectorParams, pub xendit: ConnectorParams, pub zen: ConnectorParams, pub zsl: ConnectorParams, } /// struct ConnectorParams #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParams { /// base url pub base_url: String, /// secondary base url pub secondary_base_url: Option<String>, } ///struct No Param for connectors with no params #[derive(Debug, Deserialize, Clone, Default)] pub struct NoParams; impl NoParams { /// function to satisfy connector param validation macro pub fn validate(&self, _parent_field: &str) -> Result<(), ApplicationError> { Ok(()) } } /// struct ConnectorParamsWithKeys #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParamsWithKeys { /// base url pub base_url: String, /// api key pub api_key: Secret<String>, /// merchant ID pub merchant_id: Secret<String>, } /// struct ConnectorParamsWithModeType #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParamsWithModeType { /// base url pub base_url: String, /// secondary base url pub secondary_base_url: Option<String>, /// Can take values like Test or Live for Noon pub key_mode: String, } /// struct ConnectorParamsWithMoreUrls #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParamsWithMoreUrls { /// base url pub base_url: String, /// base url for bank redirects pub base_url_bank_redirects: String, } /// struct ConnectorParamsWithFileUploadUrl #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParamsWithFileUploadUrl { /// base url pub base_url: String, /// base url for file upload pub base_url_file_upload: String, } /// struct ConnectorParamsWithThreeBaseUrls #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct AdyenParamsWithThreeBaseUrls { /// base url pub base_url: String, /// secondary base url #[cfg(feature = "payouts")] pub payout_base_url: String, /// third base url pub dispute_base_url: String, } /// struct ConnectorParamsWithSecondaryBaseUrl #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParamsWithSecondaryBaseUrl { /// base url pub base_url: String, /// secondary base url pub secondary_base_url: String, } /// struct ConnectorParamsWithThreeUrls #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParamsWithThreeUrls { /// base url pub base_url: String, /// secondary base url pub secondary_base_url: String, /// third base url pub third_base_url: String, } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/router_derive/src/lib.rs<|crate|> hyperswitch_domain_models macro=ConfigValidate roles=use_site,macro_def use=derive item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub fn validate_config(input: proc_macro::TokenStream) -> proc_macro::TokenStream { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> <|fim_prefix|> pub fn validate_config(input: proc_macro::TokenStream) -> proc_macro::TokenStream { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods
<file_sep path="hyperswitch/crates/hyperswitch_domain_models/src/configs.rs" crate="hyperswitch_domain_models" role="use_site"> //! Configs interface use common_enums::ApplicationError; use masking::Secret; use router_derive; use serde::Deserialize; // struct Connectors #[allow(missing_docs, missing_debug_implementations)] #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct Connectors { pub aci: ConnectorParams, pub adyen: AdyenParamsWithThreeBaseUrls, pub adyenplatform: ConnectorParams, pub airwallex: ConnectorParams, pub amazonpay: ConnectorParams, pub applepay: ConnectorParams, pub authorizedotnet: ConnectorParams, pub bambora: ConnectorParams, pub bamboraapac: ConnectorParams, pub bankofamerica: ConnectorParams, pub billwerk: ConnectorParams, pub bitpay: ConnectorParams, pub bluesnap: ConnectorParamsWithSecondaryBaseUrl, pub boku: ConnectorParams, pub braintree: ConnectorParams, pub cashtocode: ConnectorParams, pub chargebee: ConnectorParams, pub checkout: ConnectorParams, pub coinbase: ConnectorParams, pub coingate: ConnectorParams, pub cryptopay: ConnectorParams, pub ctp_mastercard: NoParams, pub ctp_visa: NoParams, pub cybersource: ConnectorParams, pub datatrans: ConnectorParamsWithSecondaryBaseUrl, pub deutschebank: ConnectorParams, pub digitalvirgo: ConnectorParams, pub dlocal: ConnectorParams, #[cfg(feature = "dummy_connector")] pub dummyconnector: ConnectorParams, pub ebanx: ConnectorParams, pub elavon: ConnectorParams, pub facilitapay: ConnectorParams, pub fiserv: ConnectorParams, pub fiservemea: ConnectorParams, pub fiuu: ConnectorParamsWithThreeUrls, pub forte: ConnectorParams, pub getnet: ConnectorParams, pub globalpay: ConnectorParams, pub globepay: ConnectorParams, pub gocardless: ConnectorParams, pub gpayments: ConnectorParams, pub helcim: ConnectorParams, pub hipay: ConnectorParamsWithThreeUrls, pub iatapay: ConnectorParams, pub inespay: ConnectorParams, pub itaubank: ConnectorParams, pub jpmorgan: ConnectorParams, pub juspaythreedsserver: ConnectorParams, pub klarna: ConnectorParams, pub mifinity: ConnectorParams, pub mollie: ConnectorParams, pub moneris: ConnectorParams, pub multisafepay: ConnectorParams, pub netcetera: ConnectorParams, pub nexinets: ConnectorParams, pub nexixpay: ConnectorParams, pub nmi: ConnectorParams, pub nomupay: ConnectorParams, pub noon: ConnectorParamsWithModeType, pub novalnet: ConnectorParams, pub nuvei: ConnectorParams, pub opayo: ConnectorParams, pub opennode: ConnectorParams, pub paybox: ConnectorParamsWithSecondaryBaseUrl, pub payeezy: ConnectorParams, pub payme: ConnectorParams, pub payone: ConnectorParams, pub paypal: ConnectorParams, pub paystack: ConnectorParams, pub payu: ConnectorParams, pub placetopay: ConnectorParams, pub plaid: ConnectorParams, pub powertranz: ConnectorParams, pub prophetpay: ConnectorParams, pub rapyd: ConnectorParams, pub razorpay: ConnectorParamsWithKeys, pub recurly: ConnectorParams, pub redsys: ConnectorParams, pub riskified: ConnectorParams, pub shift4: ConnectorParams, pub signifyd: ConnectorParams, pub square: ConnectorParams, pub stax: ConnectorParams, pub stripe: ConnectorParamsWithFileUploadUrl, pub stripebilling: ConnectorParams, pub taxjar: ConnectorParams, pub threedsecureio: ConnectorParams, pub thunes: ConnectorParams, pub trustpay: ConnectorParamsWithMoreUrls, pub tsys: ConnectorParams, pub unified_authentication_service: ConnectorParams, pub volt: ConnectorParams, pub wellsfargo: ConnectorParams, pub wellsfargopayout: ConnectorParams, pub wise: ConnectorParams, pub worldline: ConnectorParams, pub worldpay: ConnectorParams, pub xendit: ConnectorParams, pub zen: ConnectorParams, pub zsl: ConnectorParams, } /// struct ConnectorParams #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParams { /// base url pub base_url: String, /// secondary base url pub secondary_base_url: Option<String>, } ///struct No Param for connectors with no params #[derive(Debug, Deserialize, Clone, Default)] pub struct NoParams; impl NoParams { /// function to satisfy connector param validation macro pub fn validate(&self, _parent_field: &str) -> Result<(), ApplicationError> { Ok(()) } } /// struct ConnectorParamsWithKeys #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParamsWithKeys { /// base url pub base_url: String, /// api key pub api_key: Secret<String>, /// merchant ID pub merchant_id: Secret<String>, } /// struct ConnectorParamsWithModeType #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParamsWithModeType { /// base url pub base_url: String, /// secondary base url pub secondary_base_url: Option<String>, /// Can take values like Test or Live for Noon pub key_mode: String, } /// struct ConnectorParamsWithMoreUrls #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParamsWithMoreUrls { /// base url pub base_url: String, /// base url for bank redirects pub base_url_bank_redirects: String, } /// struct ConnectorParamsWithFileUploadUrl #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParamsWithFileUploadUrl { /// base url pub base_url: String, /// base url for file upload pub base_url_file_upload: String, } /// struct ConnectorParamsWithThreeBaseUrls #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct AdyenParamsWithThreeBaseUrls { /// base url pub base_url: String, /// secondary base url #[cfg(feature = "payouts")] pub payout_base_url: String, /// third base url pub dispute_base_url: String, } /// struct ConnectorParamsWithSecondaryBaseUrl #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParamsWithSecondaryBaseUrl { /// base url pub base_url: String, /// secondary base url pub secondary_base_url: String, } /// struct ConnectorParamsWithThreeUrls #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParamsWithThreeUrls { /// base url pub base_url: String, /// secondary base url pub secondary_base_url: String, /// third base url pub third_base_url: String, } <file_sep path="hyperswitch/crates/hyperswitch_domain_models/src/configs.rs" crate="hyperswitch_domain_models" role="use_site"> //! Configs interface use common_enums::ApplicationError; use masking::Secret; use router_derive; use serde::Deserialize; // struct Connectors #[allow(missing_docs, missing_debug_implementations)] #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct Connectors { pub aci: ConnectorParams, pub adyen: AdyenParamsWithThreeBaseUrls, pub adyenplatform: ConnectorParams, pub airwallex: ConnectorParams, pub amazonpay: ConnectorParams, pub applepay: ConnectorParams, pub authorizedotnet: ConnectorParams, pub bambora: ConnectorParams, pub bamboraapac: ConnectorParams, pub bankofamerica: ConnectorParams, pub billwerk: ConnectorParams, pub bitpay: ConnectorParams, pub bluesnap: ConnectorParamsWithSecondaryBaseUrl, pub boku: ConnectorParams, pub braintree: ConnectorParams, pub cashtocode: ConnectorParams, pub chargebee: ConnectorParams, pub checkout: ConnectorParams, pub coinbase: ConnectorParams, pub coingate: ConnectorParams, pub cryptopay: ConnectorParams, pub ctp_mastercard: NoParams, pub ctp_visa: NoParams, pub cybersource: ConnectorParams, pub datatrans: ConnectorParamsWithSecondaryBaseUrl, pub deutschebank: ConnectorParams, pub digitalvirgo: ConnectorParams, pub dlocal: ConnectorParams, #[cfg(feature = "dummy_connector")] pub dummyconnector: ConnectorParams, pub ebanx: ConnectorParams, pub elavon: ConnectorParams, pub facilitapay: ConnectorParams, pub fiserv: ConnectorParams, pub fiservemea: ConnectorParams, pub fiuu: ConnectorParamsWithThreeUrls, pub forte: ConnectorParams, pub getnet: ConnectorParams, pub globalpay: ConnectorParams, pub globepay: ConnectorParams, pub gocardless: ConnectorParams, pub gpayments: ConnectorParams, pub helcim: ConnectorParams, pub hipay: ConnectorParamsWithThreeUrls, pub iatapay: ConnectorParams, pub inespay: ConnectorParams, pub itaubank: ConnectorParams, pub jpmorgan: ConnectorParams, pub juspaythreedsserver: ConnectorParams, pub klarna: ConnectorParams, pub mifinity: ConnectorParams, pub mollie: ConnectorParams, pub moneris: ConnectorParams, pub multisafepay: ConnectorParams, pub netcetera: ConnectorParams, pub nexinets: ConnectorParams, pub nexixpay: ConnectorParams, pub nmi: ConnectorParams, pub nomupay: ConnectorParams, pub noon: ConnectorParamsWithModeType, pub novalnet: ConnectorParams, pub nuvei: ConnectorParams, pub opayo: ConnectorParams, pub opennode: ConnectorParams, pub paybox: ConnectorParamsWithSecondaryBaseUrl, pub payeezy: ConnectorParams, pub payme: ConnectorParams, pub payone: ConnectorParams, pub paypal: ConnectorParams, pub paystack: ConnectorParams, pub payu: ConnectorParams, pub placetopay: ConnectorParams, pub plaid: ConnectorParams, pub powertranz: ConnectorParams, pub prophetpay: ConnectorParams, pub rapyd: ConnectorParams, pub razorpay: ConnectorParamsWithKeys, pub recurly: ConnectorParams, pub redsys: ConnectorParams, pub riskified: ConnectorParams, pub shift4: ConnectorParams, pub signifyd: ConnectorParams, pub square: ConnectorParams, pub stax: ConnectorParams, pub stripe: ConnectorParamsWithFileUploadUrl, pub stripebilling: ConnectorParams, pub taxjar: ConnectorParams, pub threedsecureio: ConnectorParams, pub thunes: ConnectorParams, pub trustpay: ConnectorParamsWithMoreUrls, pub tsys: ConnectorParams, pub unified_authentication_service: ConnectorParams, pub volt: ConnectorParams, pub wellsfargo: ConnectorParams, pub wellsfargopayout: ConnectorParams, pub wise: ConnectorParams, pub worldline: ConnectorParams, pub worldpay: ConnectorParams, pub xendit: ConnectorParams, pub zen: ConnectorParams, pub zsl: ConnectorParams, } /// struct ConnectorParams #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParams { /// base url pub base_url: String, /// secondary base url pub secondary_base_url: Option<String>, } ///struct No Param for connectors with no params #[derive(Debug, Deserialize, Clone, Default)] pub struct NoParams; impl NoParams { /// function to satisfy connector param validation macro pub fn validate(&self, _parent_field: &str) -> Result<(), ApplicationError> { Ok(()) } } /// struct ConnectorParamsWithKeys #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParamsWithKeys { /// base url pub base_url: String, /// api key pub api_key: Secret<String>, /// merchant ID pub merchant_id: Secret<String>, } /// struct ConnectorParamsWithModeType #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParamsWithModeType { /// base url pub base_url: String, /// secondary base url pub secondary_base_url: Option<String>, /// Can take values like Test or Live for Noon pub key_mode: String, } /// struct ConnectorParamsWithMoreUrls #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParamsWithMoreUrls { /// base url pub base_url: String, /// base url for bank redirects pub base_url_bank_redirects: String, } /// struct ConnectorParamsWithFileUploadUrl #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParamsWithFileUploadUrl { /// base url pub base_url: String, /// base url for file upload pub base_url_file_upload: String, } /// struct ConnectorParamsWithThreeBaseUrls #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct AdyenParamsWithThreeBaseUrls { /// base url pub base_url: String, /// secondary base url #[cfg(feature = "payouts")] pub payout_base_url: String, /// third base url pub dispute_base_url: String, } /// struct ConnectorParamsWithSecondaryBaseUrl #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParamsWithSecondaryBaseUrl { /// base url pub base_url: String, /// secondary base url pub secondary_base_url: String, } /// struct ConnectorParamsWithThreeUrls #[derive(Debug, Deserialize, Clone, Default, router_derive::ConfigValidate)] #[serde(default)] pub struct ConnectorParamsWithThreeUrls { /// base url pub base_url: String, /// secondary base url pub secondary_base_url: String, /// third base url pub third_base_url: String, } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> <|fim_prefix|> <|meta_start|><|file|> hyperswitch/crates/router_derive/src/lib.rs<|crate|> hyperswitch_domain_models macro=ConfigValidate roles=use_site,macro_def use=derive item=file pack=proc_macro_neighborhoods lang=rust<|meta_end|> pub fn validate_config(input: proc_macro::TokenStream) -> proc_macro::TokenStream { <|fim_suffix|> <|fim_middle|> } <file_sep path="hyperswitch/crates/router_derive/src/lib.rs" crate="router_derive" role="macro_def"> <|fim_prefix|> pub fn validate_config(input: proc_macro::TokenStream) -> proc_macro::TokenStream { <|fim_suffix|> <|fim_middle|> }
proc_macro_neighborhoods