Class: Stripe::PaymentIntent::TestHelpers

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

Constant Summary collapse

RESOURCE_CLASS =
PaymentIntent

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

.resource_classObject



5208
5209
5210
# File 'lib/stripe/resources/payment_intent.rb', line 5208

def self.resource_class
  "PaymentIntent"
end

.simulate_crypto_deposit(intent, params = {}, opts = {}) ⇒ Object

Simulate an incoming crypto deposit for a testmode PaymentIntent with payment_method_options[mode]=deposit. The transaction_hash parameter determines whether the simulated deposit succeeds or fails. Learn more about [testing your integration](docs.stripe.com/docs/payments/deposit-mode-stablecoin-payments#test-your-integration).



5213
5214
5215
5216
5217
5218
5219
5220
# File 'lib/stripe/resources/payment_intent.rb', line 5213

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

Instance Method Details

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

Simulate an incoming crypto deposit for a testmode PaymentIntent with payment_method_options[mode]=deposit. The transaction_hash parameter determines whether the simulated deposit succeeds or fails. Learn more about [testing your integration](docs.stripe.com/docs/payments/deposit-mode-stablecoin-payments#test-your-integration).



5223
5224
5225
5226
5227
5228
5229
5230
# File 'lib/stripe/resources/payment_intent.rb', line 5223

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