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

This commit is contained in:
Prajjwal Kumar
2023-09-05 18:15:30 +05:30
committed by GitHub
parent e5d31801ec
commit dc908f6902
3 changed files with 4 additions and 3 deletions

View File

@ -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(),