#stripe

jwiesler-async-stripe

Stripe HTTP API 的 API 绑定

1 个不稳定版本

0.34.3 2024年4月12日

#124 in 电子邮件

MIT/Apache

4.5MB
77K SLoC

async-stripe

CI async-stripe on crates.io async-stripe  on docs.rs

为 Stripe HTTP API 提供便捷的 Rust 绑定和类型,旨在支持整个 API 面板。如果不是这样?请提交一个问题。我们每周更新我们的定义 以确保最新。想要查看 Stripe API 的更改日志? 请查看这里

文档

请参阅 Rust API 文档示例payments.rs

安装

async-stripeasync-stdtokio 运行时以及 native-tlsrustls 后端兼容。在添加依赖项时,您必须选择运行时功能。

[dependencies]
async-stripe = { version = "0.31", features = ["runtime-tokio-hyper"] }

功能标志

运行时

  • runtime-tokio-hyper
  • runtime-tokio-hyper-rustls
  • runtime-blocking
  • runtime-blocking-rustls
  • runtime-async-std-surf

API 功能

此外,由于这是一个大型库,因此可以按需条件性地启用功能,以减少编译时间和最终二进制文件大小。请参阅 Stripe API 文档,以确定每个功能标志包含哪些 API。

# Example: Core-only (enough to create a `Charge` or `Card` or `Customer`)
async-stripe = { version = "*", default-features = false, features = ["runtime-async-std-surf"] }

# Example: Support for "Subscriptions" and "Invoices"
async-stripe = { version = "*", default-features = false, features = ["runtime-async-std-surf", "billing"] }

API 版本

该库始终跟踪 stripe API 的最新版本。

https://github.com/arlyon/async-stripe/blob/f0fd7115aa3b7500134da10f848c8e93ba8eca2e/src/resources/generated/version.rs#L1-L3

如果您想要找到一个与您正在使用的 API 匹配的版本,您可以轻松地通过该文件的 git blame 回溯。根据您固定的 Stripe API 版本设置相应的 crate 版本。如果您看不到您正在使用的特定版本,请选择下一个可用的版本。

MSRV

我们目前在 CI 中固定了 1.68.0,因此任何比这更新的 rustc 版本都应该可以工作。如果不是这种情况,请提交一个问题。作为一项政策,我们在非破坏性版本中允许 MSRV 增加。如果您有充分的理由需要提高它,我们通常愿意这样做,只要 rust 版本不是太新(通常是 3 个版本)。

贡献

有关如何为 async-stripe 贡献的信息,请参阅 CONTRIBUTING.md

许可证

该项目最初是 stripe-rs 的分支。没有他们,我们不会在这里!:)

许可协议为以下之一

任选其一。

依赖项

~5–22MB
~337K SLoC