Sha256: ab6e15c1f53e369dcd0cdb64db11c59277fea7ed071334076400da49615bb3a3

Contents?: true

Size: 1.95 KB

Versions: 18

Compression:

Stored size: 1.95 KB

Contents

# 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

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
stripe-10.5.0.pre.beta.1 lib/stripe/resources/issuing/transaction.rb
stripe-10.4.0 lib/stripe/resources/issuing/transaction.rb
stripe-10.4.0.pre.beta.1 lib/stripe/resources/issuing/transaction.rb
stripe-10.3.0 lib/stripe/resources/issuing/transaction.rb
stripe-10.3.0.pre.beta.1 lib/stripe/resources/issuing/transaction.rb
stripe-10.2.0 lib/stripe/resources/issuing/transaction.rb
stripe-10.2.0.pre.beta.1 lib/stripe/resources/issuing/transaction.rb
stripe-10.1.0 lib/stripe/resources/issuing/transaction.rb
stripe-10.1.0.pre.beta.2 lib/stripe/resources/issuing/transaction.rb
stripe-10.1.0.pre.beta.1 lib/stripe/resources/issuing/transaction.rb
stripe-10.0.0 lib/stripe/resources/issuing/transaction.rb
stripe-9.5.0.pre.beta.2 lib/stripe/resources/issuing/transaction.rb
stripe-9.5.0.pre.beta.1 lib/stripe/resources/issuing/transaction.rb
stripe-9.4.0 lib/stripe/resources/issuing/transaction.rb
stripe-9.4.0.pre.beta.3 lib/stripe/resources/issuing/transaction.rb
stripe-9.4.0.pre.beta.2 lib/stripe/resources/issuing/transaction.rb
stripe-9.4.0.pre.beta.1 lib/stripe/resources/issuing/transaction.rb
stripe-9.3.0 lib/stripe/resources/issuing/transaction.rb