Payment Method Collect Link Validator (payment_methods/validator.rs)

mperkins0155/hyperswitch · payments, validation, router, api, payment-method

Validates incoming collect‑link requests and initiates the payment method collection flow for both v1 and v2 APIs.

// Source: https://github.com/mperkins0155/hyperswitch | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
use api_models::{admin, payment_methods::PaymentMethodCollectLinkRequest};
use common_utils::link_utils;
use diesel_models::generic_link::PaymentMethodCollectLinkData;
use error_stack::ResultExt;
use hyperswitch_masking::Secret;

use crate::{
    consts,
    core::{
        errors::{self, RouterResult},
        utils as core_utils,
    },
    routes::{app::StorageInterface, SessionState},
    types::domain,
    utils,
};

#[cfg(feature = "v2")]
pub async fn validate_request_and_initiate_payment_method_collect_link(
    _state: &SessionState,
    _platform: &domain::Platform,
    

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search 40K more like it.

Get a free API key