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