Class: Stripe::TestHelpers::Issuing::AuthorizationService

Inherits:
StripeService
  • Object
show all
Defined in:
lib/stripe/services/test_helpers/issuing/authorization_service.rb

Defined Under Namespace

Classes: CaptureParams, CreateParams, ExpireParams, FinalizeAmountParams, IncrementParams, RespondParams, ReverseParams

Instance Method Summary collapse

Methods inherited from StripeService

#initialize, #request, #request_stream

Constructor Details

This class inherits a constructor from Stripe::StripeService

Instance Method Details

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

Capture a test-mode authorization.



853
854
855
856
857
858
859
860
861
# File 'lib/stripe/services/test_helpers/issuing/authorization_service.rb', line 853

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

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

Create a test-mode authorization.



864
865
866
867
868
869
870
871
872
# File 'lib/stripe/services/test_helpers/issuing/authorization_service.rb', line 864

def create(params = {}, opts = {})
  request(
    method: :post,
    path: "/v1/test_helpers/issuing/authorizations",
    params: params,
    opts: opts,
    base_address: :api
  )
end

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

Expire a test-mode Authorization.



875
876
877
878
879
880
881
882
883
# File 'lib/stripe/services/test_helpers/issuing/authorization_service.rb', line 875

def expire(authorization, params = {}, opts = {})
  request(
    method: :post,
    path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/expire", { authorization: CGI.escape(authorization) }),
    params: params,
    opts: opts,
    base_address: :api
  )
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.



886
887
888
889
890
891
892
893
894
# File 'lib/stripe/services/test_helpers/issuing/authorization_service.rb', line 886

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

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

Increment a test-mode Authorization.



897
898
899
900
901
902
903
904
905
# File 'lib/stripe/services/test_helpers/issuing/authorization_service.rb', line 897

def increment(authorization, params = {}, opts = {})
  request(
    method: :post,
    path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/increment", { authorization: CGI.escape(authorization) }),
    params: params,
    opts: opts,
    base_address: :api
  )
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.



908
909
910
911
912
913
914
915
916
# File 'lib/stripe/services/test_helpers/issuing/authorization_service.rb', line 908

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

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

Reverse a test-mode Authorization.



919
920
921
922
923
924
925
926
927
# File 'lib/stripe/services/test_helpers/issuing/authorization_service.rb', line 919

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