Merge pull request #1308 from stripe/helenye-demagic-ruby

Extract search api operation into resource from mixin
This commit is contained in:
helenye-stripe 2024-01-11 06:47:31 -08:00 committed by GitHub
commit 871a4c55b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 18 additions and 7 deletions

View File

@ -1,5 +1,6 @@
# frozen_string_literal: true
# TODO: (major) Deprecated, Remove along with extends
module Stripe
module APIOperations
module Search

View File

@ -43,7 +43,7 @@ module Stripe
end
def self.search(params = {}, opts = {})
_search("/v1/charges/search", params, opts)
request_stripe_object(method: :get, path: "/v1/charges/search", params: params, opts: opts)
end
def self.search_auto_paging_each(params = {}, opts = {}, &blk)

View File

@ -114,7 +114,7 @@ module Stripe
end
def self.search(params = {}, opts = {})
_search("/v1/customers/search", params, opts)
request_stripe_object(method: :get, path: "/v1/customers/search", params: params, opts: opts)
end
def self.search_auto_paging_each(params = {}, opts = {}, &blk)

View File

@ -167,7 +167,7 @@ module Stripe
end
def self.search(params = {}, opts = {})
_search("/v1/invoices/search", params, opts)
request_stripe_object(method: :get, path: "/v1/invoices/search", params: params, opts: opts)
end
def self.search_auto_paging_each(params = {}, opts = {}, &blk)

View File

@ -248,7 +248,12 @@ module Stripe
end
def self.search(params = {}, opts = {})
_search("/v1/payment_intents/search", params, opts)
request_stripe_object(
method: :get,
path: "/v1/payment_intents/search",
params: params,
opts: opts
)
end
def self.search_auto_paging_each(params = {}, opts = {}, &blk)

View File

@ -17,7 +17,7 @@ module Stripe
OBJECT_NAME = "price"
def self.search(params = {}, opts = {})
_search("/v1/prices/search", params, opts)
request_stripe_object(method: :get, path: "/v1/prices/search", params: params, opts: opts)
end
def self.search_auto_paging_each(params = {}, opts = {}, &blk)

View File

@ -20,7 +20,7 @@ module Stripe
OBJECT_NAME = "product"
def self.search(params = {}, opts = {})
_search("/v1/products/search", params, opts)
request_stripe_object(method: :get, path: "/v1/products/search", params: params, opts: opts)
end
def self.search_auto_paging_each(params = {}, opts = {}, &blk)

View File

@ -84,7 +84,12 @@ module Stripe
save_nested_resource :source
def self.search(params = {}, opts = {})
_search("/v1/subscriptions/search", params, opts)
request_stripe_object(
method: :get,
path: "/v1/subscriptions/search",
params: params,
opts: opts
)
end
def self.search_auto_paging_each(params = {}, opts = {}, &blk)