Class: MethodRuby::Resources::Simulate::Payments::PaymentInstruments
- Inherits:
-
Object
- Object
- MethodRuby::Resources::Simulate::Payments::PaymentInstruments
- Defined in:
- lib/method_ruby/resources/simulate/payments/payment_instruments.rb
Overview
Sandbox payment simulation
Instance Method Summary collapse
-
#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.
-
#initialize(client:) ⇒ PaymentInstruments
constructor
private
A new instance of PaymentInstruments.
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.
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`.
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, = 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: ) end |