Class: Stripe::Treasury::InboundTransfer::TestHelpers

Inherits:
APIResourceTestHelpers show all
Defined in:
lib/stripe/resources/treasury/inbound_transfer.rb

Constant Summary collapse

RESOURCE_CLASS =
InboundTransfer

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from APIResourceTestHelpers

custom_method, #initialize, resource_url, #resource_url

Methods included from APIOperations::Request

included

Constructor Details

This class inherits a constructor from Stripe::APIResourceTestHelpers

Class Method Details

.fail(id, params = {}, opts = {}) ⇒ Object

Transitions a test mode created InboundTransfer to the failed status. The InboundTransfer must already be in the processing state.



41
42
43
44
45
46
47
48
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 41

def self.fail(id, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/test_helpers/treasury/inbound_transfers/%<id>s/fail", { id: CGI.escape(id) }),
    params: params,
    opts: opts
  )
end

.return_inbound_transfer(id, params = {}, opts = {}) ⇒ Object

Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state.



51
52
53
54
55
56
57
58
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 51

def self.return_inbound_transfer(id, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/test_helpers/treasury/inbound_transfers/%<id>s/return", { id: CGI.escape(id) }),
    params: params,
    opts: opts
  )
end

.succeed(id, params = {}, opts = {}) ⇒ Object

Transitions a test mode created InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state.



61
62
63
64
65
66
67
68
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 61

def self.succeed(id, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/test_helpers/treasury/inbound_transfers/%<id>s/succeed", { id: CGI.escape(id) }),
    params: params,
    opts: opts
  )
end

Instance Method Details

#fail(params = {}, opts = {}) ⇒ Object

Transitions a test mode created InboundTransfer to the failed status. The InboundTransfer must already be in the processing state.



71
72
73
74
75
76
77
78
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 71

def fail(params = {}, opts = {})
  @resource.request_stripe_object(
    method: :post,
    path: format("/v1/test_helpers/treasury/inbound_transfers/%<id>s/fail", { id: CGI.escape(@resource["id"]) }),
    params: params,
    opts: opts
  )
end

#return_inbound_transfer(params = {}, opts = {}) ⇒ Object

Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state.



81
82
83
84
85
86
87
88
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 81

def return_inbound_transfer(params = {}, opts = {})
  @resource.request_stripe_object(
    method: :post,
    path: format("/v1/test_helpers/treasury/inbound_transfers/%<id>s/return", { id: CGI.escape(@resource["id"]) }),
    params: params,
    opts: opts
  )
end

#succeed(params = {}, opts = {}) ⇒ Object

Transitions a test mode created InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state.



91
92
93
94
95
96
97
98
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 91

def succeed(params = {}, opts = {})
  @resource.request_stripe_object(
    method: :post,
    path: format("/v1/test_helpers/treasury/inbound_transfers/%<id>s/succeed", { id: CGI.escape(@resource["id"]) }),
    params: params,
    opts: opts
  )
end