Log number purchase error

root21 created

Change summary

lib/registration.rb | 8 +++++---
test/test_helper.rb | 2 ++
2 files changed, 7 insertions(+), 3 deletions(-)

Detailed changes

lib/registration.rb 🔗

@@ -448,16 +448,18 @@ class Registration
 		def write
 			BandwidthTNOrder.create(
 				@tel,
-				customer_order_id: @customer.customer_id
+				customer_order_id: @customer.customer_id,
+				reservation_id: rid
 			).then(&:poll).then(
 				->(_) { customer_active_tel_purchased },
-				->(_) { number_purchase_error }
+				method(:number_purchase_error)
 			)
 		end
 
 	protected
 
-		def number_purchase_error
+		def number_purchase_error(e)
+			Command.log.error "number_purchase_error", e
 			TEL_SELECTIONS.delete(@customer.jid).then {
 				TelSelections::ChooseTel.new.choose_tel(
 					error: "The JMP number #{@tel} is no longer available."

test/test_helper.rb 🔗

@@ -127,6 +127,8 @@ LOG = Class.new {
 	end
 
 	def info(*); end
+
+	def error(*); end
 }.new.freeze
 
 def log