Sha256: fd0ecc26c2087ce18c870f53237138e70cbefde3d901c2b33c2984b0bd48945d

Contents?: true

Size: 1.09 KB

Versions: 9

Compression:

Stored size: 1.09 KB

Contents

module MangoPay

  class Conversion < Resource
    include HTTPCalls::Fetch
    include HTTPCalls::Update

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

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

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

      def get(id, params)
        url = "#{MangoPay.api_path}/conversions/#{id}"
        MangoPay.request(:get, url, params)
      end

      def create_quote(params)
        url = "#{MangoPay.api_path}/conversions/quote"
        MangoPay.request(:post, url, params)
      end

      def get_quote(id, params)
        url = "#{MangoPay.api_path}/conversions/quote/#{id}"
        MangoPay.request(:get, url, params)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
mangopay-3.28.0 lib/mangopay/conversion.rb
mangopay-3.27.0 lib/mangopay/conversion.rb
mangopay-3.26.1 lib/mangopay/conversion.rb
mangopay-3.26.0 lib/mangopay/conversion.rb
mangopay-3.25.1 lib/mangopay/conversion.rb
mangopay-3.25.0 lib/mangopay/conversion.rb
mangopay-3.24.1 lib/mangopay/conversion.rb
mangopay-3.24.0 lib/mangopay/conversion.rb
mangopay-3.23.0 lib/mangopay/conversion.rb