Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
809da65
add address field and attempt_count in stripebilling webhook
Apr 2, 2025
8f160b0
Merge branch 'main' into stripebilling_transaction_monitoring_feilds
Apr 2, 2025
bd411f5
add endtime and start time of invoice in webhook
Apr 3, 2025
2e02b84
ran formatter
Apr 4, 2025
fd47398
add full address with encryption
Apr 4, 2025
4a82642
consumes required fields to support transaction monitoring[chargebee]
Apr 9, 2025
dd531f9
formats the code
Apr 9, 2025
01d98a0
Merge branch 'main' into support_for_storing_address
Apr 9, 2025
653cd5d
docs(openapi): re-generate OpenAPI specification
hyperswitch-bot[bot] Apr 9, 2025
6cae8e1
addresses clippy v2 failure
Apr 9, 2025
787912a
chore: run formatter
hyperswitch-bot[bot] Apr 9, 2025
a5c5d9a
makes billing address optional
Apr 10, 2025
da18869
Merge branch 'main' into stripebilling_transaction_monitoring_feilds
Apr 10, 2025
f5d5294
Merge branch 'support_for_storing_address' into stripebilling_transac…
Apr 10, 2025
826202a
adds get_billing_address_for_invoice function
Apr 10, 2025
d03c564
invoice from webhook for stripebilling
Apr 11, 2025
24dac12
add bool to get invoice from webhook or additional call
Apr 11, 2025
a4262c7
adds billing connector invoice sync flow
Apr 11, 2025
71ec2bc
typo fix
Apr 11, 2025
3b04911
add invoice sync flow to revenue recovery
Apr 11, 2025
44e5a18
chore: run formatter
hyperswitch-bot[bot] Apr 11, 2025
75ef438
adds config to fetch details
Apr 15, 2025
c53b310
recurly invoice sync connector inetgration support
Apr 17, 2025
0479693
add invoice sync call support in recovery incoming file
Apr 17, 2025
4227dfb
Merge branch 'main' into recurly_invoice_sync_support_with_transactio…
Apr 17, 2025
69d5d24
recoveryincoming changes
Apr 17, 2025
6764550
define ve type and change connector integration v1 to v2
Apr 21, 2025
2fe86f9
resolve clippy fails
Apr 21, 2025
3142502
add support for transaction monitoring for recurly
Apr 22, 2025
49f7a22
Merge branch 'main' into billing_connector_invoice_psync_call
Apr 22, 2025
b4c7e71
Merge branch 'billing_connector_invoice_psync_call' into recurly_invo…
Apr 22, 2025
a9899b5
resolve spell checks
Apr 22, 2025
e93d5a7
resolve spell checks
Apr 22, 2025
5aaaea6
Merge branch 'recurly_invoice_sync_support_with_transaction_monitorin…
Apr 23, 2025
da5a505
chore: run formatter
hyperswitch-bot[bot] Apr 23, 2025
d75b207
format the code and remove print statements
Apr 23, 2025
c9f7aa6
cleaning up recurly code
Apr 24, 2025
9bebc57
fix clippy_errors
Apr 24, 2025
86c9715
removed recurly tests since we dont have any payment related thngs to…
Apr 27, 2025
272c416
resolve clippy error
Apr 28, 2025
7378787
Merge branch 'main' into billing_connector_invoice_psync_call
NISHANTH1221 Apr 28, 2025
23ed82c
resolve clippy errors
Apr 28, 2025
23e13fa
resolve merge conflicts
Apr 28, 2025
9e30a2a
Merge branch 'main' into recurly_invoice_sync_support_with_transactio…
Apr 29, 2025
eaf1e40
resolve clippy errors
Apr 29, 2025
b154311
Merge branch 'recurly_invoice_sync_support_with_transaction_monitorin…
NISHANTH1221 Apr 29, 2025
d2e3caa
remove string based matching
Apr 29, 2025
1110062
chore: run formatter
hyperswitch-bot[bot] Apr 29, 2025
7170f7a
Merge branch 'main' into recurly_invoice_sync_support_with_transactio…
Apr 29, 2025
79d8e64
resolve error in clippy-v2
Apr 29, 2025
964fd78
removes unncessary billing address function in Incoming Webhook Trait
Apr 29, 2025
fda03ea
recurly add comment on why we dont need amount convertor
Apr 29, 2025
3e619b7
format the code
Apr 29, 2025
054bf7f
Merge branch 'recurly_invoice_sync_support_with_transaction_monitorin…
Apr 29, 2025
f916cb5
add white space
Apr 29, 2025
f0fe9d5
Merge branch 'main' into stripebilling_transaction_monitoring_feilds
May 2, 2025
1fdab57
consume card details from billing connectors
May 21, 2025
e1483a3
Merge branch 'main' into add_card_information_for_billing_connectors
May 28, 2025
264766f
small bug fix for stripebilling external payments sync flow
May 28, 2025
4c0503d
add connector level support to consume card network and card bin
Jun 2, 2025
4386261
Final Adjustments
Jun 4, 2025
a4aac2a
chore: run formatter
hyperswitch-bot[bot] Jun 4, 2025
1bdedf7
add card network in stripe billing
Jun 5, 2025
98aeceb
add open api changes
Jun 5, 2025
f478efb
Merge branch 'main' into add_card_information_for_billing_connectors
NISHANTH1221 Jun 5, 2025
38378f9
docs(openapi): re-generate OpenAPI specification
hyperswitch-bot[bot] Jun 5, 2025
d4b6025
add error codes
Jun 6, 2025
b7fc94e
bring back v1 from v2
Jun 8, 2025
ad3beaa
chore: run formatter
hyperswitch-bot[bot] Jun 8, 2025
c6ed016
docs(openapi): re-generate OpenAPI specification
hyperswitch-bot[bot] Jun 8, 2025
49e68b5
write correct example for card issuer
Jun 8, 2025
35eae6a
docs(openapi): re-generate OpenAPI specification
hyperswitch-bot[bot] Jun 8, 2025
9770ff6
resolves comments
Jun 10, 2025
bd1913e
Rename comments
NISHANTH1221 Jun 11, 2025
f89bf01
chore: run formatter
hyperswitch-bot[bot] Jun 11, 2025
88671ca
Merge branch 'main' into add_card_information_for_billing_connectors
NISHANTH1221 Jun 11, 2025
ffd75fe
add new BillingConnectorPaymentMethodDetails enum
Jun 11, 2025
2b1d402
chore: run formatter
hyperswitch-bot[bot] Jun 11, 2025
401c7b5
Merge branch 'main' into add_card_information_for_billing_connectors
Jun 12, 2025
aa325bd
make the enum optional
Jun 12, 2025
feb3f88
chore: run formatter
hyperswitch-bot[bot] Jun 12, 2025
89405fb
revert default version and add box pin
Jun 12, 2025
5cead6b
add v2 feeature flag on conversions
Jun 12, 2025
5de0d97
add type serde tag and write an time stamp desrializing tag on primit…
Jun 12, 2025
1b768bf
Merge branch 'main' into add_card_information_for_billing_connectors
NISHANTH1221 Jun 12, 2025
ba0f74d
make open api changes
Jun 13, 2025
35fa8ce
chore: run formatter
hyperswitch-bot[bot] Jun 13, 2025
f3475b9
Merge branch 'main' into add_card_information_for_billing_connectors
Jun 13, 2025
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
66 changes: 65 additions & 1 deletion api-reference/v2/openapi_spec_v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -6780,6 +6780,23 @@
}
}
},
"BillingConnectorAdditionalCardInfo": {
"type": "object",
"required": [
"card_network"
],
"properties": {
"card_network": {
"$ref": "#/components/schemas/CardNetwork"
},
"card_issuer": {
"type": "string",
"description": "Card Issuer",
"example": "JP MORGAN CHASE",
"nullable": true
}
}
},
"BillingConnectorPaymentDetails": {
"type": "object",
"required": [
Expand All @@ -6797,6 +6814,31 @@
}
}
},
"BillingConnectorPaymentMethodDetails": {
"oneOf": [
{
"type": "object",
"required": [
"type",
"value"
],
"properties": {
"type": {
"type": "string",
"enum": [
"card"
]
},
"value": {
"$ref": "#/components/schemas/BillingConnectorAdditionalCardInfo"
}
}
}
],
"discriminator": {
"propertyName": "type"
}
},
"BlikBankRedirectAdditionalData": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -17854,7 +17896,8 @@
"billing_connector_payment_details",
"payment_method_type",
"payment_method_subtype",
"connector"
"connector",
"billing_connector_payment_method_details"
],
"properties": {
"total_retry_count": {
Expand Down Expand Up @@ -17894,11 +17937,32 @@
"connector": {
"$ref": "#/components/schemas/Connector"
},
"billing_connector_payment_method_details": {
"$ref": "#/components/schemas/BillingConnectorPaymentMethodDetails"
},
"invoice_next_billing_time": {
"type": "string",
"format": "date-time",
"description": "Invoice Next billing time",
"nullable": true
},
"first_payment_attempt_pg_error_code": {
"type": "string",
"description": "First Payment Attempt Payment Gateway Error Code",
"example": "card_declined",
"nullable": true
},
"first_payment_attempt_network_decline_code": {
"type": "string",
"description": "First Payment Attempt Network Error Code",
"example": "05",
"nullable": true
},
"first_payment_attempt_network_advice_code": {
"type": "string",
"description": "First Payment Attempt Network Advice Code",
"example": "02",
"nullable": true
}
}
},
Expand Down
40 changes: 40 additions & 0 deletions crates/api_models/src/payments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8694,9 +8694,41 @@ pub struct PaymentRevenueRecoveryMetadata {
/// The name of the payment connector through which the payment attempt was made.
#[schema(value_type = Connector, example = "stripe")]
pub connector: common_enums::connector_enums::Connector,
#[schema(value_type = BillingConnectorPaymentMethodDetails)]
/// Extra Payment Method Details that are needed to be stored
pub billing_connector_payment_method_details: Option<BillingConnectorPaymentMethodDetails>,
/// Invoice Next billing time
#[serde(default, with = "common_utils::custom_serde::iso8601::option")]
pub invoice_next_billing_time: Option<PrimitiveDateTime>,
/// First Payment Attempt Payment Gateway Error Code
#[schema(value_type = Option<String>, example = "card_declined")]
pub first_payment_attempt_pg_error_code: Option<String>,
/// First Payment Attempt Network Error Code
#[schema(value_type = Option<String>, example = "05")]
pub first_payment_attempt_network_decline_code: Option<String>,
/// First Payment Attempt Network Advice Code
#[schema(value_type = Option<String>, example = "02")]
pub first_payment_attempt_network_advice_code: Option<String>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need network error message? if not, why are we not including ?

Copy link
Contributor Author

@NISHANTH1221 NISHANTH1221 Jun 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Network decline code is Network error code

}

