swift – (iOS, Apple Pay) Display multiple summary items results in a bug


I display Apple Pay dialog with multiple PKPaymentSummaryItem items:

    let paymentRequest = PKPaymentRequest()
    paymentRequest.paymentSummaryItems = [
        PKPaymentSummaryItem(label: "item 1", amount: NSDecimalNumber(decimal: 10)),
        PKPaymentSummaryItem(label: "item 2", amount: NSDecimalNumber(decimal: 20)),
        PKPaymentSummaryItem(label: "item 3", amount: NSDecimalNumber(decimal: 30))
    ]
    paymentRequest.merchantIdentifier = merchantIdentifier
    paymentRequest.merchantCapabilities = .capability3DS
    paymentRequest.currencyCode = self.currencyCode
    paymentRequest.countryCode = self.countryCode
    paymentRequest.supportedNetworks = supportedNetworks
    paymentRequest.shippingType = .servicePickup
    applePayController = PKPaymentAuthorizationController(paymentRequest: paymentRequest)

And in result I see a weird picture:
On the bottom sheet dialog only item 3 is present
enter image description here
If I navigate to item details there are all three items in weird order
enter image description here
I haven’t found any explanation of this issue in official docs, so interesting if anyone has dealt with it on practice, and how to resolve it in the best way

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img