@@ -296,6 +296,7 @@ pub struct StripebillingWebhookObject {
296
296
#[ serde( rename = "amount_remaining" ) ]
297
297
pub amount : common_utils:: types:: MinorUnit ,
298
298
pub charge : String ,
299
+ pub payment_intent : String ,
299
300
}
300
301
301
302
#[ derive( Debug , Serialize , Deserialize ) ]
@@ -346,7 +347,12 @@ impl TryFrom<StripebillingInvoiceBody> for revenue_recovery::RevenueRecoveryInvo
346
347
}
347
348
348
349
#[ derive( Serialize , Deserialize , Debug , Clone ) ]
349
- pub struct StripebillingRecoveryDetailsData {
350
+ pub struct StripebillingBillingConnectorPaymentSyncResponseData {
351
+ pub latest_charge : StripebillingLatestChargeData ,
352
+ }
353
+
354
+ #[ derive( Serialize , Deserialize , Debug , Clone ) ]
355
+ pub struct StripebillingLatestChargeData {
350
356
#[ serde( rename = "id" ) ]
351
357
pub charge_id : String ,
352
358
pub status : StripebillingChargeStatus ,
410
416
TryFrom <
411
417
ResponseRouterData <
412
418
recovery_router_flows:: BillingConnectorPaymentsSync ,
413
- StripebillingRecoveryDetailsData ,
419
+ StripebillingBillingConnectorPaymentSyncResponseData ,
414
420
recovery_request_types:: BillingConnectorPaymentsSyncRequest ,
415
421
recovery_response_types:: BillingConnectorPaymentsSyncResponse ,
416
422
> ,
@@ -420,45 +426,45 @@ impl
420
426
fn try_from (
421
427
item : ResponseRouterData <
422
428
recovery_router_flows:: BillingConnectorPaymentsSync ,
423
- StripebillingRecoveryDetailsData ,
429
+ StripebillingBillingConnectorPaymentSyncResponseData ,
424
430
recovery_request_types:: BillingConnectorPaymentsSyncRequest ,
425
431
recovery_response_types:: BillingConnectorPaymentsSyncResponse ,
426
432
> ,
427
433
) -> Result < Self , Self :: Error > {
428
- let merchant_reference_id = id_type :: PaymentReferenceId :: from_str (
429
- & item . response . invoice_id ,
430
- )
431
- . change_context ( errors:: ConnectorError :: MissingRequiredField {
432
- field_name : "invoice_id" ,
433
- } ) ?;
434
+ let charge_details = item . response . latest_charge ;
435
+ let merchant_reference_id =
436
+ id_type :: PaymentReferenceId :: from_str ( charge_details . invoice_id . as_str ( ) )
437
+ . change_context ( errors:: ConnectorError :: MissingRequiredField {
438
+ field_name : "invoice_id" ,
439
+ } ) ?;
434
440
let connector_transaction_id = Some ( common_utils:: types:: ConnectorTransactionId :: from (
435
- item . response . charge_id ,
441
+ charge_details . charge_id ,
436
442
) ) ;
437
443
438
444
Ok ( Self {
439
445
response : Ok (
440
446
recovery_response_types:: BillingConnectorPaymentsSyncResponse {
441
- status : item . response . status . into ( ) ,
442
- amount : item . response . amount ,
443
- currency : item . response . currency ,
447
+ status : charge_details . status . into ( ) ,
448
+ amount : charge_details . amount ,
449
+ currency : charge_details . currency ,
444
450
merchant_reference_id,
445
451
connector_account_reference_id :
446
452
MCA_ID_IDENTIFIER_FOR_STRIPE_IN_STRIPEBILLING_MCA_FEAATURE_METADATA
447
453
. to_string ( ) ,
448
454
connector_transaction_id,
449
- error_code : item . response . failure_code ,
450
- error_message : item . response . failure_message ,
451
- processor_payment_method_token : item . response . payment_method ,
452
- connector_customer_id : item . response . customer ,
453
- transaction_created_at : Some ( item . response . created ) ,
455
+ error_code : charge_details . failure_code ,
456
+ error_message : charge_details . failure_message ,
457
+ processor_payment_method_token : charge_details . payment_method ,
458
+ connector_customer_id : charge_details . customer ,
459
+ transaction_created_at : Some ( charge_details . created ) ,
454
460
payment_method_sub_type : common_enums:: PaymentMethodType :: from (
455
- item . response
461
+ charge_details
456
462
. payment_method_details
457
463
. card_funding_type
458
464
. funding ,
459
465
) ,
460
466
payment_method_type : common_enums:: PaymentMethod :: from (
461
- item . response . payment_method_details . type_of_payment_method ,
467
+ charge_details . payment_method_details . type_of_payment_method ,
462
468
) ,
463
469
} ,
464
470
) ,
0 commit comments