Skip to content

[Bug]: Class Adyen::ModificationsApi exists twice #324

@Korri

Description

@Korri

Description

Adyen::ModificationsApi exists both for Payment and Checkout

Steps to reproduce

  it 'loads modification_api without conflicting with checkout modification_api' do
    @shared_values[:client].payment.modifications_api
    @shared_values[:client].checkout.modifications_api

    expect(@shared_values[:client].checkout.modifications_api.service).to eq('Checkout')
    expect(@shared_values[:client].payment.modifications_api.service).to eq('Payment')
  end

This test fails with:

Actual behavior

This test fails with:

      Failure/Error: expect(@shared_values[:client].checkout.modifications_api.service).to eq('Checkout')
     
       expected: "Checkout"
            got: "Payment"
     
       (compared using ==)

Expected behavior

Both modification_api classes should be their own classes, they currently share the same name and one override the other's #initialize method.

Code snippet or screenshots (if applicable)

https://github.com/Adyen/adyen-ruby-api-library/blob/main/lib/adyen/services/checkout/modifications_api.rb
https://github.com/Adyen/adyen-ruby-api-library/blob/main/lib/adyen/services/payment/modifications_api.rb

Adyen Ruby API Library version

11.0.0

Ruby language version

N/A

Operating System

macOS

Additional context

Bug introduced by #313

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions