# File generated from our OpenAPI spec # frozen_string_literal: true module Stripe module Treasury # Use [InboundTransfers](https://stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://stripe.com/docs/api#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit. class InboundTransfer < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List OBJECT_NAME = "treasury.inbound_transfer" def cancel(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/treasury/inbound_transfers/%s/cancel", { inbound_transfer: CGI.escape(self["id"]) }), params: params, opts: opts ) end def self.cancel(inbound_transfer, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/treasury/inbound_transfers/%s/cancel", { inbound_transfer: CGI.escape(inbound_transfer) }), params: params, opts: opts ) end def test_helpers TestHelpers.new(self) end class TestHelpers < APIResourceTestHelpers RESOURCE_CLASS = InboundTransfer def self.fail(id, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/test_helpers/treasury/inbound_transfers/%s/fail", { id: CGI.escape(id) }), params: params, opts: opts ) end def self.return_inbound_transfer(id, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/test_helpers/treasury/inbound_transfers/%s/return", { id: CGI.escape(id) }), params: params, opts: opts ) end def self.succeed(id, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/test_helpers/treasury/inbound_transfers/%s/succeed", { id: CGI.escape(id) }), params: params, opts: opts ) end def fail(params = {}, opts = {}) @resource.request_stripe_object( method: :post, path: format("/v1/test_helpers/treasury/inbound_transfers/%s/fail", { id: CGI.escape(@resource["id"]) }), params: params, opts: opts ) end def return_inbound_transfer(params = {}, opts = {}) @resource.request_stripe_object( method: :post, path: format("/v1/test_helpers/treasury/inbound_transfers/%s/return", { id: CGI.escape(@resource["id"]) }), params: params, opts: opts ) end def succeed(params = {}, opts = {}) @resource.request_stripe_object( method: :post, path: format("/v1/test_helpers/treasury/inbound_transfers/%s/succeed", { id: CGI.escape(@resource["id"]) }), params: params, opts: opts ) end end end end end