mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-10-05 00:02:50 -04:00
63 lines
2.0 KiB
Ruby
63 lines
2.0 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
|
|
|
|
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
|