From b3a12eb4487269fd184aec4fd4254965d2e6c3ca Mon Sep 17 00:00:00 2001 From: Hugo EXTRAT Date: Thu, 10 Oct 2024 21:07:37 +0200 Subject: [PATCH] feat: add selectedShippingMethodOrderItem --- .../ApplePayTokenizationViewModel.swift | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Sources/PrimerSDK/Classes/User Interface/TokenizationViewModels/ApplePayTokenizationViewModel.swift b/Sources/PrimerSDK/Classes/User Interface/TokenizationViewModels/ApplePayTokenizationViewModel.swift index a5200b376..856048db7 100644 --- a/Sources/PrimerSDK/Classes/User Interface/TokenizationViewModels/ApplePayTokenizationViewModel.swift +++ b/Sources/PrimerSDK/Classes/User Interface/TokenizationViewModels/ApplePayTokenizationViewModel.swift @@ -378,8 +378,16 @@ class ApplePayTokenizationViewModel: PaymentMethodTokenizationViewModel { ) pkShippingMethod.detail = shippingMethod.methodDescription pkShippingMethod.identifier = shippingMethod.methodId + + let selectedShippingMethod = try? ApplePayOrderItem( + name: shippingMethodName, + unitAmount: shippingMethod.amount, + quantity: 1, + discountAmount: nil, + taxAmount: nil + ) - return .init(shippingMethods: [pkShippingMethod], selectedShippingMethodOrderItem: nil) + return .init(shippingMethods: [pkShippingMethod], selectedShippingMethodOrderItem: selectedShippingMethod) } // Convert to PKShippingMethods