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

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

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.



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/stripe/services/test_helpers/issuing/authorization_service.rb', line 9

def capture(authorization, params = {}, opts = {})
  unless params.is_a?(Stripe::RequestParams)
    params = ::Stripe::TestHelpers::Issuing::AuthorizationCaptureParams.coerce_params(params)
  end

  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.



24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/stripe/services/test_helpers/issuing/authorization_service.rb', line 24

def create(params = {}, opts = {})
  unless params.is_a?(Stripe::RequestParams)
    params = ::Stripe::TestHelpers::Issuing::AuthorizationCreateParams.coerce_params(params)
  end

  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.



39
40
41
42
43
44
45
46
47
# File 'lib/stripe/services/test_helpers/issuing/authorization_service.rb', line 39

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.



50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/stripe/services/test_helpers/issuing/authorization_service.rb', line 50

def finalize_amount(authorization, params = {}, opts = {})
  unless params.is_a?(Stripe::RequestParams)
    params = ::Stripe::TestHelpers::Issuing::AuthorizationFinalizeAmountParams.coerce_params(params)
  end

  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.



65
66
67
68
69
70
71
72
73
# File 'lib/stripe/services/test_helpers/issuing/authorization_service.rb', line 65

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.



76
77
78
79
80
81
82
83
84
# File 'lib/stripe/services/test_helpers/issuing/authorization_service.rb', line 76

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.



87
88
89
90
91
92
93
94
95
# File 'lib/stripe/services/test_helpers/issuing/authorization_service.rb', line 87

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