Class: Stripe::Issuing::Transaction::TestHelpers

Inherits:
APIResourceTestHelpers show all
Defined in:
lib/stripe/resources/issuing/transaction.rb

Constant Summary collapse

RESOURCE_CLASS =
Transaction

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from APIResourceTestHelpers

custom_method, #initialize, resource_url, #resource_url

Methods included from APIOperations::Request

included

Constructor Details

This class inherits a constructor from Stripe::APIResourceTestHelpers

Class Method Details

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

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



1106
1107
1108
1109
1110
1111
1112
1113
# File 'lib/stripe/resources/issuing/transaction.rb', line 1106

def self.create_force_capture(params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: "/v1/test_helpers/issuing/transactions/create_force_capture",
    params: params,
    opts: opts
  )
end

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

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



1116
1117
1118
1119
1120
1121
1122
1123
# File 'lib/stripe/resources/issuing/transaction.rb', line 1116

def self.create_unlinked_refund(params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: "/v1/test_helpers/issuing/transactions/create_unlinked_refund",
    params: params,
    opts: opts
  )
end

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

Refund a test-mode Transaction.



1126
1127
1128
1129
1130
1131
1132
1133
# File 'lib/stripe/resources/issuing/transaction.rb', line 1126

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

.resource_classObject



1101
1102
1103
# File 'lib/stripe/resources/issuing/transaction.rb', line 1101

def self.resource_class
  "Transaction"
end

Instance Method Details

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

Refund a test-mode Transaction.



1136
1137
1138
1139
1140
1141
1142
1143
# File 'lib/stripe/resources/issuing/transaction.rb', line 1136

def refund(params = {}, opts = {})
  @resource.request_stripe_object(
    method: :post,
    path: format("/v1/test_helpers/issuing/transactions/%<transaction>s/refund", { transaction: CGI.escape(@resource["id"]) }),
    params: params,
    opts: opts
  )
end