1
0
зеркало из https://github.com/glebtv/yookassa.git synced 2026-09-04 18:15:49 +03:00
Этот коммит содержится в:
Ivan Shamatov
2021-11-04 21:57:31 +03:00
коммит произвёл GitHub
родитель 49d8a8c208
Коммит f5f9f3793d
6 изменённых файлов: 95 добавлений и 3 удалений

Просмотреть файл

@@ -2,18 +2,45 @@
require_relative "./types"
require_relative "./amount"
require_relative "./source"
module Yookassa
module Entity
class Refund < Dry::Struct
attribute :id, Types::String
attribute? :idempotency_key, Types::String
attribute :status, Types::String
# id [string, required]
# Refund's ID in YooMoney
attribute :id, Types::String
# payment_id [string, required]
# Payment ID in YooMoney
attribute :payment_id, Types::String
# status [string, required]
# Refund status. Possible values: canceled, succeeded
attribute :status, Types::String.enum("canceled", "succeeded")
# receipt_registration [string, optional]
# Delivery status of receipt data to online sales register (pending, succeeded, or canceled).
# For those who use the solution for 54-FZ
attribute? :receipt_registration, Types::String.enum("pending", "succeeded", "canceled")
# created_at [string, required]
# Time to refund creation, based on UTC and specified in the ISO 8601 format, for example, 2017-11-03T11:52:31.827Z
attribute :created_at, Types::String
# amount [object, required]
# Amount refunded to the user.
attribute :amount, Entity::Amount
attribute? :receipt_registration, Types::String
# description [string, optional]
# Reason behind the refund.
attribute :description, Types::String
# sources [array, optional]
# Information about money held for refunds: the amount to be held and the stores getting the refunds.
# Specified if you use the YooMoney solution for marketplaces
attribute? :sources, Types::Array.of(Entity::Source)
end
end
end

23
lib/yookassa/entity/source.rb Обычный файл
Просмотреть файл

@@ -0,0 +1,23 @@
# frozen_string_literal: true
require_relative "./types"
require_relative "./amount"
module Yookassa
module Entity
class Source < Dry::Struct
# account_id [string, required]
# ID of the store in favor of which you're accepting the receipt. Provided by YooMoney, displayed in the Sellers section
# of your Merchant Profile (shopId column).
attribute :account_id, Types::String
# amount [object, required]
# Refund amount
attribute :amount, Entity::Amount
# platform_fee_amount [object, optional]
# Commission for sold products or services charged in your favor.
attribute? :platform_fee_amount, Entity::Amount
end
end
end