diff --git a/lib/btc_sell_prices.rb b/lib/btc_sell_prices.rb index 771f1a27bc9b4fa86963c3b0cafa4ffb300ca04d..e9bd3f7b59518752c707fcddbf213ae6f99bb58b 100644 --- a/lib/btc_sell_prices.rb +++ b/lib/btc_sell_prices.rb @@ -33,8 +33,8 @@ class CryptoSellPrices fetch_canadianbitcoins.then do |http| cb = Nokogiri::HTML.parse(http.response) - row = cb.at(self.ticker_row_selector) - unless row.at("td").text == self.crypto_name + row = cb.at(ticker_row_selector) + unless row.at("td").text == crypto_name raise "#{crypto_name} row has moved" end diff --git a/lib/registration.rb b/lib/registration.rb index 8ad7f33e31788d89e6ed21c39205a6bd47038320..33c9bac6d08d380af32bfc987f506a4f304ad2ac 100644 --- a/lib/registration.rb +++ b/lib/registration.rb @@ -322,7 +322,9 @@ class Registration }.then(&method(:handle_possible_prev)) end end + protected + def handle_possible_prev(iq) raise "Action not allowed" unless iq.prev? @@ -331,8 +333,8 @@ class Registration def addr_and_rate EMPromise.all([ - self.crypto_addrs.then { |addrs| - addrs.first || self.add_crypto_addr + crypto_addrs.then { |addrs| + addrs.first || add_crypto_addr }, sell_prices.public_send(@customer.currency.to_s.downcase) @@ -381,7 +383,6 @@ class Registration end end - class CreditCard Payment.kinds[:credit_card] = ->(*args, **kw) { self.for(*args, **kw) }