mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-02 21:07:58 +08:00
refactor(router): new separate routes for applepay merchant verification (#2083)
This commit is contained in:
@ -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 = ""
|
||||
|
||||
@ -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)]
|
||||
|
||||
@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user