Closed naveenjangra2 closed 3 years ago
Hey @naveenjangra2! STPAddCardViewController doesn't accept an email address or phone number. Those are considered "shipping information", and can be requested using STPShippingAddressViewController or STPPaymentContext.
In StpAddCardViewController try to send Name, Email, Phone giving null these values after adding card.
Summary
Code to reproduce
let config = STPPaymentConfiguration.shared() config.verifyPrefilledShippingAddress = true config.companyName = "UBI" config.requiredBillingAddressFields = .full config.requiredShippingAddressFields = [.emailAddress,.name,.phoneNumber,.postalAddress] let addCardViewController = STPAddCardViewController.init(configuration: config, theme: .default()) let info = STPAddress() info.city = "CIty" info.state = "State" info.country = "IN" info.name = "Abc" info.phone = "+918901383335" info.postalCode = "133001" info.email = "abc@gmail.com" info.line1 = "line1" info.line2 = "line2" let payment = STPPaymentMethodAddress.init(address: info) let ifn = STPUserInformation() //ifn.shippingAddress = info let dt = STPPaymentMethodBillingDetails() dt.phone = "+918901383335" dt.email = "abc@gmail.com" dt.name = "Abc" dt.address = payment ifn.setBillingAddress(with: dt) addCardViewController.prefilledInformation = ifn addCardViewController.delegate = self
iOS version
iOS 14
Installation method
Using CocoaPod
SDK version
20.0.0.1
Other information