Skip to content

Releases: vapor-community/stripe-kit

18.1.0

19 May 20:57
85c3d68
Compare
Choose a tag to compare

What's Changed

Full Changelog: 18.0.0...18.1.0

StripeKit 18.0.0 async await support

18 May 16:14
c558b4b
Compare
Choose a tag to compare

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

14 Mar 18:23
211a1fe
Compare
Choose a tag to compare

What's Changed

  • Add automaticTax parameter to Session.create by @winsmith in #147

Full Changelog: 17.0.1...17.1.0

17.0.1

28 Jan 13:09
58ea4f4
Compare
Choose a tag to compare

What's Changed

  • Fix incorrect parameter type for StripeSessionRoutes.create by @shial4 in #156

Full Changelog: 17.0.0...17.0.1

17.0.0

18 Jan 00:08
81e9e52
Compare
Choose a tag to compare

What's Changed

  • Add Invoice creation parameter to checkout session by @shial4 in #155

New Contributors

Full Changelog: 16.2.2...17.0.0

16.2.2

24 Jun 12:30
9454cd5
Compare
Choose a tag to compare

What's Changed

Full Changelog: 16.2.1...16.2.3

Added more payment method `types`

31 May 20:44
800f241
Compare
Choose a tag to compare
16.2.1

Update CHANGELOG.md

SwiftCrypto dependency version requirement updated

23 Dec 02:48
d12f5dc
Compare
Choose a tag to compare

Expandable Collection Support

18 Dec 16:05
e1b4bae
Compare
Choose a tag to compare
Merge pull request #143 from vapor-community/expandable-collection

Expandable collection support.

API updates

17 Dec 23:57
369ccae
Compare
Choose a tag to compare
Merge pull request #142 from vapor-community/december-update

API updates.