Skip to content

Commit a2f1f96

Browse files
committed
Fix allowedInstallment
1 parent 39df548 commit a2f1f96

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/merchant_session/allowed_installments.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
module StarkBank
5-
class AllowedInstallments < StarkCore::Utils::SubResource
5+
class AllowedInstallment < StarkCore::Utils::SubResource
66
attr_reader :total_amount, :count
77

88
def initialize(total_amount:, count:)
@@ -13,9 +13,9 @@ def initialize(total_amount:, count:)
1313

1414
def self.resource
1515
{
16-
resource_name: 'AllowedInstallments',
16+
resource_name: 'AllowedInstallment',
1717
resource_maker: proc { |json|
18-
AllowedInstallments.new(
18+
AllowedInstallment.new(
1919
total_amount: json['total_amount'],
2020
count: json['count']
2121
)

lib/merchant_session/merchant_session.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def self.resource
3030
MerchantSession.new(
3131
id: json['id'],
3232
allowed_funding_types: json['allowed_funding_types'],
33-
allowed_installments: json['allowed_installments'].map { |installment| StarkBank::AllowedInstallments.resource[:resource_maker].call(installment) },
33+
allowed_installments: json['allowed_installments'].map { |installment| StarkBank::AllowedInstallment.resource[:resource_maker].call(installment) },
3434
allowed_ips: json['allowed_ips'],
3535
challenge_mode: json['challenge_mode'],
3636
expiration: json['expiration'],
@@ -88,10 +88,10 @@ def self.purchase(uuid:, payload:, user: nil)
8888
def parse_allowed_installments(allowed_installments)
8989
return nil if allowed_installments.nil?
9090
allowed_installments.map do |allowed_installment|
91-
if allowed_installment.is_a?(StarkBank::AllowedInstallments)
91+
if allowed_installment.is_a?(StarkBank::AllowedInstallment)
9292
allowed_installment
9393
else
94-
StarkCore::Utils::API.from_api_json(StarkBank::AllowedInstallments.resource, allowed_installment)
94+
StarkCore::Utils::API.from_api_json(StarkBank::AllowedInstallment.resource, allowed_installment)
9595
end
9696
end
9797
end

0 commit comments

Comments
 (0)