- Fix failing
Invoice::upcoming
by adding ais_none
representation to InvoiceId (@bryanburgers)
- Enable RustTLS behind a feature flag (@kiljacken)
- Add missing values to
PaymentMethodType
andPaymentIntentMethodType
(@ThouCheese)
- Fixed deserialization of
ChargeId
s withpy_
prefix inPaymentIntent
event(s).
-
Updated to a newer version of the Stripe API.
-
The
PaymentIntent<___>Params
structs have been renamed to be consistent with the autogenerated APIe.g.
PaymentIntentCreateParams
has becomeCreatePaymentIntent
- The
app-info
header can now be set/customized with theClient::set_app_info
method.
-
New feature flags have been introduced to disable unused parts of the stripe APIs. This helps reduce binary bloat and compile time.
-
The async client has been updated to use
std::future::Future
. Theasync
feature flag is deprecated. Prefer{ default-features = false, features = ["full"] }
instead. -
Set default stripe api version to the latest version supported by the library. This is intended to avoid bugs where a later version of stripe is enabled by a customer.
By default the full
stripe api is enabled.
To reduce code size, disable default features and enable just the APIs you use:
# Example: Core-only (enough to create a `Charge` or `Card` or `Customer`)
stripe-rust = { version = "*", default-features = false, features = ["blocking"] }
# Example: Support for "Subscriptions" and "Invoices"
stripe-rust = { version = "*", default-features = false, features = ["blocking", "billing"] }
Refer to the Stripe API docs to determine which APIs are included as part of each feature flag.
- The
stripe-version
header can now be set/customized with theClient::with_headers
method.
- The
Default
trait is now derived for all structs that have only defaultable parameters. Webhook::construct_event
takes payload, signature, and secret args by ref (&str
) instead of value.- The
payment_method
andconfirmation_method
fields were added toPaymentIntentCreateParams
. - The
payment_method_details
structure now supports thecard
data field.
- Boolean fields that may be
null
, are nowOption
instead ofserde(default)
. - The
Customer
variant was added to theEventObject
enum. - The
PaymentIntentCaptureParams
are now correctlypub
. - Fixed parsing a negative customer
account_balance
.
- The
PaymentSourceParams
struct was edit to only include aTokenId
andSourceId
as per improvements to the API. - The
charge.source
field to create aCharge
was fixed to accept the new structChargeSourceParams
.
- Added
id
field toEvent
- Fixes a regression deriving
Eq
andPartialEq
forPaymentIntent
enums.
- Fixed deserialization of
CheckoutSessionCompleted
events. - Added missing
Invoice
events.
- Fixed the
InvoiceLineItemId
type to correctly handle subscription items.
This version uses code generation to generate the stripe API according to the openapi spec.
This contains major breaking changes from previous versions, both because many structures were out of date and because some changes were made to make things easier to generate.
-
Many new APIs have now been implemented (mostly CRUD); some requests are still missing because not all requests are automatically implemented. All previously implemented requests are still implemented (even if they couldn't be code-generated).
-
Many requests now take the
expand
parameter which controls whether more data should be returned forExpandable<T>
fields. Previously these fields were just id types.
- Fields and requests have descriptive documentation rather than just referring to the stripe API docs.
- Ids and fields are more strictly typed (newtypes vs raw strings).
- Ids no longer need to be allocated and are cheaply clonable (in almost all cases).
- Enum types now implement
Display
andAsRef<str>
.
- Add missing
product
toPlan
. - Add missing
receipt_url
toCharge
. - The deprecated
closed
field inInvoice
is now optional. - Fix allowing the
description
field inPayout
to be optional. - Fix allowing a
SubscriptionItem
quantity to beNone
(e.g. when using metered pricing API). - Fix signature checking for received Webhooks.
- Allow the timestamp to be manually specified when verifying webhook signature.
- Detach source data structure is a new
DetachedSource
enum - The
object
field was removed fromPaymentIntent
,Refund
andPayout
. - Fields in
PaymentIntent
were updated to correctly be optional
- Added an
async
feature flag which removesstripe::Client
and addsstripe::async::Client
.
- The
stripe::Params
typed was renamed toHeaders
to avoid confusion with otherFooParams
types and theparams
module.
- Added
verify_bank_account
toCustomer
resource. - Added BankAccount as a variant of
PaymentSource
. - Add the PaymentIntents resources, apis and events.
- Minimum Rust version required is 1.31.1.
- Moved
retrieve_source
anddetach_source
toCustomer
resource fromSource
. - The
Error::Conversion
enum variant has been replaced byError::Serialize
andError::Deserialize
. - See also Fixes / Improvements.
- TokenId has become an enum to account for different Token options
- Updated fields on
BankAccount
resource so all are correct. - The
Payout
andRefund
types now use enums instead of Strings. - The
WebhookError
type is now externally public.
- Fix sending
metadata
(and other nested params) as part of a POST request; e.g.Customer::create
,Customer::update
, etc.
- The type of
Customer.default_source
has changed fromSourceId
toPaymentSourceId
. - The type of
Customer.sources
has changed fromList<Source>
toList<PaymentSource>
.
- The
List<T>
type has newnext
andget_all
methods for pagination. - Struct types more consistently implement
Clone
. - Enum types more consistently implement
Copy
,Eq
, andHash
. - More source details (e.g.
ach_credit_transfer
, etc) were added toSource
. - The blocking api is now backed by
reqwest
instead ofhyper:0.10
so that the library is no longer pinned to outdated dependencies. - Added the "webhooks" feature flag for processing events (enabled by default)
to convert
hmac
andsha2
to optional dependencies.
- (Mostly from 0.5.x series)
Charge
,Card
, andSource
have been updated to use new enum values rather thanString
. - The
SourceType
enum used by ChargeListParams has been renamed toSourceFilterType
to remove a conflict with theSourceType
enum used by the type field of Source.
- All
Address
fields have been updated to be optional. - The
Client-Id
param has been added to params to make support for impersonating Connect Accounts compatible with newer stripe api versions.
- Updated
Charge
to use enum types rather than&str
where possible.
- Fixed many issues with the
Source
object. - Updated
Card
to use enum types rather than&str
where possible. - Added many new fields to
Card
.
- Bumped dependency versions
- Implemented the sources resource and
added the
Source
type .
- The
CustomerSourceParams
struct was renamed toPaymentSourceParams
. - The
Source
enum was renamed toPaymentSource
(there is a newSource
struct). - Source and token fields (like
token: &str
) now usesource: SourceId
ortoken: TokenId
instead.
- Added missing
default_source
field toCustomer
. - The
Deserialize
andSerialize
traits have now been implemented for all param and resource structs. - The
Copy
,Clone
,Eq
,PartialEq
, andHash
traits have been derived for flat enum types.
- Fix, adds all missing error code variants to
stripe::error::ErrorCode
.
- Fixed field
nickname
ofPlan
can be null.
- Fixed field
nickname
ofPlan
should bename
- The
balance_transaction
field ofCharge
is nowOption<_>
.
- Added basic crate documentation
- Added the
invoice.upcoming
event
- Add RangeQuery struct for created/date filters in list requests
- Implement
Customer::list
request (ie. "GET /customers"); Thanks @pocket7878 - Add missing params to
InvoiceListParams
forInvoice::list
- Upgrade Serde to v1.0
- Add support for authentication using the Stripe-Account header
- Implement
Event
struct for implementing a Stripe Webhook (only some events) - Implement
Invoice::update
request (ie. POST "/invoices/{invoice_id}") - Implement
InvoiceItem::create
request (ie. POST "/invoiceitems") - Fix
Subscription::cancel
request (previously used wrong method/path)
- Implemented the
Invoice::list
API (ie. "/invoices") - Fixed a request encoding error for
Invoice::pay
(ie. "/invoices/{invoice_id}/pay") - Fixed fields on
Subscription
that could be null but were missingOptional<..>
- Added missing
last4
field toCard
resource - Changed the repository URL
- Made rust docs slightly easier to read
- Fixed incorrect method name for
Plan
resource - Use
native-tls
by default and add feature-flag supportingopenssl
- Implemented the charges resource and
added the
Charge
type.
- The
Resource::get
requests have been renamed toResource::retrieve
. - The
Subscription::cancel
request now expectsCancelParams
instead of expecting a one-off function argument. - Removed the
blame
method andBlame
type from errors. - The
Error::Decode
andError::Encode
variants have been combined into a singleError::Conversion
variant.
- The
Error
type now has easier to read error messages and will parses JSON errors returned by Stripe into a structured error type (RequestError
). - Added Travis CI for automated testing on GitHub.
- Added reference documentation to implemented resources (but still no docs at crate/module level nor a "Getting started" guide)
- Added
Client
which is created once with a stripe private key and is intended to be re-used for multiple requests. It implementsSync
so you can share it among multiple threads. - Added new strongly-typed
Currency
type following the example of https://github.com/stripe/stripe-go. Customer::create
/CustomerParams
now support usingCardParams
as a source instead of just tokens.- Implemented the sources API in the
Source
type.
- All
Params
types now use&str
fields instead ofString
s. - Requests used to require a
stripe_key: &str
as their final argument but now use a&Client
as the first argument instead. - Stripe tokens used to be directly used as a source in
CustomerParams
but now must be used withCustomerSourceParams::Token("tok_xyzABC123")
.
- Added remaining fields to
Params
types after switching fromserde_urlencoded
toserde_qs
to support nested params. - Added the
create_customer
example - Types that implement
Deserialize
now also implementDebug
. - Types that implement
Serialize
now also implementDefault
.