stripe-react-native
stripe-react-native copied to clipboard
Add extra field to the shipping details
added the phone number, tracking number and carrier to the shipping details if data is available
this fixes #1548
Summary
Added to the mappers the trackingNumber, carrier and phone number to the shipping details
Motivation
This will help to have more complete data in the stripe's dashboard, as mentioned in the following issue
https://github.com/stripe/stripe-react-native/issues/1548
Android Change
File - stripe-react-native/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt Line - 608
return ConfirmPaymentIntentParams.Shipping(
name = getValOr(shippingDetails, "name") ?: "",
phone = getValOr(shippingDetails, "phone") ?: "",
trackingNumber = getValOr(shippingDetails, "trackingNumber") ?: "",
carrier = getValOr(shippingDetails, "carrier") ?: "",
address = address
)
iOS Change
File - stripe-react-native/ios/Mappers.swift Line - 551
// 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 ?? ""
Testing
- [X] I tested this manually
- [ ] I added automated tests
Documentation
Select one:
- [ ] I have added relevant documentation for my changes.
- [X] This PR does not result in any developer-facing changes.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.