diff --git a/sgx_jmp.rb b/sgx_jmp.rb index 21eb24b7b48b0662f1e65896e1066771f4734096..d1283392a63696508477a33b542ac7d3ab1c2e0c 100644 --- a/sgx_jmp.rb +++ b/sgx_jmp.rb @@ -601,11 +601,15 @@ Command.new( reply.command << FormTemplate.render("migrate_billing") end ]).then do |(customer, iq)| - Registration::Payment.for( - iq, customer, customer.registered?.phone, - final_message: PaypalDone::MESSAGE, - finish: PaypalDone - ).then(&:write).catch_only(Command::Execution::FinalStanza) do |s| + plan_name = iq.form.field("plan_name").value.to_s + customer = customer.with_plan(plan_name) + customer.save_plan!.then { + Registration::Payment.for( + iq, customer, customer.registered?.phone, + final_message: PaypalDone::MESSAGE, + finish: PaypalDone + ) + }.then(&:write).catch_only(Command::Execution::FinalStanza) do |s| BLATHER.join(CONFIG[:notify_admin], "sgx-jmp") BLATHER.say( CONFIG[:notify_admin],