From b74bae17fab7590817d4178317bc8404eec92f90 Mon Sep 17 00:00:00 2001 From: Andrew Edwards Date: Fri, 10 Apr 2020 14:37:12 -0400 Subject: [PATCH] Update for the Vapor 4 official tag. --- Package.swift | 2 +- Sources/Stripe/Stripe+Extensions.swift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Package.swift b/Package.swift index 80c6dc2..223fb19 100644 --- a/Package.swift +++ b/Package.swift @@ -10,7 +10,7 @@ let package = Package( .library(name: "Stripe", targets: ["Stripe"]) ], dependencies: [ - .package(url: "https://github.com/vapor/vapor.git", from: "4.0.0-rc.1"), + .package(url: "https://github.com/vapor/vapor.git", from: "4.0.0"), .package(url: "https://github.com/vapor-community/stripe-kit.git", from: "6.1.0"), ], targets: [ diff --git a/Sources/Stripe/Stripe+Extensions.swift b/Sources/Stripe/Stripe+Extensions.swift index df1c2a0..07dd1ff 100644 --- a/Sources/Stripe/Stripe+Extensions.swift +++ b/Sources/Stripe/Stripe+Extensions.swift @@ -13,7 +13,7 @@ extension Application { guard let stripeKey = Environment.get("STRIPE_API_KEY") else { fatalError("STRIPE_API_KEY env var required") } - return .init(httpClient: self.client.http, + return .init(httpClient: self.http.client.shared, eventLoop: self.eventLoopGroup.next(), apiKey: stripeKey) } @@ -30,7 +30,7 @@ extension Request { guard let stripeKey = Environment.get("STRIPE_API_KEY") else { fatalError("STRIPE_API_KEY env var required") } - let new = StripeClient(httpClient: self.application.client.http, + let new = StripeClient(httpClient: self.application.http.client.shared, eventLoop: self.eventLoop, apiKey: stripeKey) self.application.storage[StripeKey.self] = new