module M2yBiz
  module Wallet
    class Teds < Base

      def initialize(token)
        @headers = json_headers(true, token)
      end

      def generateTedRecharge(body)
        # https://code.biz.com.br/api-details#api=wallet-lancamentos&operation=post-entries-bank-transfer
        return Base::FAILURE if body.blank?
        url = "#{base_url}#{Constants::Paths::GENERATE_TED_RECHARGE_PATH}"
        request = HTTParty.post(url, body: body.to_json, headers: @headers)
        BizHelper.parse_response(request)
      end
    end
  end
end
