Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

refactor(router): new separate routes for applepay merchant verification (#2083)

Prajjwal Kumardc908f6902d3
diff --git a/config/development.toml b/config/development.toml
index 4f84052253..29679806a8 100644
--- a/config/development.toml
+++ b/config/development.toml
@@ -44,6 +44,7 @@ recon_admin_api_key = "recon_test_admin"
merchant_cert_key = "MERCHANT CERTIFICATE KEY"
merchant_cert = "MERCHANT CERTIFICATE"
common_merchant_identifier = "COMMON MERCHANT IDENTIFIER"
+applepay_endpoint = "DOMAIN SPECIFIC ENDPOINT"
[locker]
host = ""
diff --git a/crates/router/src/configs/settings.rs b/crates/router/src/configs/settings.rs
index bf5217b60a..fd098f5e58 100644
--- a/crates/router/src/configs/settings.rs
+++ b/crates/router/src/configs/settings.rs
@@ -104,6 +104,7 @@ pub struct ApplepayMerchantConfigs {
pub merchant_cert: String,
pub merchant_cert_key: String,
pub common_merchant_identifier: String,
+ pub applepay_endpoint: String,
}
#[derive(Debug, Deserialize, Clone, Default)]
diff --git a/crates/router/src/utils/verification.rs b/crates/router/src/utils/verification.rs
index 97b496e66d..db50a47e35 100644
--- a/crates/router/src/utils/verification.rs
+++ b/crates/router/src/utils/verification.rs
@@ -12,8 +12,6 @@ use crate::{
services, types, utils,
};
-const APPLEPAY_MERCHANT_VERIFICATION_URL: &str =
- "https://apple-pay-gateway.apple.com/paymentservices/registerMerchant";
const APPLEPAY_INTERNAL_MERCHANT_NAME: &str = "Applepay_merchant";
pub async fn verify_merchant_creds_for_applepay(
@@ -31,6 +29,7 @@ pub async fn verify_merchant_creds_for_applepay(
.common_merchant_identifier;
let encrypted_cert = &state.conf.applepay_merchant_configs.merchant_cert;
let encrypted_key = &state.conf.applepay_merchant_configs.merchant_cert_key;
+ let applepay_endpoint = &state.conf.applepay_merchant_configs.applepay_endpoint;
let applepay_internal_merchant_identifier = kms::get_kms_client(kms_config)
.await
@@ -66,7 +65,7 @@ pub async fn verify_merchant_creds_for_applepay(
let apple_pay_merch_verification_req = services::RequestBuilder::new()
.method(services::Method::Post)
- .url(APPLEPAY_MERCHANT_VERIFICATION_URL)
+ .url(applepay_endpoint)
.attach_default_headers()
.headers(vec![(
headers::CONTENT_TYPE.to_string(),