diff --git a/src/Utilities/PaymentHelpers.res b/src/Utilities/PaymentHelpers.res index d1d49c442..ff0403d87 100644 --- a/src/Utilities/PaymentHelpers.res +++ b/src/Utilities/PaymentHelpers.res @@ -476,7 +476,7 @@ let usePaymentIntent = (optLogger: option, paymentType: p ]) let uri = `${endpoint}/payments/${paymentIntentID}/confirm` let fetchMethod = Fetch.Post - let loggerPayload = body->Js.Dict.fromArray->Js.Json.object_->Js.Json.stringify + // let loggerPayload = body->Js.Dict.fromArray->Js.Json.object_->Js.Json.stringify let callIntent = body => { let maskedPayload = @@ -485,10 +485,27 @@ let usePaymentIntent = (optLogger: option, paymentType: p ->Belt.Option.getWithDefault(Js.Json.null) ->Utils.getDictFromJson ->maskPayload + let loggerPayload = + [ + ("payload", maskedPayload->Js.Json.string), + ( + "headers", + headers + ->Js.Array2.map(header => { + let (key, value) = header + (key, value->Js.Json.string) + }) + ->Js.Dict.fromArray + ->Js.Json.object_, + ), + ] + ->Js.Dict.fromArray + ->Js.Json.object_ + ->Js.Json.stringify if paymentType == Card { handleLogging( ~optLogger, - ~value=maskedPayload, + ~value=loggerPayload, ~eventName=PAYMENT_ATTEMPT, ~paymentMethod="CARD", ) @@ -497,7 +514,7 @@ let usePaymentIntent = (optLogger: option, paymentType: p if str === "payment_method_type" { handleLogging( ~optLogger, - ~value=maskedPayload, + ~value=loggerPayload, ~eventName=PAYMENT_ATTEMPT, ~paymentMethod=json->Js.Json.decodeString->Belt.Option.getWithDefault(""), )