зеркало из
https://github.com/glebtv/yookassa.git
synced 2026-08-28 15:16:18 +03:00
Merge pull request #1 from glebtv/fix/dry-struct-excise
Fix optional excise attribute
Этот коммит содержится в:
4
.github/workflows/main.yml
поставляемый
4
.github/workflows/main.yml
поставляемый
@@ -13,7 +13,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
ruby:
|
ruby:
|
||||||
- "3.4"
|
- "3.4"
|
||||||
- "4.0"
|
- "4.0.6"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -35,7 +35,7 @@ jobs:
|
|||||||
- name: Set up Ruby
|
- name: Set up Ruby
|
||||||
uses: ruby/setup-ruby@v1
|
uses: ruby/setup-ruby@v1
|
||||||
with:
|
with:
|
||||||
ruby-version: 4.0
|
ruby-version: 4.0.6
|
||||||
bundler-cache: true
|
bundler-cache: true
|
||||||
- name: Set up Chrome
|
- name: Set up Chrome
|
||||||
uses: browser-actions/setup-chrome@v1
|
uses: browser-actions/setup-chrome@v1
|
||||||
|
|||||||
1
.ruby-version
Обычный файл
1
.ruby-version
Обычный файл
@@ -0,0 +1 @@
|
|||||||
|
4.0.6
|
||||||
@@ -62,7 +62,7 @@ module Yookassa
|
|||||||
|
|
||||||
# Amount of excise tax on products including kopeks. Decimal number with 2 digits after the period.
|
# Amount of excise tax on products including kopeks. Decimal number with 2 digits after the period.
|
||||||
# Online sales register that support this parameter: Orange Data, Kit Invest.
|
# Online sales register that support this parameter: Orange Data, Kit Invest.
|
||||||
attribute? :excise
|
attribute? :excise, Types::Coercible::Float
|
||||||
|
|
||||||
# Information about the supplier of product or service. You can specify this parameter if you send the data
|
# Information about the supplier of product or service. You can specify this parameter if you send the data
|
||||||
# for creating the receipt using the Receipt after payment scenario.
|
# for creating the receipt using the Receipt after payment scenario.
|
||||||
|
|||||||
17
spec/yookassa/entity/product_spec.rb
Обычный файл
17
spec/yookassa/entity/product_spec.rb
Обычный файл
@@ -0,0 +1,17 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
RSpec.describe Yookassa::Entity::Product do
|
||||||
|
let(:attributes) do
|
||||||
|
{
|
||||||
|
description: "Fuel",
|
||||||
|
quantity: 1,
|
||||||
|
amount: { value: 100, currency: "RUB" },
|
||||||
|
vat_code: 1
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
it "defines excise as an optional numeric attribute" do
|
||||||
|
expect(described_class.new(**attributes, excise: "12.34").excise).to eq(12.34)
|
||||||
|
expect(described_class.new(**attributes).excise).to be_nil
|
||||||
|
end
|
||||||
|
end
|
||||||
Ссылка в новой задаче
Block a user