refactor(connector): add amount framework to payme & Trustpay with googlePay, ApplePay for bluesnap, Noon & Trustpay (#4833)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: Hrithikesh <61539176+hrithikesh026@users.noreply.github.com>
Co-authored-by: Narayan Bhat <narayan.bhat@juspay.in>
This commit is contained in:
Sahkal Poddar
2024-06-26 14:44:48 +05:30
committed by GitHub
parent ffe90a4112
commit e69a7bda52
14 changed files with 224 additions and 146 deletions

View File

@ -11,7 +11,7 @@ use common_utils::{
ext_traits::{ConfigExt, Encode},
id_type,
pii::{self, Email},
types::MinorUnit,
types::{MinorUnit, StringMajorUnit},
};
use masking::{PeekInterface, Secret};
use router_derive::Setter;
@ -4175,7 +4175,8 @@ pub struct GpayTransactionInfo {
/// The total price status (ex: 'FINAL')
pub total_price_status: String,
/// The total price
pub total_price: String,
#[schema(value_type = String, example = "38.02")]
pub total_price: StringMajorUnit,
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]
@ -4547,8 +4548,9 @@ pub struct AmountInfo {
/// A value that indicates whether the line item(Ex: total, tax, discount, or grand total) is final or pending.
#[serde(rename = "type")]
pub total_type: Option<String>,
/// The total amount for the payment
pub amount: String,
/// The total amount for the payment in majot unit string (Ex: 38.02)
#[schema(value_type = String, example = "38.02")]
pub amount: StringMajorUnit,
}
#[derive(Debug, Clone, serde::Deserialize)]