Class: Yookassa::Refunds
- Inherits:
-
Object
- Object
- Yookassa::Refunds
- Defined in:
- lib/yookassa/refunds.rb
Instance Method Summary collapse
- #create(payload:, idempotency_key: SecureRandom.hex(10)) ⇒ Object
- #find(payment_id:) ⇒ Object
-
#initialize(api) ⇒ Refunds
constructor
A new instance of Refunds.
Constructor Details
#initialize(api) ⇒ Refunds
Returns a new instance of Refunds.
7 8 9 |
# File 'lib/yookassa/refunds.rb', line 7 def initialize(api) @api = api end |
Instance Method Details
#create(payload:, idempotency_key: SecureRandom.hex(10)) ⇒ Object
16 17 18 19 |
# File 'lib/yookassa/refunds.rb', line 16 def create(payload:, idempotency_key: SecureRandom.hex(10)) data = api.post("refunds", payload: payload, idempotency_key: idempotency_key) Entity::Refund.new(**data.merge(idempotency_key: idempotency_key)) end |