Skip to content
Merged
Show file tree
Hide file tree
Changes from 112 commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
a0ffaa7
add template code for stripebilling
Feb 9, 2025
bb432a5
add logic instead of todo in template code
Feb 9, 2025
4555023
chore: run formatter
hyperswitch-bot[bot] Feb 9, 2025
8ab0630
Merge branch 'main' into template_code_stripebilling
Feb 13, 2025
2ad25d7
fixes errors
Feb 13, 2025
3c38093
chore: run formatter
hyperswitch-bot[bot] Feb 13, 2025
a2ca88b
Merge branch 'main' into template_code_stripebilling
NISHANTH1221 Feb 24, 2025
4412b10
resolved error in default implementation
Feb 24, 2025
d6c7f7a
additional api call flow for revenue recovery
Feb 27, 2025
0139e03
Merge branch 'main' into template_code_stripebilling
Feb 27, 2025
ccfcff3
chore: run formatter
hyperswitch-bot[bot] Feb 27, 2025
4abdce9
Merge branch 'main' into template_code_stripebilling
NISHANTH1221 Mar 2, 2025
6e08413
Merge branch 'main' into template_code_stripebilling
NISHANTH1221 Mar 3, 2025
edbe0bd
add incoming webhook support and recovery invoice flow
Mar 3, 2025
3295979
chore: run formatter
hyperswitch-bot[bot] Mar 3, 2025
0d5a8ea
changes in name of the flow in config files
Mar 3, 2025
1ad2464
chore: run formatter
hyperswitch-bot[bot] Mar 3, 2025
24dd8cf
cargo.toml changes in par with main
Mar 3, 2025
70b7546
Merge branch 'template_code_stripebilling' into additional_recovery_c…
NISHANTH1221 Mar 3, 2025
966ce1b
add paystack in deafult implememtation additional call flow
Mar 3, 2025
6f4573a
Merge branch 'main' into additional_recovery_call_flow
NISHANTH1221 Mar 3, 2025
4a34e07
added paystack connector in default implementation
Mar 3, 2025
e10b589
add debug and clone trait to Additional Revenue Recovery Flow Common …
Mar 3, 2025
145a6d9
chore: run formatter
hyperswitch-bot[bot] Mar 3, 2025
2cc26be
resolve spell check
Mar 3, 2025
70a430f
add stripebilling in configs
Mar 3, 2025
c9ae685
refactor: rename Additional Revenue Recovery related types and traits
Mar 4, 2025
65326ec
Merge branch 'main' into stripebilling_incoming_webhook_support
Mar 4, 2025
524cce1
chore: run formatter
hyperswitch-bot[bot] Mar 4, 2025
66132cb
refactor: reorganize revenue recovery module structure
Mar 4, 2025
f2d5295
Merge branch 'additional_recovery_call_flow' into stripebilling_incom…
Mar 4, 2025
fc01f6c
chore: run formatter
hyperswitch-bot[bot] Mar 4, 2025
f93bbc6
Merge branch 'main' into additional_recovery_call_flow
NISHANTH1221 Mar 4, 2025
cec5702
Merge branch 'additional_recovery_call_flow' into stripebilling_incom…
Mar 4, 2025
51e6dcd
change v2 to v1
Mar 4, 2025
2cd73be
chore: run formatter
hyperswitch-bot[bot] Mar 4, 2025
e5b8314
refactor: update additional revenue recovery call implementations for…
Mar 4, 2025
eaaa438
Merge branch 'additional_recovery_call_flow' into stripebilling_incom…
NISHANTH1221 Mar 4, 2025
25855cc
refactor: add RevenueRecovery trait and update related implementations
Mar 4, 2025
ad1e7dd
chore: run formatter
hyperswitch-bot[bot] Mar 4, 2025
7c05cb5
refactor: update revenue recovery request data structure
Mar 4, 2025
8cd127d
refactor: add necessary changes for connector to be enabled and reolv…
Mar 5, 2025
80ac277
removed unnecessary comments
Mar 5, 2025
738c251
chore: run formatter
hyperswitch-bot[bot] Mar 5, 2025
66e85bc
Merge branch 'additional_recovery_call_flow' into stripebilling_incom…
Mar 5, 2025
f09f19c
Merge branch 'main' into additional_recovery_call_flow
NISHANTH1221 Mar 5, 2025
968ba54
feat: Add Stripebilling revenue recovery support and additional detai…
Mar 5, 2025
5bf5bf1
feat(connector): add Recurly to additional revenue recovery call
Mar 5, 2025
43275b8
Merge branch 'additional_recovery_call_flow' into stripebilling_incom…
Mar 5, 2025
21d47f2
Merge branch 'stripebilling_incoming_webhook_support' into billing_co…
Mar 5, 2025
2e38d3b
Merge branch 'main' into stripebilling_incoming_webhook_support
NISHANTH1221 Mar 6, 2025
11f4ae4
feat(connector): Enable Stripebilling webhook support with additional…
Mar 7, 2025
44cf2c4
chore: run formatter
hyperswitch-bot[bot] Mar 7, 2025
ec4aa43
Switch default feature from v2 to v1
Mar 7, 2025
2a0965b
Merge branch 'main' into stripebilling_incoming_webhook_support
NISHANTH1221 Mar 7, 2025
c3aca3a
Merge branch 'main' into stripebilling_incoming_webhook_support
NISHANTH1221 Mar 10, 2025
48395a4
Merge branch 'stripebilling_incoming_webhook_support' into billing_co…
Mar 10, 2025
b1a2f3a
Adds Hipay and Juspaythreedsserver to revenue recovery flow
Mar 10, 2025
8c5f05d
chore: run formatter
hyperswitch-bot[bot] Mar 10, 2025
0e8966c
Merge branch 'main' into stripebilling_incoming_webhook_support
NISHANTH1221 Mar 10, 2025
1598eeb
Merge branch 'main' into stripebilling_incoming_webhook_support
NISHANTH1221 Mar 11, 2025
a8a9777
Merge branch 'stripebilling_incoming_webhook_support' into billing_co…
NISHANTH1221 Mar 11, 2025
55347ff
resolve stripebilling payment mca issue
Mar 11, 2025
5f21920
Merge branch 'main' into stripebilling_incoming_webhook_support
Mar 12, 2025
c234e27
resolve spell check
Mar 12, 2025
74451f8
Merge branch 'main' into stripebilling_incoming_webhook_support
NISHANTH1221 Mar 12, 2025
9fe1b4e
refactor hanging functions in recoevry_incoming
Mar 13, 2025
663bb0d
spell check resolve
Mar 13, 2025
ff80f84
spell check resolve
Mar 13, 2025
ac5e0cb
Merge branch 'main' into stripebilling_incoming_webhook_support
NISHANTH1221 Mar 13, 2025
f5629b7
Merge branch 'stripebilling_incoming_webhook_support' into billing_co…
Mar 13, 2025
398c61e
chore: run formatter
hyperswitch-bot[bot] Mar 13, 2025
2f7d5af
feat(revenue_recovery): derive Debug and Clone for GetAdditionalReven…
Mar 13, 2025
d1f79e2
chore: run formatter
hyperswitch-bot[bot] Mar 13, 2025
be2855b
solved the errors in the flow
Mar 13, 2025
439da0b
chore: run formatter
hyperswitch-bot[bot] Mar 13, 2025
a76bfe5
Merge branch 'main' into stripebilling_incoming_webhook_support
NISHANTH1221 Mar 13, 2025
0d4b48f
Merge branch 'stripebilling_incoming_webhook_support' into billing_co…
Mar 13, 2025
c86fb35
chore: run formatter
hyperswitch-bot[bot] Mar 13, 2025
c98e0e4
Merge branch 'main' into stripebilling_incoming_webhook_support
NISHANTH1221 Mar 17, 2025
9c330c4
refactor: update failure_code and failure_message to be optional; rem…
Mar 17, 2025
299c68b
Merge branch 'stripebilling_incoming_webhook_support' into billing_co…
NISHANTH1221 Mar 17, 2025
effae0b
chore: run formatter
hyperswitch-bot[bot] Mar 17, 2025
77bb4bf
remove print statements
Mar 17, 2025
0654060
chore: run formatter
hyperswitch-bot[bot] Mar 17, 2025
0aaed17
Merge branch 'main' into billing_connector_additional_api_call_flow
Mar 17, 2025
ab5a21e
chore: run formatter
hyperswitch-bot[bot] Mar 17, 2025
0e53ec7
resolve merge errors
Mar 17, 2025
10034e2
chore: run formatter
hyperswitch-bot[bot] Mar 17, 2025
97eaa8f
Merge branch 'main' into billing_connector_additional_api_call_flow
Mar 18, 2025
ad85e5f
chore: run formatter
hyperswitch-bot[bot] Mar 18, 2025
b947288
resolve clippy errors
Mar 18, 2025
7ba0527
Simplify webhook event handling and improve data cloning in revenue r…
Mar 19, 2025
64d00ed
remove print statement
Mar 19, 2025
7f6dd29
refactor match statments
Mar 20, 2025
7ef279f
format code
Mar 20, 2025
8e5b5f1
refactor object reference id tuple implementation to object reference…
Mar 20, 2025
b0738ec
Merge branch 'main' into billing_connector_additional_api_call_flow
NISHANTH1221 Mar 20, 2025
8ae6fb7
docs(openapi): re-generate OpenAPI specification
hyperswitch-bot[bot] Mar 20, 2025
ec69c03
Merge branch 'main' into billing_connector_additional_api_call_flow
aniketburman014 Mar 20, 2025
640c690
reduced match statements
Mar 21, 2025
ca92111
chore: run formatter
hyperswitch-bot[bot] Mar 21, 2025
3da0b3d
specific import resolve
Mar 21, 2025
404d5fb
use router data v2 and converts it into v1 while calling
Mar 23, 2025
d4a64e2
chore: run formatter
hyperswitch-bot[bot] Mar 23, 2025
bb63b04
refactor minor changes
Mar 24, 2025
756edcb
formatter
Mar 24, 2025
c771b3e
Merge branch 'main' into billing_connector_additional_api_call_flow
Mar 24, 2025
2b14293
format code
Mar 24, 2025
8a107d8
handle other additional revenue recovery id types
Mar 24, 2025
0b15b29
Merge branch 'main' into billing_connector_additional_api_call_flow
NISHANTH1221 Mar 25, 2025
59fd066
remove unnecesssary comment
Mar 25, 2025
76ca75b
refactor(webhooks): remove AdditionalRevenueRecoveryId and update rel…
Mar 26, 2025
95a77d7
Merge branch 'main' into billing_connector_additional_api_call_flow
Mar 26, 2025
b391c2d
chore: run formatter
hyperswitch-bot[bot] Mar 26, 2025
38678ce
resolve conficts
Mar 26, 2025
cd846e1
change additional revenue recovery to billing conenctor payment sync
Mar 27, 2025
7006f1d
chore: run formatter
hyperswitch-bot[bot] Mar 27, 2025
8364cb1
comment change
Mar 27, 2025
2ef938d
Merge branch 'main' into billing_connector_additional_api_call_flow
Mar 27, 2025
dfe7a20
resolve merge conflicts
Mar 27, 2025
bd578f2
spell check resolve
Mar 27, 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
2 changes: 2 additions & 0 deletions api-reference-v2/openapi_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -7677,6 +7677,7 @@
"square",
"stax",
"stripe",
"stripebilling",
"taxjar",
"threedsecureio",
"trustpay",
Expand Down Expand Up @@ -20583,6 +20584,7 @@
"square",
"stax",
"stripe",
"stripebilling",
"trustpay",
"tsys",
"volt",
Expand Down
2 changes: 2 additions & 0 deletions api-reference/openapi_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -9859,6 +9859,7 @@
"square",
"stax",
"stripe",
"stripebilling",
"taxjar",
"threedsecureio",
"trustpay",
Expand Down Expand Up @@ -25109,6 +25110,7 @@
"square",
"stax",
"stripe",
"stripebilling",
"trustpay",
"tsys",
"volt",
Expand Down
57 changes: 57 additions & 0 deletions crates/api_models/src/webhooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@ pub enum ObjectReferenceId {
PayoutId(PayoutIdType),
#[cfg(all(feature = "revenue_recovery", feature = "v2"))]
InvoiceId(InvoiceIdType),
#[cfg(all(feature = "revenue_recovery", feature = "v2"))]
AdditionalRevenueRecoveryId(AdditionalRevenueRecoveryIdType),
Copy link
Member

Choose a reason for hiding this comment

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

why this is AdditionalRevenueRecoveryId rather RevenueRecoveryId?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

wanted to specify what that Id is for So named it after Additional

}

