From a3dd98e1387cc38797b47540037de21b885ec742 Mon Sep 17 00:00:00 2001 From: ramont-stripe <88752322+ramont-stripe@users.noreply.github.com> Date: Fri, 10 Jun 2022 16:18:04 -0400 Subject: [PATCH] Switch shipping address API to SPI (#1208) --- .../PaymentSheet Example/PaymentSheetTestPlayground.swift | 4 ++-- Stripe/PaymentSheetFlowController+Shipping.swift | 4 ++-- Stripe/PaymentSheetFlowController.swift | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Example/PaymentSheet Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlayground.swift b/Example/PaymentSheet Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlayground.swift index 961b518760b..bfde6690f6d 100644 --- a/Example/PaymentSheet Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlayground.swift +++ b/Example/PaymentSheet Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlayground.swift @@ -7,9 +7,9 @@ // // ⚠️🏗 This is a playground for internal Stripe engineers to help us test things, and isn't // an example of what you should do in a real app! -// Note: Do not import Stripe using `@_spi(STP)` or @testable in production. +// Note: Do not import Stripe using `@_spi(STP)` in production. // This exposes internal functionality which may cause unexpected behavior if used directly. -@_spi(STP) @testable import Stripe +@_spi(STP) import Stripe @_spi(STP) import StripeCore import UIKit import SwiftUI diff --git a/Stripe/PaymentSheetFlowController+Shipping.swift b/Stripe/PaymentSheetFlowController+Shipping.swift index 6f81ddc5750..7ccc6625f15 100644 --- a/Stripe/PaymentSheetFlowController+Shipping.swift +++ b/Stripe/PaymentSheetFlowController+Shipping.swift @@ -9,14 +9,14 @@ import Foundation import Contacts -extension PaymentSheet { +@_spi(STP) public extension PaymentSheet { /// 🏗 Under construction /// Contains Customer information related to shipping address. struct ShippingAddressDetails { let address: Address /// A user-facing description of the shipping address details. - var localizedDescription: String { + @_spi(STP) public var localizedDescription: String { let formatter = CNPostalAddressFormatter() let postalAddress = CNMutablePostalAddress() diff --git a/Stripe/PaymentSheetFlowController.swift b/Stripe/PaymentSheetFlowController.swift index 15b35566b95..d94754f14c9 100644 --- a/Stripe/PaymentSheetFlowController.swift +++ b/Stripe/PaymentSheetFlowController.swift @@ -86,7 +86,7 @@ extension PaymentSheet { /// A valid (passing basic client-side checks) address, or nil. /// 🏗 Under construction - var shippingAddressDetails: ShippingAddressDetails? { + @_spi(STP) public var shippingAddressDetails: ShippingAddressDetails? { let shippingAddressDetails = shippingAddressViewController.shippingAddressDetails return shippingAddressDetails } @@ -234,7 +234,7 @@ extension PaymentSheet { /// - Parameter presentingViewController: The view controller that presents the sheet. /// - Parameter completion: This is called after the sheet is dismissed. Use the `shippingAddressDetails` property to get the customer's shipping address details. /// 🏗 Under construction - func presentShippingAddress( + @_spi(STP) public func presentShippingAddress( from presentingViewController: UIViewController, completion: (() -> ())? = nil ) {