登录 注册

stripe-ruby

去点 Star
开发者工具
2,188
Stars
701
Forks
67
Watchers
29
Open Issues
MIT
许可证
Ruby
语言
2011-06-25
创建时间
2026-11-12
最近更新

项目能做什么

Stripe API 官方 Ruby 开发库。
来源:基于仓库元数据 · 内容以仓库实际 README 为准

使用说明 查看原始 README 原仓库文档

中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
# Stripe Ruby Library

[![Gem Version](https://badge.fury.io/rb/stripe.svg)](https://badge.fury.io/rb/stripe)
[![Build Status](https://github.com/stripe/stripe-ruby/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/stripe/stripe-ruby/actions?query=branch%3Amaster)

> [!TIP]
> Want to chat live with Stripe engineers? Join us on our [Discord server](https://stripe.com/go/discord/ruby).

The Stripe Ruby library provides convenient access to the Stripe API from
applications written in the Ruby language. It includes a pre-defined set of
classes for API resources that initialize themselves dynamically from API
responses which makes it compatible with a wide range of versions of the Stripe
API.

The library also provides other features. For example:

- Easy configuration path for fast setup and use.
- Helpers for pagination.
- Built-in mechanisms for the serialization of parameters according to the
  expectations of Stripe's API.

## Documentation

See the [Ruby API docs](https://stripe.com/docs/api?lang=ruby).

## Installation

You don't need this source code unless you want to modify the gem. If you just
want to use the package, just run:

```sh
gem install stripe
```

If you want to build the gem from source:

```sh
gem build stripe.gemspec
```

### Requirements

Per our [Language Version Support Policy](https://docs.stripe.com/sdks/versioning?lang=ruby#stripe-sdk-language-version-support-policy), we currently support **Ruby 3.0+**.

Support for Ruby 3.0 is deprecated and will be removed in upcoming major versions. Read more and see the full schedule in the docs: https://docs.stripe.com/sdks/versioning?lang=ruby#stripe-sdk-language-version-support-policy

### Bundler

If you are installing via bundler, you should be sure to use the https rubygems
source in your Gemfile, as any gems fetched over http could potentially be
compromised in transit and alter the code of gems fetched securely over https:

```ruby
source 'https://rubygems.org'

gem 'rails'
gem 'stripe'
```

## Usage

The library needs to be configured with your account's secret key which is
available in your [Stripe Dashboard][api-keys]. Initialize a new client with your API key:

```ruby
require 'stripe'

client = Stripe::StripeClient.new("sk_test_...")

# list customers
customers = client.v1.customers.list()

# retrieve single customer
customer = client.v1.customers.retrieve('cus_123456789')
```

### Per-request Configuration

For apps that need to use multiple keys during the lifetime of a process, like
one that uses [Stripe Connect][connect], it's also possible to set a
per-request key and/or account:

```ruby
require "stripe"

client = Stripe::StripeClient.new("sk_test_...")

client.v1.customers.list(
  {},
  {
    api_key: 'sk_test_...',
    stripe_account: 'acct_...',
    stripe_version: '2018-02-28',
  }
)
```

### StripeClient vs legacy pattern

We introduced the `StripeClient` class in v13 of the Ruby SDK. The legacy pattern used prior to that version is still a
阅读完整原文

项目深度分析 规则生成(AI 未配置)

综合评分 48.0 分。该项目在“个人可实施性”维度得 45 分,“付费可能性”维度得 44.0 分,差异化空间 70.0 分(评分依据见评分卡)。

将 stripe-ruby 改造为垂直场景 SaaS

产品构想保留核心能力,针对某一类用户(如某行业团队)做托管版,收取月费。
目标用户有该需求的中小团队 / 独立站长
难度/周期中 · 2~4 周(MVP)
收费模式订阅制(如 ¥29~99/月)
竞争风险需验证付费意愿;注意许可证合规
依据 数据支持的判断:许可证与关键词显示存在商用与付费场景

面向细分需求的二次开发产品

产品构想基于 stripe-ruby 的核心能力,聚焦一个更窄的场景(如某平台、某行业)做差异化。
目标用户该细分场景用户
难度/周期中 · 2~6 周
收费模式买断制 / 订阅制 / 广告
竞争风险细分需求规模需验证
依据 AI 推测:基于项目主题标签的判断
以上为规则引擎基于仓库公开数据生成的参考结论,包含推测成分,不构成投资或创业承诺;配置 AI 后可获得更深入的分析。
报告会保存到 个人中心

竞品与相似项目 GitHub Search 真实检索

项目中文简介Stars语言
stripe-ruby-mock/stripe-ruby-mock 中文介绍暂未生成
A mocking library for testing stripe ruby
998 Ruby
rfunduk/rails-stripe-connect-example 中文介绍暂未生成
Example app of various bits and pieces needed to build a Str
115 Ruby
gtolle/stripe-iiftoqbo 中文介绍暂未生成
A ruby gem that transforms Stripe's transaction history from
27 Ruby
以上为通过 GitHub 官方 Search API 检索的相似项目,功能差异与优劣势需进一步人工确认,配置 AI 后可生成对比分析。

项目优势与风险

技术成熟度创建于 2011-06-25,近 30 天仍在推送,发布过 100 个 Release
社区活跃Star 2,188 / Fork 701 / Issue 29(数据支持,可自行核实)
许可证MIT
主要风险上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价

安装与使用

此项目未提供 Docker 镜像,安装步骤以原仓库 README 为准(涉及依赖安装与环境配置,对新手门槛较高)。