moraki-finance / revolut-connect

Revolut non-official API connector
MIT License
0 stars 3 forks source link

[BusinessAPI] Add ForeignExchange resource #26

Closed leobz closed 1 month ago

leobz commented 1 month ago

Resume

Add the ForeignExchange resource, to retrieve information on exchange rates between currencies, buy and sell currencies.

Proposed interface

#  Note: delegates to 'Rate' resource to get an exchange rate
Revolut::ForeignExchange.rate(
  from: "EUR",
  to: "USD",
  amount: 100
)

Revolut::ForeignExchange.exchange(
  request_id: "49c6a48b-6b58-40a0-b974-0b8c4888c8a7", # The ID of the request, provided by you. It helps you identify the transaction in your system.
  from: {
    account_id: "8fe12333-5b27-4ad5-896c-38a25673fcc8",
    currency: "USD"
  },
  to: {
    account_id: "b4a3bcd2-c1dd-47cc-ac50-40cdb5856d42",
    currency: "GBP",
    amount: 10
  },
 reference: "exchange"
)

Tasks

Related Links

leobz commented 1 month ago

I just read the API docs and the repository code. I'm going to start the implementation at night :muscle:. I adjusted the proposal interface in the issue description, any feedback is welcome :raised_hands:

cc @mochetts