mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 10:06:32 +08:00 
			
		
		
		
	chore(scripts): add connector script changes (#2620)
This commit is contained in:
		| @ -27,7 +27,7 @@ pub struct {{project-name | downcase | pascal_case}}; | |||||||
| impl api::Payment for {{project-name | downcase | pascal_case}} {} | impl api::Payment for {{project-name | downcase | pascal_case}} {} | ||||||
| impl api::PaymentSession for {{project-name | downcase | pascal_case}} {} | impl api::PaymentSession for {{project-name | downcase | pascal_case}} {} | ||||||
| impl api::ConnectorAccessToken for {{project-name | downcase | pascal_case}} {} | impl api::ConnectorAccessToken for {{project-name | downcase | pascal_case}} {} | ||||||
| impl api::PreVerify for {{project-name | downcase | pascal_case}} {} | impl api::MandateSetup for {{project-name | downcase | pascal_case}} {} | ||||||
| impl api::PaymentAuthorize for {{project-name | downcase | pascal_case}} {} | impl api::PaymentAuthorize for {{project-name | downcase | pascal_case}} {} | ||||||
| impl api::PaymentSync for {{project-name | downcase | pascal_case}} {} | impl api::PaymentSync for {{project-name | downcase | pascal_case}} {} | ||||||
| impl api::PaymentCapture for {{project-name | downcase | pascal_case}} {} | impl api::PaymentCapture for {{project-name | downcase | pascal_case}} {} | ||||||
|  | |||||||
| @ -78,7 +78,7 @@ impl ConnectorAuthentication { | |||||||
|     /// Will panic if `CONNECTOR_AUTH_FILE_PATH` env is not set |     /// Will panic if `CONNECTOR_AUTH_FILE_PATH` env is not set | ||||||
|     #[allow(clippy::expect_used)] |     #[allow(clippy::expect_used)] | ||||||
|     pub fn new() -> Self { |     pub fn new() -> Self { | ||||||
|         // Do `export CONNECTOR_AUTH_FILE_PATH="/hyperswitch/crates/router/tests/connectors/sample_sample_auth.toml"` |         // Do `export CONNECTOR_AUTH_FILE_PATH="/hyperswitch/crates/router/tests/connectors/sample_auth.toml"` | ||||||
|         // before running tests in shell |         // before running tests in shell | ||||||
|         let path = env::var("CONNECTOR_AUTH_FILE_PATH") |         let path = env::var("CONNECTOR_AUTH_FILE_PATH") | ||||||
|             .expect("Connector authentication file path not set"); |             .expect("Connector authentication file path not set"); | ||||||
| @ -110,7 +110,7 @@ impl ConnectorAuthenticationMap { | |||||||
|     /// Will panic if `CONNECTOR_AUTH_FILE_PATH` env  is not set |     /// Will panic if `CONNECTOR_AUTH_FILE_PATH` env  is not set | ||||||
|     #[allow(clippy::expect_used)] |     #[allow(clippy::expect_used)] | ||||||
|     pub fn new() -> Self { |     pub fn new() -> Self { | ||||||
|         // Do `export CONNECTOR_AUTH_FILE_PATH="/hyperswitch/crates/router/tests/connectors/sample_sample_auth.toml"` |         // Do `export CONNECTOR_AUTH_FILE_PATH="/hyperswitch/crates/router/tests/connectors/sample_auth.toml"` | ||||||
|         // before running tests in shell |         // before running tests in shell | ||||||
|         let path = env::var("CONNECTOR_AUTH_FILE_PATH") |         let path = env::var("CONNECTOR_AUTH_FILE_PATH") | ||||||
|             .expect("connector authentication file path not set"); |             .expect("connector authentication file path not set"); | ||||||
|  | |||||||
| @ -78,7 +78,7 @@ git checkout ${tests}/main.rs ${test_utils}/connector_auth.rs ${tests}/sample_au | |||||||
|  |  | ||||||
| # Add enum for this connector in test folder | # Add enum for this connector in test folder | ||||||
| sed -i'' -e "s/mod utils;/mod ${payment_gateway};\nmod utils;/" ${tests}/main.rs | sed -i'' -e "s/mod utils;/mod ${payment_gateway};\nmod utils;/" ${tests}/main.rs | ||||||
| sed -i'' -e "s/    pub $previous_connector: \(.*\)/\tpub $previous_connector: \1\n\tpub ${payment_gateway}: Option<HeaderKey>,/; s/auth.toml/sample_auth.toml/" ${test_utils}/connector_auth.rs | sed -i'' -e "s/    pub $previous_connector: \(.*\)/\tpub $previous_connector: \1\n\tpub ${payment_gateway}: Option<HeaderKey>,/" ${test_utils}/connector_auth.rs | ||||||
| echo "\n\n[${payment_gateway}]\napi_key=\"API Key\"" >> ${tests}/sample_auth.toml | echo "\n\n[${payment_gateway}]\napi_key=\"API Key\"" >> ${tests}/sample_auth.toml | ||||||
|  |  | ||||||
| # Remove temporary files created in above step | # Remove temporary files created in above step | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Arjun Karthik
					Arjun Karthik