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.



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

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.



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

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.



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

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.



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

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.



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

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



838
839
840
# File 'lib/stripe/resources/issuing/authorization.rb', line 838

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.



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

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.



953
954
955
956
957
958
959
960
# File 'lib/stripe/resources/issuing/authorization.rb', line 953

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.



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

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.



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

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.



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

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.



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

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.



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

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.



963
964
965
966
967
968
969
970
# File 'lib/stripe/resources/issuing/authorization.rb', line 963

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