Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
dea0741
feat: add email to address
Narayanbhat166 Feb 16, 2024
5ef577a
chore: cargo clippy
Narayanbhat166 Feb 16, 2024
eeee5c2
refactor: add billing details to payment method data
Narayanbhat166 Feb 21, 2024
05b2e65
feat: store payment_method_billing in pa
Narayanbhat166 Feb 22, 2024
e599e2d
refactor: handle passing payment_method_billing to connector
Narayanbhat166 Feb 23, 2024
fc010b2
chore: cargo clippy
Narayanbhat166 Feb 23, 2024
c6760fe
Merge branch 'main' into 4239-refactor-add-payment-method-billing-det…
Narayanbhat166 Feb 26, 2024
b6182a0
fix: tests
Narayanbhat166 Feb 26, 2024
1780371
fix: schema file
Narayanbhat166 Feb 26, 2024
b8b1007
fix: make response as unit struct variant instead of empty
Narayanbhat166 Feb 26, 2024
12e4db1
fix: openapi file
Narayanbhat166 Feb 26, 2024
882f853
Merge branch '4239-refactor-add-payment-method-billing-details' into …
Narayanbhat166 Feb 26, 2024
e83c021
chore: gix tests
Narayanbhat166 Feb 28, 2024
c50acd3
feat: store payment_checks and authentication_data
Narayanbhat166 Mar 5, 2024
9640a7e
fix: tests
Narayanbhat166 Mar 5, 2024
57ba39c
Merge branch 'main' into 4229-feature-store-payment-check-codes-and-a…
Narayanbhat166 Mar 12, 2024
bc1586f
chore: fix tests
Narayanbhat166 Mar 12, 2024
ee9b3bb
refactor: address PR comments
Narayanbhat166 Mar 14, 2024
a414de0
fix: typos
Narayanbhat166 Mar 14, 2024
19840b6
Merge branch 'main' into 4229-feature-store-payment-check-codes-and-a…
Narayanbhat166 Mar 14, 2024
2d7fff2
tests: added test cases
Narayanbhat166 Mar 14, 2024
ebc3462
chore: move statement outside match arm
Narayanbhat166 Mar 15, 2024
c1ac6d4
chore: cargo clippy
Narayanbhat166 Mar 15, 2024
530ca40
Merge branch 'main' into 4229-feature-store-payment-check-codes-and-a…
Narayanbhat166 Mar 18, 2024
801733d
chore: revert country to NL in tests
Narayanbhat166 Mar 18, 2024
fdd25ea
refactor(stripe): fix setup mandate error
AkshayaFoiger Mar 18, 2024
89630c7
chore: run formatter
hyperswitch-bot[bot] Mar 18, 2024
c6eab40
Merge branch 'fix-stripe' into 4229-feature-store-payment-check-codes…
Narayanbhat166 Mar 19, 2024
adaafcc
refactor: add payment checks in setupintent
Narayanbhat166 Mar 19, 2024
b5985d3
Merge branch 'main' into 4229-feature-store-payment-check-codes-and-a…
Narayanbhat166 Mar 19, 2024
08ffaed
Merge branch 'main' into 4229-feature-store-payment-check-codes-and-a…
Narayanbhat166 Mar 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions crates/api_models/src/payments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1240,6 +1240,7 @@ impl PaymentMethodData {
self.to_owned()
}
}

