mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-07-14 00:00:44 -04:00
Compare commits
1 Commits
c90f87750a
...
e75f90723c
Author | SHA1 | Date | |
---|---|---|---|
|
e75f90723c |
9
.github/workflows/ci.yml
vendored
9
.github/workflows/ci.yml
vendored
@ -50,9 +50,10 @@ jobs:
|
|||||||
uses: ruby/setup-ruby@v1
|
uses: ruby/setup-ruby@v1
|
||||||
with:
|
with:
|
||||||
ruby-version: ${{ matrix.ruby-version }}
|
ruby-version: ${{ matrix.ruby-version }}
|
||||||
- uses: stripe/openapi/actions/stripe-mock@master
|
- name: Start stripe-mock
|
||||||
|
run: docker run -d -p 12111-12112:12111-12112 stripe/stripe-mock && sleep 5
|
||||||
- name: test
|
- name: test
|
||||||
run: make ci-test
|
run: bundle install && bundle exec rake test
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.github_token }}
|
GITHUB_TOKEN: ${{ secrets.github_token }}
|
||||||
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
|
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
|
||||||
@ -80,7 +81,3 @@ jobs:
|
|||||||
run: gem push gems/*.gem
|
run: gem push gems/*.gem
|
||||||
env:
|
env:
|
||||||
GEM_HOST_API_KEY: ${{secrets.GEM_HOST_API_KEY}}
|
GEM_HOST_API_KEY: ${{secrets.GEM_HOST_API_KEY}}
|
||||||
- uses: stripe/openapi/actions/notify-release@master
|
|
||||||
if: always()
|
|
||||||
with:
|
|
||||||
bot_token: ${{ secrets.SLACK_BOT_TOKEN }}
|
|
||||||
|
7
Makefile
7
Makefile
@ -1,4 +1,4 @@
|
|||||||
.PHONY: update-version codegen-format test ci-test
|
.PHONY: update-version codegen-format
|
||||||
update-version:
|
update-version:
|
||||||
@echo "$(VERSION)" > VERSION
|
@echo "$(VERSION)" > VERSION
|
||||||
@perl -pi -e 's|VERSION = "[.\-\w\d]+"|VERSION = "$(VERSION)"|' lib/stripe/version.rb
|
@perl -pi -e 's|VERSION = "[.\-\w\d]+"|VERSION = "$(VERSION)"|' lib/stripe/version.rb
|
||||||
@ -6,8 +6,3 @@ update-version:
|
|||||||
codegen-format:
|
codegen-format:
|
||||||
bundle install --quiet
|
bundle install --quiet
|
||||||
bundle exec rubocop -o /dev/null --auto-correct
|
bundle exec rubocop -o /dev/null --auto-correct
|
||||||
|
|
||||||
ci-test:
|
|
||||||
bundle install && bundle exec rake test
|
|
||||||
|
|
||||||
test: ci-test
|
|
||||||
|
@ -1 +1 @@
|
|||||||
v277
|
v232
|
@ -89,8 +89,6 @@ module Stripe
|
|||||||
Subscription::OBJECT_NAME => Subscription,
|
Subscription::OBJECT_NAME => Subscription,
|
||||||
SubscriptionItem::OBJECT_NAME => SubscriptionItem,
|
SubscriptionItem::OBJECT_NAME => SubscriptionItem,
|
||||||
SubscriptionSchedule::OBJECT_NAME => SubscriptionSchedule,
|
SubscriptionSchedule::OBJECT_NAME => SubscriptionSchedule,
|
||||||
Tax::Calculation::OBJECT_NAME => Tax::Calculation,
|
|
||||||
Tax::Transaction::OBJECT_NAME => Tax::Transaction,
|
|
||||||
TaxCode::OBJECT_NAME => TaxCode,
|
TaxCode::OBJECT_NAME => TaxCode,
|
||||||
TaxId::OBJECT_NAME => TaxId,
|
TaxId::OBJECT_NAME => TaxId,
|
||||||
TaxRate::OBJECT_NAME => TaxRate,
|
TaxRate::OBJECT_NAME => TaxRate,
|
||||||
|
@ -76,8 +76,6 @@ require "stripe/resources/source_transaction"
|
|||||||
require "stripe/resources/subscription"
|
require "stripe/resources/subscription"
|
||||||
require "stripe/resources/subscription_item"
|
require "stripe/resources/subscription_item"
|
||||||
require "stripe/resources/subscription_schedule"
|
require "stripe/resources/subscription_schedule"
|
||||||
require "stripe/resources/tax/calculation"
|
|
||||||
require "stripe/resources/tax/transaction"
|
|
||||||
require "stripe/resources/tax_code"
|
require "stripe/resources/tax_code"
|
||||||
require "stripe/resources/tax_id"
|
require "stripe/resources/tax_id"
|
||||||
require "stripe/resources/tax_rate"
|
require "stripe/resources/tax_rate"
|
||||||
|
@ -1,31 +0,0 @@
|
|||||||
# File generated from our OpenAPI spec
|
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
module Stripe
|
|
||||||
module Tax
|
|
||||||
# A Tax `Calculation` allows you to calculate the tax to collect from your customer.
|
|
||||||
class Calculation < APIResource
|
|
||||||
extend Stripe::APIOperations::Create
|
|
||||||
|
|
||||||
OBJECT_NAME = "tax.calculation"
|
|
||||||
|
|
||||||
def list_line_items(params = {}, opts = {})
|
|
||||||
request_stripe_object(
|
|
||||||
method: :get,
|
|
||||||
path: format("/v1/tax/calculations/%<calculation>s/line_items", { calculation: CGI.escape(self["id"]) }),
|
|
||||||
params: params,
|
|
||||||
opts: opts
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.list_line_items(calculation, params = {}, opts = {})
|
|
||||||
request_stripe_object(
|
|
||||||
method: :get,
|
|
||||||
path: format("/v1/tax/calculations/%<calculation>s/line_items", { calculation: CGI.escape(calculation) }),
|
|
||||||
params: params,
|
|
||||||
opts: opts
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,49 +0,0 @@
|
|||||||
# File generated from our OpenAPI spec
|
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
module Stripe
|
|
||||||
module Tax
|
|
||||||
# A Tax transaction records the tax collected from or refunded to your customer.
|
|
||||||
class Transaction < APIResource
|
|
||||||
extend Stripe::APIOperations::Create
|
|
||||||
|
|
||||||
OBJECT_NAME = "tax.transaction"
|
|
||||||
|
|
||||||
def list_line_items(params = {}, opts = {})
|
|
||||||
request_stripe_object(
|
|
||||||
method: :get,
|
|
||||||
path: format("/v1/tax/transactions/%<transaction>s/line_items", { transaction: CGI.escape(self["id"]) }),
|
|
||||||
params: params,
|
|
||||||
opts: opts
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.create_from_calculation(params = {}, opts = {})
|
|
||||||
request_stripe_object(
|
|
||||||
method: :post,
|
|
||||||
path: "/v1/tax/transactions/create_from_calculation",
|
|
||||||
params: params,
|
|
||||||
opts: opts
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.create_reversal(params = {}, opts = {})
|
|
||||||
request_stripe_object(
|
|
||||||
method: :post,
|
|
||||||
path: "/v1/tax/transactions/create_reversal",
|
|
||||||
params: params,
|
|
||||||
opts: opts
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.list_line_items(transaction, params = {}, opts = {})
|
|
||||||
request_stripe_object(
|
|
||||||
method: :get,
|
|
||||||
path: format("/v1/tax/transactions/%<transaction>s/line_items", { transaction: CGI.escape(transaction) }),
|
|
||||||
params: params,
|
|
||||||
opts: opts
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -2020,20 +2020,6 @@ module Stripe
|
|||||||
assert_requested :post, "#{Stripe.api_base}/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx"
|
assert_requested :post, "#{Stripe.api_base}/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
context "Tax.Calculation.list_line_items" do
|
|
||||||
should "support requests with args: calculation" do
|
|
||||||
Stripe::Tax::Calculation.list_line_items("xxx")
|
|
||||||
assert_requested :get, "#{Stripe.api_base}/v1/tax/calculations/xxx/line_items?"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
context "Tax.Transaction.create_from_calculation" do
|
|
||||||
should "support requests with args: calculation, reference" do
|
|
||||||
Stripe::Tax::Transaction.create_from_calculation(
|
|
||||||
{ calculation: "xxx", reference: "yyy" }
|
|
||||||
)
|
|
||||||
assert_requested :post, "#{Stripe.api_base}/v1/tax/transactions/create_from_calculation"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
context "TaxCode.list" do
|
context "TaxCode.list" do
|
||||||
should "support requests with args: limit" do
|
should "support requests with args: limit" do
|
||||||
Stripe::TaxCode.list({ limit: 3 })
|
Stripe::TaxCode.list({ limit: 3 })
|
||||||
|
@ -78,6 +78,16 @@ module Stripe
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context ".retrieve_source_transaction" do
|
||||||
|
should "retrieve a source transaction" do
|
||||||
|
Stripe::Source.retrieve_source_transaction(
|
||||||
|
"src_123",
|
||||||
|
"srctxn_123"
|
||||||
|
)
|
||||||
|
assert_requested :get, "#{Stripe.api_base}/v1/sources/src_123/source_transactions/srctxn_123"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
context ".list_source_transactions" do
|
context ".list_source_transactions" do
|
||||||
should "list source transactions" do
|
should "list source transactions" do
|
||||||
Stripe::Source.list_source_transactions(
|
Stripe::Source.list_source_transactions(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user