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.



560
561
562
563
564
565
566
567
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 560

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.



580
581
582
583
584
585
586
587
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 580

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



555
556
557
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 555

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.



600
601
602
603
604
605
606
607
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 600

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.



620
621
622
623
624
625
626
627
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 620

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.



570
571
572
573
574
575
576
577
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 570

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.



590
591
592
593
594
595
596
597
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 590

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.



610
611
612
613
614
615
616
617
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 610

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.



630
631
632
633
634
635
636
637
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 630

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