Class: Stripe::Treasury::OutboundTransfer::TestHelpers

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

Constant Summary collapse

RESOURCE_CLASS =
OutboundTransfer

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(outbound_transfer, params = {}, opts = {}) ⇒ Object

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



153
154
155
156
157
158
159
160
# File 'lib/stripe/resources/treasury/outbound_transfer.rb', line 153

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

.post(outbound_transfer, params = {}, opts = {}) ⇒ Object

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



173
174
175
176
177
178
179
180
# File 'lib/stripe/resources/treasury/outbound_transfer.rb', line 173

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

.resource_classObject



148
149
150
# File 'lib/stripe/resources/treasury/outbound_transfer.rb', line 148

def self.resource_class
  "OutboundTransfer"
end

.return_outbound_transfer(outbound_transfer, params = {}, opts = {}) ⇒ Object

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



193
194
195
196
197
198
199
200
# File 'lib/stripe/resources/treasury/outbound_transfer.rb', line 193

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

.update(outbound_transfer, params = {}, opts = {}) ⇒ Object

Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must not be cancelable, and cannot be in the canceled or failed states.



213
214
215
216
217
218
219
220
# File 'lib/stripe/resources/treasury/outbound_transfer.rb', line 213

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

Instance Method Details

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

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



163
164
165
166
167
168
169
170
# File 'lib/stripe/resources/treasury/outbound_transfer.rb', line 163

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

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

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



183
184
185
186
187
188
189
190
# File 'lib/stripe/resources/treasury/outbound_transfer.rb', line 183

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

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

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



203
204
205
206
207
208
209
210
# File 'lib/stripe/resources/treasury/outbound_transfer.rb', line 203

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

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

Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must not be cancelable, and cannot be in the canceled or failed states.



223
224
225
226
227
228
229
230
# File 'lib/stripe/resources/treasury/outbound_transfer.rb', line 223

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