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.



754
755
756
757
758
759
760
761
762
# File 'lib/stripe/services/test_helpers/issuing/authorization_service.rb', line 754

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.



765
766
767
768
769
770
771
772
773
# File 'lib/stripe/services/test_helpers/issuing/authorization_service.rb', line 765

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.



776
777
778
779
780
781
782
783
784
# File 'lib/stripe/services/test_helpers/issuing/authorization_service.rb', line 776

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.



787
788
789
790
791
792
793
794
795
# File 'lib/stripe/services/test_helpers/issuing/authorization_service.rb', line 787

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.



798
799
800
801
802
803
804
805
806
# File 'lib/stripe/services/test_helpers/issuing/authorization_service.rb', line 798

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.



809
810
811
812
813
814
815
816
817
# File 'lib/stripe/services/test_helpers/issuing/authorization_service.rb', line 809

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.



820
821
822
823
824
825
826
827
828
# File 'lib/stripe/services/test_helpers/issuing/authorization_service.rb', line 820

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