#[cfg(all(feature = "revenue_recovery", feature = "v2"))]
Expand All @@ -261,6 +263,61 @@ pub enum InvoiceIdType {
ConnectorInvoiceId(String),
}

#[cfg(all(feature = "revenue_recovery", feature = "v2"))]
#[derive(Clone)]
pub enum AdditionalRevenueRecoveryIdType {
AdditionalRevenueRecoveryCallId(String),
}

#[cfg(all(feature = "revenue_recovery", feature = "v2"))]
impl ObjectReferenceId {
pub fn get_additional_revenue_recovery_id_as_string(
self,
) -> Result<String, common_utils::errors::ValidationError> {
match self {
Self::AdditionalRevenueRecoveryId(
AdditionalRevenueRecoveryIdType::AdditionalRevenueRecoveryCallId(data),
) => Ok(data),
Self::PaymentId(_) => Err(
common_utils::errors::ValidationError::IncorrectValueProvided {
field_name: "AdditionalRevenueRecoveryId is required but received PaymentId",
},
),
Self::RefundId(_) => Err(
common_utils::errors::ValidationError::IncorrectValueProvided {
field_name: "AdditionalRevenueRecoveryId is required but received RefundId",
},
),
Self::MandateId(_) => Err(
common_utils::errors::ValidationError::IncorrectValueProvided {
field_name: "AdditionalRevenueRecoveryId is required but received MandateId",
},
),
Self::ExternalAuthenticationID(_) => Err(
common_utils::errors::ValidationError::IncorrectValueProvided {
field_name: "AdditionalRevenueRecoveryId is required but received ExternalAuthenticationID",
},
),
#[cfg(feature = "payouts")]
Self::PayoutId(_) => Err(
common_utils::errors::ValidationError::IncorrectValueProvided {
field_name: "AdditionalRevenueRecoveryId is required but received PayoutId",
},
),
Self::InvoiceId(_) => Err(
common_utils::errors::ValidationError::IncorrectValueProvided {
field_name: "AdditionalRevenueRecoveryId is required but received InvoiceId",
},
),
Self::AdditionalRevenueRecoveryId(_) => Err(
common_utils::errors::ValidationError::IncorrectValueProvided {
field_name: "AdditionalRevenueRecoveryId of type AdditionalRevenueRecoveryCallId is required but received other variant",
},
)
}
}
}

