Skip to content

Commit

Permalink
Switch shipping address API to SPI (#1208)
Browse files Browse the repository at this point in the history
  • Loading branch information
ramont-stripe authored Jun 10, 2022
1 parent c6db99c commit a3dd98e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Stripe/PaymentSheetFlowController+Shipping.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions Stripe/PaymentSheetFlowController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
) {
Expand Down

0 comments on commit a3dd98e

Please sign in to comment.