# 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" # Cancels an InboundTransfer. 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 # Cancels an InboundTransfer. 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 # Transitions a test mode created InboundTransfer to the failed status. The InboundTransfer must already be in the processing state. 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 # Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state. 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 # Transitions a test mode created InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state. 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 # Transitions a test mode created InboundTransfer to the failed status. The InboundTransfer must already be in the processing state. 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 # Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state. 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 # Transitions a test mode created InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state. 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