i’m making an attempt to check apple pay integration on an precise machine , nonetheless when i click on apple pay i get a immediate that claims add card to apple pay, i’ve added a number of supported playing cards already, nonetheless it says my app dosen’t settle for these playing cards (the playing cards are listed as supported within the PKPaymentRequest().supportedNetworks
)
my begin fee technique is under
func startPayment(paymentInfo: OrderInfo, completion: @escaping PaymentCompletionHandler) {
self.completionHandler = completion
let order = PKPaymentSummaryItem(label: "Whole Order", quantity: NSDecimalNumber(string: String(paymentInfo.totalPrice)), kind: .closing)
let delivery = PKPaymentSummaryItem(label: "Transport", quantity: NSDecimalNumber(string: String(paymentInfo.shippingPrice)), kind: .closing)
let whole = PKPaymentSummaryItem(label: "My Abstract label", quantity: NSDecimalNumber(string: paymentInfo.totalPrice), kind: .closing)
paymentSummaryItems = [order, shipping, total]
// Create a fee request.
let paymentRequest = PKPaymentRequest()
if let shippingAddress = paymentInfo.shippingAddress {
let shippingContact = PKContact()
shippingContact.postalAddress = createPostalAddress(tackle: shippingAddress)
paymentRequest.shippingContact = shippingContact
if #accessible(iOS 15, *) {
paymentRequest.shippingContact?.identify = PersonNameComponents(namePrefix: "Mr", givenName: "SammpleName", familyName: "SampleGIVEN NAME")
}
}
if let billingAddress = paymentInfo.billingAddress {
let billingContact = PKContact()
billingContact.postalAddress = createPostalAddress(tackle: billingAddress)
paymentRequest.billingContact = billingContact
}
paymentRequest.paymentSummaryItems = paymentSummaryItems
paymentRequest.merchantIdentifier = "my service provider identifier"
paymentRequest.merchantCapabilities = .capability3DS
paymentRequest.countryCode = paymentInfo.shippingAddress?.nation ?? "DE"
paymentRequest.currencyCode = "EUR"
paymentRequest.supportedNetworks = [
.amex,
.discover,
.masterCard,
.visa
]
paymentRequest.supportedCountries = AllowedCountries
paymentRequest.requiredShippingContactFields = [.postalAddress]
print(paymentRequest.shippingContact, "paymentRewuet")
// Show the fee request.
paymentController = PKPaymentAuthorizationController(paymentRequest: paymentRequest)
paymentController?.delegate = self
paymentController?.current(completion: { (offered: Bool) in
if offered {
debugPrint("Offered fee controller")
print(self.paymentStatus)
} else {
debugPrint("Didn't current fee controller")
self.completionHandler(false)
}
})
}
The picture of the immediate on the precise machine is
how do i repair this?