Class: Stripe::Issuing::Authorization::TestHelpers

Inherits:
APIResourceTestHelpers show all
Defined in:
lib/stripe/resources/issuing/authorization.rb

Constant Summary collapse

RESOURCE_CLASS =
Authorization

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

.capture(authorization, params = {}, opts = {}) ⇒ Object

Capture a test-mode authorization.



649
650
651
652
653
654
655
656
# File 'lib/stripe/resources/issuing/authorization.rb', line 649

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

.create(params = {}, opts = {}) ⇒ Object

Create a test-mode authorization.



669
670
671
672
673
674
675
676
# File 'lib/stripe/resources/issuing/authorization.rb', line 669

def self.create(params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: "/v1/test_helpers/issuing/authorizations",
    params: params,
    opts: opts
  )
end

.expire(authorization, params = {}, opts = {}) ⇒ Object

Expire a test-mode Authorization.



679
680
681
682
683
684
685
686
# File 'lib/stripe/resources/issuing/authorization.rb', line 679

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

.finalize_amount(authorization, params = {}, opts = {}) ⇒ Object

Finalize the amount on an Authorization prior to capture, when the initial authorization was for an estimated amount.



699
700
701
702
703
704
705
706
# File 'lib/stripe/resources/issuing/authorization.rb', line 699

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

.increment(authorization, params = {}, opts = {}) ⇒ Object

Increment a test-mode Authorization.



719
720
721
722
723
724
725
726
# File 'lib/stripe/resources/issuing/authorization.rb', line 719

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

.resource_classObject



644
645
646
# File 'lib/stripe/resources/issuing/authorization.rb', line 644

def self.resource_class
  "Authorization"
end

.respond(authorization, params = {}, opts = {}) ⇒ Object

Respond to a fraud challenge on a testmode Issuing authorization, simulating either a confirmation of fraud or a correction of legitimacy.



739
740
741
742
743
744
745
746
# File 'lib/stripe/resources/issuing/authorization.rb', line 739

def self.respond(authorization, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/fraud_challenges/respond", { authorization: CGI.escape(authorization) }),
    params: params,
    opts: opts
  )
end

.reverse(authorization, params = {}, opts = {}) ⇒ Object

Reverse a test-mode Authorization.



759
760
761
762
763
764
765
766
# File 'lib/stripe/resources/issuing/authorization.rb', line 759

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

Instance Method Details

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

Capture a test-mode authorization.



659
660
661
662
663
664
665
666
# File 'lib/stripe/resources/issuing/authorization.rb', line 659

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

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

Expire a test-mode Authorization.



689
690
691
692
693
694
695
696
# File 'lib/stripe/resources/issuing/authorization.rb', line 689

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

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

Finalize the amount on an Authorization prior to capture, when the initial authorization was for an estimated amount.



709
710
711
712
713
714
715
716
# File 'lib/stripe/resources/issuing/authorization.rb', line 709

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

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

Increment a test-mode Authorization.



729
730
731
732
733
734
735
736
# File 'lib/stripe/resources/issuing/authorization.rb', line 729

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

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

Respond to a fraud challenge on a testmode Issuing authorization, simulating either a confirmation of fraud or a correction of legitimacy.



749
750
751
752
753
754
755
756
# File 'lib/stripe/resources/issuing/authorization.rb', line 749

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

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

Reverse a test-mode Authorization.



769
770
771
772
773
774
775
776
# File 'lib/stripe/resources/issuing/authorization.rb', line 769

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