mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-07-04 00:00:45 -04:00
Compare commits
14 Commits
486bee15a8
...
3c78633ce8
Author | SHA1 | Date | |
---|---|---|---|
|
3c78633ce8 | ||
|
bf05d0ce43 | ||
|
9876ba12dc | ||
|
0b67ca3197 | ||
|
af6fb06cd6 | ||
|
4d87c3af1e | ||
|
dc93d96cb9 | ||
|
f647412789 | ||
|
2076cfd42e | ||
|
78863b4b0f | ||
|
0f12721697 | ||
|
671163245a | ||
|
53ab9bf668 | ||
|
cfeaa0ca23 |
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@ -54,6 +54,10 @@ jobs:
|
||||
run: docker run -d -p 12111-12112:12111-12112 stripe/stripe-mock && sleep 5
|
||||
- name: test
|
||||
run: bundle install && bundle exec rake test
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.github_token }}
|
||||
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
|
||||
COVERALLS_SERVICE_NAME: github-action
|
||||
|
||||
publish:
|
||||
name: Publish
|
||||
|
@ -1,5 +1,10 @@
|
||||
# Changelog
|
||||
|
||||
## 7.2.0-beta.1 - 2022-08-23
|
||||
* [#1122](https://github.com/stripe/stripe-ruby/pull/1122) API Updates for beta branch
|
||||
- Updated stable APIs to the latest version
|
||||
- `Stripe-Version` beta headers are not pinned by-default and need to be manually specified, please refer to [beta SDKs README section](https://github.com/stripe/stripe-ruby/blob/master/README.md#beta-sdks)
|
||||
|
||||
## 7.1.0 - 2022-08-19
|
||||
* [#1116](https://github.com/stripe/stripe-ruby/pull/1116) API Updates
|
||||
* Add support for new resource `CustomerCashBalanceTransaction`
|
||||
|
1
Gemfile
1
Gemfile
@ -5,6 +5,7 @@ source "https://rubygems.org"
|
||||
gemspec
|
||||
|
||||
group :development do
|
||||
gem "coveralls_reborn", "~> 0.25.0" if RUBY_VERSION >= "3.1"
|
||||
gem "mocha", "~> 0.13.2"
|
||||
gem "rack", ">= 2.0.6"
|
||||
gem "rake"
|
||||
|
@ -1 +1 @@
|
||||
v184
|
||||
v185
|
30
README.md
30
README.md
@ -2,6 +2,7 @@
|
||||
|
||||
[](https://badge.fury.io/rb/stripe)
|
||||
[](https://github.com/stripe/stripe-ruby/actions?query=branch%3Amaster)
|
||||
[](https://coveralls.io/github/stripe/stripe-ruby?branch=master)
|
||||
|
||||
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
|
||||
@ -16,10 +17,6 @@ The library also provides other features. For example:
|
||||
- Built-in mechanisms for the serialization of parameters according to the
|
||||
expectations of Stripe's API.
|
||||
|
||||
## Support
|
||||
|
||||
New features and bug fixes are released on the latest major version of the Stripe Ruby library. If you are on an older major version, we recommend that you upgrade to the latest in order to use the new features and bug fixes including those for security vulnerabilities. Older major versions of the package will continue to be available for use, but will not be receiving any updates.
|
||||
|
||||
## Documentation
|
||||
|
||||
See the [Ruby API docs](https://stripe.com/docs/api?lang=ruby).
|
||||
@ -297,6 +294,31 @@ You can disable this behavior if you prefer:
|
||||
Stripe.enable_telemetry = false
|
||||
```
|
||||
|
||||
### Beta SDKs
|
||||
|
||||
Stripe has features in the beta phase that can be accessed via the beta version of this package.
|
||||
We would love for you to try these and share feedback with us before these features reach the stable phase.
|
||||
To install a beta version use `gem install` with the exact version you'd like to use:
|
||||
|
||||
```sh
|
||||
gem install stripe -v 7.1.0.pre.beta.2
|
||||
```
|
||||
|
||||
> **Note**
|
||||
> There can be breaking changes between beta versions. Therefore we recommend pinning the package version to a specific beta version in your Gemfile. This way you can install the same version each time without breaking changes unless you are intentionally looking for the latest beta version.
|
||||
|
||||
We highly recommend keeping an eye on when the beta feature you are interested in goes from beta to stable so that you can move from using a beta version of the SDK to the stable version.
|
||||
|
||||
If your beta feature requires a `Stripe-Version` header to be sent, use the `Stripe.api_version` field to set it:
|
||||
|
||||
```python
|
||||
Stripe.api_version += "; feature_beta=v3"
|
||||
```
|
||||
|
||||
## Support
|
||||
|
||||
New features and bug fixes are released on the latest major version of the Stripe Ruby library. If you are on an older major version, we recommend that you upgrade to the latest in order to use the new features and bug fixes including those for security vulnerabilities. Older major versions of the package will continue to be available for use, but will not be receiving any updates.
|
||||
|
||||
## Development
|
||||
|
||||
The test suite depends on [stripe-mock], so make sure to fetch and run it from a
|
||||
|
@ -50,6 +50,8 @@ module Stripe
|
||||
FinancialConnections::AccountOwnership,
|
||||
FinancialConnections::Session::OBJECT_NAME => FinancialConnections::Session,
|
||||
FundingInstructions::OBJECT_NAME => FundingInstructions,
|
||||
GiftCards::Card::OBJECT_NAME => GiftCards::Card,
|
||||
GiftCards::Transaction::OBJECT_NAME => GiftCards::Transaction,
|
||||
Identity::VerificationReport::OBJECT_NAME => Identity::VerificationReport,
|
||||
Identity::VerificationSession::OBJECT_NAME => Identity::VerificationSession,
|
||||
Invoice::OBJECT_NAME => Invoice,
|
||||
|
@ -37,6 +37,8 @@ require "stripe/resources/financial_connections/account_owner"
|
||||
require "stripe/resources/financial_connections/account_ownership"
|
||||
require "stripe/resources/financial_connections/session"
|
||||
require "stripe/resources/funding_instructions"
|
||||
require "stripe/resources/gift_cards/card"
|
||||
require "stripe/resources/gift_cards/transaction"
|
||||
require "stripe/resources/identity/verification_report"
|
||||
require "stripe/resources/identity/verification_session"
|
||||
require "stripe/resources/invoice"
|
||||
|
25
lib/stripe/resources/gift_cards/card.rb
Normal file
25
lib/stripe/resources/gift_cards/card.rb
Normal file
@ -0,0 +1,25 @@
|
||||
# File generated from our OpenAPI spec
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Stripe
|
||||
module GiftCards
|
||||
# A gift card represents a single gift card owned by a customer, including the
|
||||
# remaining balance, gift card code, and whether or not it is active.
|
||||
class Card < APIResource
|
||||
extend Stripe::APIOperations::Create
|
||||
extend Stripe::APIOperations::List
|
||||
include Stripe::APIOperations::Save
|
||||
|
||||
OBJECT_NAME = "gift_cards.card"
|
||||
|
||||
def self.validate(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
path: "/v1/gift_cards/cards/validate",
|
||||
params: params,
|
||||
opts: opts
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
56
lib/stripe/resources/gift_cards/transaction.rb
Normal file
56
lib/stripe/resources/gift_cards/transaction.rb
Normal file
@ -0,0 +1,56 @@
|
||||
# File generated from our OpenAPI spec
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Stripe
|
||||
module GiftCards
|
||||
# A gift card transaction represents a single transaction on a referenced gift card.
|
||||
# A transaction is in one of three states, `confirmed`, `held` or `canceled`. A `confirmed`
|
||||
# transaction is one that has added/deducted funds. A `held` transaction has created a
|
||||
# temporary hold on funds, which can then be cancelled or confirmed. A `held` transaction
|
||||
# can be confirmed into a `confirmed` transaction, or canceled into a `canceled` transaction.
|
||||
# A `canceled` transaction has no effect on a gift card's balance.
|
||||
class Transaction < APIResource
|
||||
extend Stripe::APIOperations::Create
|
||||
extend Stripe::APIOperations::List
|
||||
include Stripe::APIOperations::Save
|
||||
|
||||
OBJECT_NAME = "gift_cards.transaction"
|
||||
|
||||
def cancel(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
path: format("/v1/gift_cards/transactions/%<id>s/cancel", { id: CGI.escape(self["id"]) }),
|
||||
params: params,
|
||||
opts: opts
|
||||
)
|
||||
end
|
||||
|
||||
def confirm(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
path: format("/v1/gift_cards/transactions/%<id>s/confirm", { id: CGI.escape(self["id"]) }),
|
||||
params: params,
|
||||
opts: opts
|
||||
)
|
||||
end
|
||||
|
||||
def self.cancel(id, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
path: format("/v1/gift_cards/transactions/%<id>s/cancel", { id: CGI.escape(id) }),
|
||||
params: params,
|
||||
opts: opts
|
||||
)
|
||||
end
|
||||
|
||||
def self.confirm(id, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
path: format("/v1/gift_cards/transactions/%<id>s/confirm", { id: CGI.escape(id) }),
|
||||
params: params,
|
||||
opts: opts
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -1,5 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Stripe
|
||||
VERSION = "7.1.0-beta.2"
|
||||
VERSION = "7.2.0-beta.1"
|
||||
end
|
||||
|
@ -1,5 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Report test coverage to coveralls for only one Ruby version to avoid
|
||||
# repeated builds. This also accounts for coveralls_reborn requiring
|
||||
# RUBY_VERSION >= 2.5.
|
||||
if RUBY_VERSION.start_with?("3.1.")
|
||||
require "coveralls"
|
||||
Coveralls.wear!
|
||||
end
|
||||
|
||||
require "stripe"
|
||||
require "test/unit"
|
||||
require "mocha/setup"
|
||||
|
Loading…
x
Reference in New Issue
Block a user