Class: Stripe::TestHelpers::Issuing::TransactionService

Inherits:
StripeService
  • Object
show all
Defined in:
lib/stripe/services/test_helpers/issuing/transaction_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

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

Allows the user to capture an arbitrary amount, also known as a forced capture.



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

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

  request(
    method: :post,
    path: "/v1/test_helpers/issuing/transactions/create_force_capture",
    params: params,
    opts: opts,
    base_address: :api
  )
end

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

Allows the user to refund an arbitrary amount, also known as a unlinked refund.



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

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

  request(
    method: :post,
    path: "/v1/test_helpers/issuing/transactions/create_unlinked_refund",
    params: params,
    opts: opts,
    base_address: :api
  )
end

#refund(transaction, params = {}, opts = {}) ⇒ Object

Refund a test-mode Transaction.



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

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