Skip to content

Commit

Permalink
feat: added content length (#366)
Browse files Browse the repository at this point in the history
Co-authored-by: Vrishab Srivatsa <[email protected]>
  • Loading branch information
Pritish Budhiraja and vsrivatsa-edinburgh authored May 14, 2024
1 parent 7a59e87 commit 2a1b42a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Utilities/PaymentHelpers.res
Original file line number Diff line number Diff line change
Expand Up @@ -982,6 +982,7 @@ let usePaymentIntent = (optLogger, paymentType) => {
let uri = `${endpoint}/payments/${paymentIntentID}/confirm`

let callIntent = body => {
let contentLength = body->String.length->Int.toString
let maskedPayload =
body->safeParseOpt->Option.getOr(JSON.Encode.null)->maskPayload->JSON.stringify
let loggerPayload =
Expand All @@ -1006,17 +1007,17 @@ let usePaymentIntent = (optLogger, paymentType) => {
handleLogging(
~optLogger,
~internalMetadata=loggerPayload,
~value="",
~value=contentLength,
~eventName=PAYMENT_ATTEMPT,
~paymentMethod="CARD",
(),
)
| _ =>
let _ = bodyArr->Array.map(((str, json)) => {
bodyArr->Array.forEach(((str, json)) => {
if str === "payment_method_type" {
handleLogging(
~optLogger,
~value="",
~value=contentLength,
~internalMetadata=loggerPayload,
~eventName=PAYMENT_ATTEMPT,
~paymentMethod=json->getStringFromJson(""),
Expand Down

0 comments on commit 2a1b42a

Please sign in to comment.