Update generated code (#1271)

* Update generated code for v519

* Update generated code for v522

* Update generated code for v522

* Update generated code for v525

* Update generated code for v525

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
This commit is contained in:
stripe-openapi[bot] 2023-09-14 08:28:36 -07:00 committed by GitHub
parent f70e9b10d3
commit a1c164e2d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 209 additions and 282 deletions

View File

@ -1 +1 @@
v507
v525

View File

@ -23,8 +23,7 @@ module Stripe
nested_resource_class_methods :capability,
operations: %i[retrieve update list],
resource_plural: "capabilities"
nested_resource_class_methods :person,
operations: %i[create retrieve update delete list]
nested_resource_class_methods :person, operations: %i[create retrieve update delete list]
def persons(params = {}, opts = {})
request_stripe_object(

View File

@ -8,7 +8,6 @@ module Stripe
OBJECT_NAME = "application_fee"
nested_resource_class_methods :refund,
operations: %i[create retrieve update list]
nested_resource_class_methods :refund, operations: %i[create retrieve update list]
end
end

View File

@ -15,12 +15,9 @@ module Stripe
OBJECT_NAME = "customer"
nested_resource_class_methods :balance_transaction,
operations: %i[create retrieve update list]
nested_resource_class_methods :cash_balance_transaction,
operations: %i[retrieve list]
nested_resource_class_methods :tax_id,
operations: %i[create retrieve delete list]
nested_resource_class_methods :balance_transaction, operations: %i[create retrieve update list]
nested_resource_class_methods :cash_balance_transaction, operations: %i[retrieve list]
nested_resource_class_methods :tax_id, operations: %i[create retrieve delete list]
def create_funding_instructions(params = {}, opts = {})
request_stripe_object(
@ -85,12 +82,7 @@ module Stripe
)
end
def self.retrieve_payment_method(
customer,
payment_method,
params = {},
opts = {}
)
def self.retrieve_payment_method(customer, payment_method, params = {}, opts = {})
request_stripe_object(
method: :get,
path: format("/v1/customers/%<customer>s/payment_methods/%<payment_method>s", { customer: CGI.escape(customer), payment_method: CGI.escape(payment_method) }),

View File

@ -134,12 +134,7 @@ module Stripe
end
def self.upcoming(params = {}, opts = {})
request_stripe_object(
method: :get,
path: "/v1/invoices/upcoming",
params: params,
opts: opts
)
request_stripe_object(method: :get, path: "/v1/invoices/upcoming", params: params, opts: opts)
end
def self.void_invoice(invoice, params = {}, opts = {})

View File

@ -49,6 +49,95 @@ module Stripe
opts: opts
)
end
def test_helpers
TestHelpers.new(self)
end
class TestHelpers < APIResourceTestHelpers
RESOURCE_CLASS = Authorization
def self.capture(authorization, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/capture", { authorization: CGI.escape(authorization) }),
params: params,
opts: opts
)
end
def self.create(params = {}, opts = {})
request_stripe_object(
method: :post,
path: "/v1/test_helpers/issuing/authorizations",
params: params,
opts: opts
)
end
def self.expire(authorization, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/expire", { authorization: CGI.escape(authorization) }),
params: params,
opts: opts
)
end
def self.increment(authorization, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/increment", { authorization: CGI.escape(authorization) }),
params: params,
opts: opts
)
end
def self.reverse(authorization, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/reverse", { authorization: CGI.escape(authorization) }),
params: params,
opts: opts
)
end
def capture(params = {}, opts = {})
@resource.request_stripe_object(
method: :post,
path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/capture", { authorization: CGI.escape(@resource["id"]) }),
params: params,
opts: opts
)
end
def expire(params = {}, opts = {})
@resource.request_stripe_object(
method: :post,
path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/expire", { authorization: CGI.escape(@resource["id"]) }),
params: params,
opts: opts
)
end
def increment(params = {}, opts = {})
@resource.request_stripe_object(
method: :post,
path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/increment", { authorization: CGI.escape(@resource["id"]) }),
params: params,
opts: opts
)
end
def reverse(params = {}, opts = {})
@resource.request_stripe_object(
method: :post,
path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/reverse", { authorization: CGI.escape(@resource["id"]) }),
params: params,
opts: opts
)
end
end
end
end
end

View File

@ -13,6 +13,50 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "issuing.transaction"
def test_helpers
TestHelpers.new(self)
end
class TestHelpers < APIResourceTestHelpers
RESOURCE_CLASS = Transaction
def self.create_force_capture(params = {}, opts = {})
request_stripe_object(
method: :post,
path: "/v1/test_helpers/issuing/transactions/create_force_capture",
params: params,
opts: opts
)
end
def self.create_unlinked_refund(params = {}, opts = {})
request_stripe_object(
method: :post,
path: "/v1/test_helpers/issuing/transactions/create_unlinked_refund",
params: params,
opts: opts
)
end
def self.refund(transaction, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/test_helpers/issuing/transactions/%<transaction>s/refund", { transaction: CGI.escape(transaction) }),
params: params,
opts: opts
)
end
def refund(params = {}, opts = {})
@resource.request_stripe_object(
method: :post,
path: format("/v1/test_helpers/issuing/transactions/%<transaction>s/refund", { transaction: CGI.escape(@resource["id"]) }),
params: params,
opts: opts
)
end
end
end
end
end

View File

@ -19,8 +19,7 @@ module Stripe
OBJECT_NAME = "source"
nested_resource_class_methods :source_transaction,
operations: %i[retrieve list]
nested_resource_class_methods :source_transaction, operations: %i[retrieve list]
def verify(params = {}, opts = {})
request_stripe_object(

View File

@ -20,7 +20,6 @@ module Stripe
OBJECT_NAME = "transfer"
nested_resource_class_methods :reversal,
operations: %i[create retrieve update list]
nested_resource_class_methods :reversal, operations: %i[create retrieve update list]
end
end

View File

@ -55,11 +55,7 @@ module Stripe
)
end
def self.return_outbound_transfer(
outbound_transfer,
params = {},
opts = {}
)
def self.return_outbound_transfer(outbound_transfer, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/test_helpers/treasury/outbound_transfers/%<outbound_transfer>s/return", { outbound_transfer: CGI.escape(outbound_transfer) }),

View File

@ -1,6 +1,6 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
# File generated from our OpenAPI spec
require ::File.expand_path("../test_helper", __dir__)
module Stripe
class CodegennedExampleTest < Test::Unit::TestCase
@ -50,10 +50,7 @@ module Stripe
end
context "Account.update" do
should "support requests with args: metadata, id" do
Stripe::Account.update(
"acct_xxxxxxxxxxxxx",
{ metadata: { order_id: "6735" } }
)
Stripe::Account.update("acct_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } })
assert_requested :post, "#{Stripe.api_base}/v1/accounts/acct_xxxxxxxxxxxxx"
end
end
@ -88,10 +85,7 @@ module Stripe
end
context "ApplicationFeeRefund.retrieve" do
should "support requests with args: parent_id, id" do
Stripe::ApplicationFee.retrieve_refund(
"fee_xxxxxxxxxxxxx",
"fr_xxxxxxxxxxxxx"
)
Stripe::ApplicationFee.retrieve_refund("fee_xxxxxxxxxxxxx", "fr_xxxxxxxxxxxxx")
assert_requested :get, "#{Stripe.api_base}/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx?"
end
end
@ -230,20 +224,13 @@ module Stripe
end
context "Capability.retrieve" do
should "support requests with args: parent_id, id" do
Stripe::Account.retrieve_capability(
"acct_xxxxxxxxxxxxx",
"card_payments"
)
Stripe::Account.retrieve_capability("acct_xxxxxxxxxxxxx", "card_payments")
assert_requested :get, "#{Stripe.api_base}/v1/accounts/acct_xxxxxxxxxxxxx/capabilities/card_payments?"
end
end
context "Capability.update" do
should "support requests with args: requested, parent_id, id" do
Stripe::Account.update_capability(
"acct_xxxxxxxxxxxxx",
"card_payments",
{ requested: true }
)
Stripe::Account.update_capability("acct_xxxxxxxxxxxxx", "card_payments", { requested: true })
assert_requested :post, "#{Stripe.api_base}/v1/accounts/acct_xxxxxxxxxxxxx/capabilities/card_payments"
end
end
@ -255,10 +242,7 @@ module Stripe
end
context "CashBalance.update" do
should "support requests with args: customer, settings" do
Stripe::Customer.update_cash_balance(
"cus_123",
{ settings: { reconciliation_mode: "manual" } }
)
Stripe::Customer.update_cash_balance("cus_123", { settings: { reconciliation_mode: "manual" } })
assert_requested :post, "#{Stripe.api_base}/v1/customers/cus_123/cash_balance"
end
end
@ -293,18 +277,13 @@ module Stripe
end
context "Charge.search" do
should "support requests with args: query" do
Stripe::Charge.search({
query: "amount>999 AND metadata['order_id']:'6735'",
})
Stripe::Charge.search({ query: "amount>999 AND metadata['order_id']:'6735'" })
assert_requested :get, "#{Stripe.api_base}/v1/charges/search?query=amount>999 AND metadata['order_id']:'6735'"
end
end
context "Charge.update" do
should "support requests with args: metadata, id" do
Stripe::Charge.update(
"ch_xxxxxxxxxxxxx",
{ metadata: { order_id: "6735" } }
)
Stripe::Charge.update("ch_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } })
assert_requested :post, "#{Stripe.api_base}/v1/charges/ch_xxxxxxxxxxxxx"
end
end
@ -508,10 +487,7 @@ module Stripe
assert_requested :get, "#{Stripe.api_base}/v1/customers/cus_xyz/payment_methods?type=card"
end
should "support requests with args: type, parent_id" do
Stripe::Customer.list_payment_methods(
"cus_xxxxxxxxxxxxx",
{ type: "card" }
)
Stripe::Customer.list_payment_methods("cus_xxxxxxxxxxxxx", { type: "card" })
assert_requested :get, "#{Stripe.api_base}/v1/customers/cus_xxxxxxxxxxxxx/payment_methods?type=card"
end
end
@ -523,42 +499,29 @@ module Stripe
end
context "Customer.search" do
should "support requests with args: query" do
Stripe::Customer.search({
query: "name:'fakename' AND metadata['foo']:'bar'",
})
Stripe::Customer.search({ query: "name:'fakename' AND metadata['foo']:'bar'" })
assert_requested :get, "#{Stripe.api_base}/v1/customers/search?query=name:'fakename' AND metadata['foo']:'bar'"
end
should "support requests with args: query2" do
Stripe::Customer.search({
query: "name:'fakename' AND metadata['foo']:'bar'",
})
Stripe::Customer.search({ query: "name:'fakename' AND metadata['foo']:'bar'" })
assert_requested :get, "#{Stripe.api_base}/v1/customers/search?query=name:'fakename' AND metadata['foo']:'bar'"
end
end
context "Customer.update" do
should "support requests with args: metadata, id" do
Stripe::Customer.update(
"cus_xxxxxxxxxxxxx",
{ metadata: { order_id: "6735" } }
)
Stripe::Customer.update("cus_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } })
assert_requested :post, "#{Stripe.api_base}/v1/customers/cus_xxxxxxxxxxxxx"
end
end
context "CustomerBalanceTransaction.list" do
should "support requests with args: limit, parent_id" do
Stripe::Customer.list_balance_transactions(
"cus_xxxxxxxxxxxxx",
{ limit: 3 }
)
Stripe::Customer.list_balance_transactions("cus_xxxxxxxxxxxxx", { limit: 3 })
assert_requested :get, "#{Stripe.api_base}/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions?limit=3"
end
end
context "CustomerBalanceTransaction.retrieve" do
should "support requests with args: parent_id, id" do
Stripe::Customer.retrieve_balance_transaction(
"cus_xxxxxxxxxxxxx",
"cbtxn_xxxxxxxxxxxxx"
)
Stripe::Customer.retrieve_balance_transaction("cus_xxxxxxxxxxxxx", "cbtxn_xxxxxxxxxxxxx")
assert_requested :get, "#{Stripe.api_base}/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx?"
end
end
@ -592,10 +555,7 @@ module Stripe
end
context "Dispute.update" do
should "support requests with args: metadata, id" do
Stripe::Dispute.update(
"dp_xxxxxxxxxxxxx",
{ metadata: { order_id: "6735" } }
)
Stripe::Dispute.update("dp_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } })
assert_requested :post, "#{Stripe.api_base}/v1/disputes/dp_xxxxxxxxxxxxx"
end
end
@ -629,17 +589,11 @@ module Stripe
end
context "ExternalAccount.delete" do
should "support requests with args: parent_id, id" do
Stripe::Account.delete_external_account(
"acct_xxxxxxxxxxxxx",
"ba_xxxxxxxxxxxxx"
)
Stripe::Account.delete_external_account("acct_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx")
assert_requested :delete, "#{Stripe.api_base}/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx?"
end
should "support requests with args: parent_id, id2" do
Stripe::Account.delete_external_account(
"acct_xxxxxxxxxxxxx",
"card_xxxxxxxxxxxxx"
)
Stripe::Account.delete_external_account("acct_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx")
assert_requested :delete, "#{Stripe.api_base}/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx?"
end
end
@ -699,10 +653,7 @@ module Stripe
end
context "FileLink.update" do
should "support requests with args: metadata, id" do
Stripe::FileLink.update(
"link_xxxxxxxxxxxxx",
{ metadata: { order_id: "6735" } }
)
Stripe::FileLink.update("link_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } })
assert_requested :post, "#{Stripe.api_base}/v1/file_links/link_xxxxxxxxxxxxx"
end
end
@ -730,10 +681,7 @@ module Stripe
end
context "FinancialConnections.Account.list_owners" do
should "support requests with args: account, ownership" do
Stripe::FinancialConnections::Account.list_owners(
"fca_xyz",
{ ownership: "fcaowns_xyz" }
)
Stripe::FinancialConnections::Account.list_owners("fca_xyz", { ownership: "fcaowns_xyz" })
assert_requested :get, "#{Stripe.api_base}/v1/financial_connections/accounts/fca_xyz/owners?ownership=fcaowns_xyz"
end
should "support requests with args: limit, ownership, parent_id" do
@ -749,10 +697,7 @@ module Stripe
end
context "FinancialConnections.Account.refresh_account" do
should "support requests with args: account, features" do
Stripe::FinancialConnections::Account.refresh_account(
"fca_xyz",
{ features: ["balance"] }
)
Stripe::FinancialConnections::Account.refresh_account("fca_xyz", { features: ["balance"] })
assert_requested :post, "#{Stripe.api_base}/v1/financial_connections/accounts/fca_xyz/refresh"
end
end
@ -843,10 +788,7 @@ module Stripe
end
context "Identity.VerificationSession.update" do
should "support requests with args: type, id" do
Stripe::Identity::VerificationSession.update(
"vs_xxxxxxxxxxxxx",
{ type: "id_number" }
)
Stripe::Identity::VerificationSession.update("vs_xxxxxxxxxxxxx", { type: "id_number" })
assert_requested :post, "#{Stripe.api_base}/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx"
end
end
@ -901,9 +843,7 @@ module Stripe
end
context "Invoice.search" do
should "support requests with args: query" do
Stripe::Invoice.search({
query: "total>999 AND metadata['order_id']:'6735'",
})
Stripe::Invoice.search({ query: "total>999 AND metadata['order_id']:'6735'" })
assert_requested :get, "#{Stripe.api_base}/v1/invoices/search?query=total>999 AND metadata['order_id']:'6735'"
end
end
@ -921,10 +861,7 @@ module Stripe
end
context "Invoice.update" do
should "support requests with args: metadata, id" do
Stripe::Invoice.update(
"in_xxxxxxxxxxxxx",
{ metadata: { order_id: "6735" } }
)
Stripe::Invoice.update("in_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } })
assert_requested :post, "#{Stripe.api_base}/v1/invoices/in_xxxxxxxxxxxxx"
end
end
@ -963,10 +900,7 @@ module Stripe
end
context "InvoiceItem.update" do
should "support requests with args: metadata, id" do
Stripe::InvoiceItem.update(
"ii_xxxxxxxxxxxxx",
{ metadata: { order_id: "6735" } }
)
Stripe::InvoiceItem.update("ii_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } })
assert_requested :post, "#{Stripe.api_base}/v1/invoiceitems/ii_xxxxxxxxxxxxx"
end
end
@ -996,10 +930,7 @@ module Stripe
end
context "Issuing.Authorization.update" do
should "support requests with args: metadata, id" do
Stripe::Issuing::Authorization.update(
"iauth_xxxxxxxxxxxxx",
{ metadata: { order_id: "6735" } }
)
Stripe::Issuing::Authorization.update("iauth_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } })
assert_requested :post, "#{Stripe.api_base}/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx"
end
end
@ -1051,10 +982,7 @@ module Stripe
end
context "Issuing.Card.update" do
should "support requests with args: metadata, id" do
Stripe::Issuing::Card.update(
"ic_xxxxxxxxxxxxx",
{ metadata: { order_id: "6735" } }
)
Stripe::Issuing::Card.update("ic_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } })
assert_requested :post, "#{Stripe.api_base}/v1/issuing/cards/ic_xxxxxxxxxxxxx"
end
end
@ -1092,10 +1020,7 @@ module Stripe
end
context "Issuing.Cardholder.update" do
should "support requests with args: metadata, id" do
Stripe::Issuing::Cardholder.update(
"ich_xxxxxxxxxxxxx",
{ metadata: { order_id: "6735" } }
)
Stripe::Issuing::Cardholder.update("ich_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } })
assert_requested :post, "#{Stripe.api_base}/v1/issuing/cardholders/ich_xxxxxxxxxxxxx"
end
end
@ -1143,10 +1068,7 @@ module Stripe
end
context "Issuing.Transaction.update" do
should "support requests with args: metadata, id" do
Stripe::Issuing::Transaction.update(
"ipi_xxxxxxxxxxxxx",
{ metadata: { order_id: "6735" } }
)
Stripe::Issuing::Transaction.update("ipi_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } })
assert_requested :post, "#{Stripe.api_base}/v1/issuing/transactions/ipi_xxxxxxxxxxxxx"
end
end
@ -1176,10 +1098,7 @@ module Stripe
end
context "PaymentIntent.confirm" do
should "support requests with args: payment_method, id" do
Stripe::PaymentIntent.confirm(
"pi_xxxxxxxxxxxxx",
{ payment_method: "pm_card_visa" }
)
Stripe::PaymentIntent.confirm("pi_xxxxxxxxxxxxx", { payment_method: "pm_card_visa" })
assert_requested :post, "#{Stripe.api_base}/v1/payment_intents/pi_xxxxxxxxxxxxx/confirm"
end
end
@ -1214,10 +1133,7 @@ module Stripe
end
context "PaymentIntent.increment_authorization" do
should "support requests with args: amount, id" do
Stripe::PaymentIntent.increment_authorization(
"pi_xxxxxxxxxxxxx",
{ amount: 2099 }
)
Stripe::PaymentIntent.increment_authorization("pi_xxxxxxxxxxxxx", { amount: 2099 })
assert_requested :post, "#{Stripe.api_base}/v1/payment_intents/pi_xxxxxxxxxxxxx/increment_authorization"
end
end
@ -1243,10 +1159,7 @@ module Stripe
end
context "PaymentIntent.update" do
should "support requests with args: metadata, id" do
Stripe::PaymentIntent.update(
"pi_xxxxxxxxxxxxx",
{ metadata: { order_id: "6735" } }
)
Stripe::PaymentIntent.update("pi_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } })
assert_requested :post, "#{Stripe.api_base}/v1/payment_intents/pi_xxxxxxxxxxxxx"
end
end
@ -1256,10 +1169,7 @@ module Stripe
assert_requested :post, "#{Stripe.api_base}/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits?"
end
should "support requests with args: amounts, id" do
Stripe::PaymentIntent.verify_microdeposits(
"pi_xxxxxxxxxxxxx",
{ amounts: [32, 45] }
)
Stripe::PaymentIntent.verify_microdeposits("pi_xxxxxxxxxxxxx", { amounts: [32, 45] })
assert_requested :post, "#{Stripe.api_base}/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits"
end
end
@ -1317,10 +1227,7 @@ module Stripe
end
context "PaymentMethod.attach" do
should "support requests with args: customer, id" do
Stripe::PaymentMethod.attach(
"pm_xxxxxxxxxxxxx",
{ customer: "cus_xxxxxxxxxxxxx" }
)
Stripe::PaymentMethod.attach("pm_xxxxxxxxxxxxx", { customer: "cus_xxxxxxxxxxxxx" })
assert_requested :post, "#{Stripe.api_base}/v1/payment_methods/pm_xxxxxxxxxxxxx/attach"
end
end
@ -1361,26 +1268,17 @@ module Stripe
end
context "PaymentMethod.update" do
should "support requests with args: metadata, id" do
Stripe::PaymentMethod.update(
"pm_xxxxxxxxxxxxx",
{ metadata: { order_id: "6735" } }
)
Stripe::PaymentMethod.update("pm_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } })
assert_requested :post, "#{Stripe.api_base}/v1/payment_methods/pm_xxxxxxxxxxxxx"
end
end
context "PaymentSource.create" do
should "support requests with args: source, parent_id" do
Stripe::Customer.create_source(
"cus_xxxxxxxxxxxxx",
{ source: "btok_xxxxxxxxxxxxx" }
)
Stripe::Customer.create_source("cus_xxxxxxxxxxxxx", { source: "btok_xxxxxxxxxxxxx" })
assert_requested :post, "#{Stripe.api_base}/v1/customers/cus_xxxxxxxxxxxxx/sources"
end
should "support requests with args: source, parent_id2" do
Stripe::Customer.create_source(
"cus_xxxxxxxxxxxxx",
{ source: "tok_xxxx" }
)
Stripe::Customer.create_source("cus_xxxxxxxxxxxxx", { source: "tok_xxxx" })
assert_requested :post, "#{Stripe.api_base}/v1/customers/cus_xxxxxxxxxxxxx/sources"
end
end
@ -1408,17 +1306,11 @@ module Stripe
end
context "PaymentSource.retrieve" do
should "support requests with args: parent_id, id" do
Stripe::Customer.retrieve_source(
"cus_xxxxxxxxxxxxx",
"ba_xxxxxxxxxxxxx"
)
Stripe::Customer.retrieve_source("cus_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx")
assert_requested :get, "#{Stripe.api_base}/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx?"
end
should "support requests with args: parent_id, id2" do
Stripe::Customer.retrieve_source(
"cus_xxxxxxxxxxxxx",
"card_xxxxxxxxxxxxx"
)
Stripe::Customer.retrieve_source("cus_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx")
assert_requested :get, "#{Stripe.api_base}/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx?"
end
end
@ -1457,19 +1349,13 @@ module Stripe
end
context "Payout.update" do
should "support requests with args: metadata, id" do
Stripe::Payout.update(
"po_xxxxxxxxxxxxx",
{ metadata: { order_id: "6735" } }
)
Stripe::Payout.update("po_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } })
assert_requested :post, "#{Stripe.api_base}/v1/payouts/po_xxxxxxxxxxxxx"
end
end
context "Person.retrieve" do
should "support requests with args: parent_id, id" do
Stripe::Account.retrieve_person(
"acct_xxxxxxxxxxxxx",
"person_xxxxxxxxxxxxx"
)
Stripe::Account.retrieve_person("acct_xxxxxxxxxxxxx", "person_xxxxxxxxxxxxx")
assert_requested :get, "#{Stripe.api_base}/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx?"
end
end
@ -1523,10 +1409,7 @@ module Stripe
end
context "Plan.update" do
should "support requests with args: metadata, id" do
Stripe::Plan.update(
"price_xxxxxxxxxxxxx",
{ metadata: { order_id: "6735" } }
)
Stripe::Plan.update("price_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } })
assert_requested :post, "#{Stripe.api_base}/v1/plans/price_xxxxxxxxxxxxx"
end
end
@ -1568,18 +1451,13 @@ module Stripe
end
context "Price.search" do
should "support requests with args: query" do
Stripe::Price.search({
query: "active:'true' AND metadata['order_id']:'6735'",
})
Stripe::Price.search({ query: "active:'true' AND metadata['order_id']:'6735'" })
assert_requested :get, "#{Stripe.api_base}/v1/prices/search?query=active:'true' AND metadata['order_id']:'6735'"
end
end
context "Price.update" do
should "support requests with args: metadata, id" do
Stripe::Price.update(
"price_xxxxxxxxxxxxx",
{ metadata: { order_id: "6735" } }
)
Stripe::Price.update("price_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } })
assert_requested :post, "#{Stripe.api_base}/v1/prices/price_xxxxxxxxxxxxx"
end
end
@ -1609,18 +1487,13 @@ module Stripe
end
context "Product.search" do
should "support requests with args: query" do
Stripe::Product.search({
query: "active:'true' AND metadata['order_id']:'6735'",
})
Stripe::Product.search({ query: "active:'true' AND metadata['order_id']:'6735'" })
assert_requested :get, "#{Stripe.api_base}/v1/products/search?query=active:'true' AND metadata['order_id']:'6735'"
end
end
context "Product.update" do
should "support requests with args: metadata, id" do
Stripe::Product.update(
"prod_xxxxxxxxxxxxx",
{ metadata: { order_id: "6735" } }
)
Stripe::Product.update("prod_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } })
assert_requested :post, "#{Stripe.api_base}/v1/products/prod_xxxxxxxxxxxxx"
end
end
@ -1644,10 +1517,7 @@ module Stripe
end
context "PromotionCode.update" do
should "support requests with args: metadata, id" do
Stripe::PromotionCode.update(
"promo_xxxxxxxxxxxxx",
{ metadata: { order_id: "6735" } }
)
Stripe::PromotionCode.update("promo_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } })
assert_requested :post, "#{Stripe.api_base}/v1/promotion_codes/promo_xxxxxxxxxxxxx"
end
end
@ -1756,10 +1626,7 @@ module Stripe
end
context "Radar.ValueList.update" do
should "support requests with args: name, id" do
Stripe::Radar::ValueList.update(
"rsl_xxxxxxxxxxxxx",
{ name: "Updated IP Block List" }
)
Stripe::Radar::ValueList.update("rsl_xxxxxxxxxxxxx", { name: "Updated IP Block List" })
assert_requested :post, "#{Stripe.api_base}/v1/radar/value_lists/rsl_xxxxxxxxxxxxx"
end
end
@ -1825,10 +1692,7 @@ module Stripe
end
context "Refund.update" do
should "support requests with args: metadata, id" do
Stripe::Refund.update(
"re_xxxxxxxxxxxxx",
{ metadata: { order_id: "6735" } }
)
Stripe::Refund.update("re_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } })
assert_requested :post, "#{Stripe.api_base}/v1/refunds/re_xxxxxxxxxxxxx"
end
end
@ -1876,10 +1740,7 @@ module Stripe
end
context "Reversal.retrieve" do
should "support requests with args: parent_id, id" do
Stripe::Transfer.retrieve_reversal(
"tr_xxxxxxxxxxxxx",
"trr_xxxxxxxxxxxxx"
)
Stripe::Transfer.retrieve_reversal("tr_xxxxxxxxxxxxx", "trr_xxxxxxxxxxxxx")
assert_requested :get, "#{Stripe.api_base}/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx?"
end
end
@ -1928,10 +1789,7 @@ module Stripe
end
context "SetupIntent.confirm" do
should "support requests with args: payment_method, id" do
Stripe::SetupIntent.confirm(
"seti_xxxxxxxxxxxxx",
{ payment_method: "pm_card_visa" }
)
Stripe::SetupIntent.confirm("seti_xxxxxxxxxxxxx", { payment_method: "pm_card_visa" })
assert_requested :post, "#{Stripe.api_base}/v1/setup_intents/seti_xxxxxxxxxxxxx/confirm"
end
end
@ -1955,10 +1813,7 @@ module Stripe
end
context "SetupIntent.update" do
should "support requests with args: metadata, id" do
Stripe::SetupIntent.update(
"seti_xxxxxxxxxxxxx",
{ metadata: { user_id: "3435453" } }
)
Stripe::SetupIntent.update("seti_xxxxxxxxxxxxx", { metadata: { user_id: "3435453" } })
assert_requested :post, "#{Stripe.api_base}/v1/setup_intents/seti_xxxxxxxxxxxxx"
end
end
@ -1968,10 +1823,7 @@ module Stripe
assert_requested :post, "#{Stripe.api_base}/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits?"
end
should "support requests with args: amounts, id" do
Stripe::SetupIntent.verify_microdeposits(
"seti_xxxxxxxxxxxxx",
{ amounts: [32, 45] }
)
Stripe::SetupIntent.verify_microdeposits("seti_xxxxxxxxxxxxx", { amounts: [32, 45] })
assert_requested :post, "#{Stripe.api_base}/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits"
end
end
@ -2017,10 +1869,7 @@ module Stripe
end
context "ShippingRate.update" do
should "support requests with args: metadata, id" do
Stripe::ShippingRate.update(
"shr_xxxxxxxxxxxxx",
{ metadata: { order_id: "6735" } }
)
Stripe::ShippingRate.update("shr_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } })
assert_requested :post, "#{Stripe.api_base}/v1/shipping_rates/shr_xxxxxxxxxxxxx"
end
end
@ -2048,10 +1897,7 @@ module Stripe
end
context "Source.update" do
should "support requests with args: metadata, id" do
Stripe::Source.update(
"src_xxxxxxxxxxxxx",
{ metadata: { order_id: "6735" } }
)
Stripe::Source.update("src_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } })
assert_requested :post, "#{Stripe.api_base}/v1/sources/src_xxxxxxxxxxxxx"
end
end
@ -2086,10 +1932,7 @@ module Stripe
end
context "Subscription.update" do
should "support requests with args: metadata, id" do
Stripe::Subscription.update(
"sub_xxxxxxxxxxxxx",
{ metadata: { order_id: "6735" } }
)
Stripe::Subscription.update("sub_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } })
assert_requested :post, "#{Stripe.api_base}/v1/subscriptions/sub_xxxxxxxxxxxxx"
end
end
@ -2123,10 +1966,7 @@ module Stripe
end
context "SubscriptionItem.update" do
should "support requests with args: metadata, id" do
Stripe::SubscriptionItem.update(
"si_xxxxxxxxxxxxx",
{ metadata: { order_id: "6735" } }
)
Stripe::SubscriptionItem.update("si_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } })
assert_requested :post, "#{Stripe.api_base}/v1/subscription_items/si_xxxxxxxxxxxxx"
end
end
@ -2177,10 +2017,7 @@ module Stripe
end
context "SubscriptionSchedule.update" do
should "support requests with args: end_behavior, id" do
Stripe::SubscriptionSchedule.update(
"sub_sched_xxxxxxxxxxxxx",
{ end_behavior: "release" }
)
Stripe::SubscriptionSchedule.update("sub_sched_xxxxxxxxxxxxx", { end_behavior: "release" })
assert_requested :post, "#{Stripe.api_base}/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx"
end
end
@ -2249,10 +2086,7 @@ module Stripe
end
context "TaxId.retrieve" do
should "support requests with args: id, parent_id" do
Stripe::Customer.retrieve_tax_id(
"cus_xxxxxxxxxxxxx",
"txi_xxxxxxxxxxxxx"
)
Stripe::Customer.retrieve_tax_id("cus_xxxxxxxxxxxxx", "txi_xxxxxxxxxxxxx")
assert_requested :get, "#{Stripe.api_base}/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx?"
end
end
@ -2330,10 +2164,7 @@ module Stripe
end
context "Terminal.Configuration.update" do
should "support requests with args: configuration, tipping" do
Stripe::Terminal::Configuration.update(
"uc_123",
{ tipping: { usd: { fixed_amounts: [10] } } }
)
Stripe::Terminal::Configuration.update("uc_123", { tipping: { usd: { fixed_amounts: [10] } } })
assert_requested :post, "#{Stripe.api_base}/v1/terminal/configurations/uc_123"
end
should "support requests with args: bbpos_wisepos_e, id" do
@ -2385,10 +2216,7 @@ module Stripe
end
context "Terminal.Location.update" do
should "support requests with args: display_name, id" do
Stripe::Terminal::Location.update(
"tml_xxxxxxxxxxxxx",
{ display_name: "My First Store" }
)
Stripe::Terminal::Location.update("tml_xxxxxxxxxxxxx", { display_name: "My First Store" })
assert_requested :post, "#{Stripe.api_base}/v1/terminal/locations/tml_xxxxxxxxxxxxx"
end
end
@ -2449,10 +2277,7 @@ module Stripe
end
context "Terminal.Reader.update" do
should "support requests with args: label, id" do
Stripe::Terminal::Reader.update(
"tmr_xxxxxxxxxxxxx",
{ label: "Blue Rabbit" }
)
Stripe::Terminal::Reader.update("tmr_xxxxxxxxxxxxx", { label: "Blue Rabbit" })
assert_requested :post, "#{Stripe.api_base}/v1/terminal/readers/tmr_xxxxxxxxxxxxx"
end
end
@ -2462,10 +2287,7 @@ module Stripe
assert_requested :post, "#{Stripe.api_base}/v1/test_helpers/test_clocks/clock_xyz/advance"
end
should "support requests with args: frozen_time, id" do
Stripe::TestHelpers::TestClock.advance(
"clock_xxxxxxxxxxxxx",
{ frozen_time: 1_675_552_261 }
)
Stripe::TestHelpers::TestClock.advance("clock_xxxxxxxxxxxxx", { frozen_time: 1_675_552_261 })
assert_requested :post, "#{Stripe.api_base}/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx/advance"
end
end
@ -2634,18 +2456,13 @@ module Stripe
end
context "Transfer.update" do
should "support requests with args: metadata, id" do
Stripe::Transfer.update(
"tr_xxxxxxxxxxxxx",
{ metadata: { order_id: "6735" } }
)
Stripe::Transfer.update("tr_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } })
assert_requested :post, "#{Stripe.api_base}/v1/transfers/tr_xxxxxxxxxxxxx"
end
end
context "Treasury.CreditReversal.create" do
should "support requests with args: received_credit" do
Stripe::Treasury::CreditReversal.create({
received_credit: "rc_xxxxxxxxxxxxx",
})
Stripe::Treasury::CreditReversal.create({ received_credit: "rc_xxxxxxxxxxxxx" })
assert_requested :post, "#{Stripe.api_base}/v1/treasury/credit_reversals"
end
end
@ -2666,9 +2483,7 @@ module Stripe
end
context "Treasury.DebitReversal.create" do
should "support requests with args: received_debit" do
Stripe::Treasury::DebitReversal.create({
received_debit: "rd_xxxxxxxxxxxxx",
})
Stripe::Treasury::DebitReversal.create({ received_debit: "rd_xxxxxxxxxxxxx" })
assert_requested :post, "#{Stripe.api_base}/v1/treasury/debit_reversals"
end
end