Class: MethodRuby::Resources::Simulate::Payments
- Inherits:
-
Object
- Object
- MethodRuby::Resources::Simulate::Payments
- Defined in:
- lib/method_ruby/resources/simulate/payments.rb,
lib/method_ruby/resources/simulate/payments/payment_instruments.rb
Overview
Sandbox payment simulation
Defined Under Namespace
Classes: PaymentInstruments
Instance Attribute Summary collapse
-
#payment_instruments ⇒ MethodRuby::Resources::Simulate::Payments::PaymentInstruments
readonly
Sandbox payment simulation.
Instance Method Summary collapse
-
#create(payment_id, status:, method_version:, error_code: nil, request_options: {}) ⇒ MethodRuby::Models::Simulate::PaymentCreateResponse
Some parameter documentations has been truncated, see Models::Simulate::PaymentCreateParams for more details.
-
#initialize(client:) ⇒ Payments
constructor
private
A new instance of Payments.
Constructor Details
#initialize(client:) ⇒ Payments
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 Payments.
53 54 55 56 |
# File 'lib/method_ruby/resources/simulate/payments.rb', line 53 def initialize(client:) @client = client @payment_instruments = MethodRuby::Resources::Simulate::Payments::PaymentInstruments.new(client: client) end |
Instance Attribute Details
#payment_instruments ⇒ MethodRuby::Resources::Simulate::Payments::PaymentInstruments (readonly)
Sandbox payment simulation
10 11 12 |
# File 'lib/method_ruby/resources/simulate/payments.rb', line 10 def payment_instruments @payment_instruments end |
Instance Method Details
#create(payment_id, status:, method_version:, error_code: nil, request_options: {}) ⇒ MethodRuby::Models::Simulate::PaymentCreateResponse
Some parameter documentations has been truncated, see Models::Simulate::PaymentCreateParams for more details.
Updates the status of a payment in the sandbox environment. Use this to test payment lifecycle and status transition flows during development.
**Development only** - This endpoint is only available in the sandbox environment.
36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/method_ruby/resources/simulate/payments.rb', line 36 def create(payment_id, params) parsed, = MethodRuby::Simulate::PaymentCreateParams.dump_request(params) header_params = {method_version: "method-version"} @client.request( method: :post, path: ["simulate/payments/%1$s", payment_id], headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: MethodRuby::Models::Simulate::PaymentCreateResponse, security: {secret_key: true}, options: ) end |