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



5993
5994
5995
# File 'lib/stripe/resources/payment_intent.rb', line 5993

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.



5998
5999
6000
6001
6002
6003
6004
6005
# File 'lib/stripe/resources/payment_intent.rb', line 5998

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.



6008
6009
6010
6011
6012
6013
6014
6015
# File 'lib/stripe/resources/payment_intent.rb', line 6008

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