File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed
crates/hyperswitch_connectors/src/connectors Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change 1
1
pub mod transformers;
2
2
3
- use std:: { collections:: HashMap , convert :: TryFrom } ;
3
+ use std:: collections:: HashMap ;
4
4
5
5
use api_models:: webhooks:: IncomingWebhookEvent ;
6
6
use common_enums:: {
@@ -2253,19 +2253,16 @@ impl IncomingWebhook for Stripe {
2253
2253
. body
2254
2254
. parse_struct ( "WebhookEvent" )
2255
2255
. change_context ( ConnectorError :: WebhookBodyDecodingFailed ) ?;
2256
- let amt = details
2257
- . event_data
2258
- . event_object
2259
- . amount
2260
- . map ( i64:: from)
2261
- . ok_or_else ( || ConnectorError :: MissingRequiredField {
2256
+ let amt = details. event_data . event_object . amount . ok_or_else ( || {
2257
+ ConnectorError :: MissingRequiredField {
2262
2258
field_name : "amount" ,
2263
- } ) ?;
2259
+ }
2260
+ } ) ?;
2264
2261
2265
2262
Ok ( DisputePayload {
2266
2263
amount : utils:: convert_amount (
2267
2264
self . amount_converter_webhooks ,
2268
- MinorUnit :: new ( amt) ,
2265
+ amt,
2269
2266
details. event_data . event_object . currency ,
2270
2267
) ?,
2271
2268
currency : details. event_data . event_object . currency ,
Original file line number Diff line number Diff line change @@ -3701,7 +3701,7 @@ pub struct WebhookPaymentMethodDetails {
3701
3701
pub struct WebhookEventObjectData {
3702
3702
pub id : String ,
3703
3703
pub object : WebhookEventObjectType ,
3704
- pub amount : Option < i32 > ,
3704
+ pub amount : Option < MinorUnit > ,
3705
3705
#[ serde( default , deserialize_with = "convert_uppercase" ) ]
3706
3706
pub currency : enums:: Currency ,
3707
3707
pub payment_intent : Option < String > ,
You can’t perform that action at this time.
0 commit comments