- Fix failing
Invoice::upcomingby adding ais_nonerepresentation to InvoiceId (@bryanburgers)
- Enable RustTLS behind a feature flag (@kiljacken)
- Add missing values to
PaymentMethodTypeandPaymentIntentMethodType(@ThouCheese)
- Fixed deserialization of
ChargeIds withpy_prefix inPaymentIntentevent(s).
-
Updated to a newer version of the Stripe API.
-
The
PaymentIntent<___>Paramsstructs have been renamed to be consistent with the autogenerated APIe.g.
PaymentIntentCreateParamshas becomeCreatePaymentIntent
- The
app-infoheader can now be set/customized with theClient::set_app_infomethod.
-
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. Theasyncfeature 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-versionheader can now be set/customized with theClient::with_headersmethod.
- The
Defaulttrait is now derived for all structs that have only defaultable parameters. Webhook::construct_eventtakes payload, signature, and secret args by ref (&str) instead of value.- The
payment_methodandconfirmation_methodfields were added toPaymentIntentCreateParams. - The
payment_method_detailsstructure now supports thecarddata field.
- Boolean fields that may be
null, are nowOptioninstead ofserde(default). - The
Customervariant was added to theEventObjectenum. - The
PaymentIntentCaptureParamsare now correctlypub. - Fixed parsing a negative customer
account_balance.
- The
PaymentSourceParamsstruct was edit to only include aTokenIdandSourceIdas per improvements to the API. - The
charge.sourcefield to create aChargewas fixed to accept the new structChargeSourceParams.
- Added
idfield toEvent
- Fixes a regression deriving
EqandPartialEqforPaymentIntentenums.
- Fixed deserialization of
CheckoutSessionCompletedevents. - Added missing
Invoiceevents.
- Fixed the
InvoiceLineItemIdtype 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
expandparameter 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
DisplayandAsRef<str>.
- Add missing
producttoPlan. - Add missing
receipt_urltoCharge. - The deprecated
closedfield inInvoiceis now optional. - Fix allowing the
descriptionfield inPayoutto be optional. - Fix allowing a
SubscriptionItemquantity 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
DetachedSourceenum - The
objectfield was removed fromPaymentIntent,RefundandPayout. - Fields in
PaymentIntentwere updated to correctly be optional
- Added an
asyncfeature flag which removesstripe::Clientand addsstripe::async::Client.
- The
stripe::Paramstyped was renamed toHeadersto avoid confusion with otherFooParamstypes and theparamsmodule.
- Added
verify_bank_accounttoCustomerresource. - Added BankAccount as a variant of
PaymentSource. - Add the PaymentIntents resources, apis and events.
- Minimum Rust version required is 1.31.1.
- Moved
retrieve_sourceanddetach_sourcetoCustomerresource fromSource. - The
Error::Conversionenum variant has been replaced byError::SerializeandError::Deserialize. - See also Fixes / Improvements.
- TokenId has become an enum to account for different Token options
- Updated fields on
BankAccountresource so all are correct. - The
PayoutandRefundtypes now use enums instead of Strings. - The
WebhookErrortype 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_sourcehas changed fromSourceIdtoPaymentSourceId. - The type of
Customer.sourceshas changed fromList<Source>toList<PaymentSource>.
- The
List<T>type has newnextandget_allmethods 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
reqwestinstead ofhyper:0.10so that the library is no longer pinned to outdated dependencies. - Added the "webhooks" feature flag for processing events (enabled by default)
to convert
hmacandsha2to optional dependencies.
- (Mostly from 0.5.x series)
Charge,Card, andSourcehave been updated to use new enum values rather thanString. - The
SourceTypeenum used by ChargeListParams has been renamed toSourceFilterTypeto remove a conflict with theSourceTypeenum used by the type field of Source.
- All
Addressfields have been updated to be optional. - The
Client-Idparam has been added to params to make support for impersonating Connect Accounts compatible with newer stripe api versions.
- Updated
Chargeto use enum types rather than&strwhere possible.
- Fixed many issues with the
Sourceobject. - Updated
Cardto use enum types rather than&strwhere possible. - Added many new fields to
Card.
- Bumped dependency versions
- Implemented the sources resource and
added the
Sourcetype .
- The
CustomerSourceParamsstruct was renamed toPaymentSourceParams. - The
Sourceenum was renamed toPaymentSource(there is a newSourcestruct). - Source and token fields (like
token: &str) now usesource: SourceIdortoken: TokenIdinstead.
- Added missing
default_sourcefield toCustomer. - The
DeserializeandSerializetraits have now been implemented for all param and resource structs. - The
Copy,Clone,Eq,PartialEq, andHashtraits have been derived for flat enum types.
- Fix, adds all missing error code variants to
stripe::error::ErrorCode.
- Fixed field
nicknameofPlancan be null.
- Fixed field
nicknameofPlanshould bename
- The
balance_transactionfield ofChargeis nowOption<_>.
- Added basic crate documentation
- Added the
invoice.upcomingevent
- Add RangeQuery struct for created/date filters in list requests
- Implement
Customer::listrequest (ie. "GET /customers"); Thanks @pocket7878 - Add missing params to
InvoiceListParamsforInvoice::list
- Upgrade Serde to v1.0
- Add support for authentication using the Stripe-Account header
- Implement
Eventstruct for implementing a Stripe Webhook (only some events) - Implement
Invoice::updaterequest (ie. POST "/invoices/{invoice_id}") - Implement
InvoiceItem::createrequest (ie. POST "/invoiceitems") - Fix
Subscription::cancelrequest (previously used wrong method/path)
- Implemented the
Invoice::listAPI (ie. "/invoices") - Fixed a request encoding error for
Invoice::pay(ie. "/invoices/{invoice_id}/pay") - Fixed fields on
Subscriptionthat could be null but were missingOptional<..> - Added missing
last4field toCardresource - Changed the repository URL
- Made rust docs slightly easier to read
- Fixed incorrect method name for
Planresource - Use
native-tlsby default and add feature-flag supportingopenssl
- Implemented the charges resource and
added the
Chargetype.
- The
Resource::getrequests have been renamed toResource::retrieve. - The
Subscription::cancelrequest now expectsCancelParamsinstead of expecting a one-off function argument. - Removed the
blamemethod andBlametype from errors. - The
Error::DecodeandError::Encodevariants have been combined into a singleError::Conversionvariant.
- The
Errortype 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
Clientwhich is created once with a stripe private key and is intended to be re-used for multiple requests. It implementsSyncso you can share it among multiple threads. - Added new strongly-typed
Currencytype following the example of https://github.com/stripe/stripe-go. Customer::create/CustomerParamsnow support usingCardParamsas a source instead of just tokens.- Implemented the sources API in the
Sourcetype.
- All
Paramstypes now use&strfields instead ofStrings. - Requests used to require a
stripe_key: &stras their final argument but now use a&Clientas the first argument instead. - Stripe tokens used to be directly used as a source in
CustomerParamsbut now must be used withCustomerSourceParams::Token("tok_xyzABC123").
- Added remaining fields to
Paramstypes after switching fromserde_urlencodedtoserde_qsto support nested params. - Added the
create_customerexample - Types that implement
Deserializenow also implementDebug. - Types that implement
Serializenow also implementDefault.