#[cfg(feature = "v2")]
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize, ToSchema)]
#[serde(rename_all = "snake_case", tag = "type", content = "value")]
pub enum BillingConnectorPaymentMethodDetails {
Card(BillingConnectorAdditionalCardInfo),
}

#[cfg(feature = "v2")]
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize, ToSchema)]
pub struct BillingConnectorAdditionalCardInfo {
#[schema(value_type = CardNetwork, example = "Visa")]
/// Card Network
pub card_network: Option<common_enums::enums::CardNetwork>,
#[schema(value_type = Option<String>, example = "JP MORGAN CHASE")]
/// Card Issuer
pub card_issuer: Option<String>,
}

#[cfg(feature = "v2")]
impl PaymentRevenueRecoveryMetadata {
pub fn set_payment_transmission_field_for_api_request(
Expand Down Expand Up @@ -8810,6 +8842,14 @@ pub struct PaymentsAttemptRecordRequest {
/// source where the payment was triggered by
#[schema(value_type = TriggeredBy, example = "internal" )]
pub triggered_by: common_enums::TriggeredBy,

#[schema(value_type = CardNetwork, example = "Visa" )]
/// card_network
pub card_network: Option<common_enums::CardNetwork>,

#[schema(example = "Chase")]
/// Card Issuer
pub card_issuer: Option<String>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this bin or issuer name ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its issuer name

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please change relevent comment then

}

/// Error details for the payment
Expand Down
24 changes: 24 additions & 0 deletions crates/diesel_models/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,14 @@ pub struct PaymentRevenueRecoveryMetadata {
pub connector: common_enums::connector_enums::Connector,
/// Time at which next invoice will be created
pub invoice_next_billing_time: Option<time::PrimitiveDateTime>,
/// Extra Payment Method Details that are needed to be stored
pub billing_connector_payment_method_details: Option<BillingConnectorPaymentMethodDetails>,
/// First Payment Attempt Payment Gateway Error Code
pub first_payment_attempt_pg_error_code: Option<String>,
/// First Payment Attempt Network Error Code
pub first_payment_attempt_network_decline_code: Option<String>,
/// First Payment Attempt Network Advice Code
pub first_payment_attempt_network_advice_code: Option<String>,
}

#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
Expand All @@ -184,3 +192,19 @@ pub struct BillingConnectorPaymentDetails {
/// Billing Connector's Customer Id
pub connector_customer_id: String,
}

#[cfg(feature = "v2")]
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "snake_case", tag = "type", content = "value")]
pub enum BillingConnectorPaymentMethodDetails {
Card(BillingConnectorAdditionalCardInfo),
}

