Releases: vapor-community/stripe-kit
Releases · vapor-community/stripe-kit
18.1.0
What's Changed
- Added public init for PaymentMethod Card. by @Andrewangeta in #211
Full Changelog: 18.0.0...18.1.0
StripeKit 18.0.0 async await support
What's Changed
Async Await
All APIs use async await which means the minimum swift version is now 5.7
// Before:
stripe.refunds.create(charge: "ch_12345", reason: .requestedByCustomer).map { ... }
// After:
try await stripe.refunds.create(charge: "ch_12345", reason: .requestedByCustomer)
Modifying headers per request
Before:
stripe = StripeClient(...)
stripe.refunds.headers.add(name: "Stripe-Account", value: "acc_12345")
stripe.refunds.create(charge: "ch_12345", reason: .requestedByCustomer)
After:
stripe = StripeClient(...)
stripe.refunds
.addHeaders(["Stripe-Account": "acc_12345",
"Authorization": "Bearer different_api_key",
"Stripe-Version": "older-api-version"])
.create(charge: "ch_12345", reason: .requestedByCustomer)
Cleaner type names and public initializers
Remove the Stripe
prefix from resources/models as well as make their inits public.
This helps a lot when unit testing to create Stripe types without having to setup a dictionary to use the decoding initializer:
// Before:
let connectProperties = ["id": "acct_1234",
"object": "account",
"created": Int(Date().timeIntervalSince1970)].toData()
let decoder = JSONDecoder()
decoder.dateDecodingStrategy = .secondsSince1970
decoder.keyDecodingStrategy = .convertFromSnakeCase
return try decoder.decode(StripeConnectAccount.self, from: connectProperties)
// After:
return ConnectAccount(id: "acct_1234", object: "account", created: Int(Date().timeIntervalSince1970))
17.1.0
17.0.1
17.0.0
16.2.2
Added more payment method `types`
16.2.1 Update CHANGELOG.md
SwiftCrypto dependency version requirement updated
Expandable Collection Support
Merge pull request #143 from vapor-community/expandable-collection Expandable collection support.
API updates
Merge pull request #142 from vapor-community/december-update API updates.