Class: Stripe::Treasury::OutboundPayment::TestHelpers

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

Constant Summary collapse

RESOURCE_CLASS =
OutboundPayment

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 OutboundPayment to the failed status. The OutboundPayment must already be in the processing state.



315
316
317
318
319
320
321
322
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 315

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

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

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



335
336
337
338
339
340
341
342
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 335

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

.resource_classObject



310
311
312
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 310

def self.resource_class
  "OutboundPayment"
end

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

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



355
356
357
358
359
360
361
362
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 355

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

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

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



375
376
377
378
379
380
381
382
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 375

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

Instance Method Details

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

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



325
326
327
328
329
330
331
332
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 325

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

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

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



345
346
347
348
349
350
351
352
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 345

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

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

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



365
366
367
368
369
370
371
372
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 365

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

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

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



385
386
387
388
389
390
391
392
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 385

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