pub fn get_payment_method(&self) -> Option<api_enums::PaymentMethod> {
match self {
Self::Card(_) => Some(api_enums::PaymentMethod::Card),
Expand Down Expand Up @@ -1443,17 +1444,40 @@ pub struct GiftCardDetails {
#[derive(Default, Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
#[serde(rename_all = "snake_case")]
pub struct AdditionalCardInfo {
/// The name of issuer of the card
pub card_issuer: Option<String>,

/// Card network of the card
pub card_network: Option<api_enums::CardNetwork>,

/// Card type, can be either `credit` or `debit`
pub card_type: Option<String>,

pub card_issuing_country: Option<String>,
pub bank_code: Option<String>,

/// Last 4 digits of the card number
pub last4: Option<String>,

/// The ISIN of the card
pub card_isin: Option<String>,

/// Extended bin of card, contains the first 8 digits of card number
pub card_extended_bin: Option<String>,

pub card_exp_month: Option<Secret<String>>,

pub card_exp_year: Option<Secret<String>>,

pub card_holder_name: Option<Secret<String>>,

/// Additional payment checks done on the cvv and billing address by the processors.
/// This is a free form field and the structure varies from processor to processor
pub payment_checks: Option<serde_json::Value>,

/// Details about the threeds environment.
/// This is a free form field and the structure varies from processor to processor
pub authentication_data: Option<serde_json::Value>,
}

#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
Expand Down Expand Up @@ -2001,6 +2025,8 @@ pub struct CardResponse {
pub card_exp_month: Option<Secret<String>>,
pub card_exp_year: Option<Secret<String>>,
pub card_holder_name: Option<Secret<String>>,
pub payment_checks: Option<serde_json::Value>,
pub authentication_data: Option<serde_json::Value>,
}

#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]
Expand Down Expand Up @@ -3003,6 +3029,8 @@ impl From<AdditionalCardInfo> for CardResponse {
card_exp_month: card.card_exp_month,
card_exp_year: card.card_exp_year,
card_holder_name: card.card_holder_name,
payment_checks: card.payment_checks,
authentication_data: card.authentication_data,
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions crates/data_models/src/payments/payment_attempt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ pub enum PaymentAttemptUpdate {
encoded_data: Option<String>,
unified_code: Option<Option<String>>,
unified_message: Option<Option<String>>,
payment_method_data: Option<serde_json::Value>,
},
UnresolvedResponseUpdate {
status: storage_enums::AttemptStatus,
Expand Down Expand Up @@ -388,6 +389,7 @@ pub enum PaymentAttemptUpdate {
unified_code: Option<Option<String>>,
unified_message: Option<Option<String>>,
connector_transaction_id: Option<String>,
payment_method_data: Option<serde_json::Value>,
},
CaptureUpdate {
amount_to_capture: Option<i64>,
Expand Down
6 changes: 6 additions & 0 deletions crates/diesel_models/src/payment_attempt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ pub enum PaymentAttemptUpdate {
encoded_data: Option<String>,
unified_code: Option<Option<String>>,
unified_message: Option<Option<String>>,
payment_method_data: Option<serde_json::Value>,
},
UnresolvedResponseUpdate {
status: storage_enums::AttemptStatus,
Expand Down Expand Up @@ -295,6 +296,7 @@ pub enum PaymentAttemptUpdate {
unified_code: Option<Option<String>>,
unified_message: Option<Option<String>>,
connector_transaction_id: Option<String>,
payment_method_data: Option<serde_json::Value>,
},
CaptureUpdate {
amount_to_capture: Option<i64>,
Expand Down Expand Up @@ -661,6 +663,7 @@ impl From<PaymentAttemptUpdate> for PaymentAttemptUpdateInternal {
encoded_data,
unified_code,
unified_message,
payment_method_data,
} => Self {
status: Some(status),
connector: connector.map(Some),
Expand All @@ -681,6 +684,7 @@ impl From<PaymentAttemptUpdate> for PaymentAttemptUpdateInternal {
encoded_data,
unified_code,
unified_message,
payment_method_data,
..Default::default()
},
PaymentAttemptUpdate::ErrorUpdate {
Expand All @@ -694,6 +698,7 @@ impl From<PaymentAttemptUpdate> for PaymentAttemptUpdateInternal {
unified_code,
unified_message,
connector_transaction_id,
payment_method_data,
} => Self {
connector: connector.map(Some),
status: Some(status),
Expand All @@ -706,6 +711,7 @@ impl From<PaymentAttemptUpdate> for PaymentAttemptUpdateInternal {
unified_code,
unified_message,
connector_transaction_id,
payment_method_data,
..Default::default()
},
PaymentAttemptUpdate::StatusUpdate { status, updated_by } => Self {
Expand Down
5 changes: 2 additions & 3 deletions crates/router/src/connector/stripe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -673,10 +673,10 @@ impl

match id.get_connector_transaction_id() {
Ok(x) if x.starts_with("set") => Ok(format!(
"{}{}/{}",
"{}{}/{}?expand[0]=latest_attempt", // expand latest attempt to extract payment checks and three_d_secure data
self.base_url(connectors),
"v1/setup_intents",
x
x,
)),
Ok(x) => Ok(format!(
"{}{}/{}{}",
Expand Down Expand Up @@ -711,7 +711,6 @@ impl
res: types::Response,
) -> CustomResult<types::PaymentsSyncRouterData, errors::ConnectorError>
where
types::PaymentsAuthorizeData: Clone,
types::PaymentsResponseData: Clone,
{
let id = data.request.connector_transaction_id.clone();
Expand Down
Loading