#[cfg(feature = "v2")]
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
pub struct BillingConnectorAdditionalCardInfo {
/// Card Network
pub card_network: Option<common_enums::enums::CardNetwork>,
/// Card Issuer
pub card_issuer: Option<String>,
}
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,8 @@ pub struct ChargebeePaymentMethodDetails {
#[derive(Serialize, Deserialize, Debug)]
pub struct ChargebeeCardDetails {
funding_type: ChargebeeFundingType,
brand: common_enums::CardNetwork,
iin: String,
}

#[derive(Serialize, Deserialize, Debug)]
Expand Down Expand Up @@ -505,6 +507,8 @@ impl TryFrom<ChargebeeWebhookBody> for revenue_recovery::RevenueRecoveryAttemptD
network_error_message: None,
retry_count,
invoice_next_billing_time,
card_network: Some(payment_method_details.card.brand),
card_isin: Some(payment_method_details.card.iin),
})
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ pub struct PaymentMethod {
pub gateway_token: String,
pub funding_source: RecurlyFundingTypes,
pub object: RecurlyPaymentObject,
pub card_type: common_enums::CardNetwork,
pub first_six: String,
}

#[derive(Debug, Serialize, Deserialize)]
Expand Down Expand Up @@ -204,6 +206,8 @@ impl
payment_method_type: common_enums::PaymentMethod::from(
item.response.payment_method.object,
),
card_network: Some(item.response.payment_method.card_type),
card_isin: Some(item.response.payment_method.first_six),
},
),
..item.data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,14 +439,15 @@ pub struct StripebillingLatestChargeData {
pub payment_method_details: StripePaymentMethodDetails,
#[serde(rename = "invoice")]
pub invoice_id: String,
pub payment_intent: String,
}

