Sha256: 80854bec30c5f02573785ba0b8a31af21232ea8ff6cb4563e5b04e582b2399d9

Contents?: true

Size: 1.57 KB

Versions: 3

Compression:

Stored size: 1.57 KB

Contents

# File generated from our OpenAPI spec
# frozen_string_literal: true

module Stripe
  module Treasury
    class OutboundTransfer < APIResource
      extend Stripe::APIOperations::Create
      extend Stripe::APIOperations::List

      OBJECT_NAME = "treasury.outbound_transfer"

      custom_method :cancel, http_verb: :post

      def cancel(params = {}, opts = {})
        request_stripe_object(
          method: :post,
          path: resource_url + "/cancel",
          params: params,
          opts: opts
        )
      end

      def test_helpers
        TestHelpers.new(self)
      end

      class TestHelpers < APIResourceTestHelpers
        RESOURCE_CLASS = OutboundTransfer

        custom_method :fail, http_verb: :post
        custom_method :post, http_verb: :post
        custom_method :return_outbound_transfer, http_verb: :post, http_path: "return"

        def fail(params = {}, opts = {})
          @resource.request_stripe_object(
            method: :post,
            path: resource_url + "/fail",
            params: params,
            opts: opts
          )
        end

        def post(params = {}, opts = {})
          @resource.request_stripe_object(
            method: :post,
            path: resource_url + "/post",
            params: params,
            opts: opts
          )
        end

        def return_outbound_transfer(params = {}, opts = {})
          @resource.request_stripe_object(
            method: :post,
            path: resource_url + "/return",
            params: params,
            opts: opts
          )
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
stripe-6.3.0 lib/stripe/resources/treasury/outbound_transfer.rb
stripe-6.2.0 lib/stripe/resources/treasury/outbound_transfer.rb
stripe-6.1.0 lib/stripe/resources/treasury/outbound_transfer.rb