feat(router): Better UI payment link and order details product image and merchant config support (#2583)

Co-authored-by: Sahkal Poddar <sahkal.poddar@juspay.in>
Co-authored-by: Kashif <46213975+kashif-m@users.noreply.github.com>
Co-authored-by: Kashif <mohammed.kashif@juspay.in>
Co-authored-by: Bernard Eugine <114725419+bernard-eugine@users.noreply.github.com>
Co-authored-by: Kashif <kashif@protonmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Sahkal Poddar
2023-10-17 14:40:45 +05:30
committed by GitHub
parent 3807601ee1
commit fdd9580012
19 changed files with 469 additions and 205 deletions

View File

@ -3410,6 +3410,7 @@ impl ApplePayData {
pub fn validate_payment_link_request(
payment_link_object: &api_models::payments::PaymentLinkObject,
confirm: Option<bool>,
order_details: Option<Vec<api_models::payments::OrderDetailsWithAmount>>,
) -> Result<(), errors::ApiErrorResponse> {
if let Some(cnf) = confirm {
if !cnf {
@ -3418,6 +3419,10 @@ pub fn validate_payment_link_request(
return Err(errors::ApiErrorResponse::InvalidRequestData {
message: "link_expiry time cannot be less than current time".to_string(),
});
} else if order_details.is_none() {
return Err(errors::ApiErrorResponse::InvalidRequestData {
message: "cannot create payment link without order details".to_string(),
});
}
} else {
return Err(errors::ApiErrorResponse::InvalidRequestData {