#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct StripePaymentMethodDetails {
#[serde(rename = "type")]
pub type_of_payment_method: StripebillingPaymentMethod,
#[serde(rename = "card")]
pub card_funding_type: StripeCardFundingTypeDetails,
pub card_details: StripeBillingCardDetails,
}

#[derive(Serialize, Deserialize, Debug, Clone, Copy)]
Expand All @@ -456,10 +457,31 @@ pub enum StripebillingPaymentMethod {
}

#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct StripeCardFundingTypeDetails {
pub struct StripeBillingCardDetails {
pub network: StripebillingCardNetwork,
pub funding: StripebillingFundingTypes,
}

#[derive(Serialize, Deserialize, Debug, Clone, Copy)]
#[serde(rename_all = "snake_case")]
pub enum StripebillingCardNetwork {
Visa,
Mastercard,
AmericanExpress,
JCB,
DinersClub,
Discover,
CartesBancaires,
UnionPay,
Interac,
RuPay,
Maestro,
Star,
Pulse,
Accel,
Nyce,
}

#[derive(Serialize, Deserialize, Debug, Clone, Copy)]
#[serde(rename = "snake_case")]
pub enum StripebillingFundingTypes {
Expand Down Expand Up @@ -509,7 +531,7 @@ impl
field_name: "invoice_id",
})?;
let connector_transaction_id = Some(common_utils::types::ConnectorTransactionId::from(
charge_details.charge_id,
charge_details.payment_intent,
));

Ok(Self {
Expand All @@ -529,14 +551,16 @@ impl
connector_customer_id: charge_details.customer,
transaction_created_at: Some(charge_details.created),
payment_method_sub_type: common_enums::PaymentMethodType::from(
charge_details
.payment_method_details
.card_funding_type
.funding,
charge_details.payment_method_details.card_details.funding,
),
payment_method_type: common_enums::PaymentMethod::from(
charge_details.payment_method_details.type_of_payment_method,
),
card_network: Some(common_enums::CardNetwork::from(
charge_details.payment_method_details.card_details.network,
)),
// Todo: Fetch Card issuer details. Generally in the other billing connector we are getting card_issuer using the card bin info. But stripe dosent provide any such details. We should find a way for stripe billing case
card_isin: None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add comment how we are planning to fetch card_isin ?

},
),
..item.data
Expand Down Expand Up @@ -611,3 +635,25 @@ impl
})
}
}

impl From<StripebillingCardNetwork> for enums::CardNetwork {
fn from(item: StripebillingCardNetwork) -> Self {
match item {
StripebillingCardNetwork::Visa => Self::Visa,
StripebillingCardNetwork::Mastercard => Self::Mastercard,
StripebillingCardNetwork::AmericanExpress => Self::AmericanExpress,
StripebillingCardNetwork::JCB => Self::JCB,
StripebillingCardNetwork::DinersClub => Self::DinersClub,
StripebillingCardNetwork::Discover => Self::Discover,
StripebillingCardNetwork::CartesBancaires => Self::CartesBancaires,
StripebillingCardNetwork::UnionPay => Self::UnionPay,
StripebillingCardNetwork::Interac => Self::Interac,
StripebillingCardNetwork::RuPay => Self::RuPay,
StripebillingCardNetwork::Maestro => Self::Maestro,
StripebillingCardNetwork::Star => Self::Star,
StripebillingCardNetwork::Pulse => Self::Pulse,
StripebillingCardNetwork::Accel => Self::Accel,
StripebillingCardNetwork::Nyce => Self::Nyce,
}
}
}
Loading
Loading