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.



824
825
826
827
828
829
830
831
# File 'lib/stripe/resources/issuing/authorization.rb', line 824

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.



844
845
846
847
848
849
850
851
# File 'lib/stripe/resources/issuing/authorization.rb', line 844

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.



854
855
856
857
858
859
860
861
# File 'lib/stripe/resources/issuing/authorization.rb', line 854

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.



874
875
876
877
878
879
880
881
# File 'lib/stripe/resources/issuing/authorization.rb', line 874

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.



894
895
896
897
898
899
900
901
# File 'lib/stripe/resources/issuing/authorization.rb', line 894

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



819
820
821
# File 'lib/stripe/resources/issuing/authorization.rb', line 819

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.



914
915
916
917
918
919
920
921
# File 'lib/stripe/resources/issuing/authorization.rb', line 914

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.



934
935
936
937
938
939
940
941
# File 'lib/stripe/resources/issuing/authorization.rb', line 934

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.



834
835
836
837
838
839
840
841
# File 'lib/stripe/resources/issuing/authorization.rb', line 834

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.



864
865
866
867
868
869
870
871
# File 'lib/stripe/resources/issuing/authorization.rb', line 864

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.



884
885
886
887
888
889
890
891
# File 'lib/stripe/resources/issuing/authorization.rb', line 884

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.



904
905
906
907
908
909
910
911
# File 'lib/stripe/resources/issuing/authorization.rb', line 904

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.



924
925
926
927
928
929
930
931
# File 'lib/stripe/resources/issuing/authorization.rb', line 924

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.



944
945
946
947
948
949
950
951
# File 'lib/stripe/resources/issuing/authorization.rb', line 944

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