From 9fc614c1345db69f68768582c3506c5db2024574 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..78e5e72c1 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: "Shipping", + unitAmount: shippingMethod.amount, + quantity: 1, + discountAmount: nil, + taxAmount: nil + ) - return .init(shippingMethods: [pkShippingMethod], selectedShippingMethodOrderItem: nil) + return .init(shippingMethods: [pkShippingMethod], selectedShippingMethodOrderItem: selectedShippingMethod) } // Convert to PKShippingMethods