Class: Stripe::TestHelpers::Issuing::AuthorizationService
- Inherits:
-
StripeService
- Object
- StripeService
- Stripe::TestHelpers::Issuing::AuthorizationService
- Defined in:
- lib/stripe/services/test_helpers/issuing/authorization_service.rb
Instance Method Summary collapse
-
#capture(authorization, params = {}, opts = {}) ⇒ Object
Capture a test-mode authorization.
-
#create(params = {}, opts = {}) ⇒ Object
Create a test-mode authorization.
-
#expire(authorization, params = {}, opts = {}) ⇒ Object
Expire a test-mode Authorization.
-
#finalize_amount(authorization, params = {}, opts = {}) ⇒ Object
Finalize the amount on an Authorization prior to capture, when the initial authorization was for an estimated amount.
-
#increment(authorization, params = {}, opts = {}) ⇒ Object
Increment a test-mode Authorization.
-
#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.
-
#reverse(authorization, params = {}, opts = {}) ⇒ Object
Reverse a test-mode Authorization.
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(, 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() }), 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(, params = {}, opts = {}) request( method: :post, path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/expire", { authorization: CGI.escape() }), 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(, 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() }), 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(, params = {}, opts = {}) request( method: :post, path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/increment", { authorization: CGI.escape() }), 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(, params = {}, opts = {}) request( method: :post, path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/fraud_challenges/respond", { authorization: CGI.escape() }), 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(, params = {}, opts = {}) request( method: :post, path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/reverse", { authorization: CGI.escape() }), params: params, opts: opts, base_address: :api ) end |