Class: MethodRuby::Resources::Simulate::Payments::PaymentInstruments

Inherits:
Object
  • Object
show all
Defined in:
lib/method_ruby/resources/simulate/payments/payment_instruments.rb

Overview

Sandbox payment simulation

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ PaymentInstruments

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of PaymentInstruments.

Parameters:



49
50
51
# File 'lib/method_ruby/resources/simulate/payments/payment_instruments.rb', line 49

def initialize(client:)
  @client = client
end

Instance Method Details

#create(pmt_inst_id, amount:, method_version:, request_options: {}) ⇒ MethodRuby::Models::Simulate::Payments::PaymentInstrumentCreateResponse

Some parameter documentations has been truncated, see Models::Simulate::Payments::PaymentInstrumentCreateParams for more details.

Simulates posting a payment through a payment instrument in the sandbox environment. Use this to test payment instrument flows during development.

**Development only** - This endpoint is only available in the sandbox environment. This endpoint is available starting with API version ‘2025-12-01`.

Parameters:

Returns:

See Also:



32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/method_ruby/resources/simulate/payments/payment_instruments.rb', line 32

def create(pmt_inst_id, params)
  parsed, options = MethodRuby::Simulate::Payments::PaymentInstrumentCreateParams.dump_request(params)
  header_params = {method_version: "method-version"}
  @client.request(
    method: :post,
    path: ["simulate/payments/payment_instruments/%1$s", pmt_inst_id],
    headers: parsed.slice(*header_params.keys).transform_keys(header_params),
    body: parsed.except(*header_params.keys),
    model: MethodRuby::Models::Simulate::Payments::PaymentInstrumentCreateResponse,
    security: {secret_key: true},
    options: options
  )
end