Skip to content

Commit

Permalink
Conform StripeClient to Sendable
Browse files Browse the repository at this point in the history
Use Swift 5.10 as minimum version
  • Loading branch information
thoven87 committed Dec 31, 2024
1 parent 5c579be commit 61857c1
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.7
// swift-tools-version:5.10
import PackageDescription

let package = Package(
Expand All @@ -13,7 +13,7 @@ let package = Package(
.library(name: "StripeKit", targets: ["StripeKit"])
],
dependencies: [
.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.1.0"),
.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.24.0"),
.package(url: "https://github.com/apple/swift-crypto.git", "1.0.0" ..< "4.0.0"),
],
targets: [
Expand Down
2 changes: 1 addition & 1 deletion Sources/StripeKit/Checkout/SessionRoutes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import NIO
import NIOHTTP1
import Foundation

public protocol SessionRoutes {
public protocol SessionRoutes: Sendable {
/// Creates a Session object.
/// - Parameters:
/// - lineItems: A list of items the customer is purchasing. Use this parameter to pass one-time or recurring Prices. For payment mode, there is a maximum of 100 line items, however it is recommended to consolidate line items if there are more than a few dozen. For subscription mode, there is a maximum of 20 line items with recurring Prices and 20 line items with one-time Prices. Line items with one-time Prices will be on the initial invoice only.
Expand Down
2 changes: 1 addition & 1 deletion Sources/StripeKit/StripeAPIRoute.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import Foundation
import NIOHTTP1

public protocol StripeAPIRoute {
public protocol StripeAPIRoute: Sendable {
var headers: HTTPHeaders { get set }

/// Headers to send with the request.
Expand Down
2 changes: 1 addition & 1 deletion Sources/StripeKit/StripeClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import NIO
import AsyncHTTPClient

public final class StripeClient {
public struct StripeClient: Sendable {
// MARK: - CORE RESOURCES
public var balances: BalanceRoutes
public var balanceTransactions: BalanceTransactionRoutes
Expand Down
2 changes: 1 addition & 1 deletion Tests/StripeKitTests/ExpandableTests.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import XCTest
@testable import StripeKit

class ExpandableTests: XCTestCase {
final class ExpandableTests: XCTestCase {

func testDynamicExpandable_decodesProperly() throws {

Expand Down
2 changes: 1 addition & 1 deletion Tests/StripeKitTests/QueryEncodingTests.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import XCTest
@testable import StripeKit

class QueryEncodingTests: XCTestCase {
final class QueryEncodingTests: XCTestCase {

func testSimpleQueryEncodedProperly() throws {
let query = [
Expand Down
2 changes: 1 addition & 1 deletion Tests/StripeKitTests/SignatureVerificationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import XCTest
@testable import StripeKit
import Crypto

class SignatureVerificationTests: XCTestCase {
final class SignatureVerificationTests: XCTestCase {
var jsonData: Data = try! JSONEncoder().encode(["key": "value"])
var secret: String = "SECRET"

Expand Down

0 comments on commit 61857c1

Please sign in to comment.