Sha256: 7b30412897f7092ad94ebcef86a9a9a75bd5123825cb3819e63f094df3187c7c
Contents?: true
Size: 538 Bytes
Versions: 1
Compression:
Stored size: 538 Bytes
Contents
# frozen_string_literal: true require_relative "./entity/refund" module Yookassa class Refunds def initialize(api) @api = api end def find(payment_id:) data = api.get("refunds/#{payment_id}") Entity::Refund.new(**data) end 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 private attr_reader :api end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
yookassa-0.2.0 | lib/yookassa/refunds.rb |