stripe-openapi[bot] 8875698b96
Update generated code for v742 (#1306)
Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
2024-01-04 11:40:30 -08:00

67 lines
2.2 KiB
Ruby

# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
module Issuing
# Any use of an [issued card](https://stripe.com/docs/issuing) that results in funds entering or leaving
# your Stripe account, such as a completed purchase or refund, is represented by an Issuing
# `Transaction` object.
#
# Related guide: [Issued card transactions](https://stripe.com/docs/issuing/purchases/transactions)
class Transaction < APIResource
extend Stripe::APIOperations::List
include Stripe::APIOperations::Save
OBJECT_NAME = "issuing.transaction"
def test_helpers
TestHelpers.new(self)
end
class TestHelpers < APIResourceTestHelpers
RESOURCE_CLASS = Transaction
# Allows the user to capture an arbitrary amount, also known as a forced capture.
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
# Allows the user to refund an arbitrary amount, also known as a unlinked refund.
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
# Refund a test-mode Transaction.
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
# Refund a test-mode Transaction.
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