pub struct IncomingWebhookDetails {
pub object_reference_id: ObjectReferenceId,
pub resource_object: Vec<u8>,
Expand Down
8 changes: 4 additions & 4 deletions crates/common_enums/src/connector_enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ pub enum RoutableConnectors {
Square,
Stax,
Stripe,
//Stripebilling,
Stripebilling,
// Taxjar,
Trustpay,
// Thunes
Expand Down Expand Up @@ -272,7 +272,7 @@ pub enum Connector {
Square,
Stax,
Stripe,
// Stripebilling,
Stripebilling,
Taxjar,
Threedsecureio,
//Thunes,
Expand Down Expand Up @@ -423,7 +423,7 @@ impl Connector {
| Self::Shift4
| Self::Square
| Self::Stax
// | Self::Stripebilling
| Self::Stripebilling
| Self::Taxjar
// | Self::Thunes
| Self::Trustpay
Expand Down Expand Up @@ -573,7 +573,7 @@ impl From<RoutableConnectors> for Connector {
RoutableConnectors::Square => Self::Square,
RoutableConnectors::Stax => Self::Stax,
RoutableConnectors::Stripe => Self::Stripe,
// RoutableConnectors::Stripebilling => Self::Stripebilling,
RoutableConnectors::Stripebilling => Self::Stripebilling,
RoutableConnectors::Trustpay => Self::Trustpay,
RoutableConnectors::Tsys => Self::Tsys,
RoutableConnectors::Volt => Self::Volt,
Expand Down
4 changes: 2 additions & 2 deletions crates/connector_configs/src/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ pub struct ConnectorConfig {
pub stripe: Option<ConnectorTomlConfig>,
#[cfg(feature = "payouts")]
pub stripe_payout: Option<ConnectorTomlConfig>,
// pub stripebilling : Option<ConnectorTomlConfig>,
pub stripebilling: Option<ConnectorTomlConfig>,
pub signifyd: Option<ConnectorTomlConfig>,
pub trustpay: Option<ConnectorTomlConfig>,
pub threedsecureio: Option<ConnectorTomlConfig>,
Expand Down Expand Up @@ -411,7 +411,7 @@ impl ConnectorConfig {
Connector::Square => Ok(connector_data.square),
Connector::Stax => Ok(connector_data.stax),
Connector::Stripe => Ok(connector_data.stripe),
// Connector::Stripebilling => Ok(connector_data.stripebilling),
Connector::Stripebilling => Ok(connector_data.stripebilling),
Connector::Trustpay => Ok(connector_data.trustpay),
Connector::Threedsecureio => Ok(connector_data.threedsecureio),
Connector::Taxjar => Ok(connector_data.taxjar),
Expand Down
143 changes: 132 additions & 11 deletions crates/hyperswitch_connectors/src/connectors/stripebilling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ use common_utils::{
types::{AmountConvertor, StringMinorUnit, StringMinorUnitForConnector},
};
use error_stack::{report, ResultExt};
#[cfg(all(feature = "v2", feature = "revenue_recovery"))]
use hyperswitch_domain_models::revenue_recovery;
use hyperswitch_domain_models::{
router_data::{AccessToken, ConnectorAuthType, ErrorResponse, RouterData},
router_flow_types::{
Expand All @@ -29,10 +31,16 @@ use hyperswitch_domain_models::{
};
#[cfg(all(feature = "v2", feature = "revenue_recovery"))]
use hyperswitch_domain_models::{
router_flow_types::RecoveryRecordBack,
router_request_types::revenue_recovery::RevenueRecoveryRecordBackRequest,
router_response_types::revenue_recovery::RevenueRecoveryRecordBackResponse,
types::RevenueRecoveryRecordBackRouterData,
router_flow_types::revenue_recovery::{
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
router_flow_types::revenue_recovery::{
router_flow_types::revenue_recovery

GetAdditionalRevenueRecoveryDetails, RecoveryRecordBack,
},
router_request_types::revenue_recovery::{
GetAdditionalRevenueRecoveryRequestData, RevenueRecoveryRecordBackRequest,
},
router_response_types::revenue_recovery::{
GetAdditionalRevenueRecoveryResponseData, RevenueRecoveryRecordBackResponse,
},
types::{AdditionalRevenueRecoveryDetailsRouterData, RevenueRecoveryRecordBackRouterData},
};
use hyperswitch_interfaces::{
api::{
Expand All @@ -45,7 +53,10 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
use masking::{ExposeInterface, Mask};
#[cfg(all(feature = "v2", feature = "revenue_recovery"))]
use masking::ExposeInterface;
use masking::{Mask, PeekInterface};
use stripebilling::auth_headers;
use transformers as stripebilling;

use crate::{constants::headers, types::ResponseRouterData, utils};
Expand Down Expand Up @@ -77,6 +88,8 @@ impl api::RefundSync for Stripebilling {}
impl api::PaymentToken for Stripebilling {}
#[cfg(all(feature = "revenue_recovery", feature = "v2"))]
impl api::revenue_recovery::RevenueRecoveryRecordBack for Stripebilling {}
#[cfg(all(feature = "v2", feature = "revenue_recovery"))]
impl api::AdditionalRevenueRecovery for Stripebilling {}

impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData>
for Stripebilling
Expand Down Expand Up @@ -126,10 +139,16 @@ impl ConnectorCommon for Stripebilling {
) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
let auth = stripebilling::StripebillingAuthType::try_from(auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
headers::AUTHORIZATION.to_string(),
auth.api_key.expose().into_masked(),
)])
Ok(vec![
(
headers::AUTHORIZATION.to_string(),
format!("Bearer {}", auth.api_key.peek()).into_masked(),
),
(
auth_headers::STRIPE_API_VERSION.to_string(),
auth_headers::STRIPE_VERSION.to_string().into_masked(),
),
])
}

fn build_error_response(
Expand Down Expand Up @@ -559,6 +578,88 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Stripebil
}
}

#[cfg(all(feature = "v2", feature = "revenue_recovery"))]
impl
ConnectorIntegration<
GetAdditionalRevenueRecoveryDetails,
GetAdditionalRevenueRecoveryRequestData,
GetAdditionalRevenueRecoveryResponseData,
> for Stripebilling
{
fn get_headers(
&self,
req: &AdditionalRevenueRecoveryDetailsRouterData,
connectors: &Connectors,
) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
self.build_headers(req, connectors)
}

fn get_content_type(&self) -> &'static str {
self.common_get_content_type()
}

fn get_url(
&self,
req: &AdditionalRevenueRecoveryDetailsRouterData,
connectors: &Connectors,
) -> CustomResult<String, errors::ConnectorError> {
Ok(format!(
"{}v1/charges/{}",
self.base_url(connectors),
req.request.additional_revenue_recovery_id
))
}

fn build_request(
&self,
req: &AdditionalRevenueRecoveryDetailsRouterData,
connectors: &Connectors,
) -> CustomResult<Option<Request>, errors::ConnectorError> {
let request = RequestBuilder::new()
.method(Method::Get)
.url(&types::AdditionalRevenueRecoveryCallType::get_url(
self, req, connectors,
)?)
.attach_default_headers()
.headers(types::AdditionalRevenueRecoveryCallType::get_headers(
self, req, connectors,
)?)
.build();
Ok(Some(request))
}

fn handle_response(
&self,
data: &AdditionalRevenueRecoveryDetailsRouterData,
event_builder: Option<&mut ConnectorEvent>,
res: Response,
) -> CustomResult<AdditionalRevenueRecoveryDetailsRouterData, errors::ConnectorError> {
let response: stripebilling::StripebillingRecoveryDetailsData = res
.response
.parse_struct::<stripebilling::StripebillingRecoveryDetailsData>(
"StripebillingRecoveryDetailsData",
)
.change_context(errors::ConnectorError::ResponseDeserializationFailed)?;

event_builder.map(|i| i.set_response_body(&response));
router_env::logger::info!(connector_response=?response);

AdditionalRevenueRecoveryDetailsRouterData::try_from(ResponseRouterData {
response,
data: data.clone(),
http_code: res.status_code,
})
}

fn get_error_response(
&self,
res: Response,
event_builder: Option<&mut ConnectorEvent>,
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
self.build_error_response(res, event_builder)
}
}

#[cfg(all(feature = "v2", feature = "revenue_recovery"))]
impl
ConnectorIntegration<
Expand Down Expand Up @@ -700,8 +801,8 @@ impl webhooks::IncomingWebhook for Stripebilling {
let webhook =
stripebilling::StripebillingWebhookBody::get_webhook_object_from_body(request.body)
.change_context(errors::ConnectorError::WebhookReferenceIdNotFound)?;
Ok(api_models::webhooks::ObjectReferenceId::PaymentId(
api_models::payments::PaymentIdType::ConnectorTransactionId(webhook.data.object.charge),
Ok(api_models::webhooks::ObjectReferenceId::AdditionalRevenueRecoveryId(
api_models::webhooks::AdditionalRevenueRecoveryIdType::AdditionalRevenueRecoveryCallId(webhook.data.object.charge),
))
}

Expand All @@ -712,6 +813,7 @@ impl webhooks::IncomingWebhook for Stripebilling {
) -> CustomResult<api_models::webhooks::ObjectReferenceId, errors::ConnectorError> {
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}

#[cfg(all(feature = "revenue_recovery", feature = "v2"))]
fn get_webhook_event_type(
&self,
Expand Down Expand Up @@ -762,6 +864,25 @@ impl webhooks::IncomingWebhook for Stripebilling {
.change_context(errors::ConnectorError::WebhookResourceObjectNotFound)?;
Ok(Box::new(webhook))
}

#[cfg(all(feature = "revenue_recovery", feature = "v2"))]
fn get_revenue_recovery_attempt_details(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
) -> CustomResult<revenue_recovery::RevenueRecoveryAttemptData, errors::ConnectorError> {
// since stripe requires an additional call we dont need to implement this function because we get the recovery data from additional call itself
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
}
#[cfg(all(feature = "revenue_recovery", feature = "v2"))]
fn get_revenue_recovery_invoice_details(
&self,
request: &webhooks::IncomingWebhookRequestDetails<'_>,
) -> CustomResult<revenue_recovery::RevenueRecoveryInvoiceData, errors::ConnectorError> {
let webhook = stripebilling::StripebillingInvoiceBody::get_invoice_webhook_data_from_body(
request.body,
)?;
revenue_recovery::RevenueRecoveryInvoiceData::try_from(webhook)
}
}

fn get_signature_elements_from_header(
Expand Down
Loading
Loading