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
# File 'lib/stripe/services/test_helpers/issuing/authorization_service.rb', line 9

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.



20
21
22
23
24
25
26
27
28
# File 'lib/stripe/services/test_helpers/issuing/authorization_service.rb', line 20

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.



31
32
33
34
35
36
37
38
39
# File 'lib/stripe/services/test_helpers/issuing/authorization_service.rb', line 31

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.



42
43
44
45
46
47
48
49
50
# File 'lib/stripe/services/test_helpers/issuing/authorization_service.rb', line 42

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.



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

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.



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

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.



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

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