Skip to content

Commit

Permalink
added the phone number, tracking number and carrier to the shipping d…
Browse files Browse the repository at this point in the history
…etails if data is available

this fixes #1548

#1548
  • Loading branch information
fhdeodato committed Dec 13, 2024
1 parent c1bb2dc commit 5e6f01f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,9 @@ internal fun mapToShippingDetails(shippingDetails: ReadableMap?): ConfirmPayment

return ConfirmPaymentIntentParams.Shipping(
name = getValOr(shippingDetails, "name") ?: "",
phone = getValOr(shippingDetails, "phone") ?: "",
trackingNumber = getValOr(shippingDetails, "trackingNumber") ?: "",
carrier = getValOr(shippingDetails, "carrier") ?: "",
address = address
)
}
Expand Down
5 changes: 5 additions & 0 deletions ios/Mappers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,11 @@ class Mappers {

let shipping = STPPaymentIntentShippingDetailsParams(address: shippingAddress, name: shippingDetails["name"] as? String ?? "")

// add the phone number, trackingNumber and carrie if available in the shipping details
shipping.phone = shippingDetails["phone"] as? String ?? ""
shipping.trackingNumber = shippingDetails["trackingNumber"] as? String ?? ""
shipping.carrier = shippingDetails["carrier"] as? String ?? ""

return shipping
}

Expand Down

0 comments on commit 5e6f01f

Please sign in to comment.