Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo in conversion endpoint #243

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/mangopay/instant_conversion.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ class InstantConversion < Resource

class << self
def get_rate(debited_currency, credited_currency, params)
url = "#{MangoPay.api_path}/conversion/rate/#{debited_currency}/#{credited_currency}"
url = "#{MangoPay.api_path}/conversions/rate/#{debited_currency}/#{credited_currency}"
MangoPay.request(:get, url, params)
end

def create(params)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename this to "createInstantConversion" and also implement the one for "createQuotedConversion"

url = "#{MangoPay.api_path}/instant-conversion"
url = "#{MangoPay.api_path}/conversions/instant-conversion"
MangoPay.request(:post, url, params)
end

def get(id, params)
url = "#{MangoPay.api_path}/instant-conversion/#{id}"
url = "#{MangoPay.api_path}/conversions/#{id}"
MangoPay.request(:get, url, params)
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/mangopay/instant_conversion_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
conversion = create_instant_conversion

expect(conversion['DebitedFunds']['Amount']).not_to be_nil
expect(conversion['CreditedFunds']['Amount']).not_to be_nil
expect(conversion['CreditedFunds']).not_to be_nil
expect(conversion['Status']).equal? 'SUCCEEDED'
end
end
Expand All @@ -26,7 +26,7 @@
returned_conversion = get_instant_conversion(conversion['Id'])

expect(returned_conversion['DebitedFunds']['Amount']).not_to be_nil
expect(returned_conversion['CreditedFunds']['Amount']).not_to be_nil
expect(returned_conversion['CreditedFunds']).not_to be_nil
expect(returned_conversion['Status']).equal? 'SUCCEEDED'
end
end
Expand Down
Loading