% % pick up the payment confirmation issued after the user % purchases the subscription and the new Twilio magic number % is satisfied, the new number is available to the user % empty ofsrvc %%% "confsrvc" log)( empty { "Conf_confput_" textwild nextfile ? "nextf" log)( execing "confirmed" log)( % % use the file date as date of subscription % filing stamp Time.DateOf !Test.Date % % establish the install codes for customer % _Order.Xact !Install.Random _Order.Tack !Install.Stamp % % XC_6787867816_1661703045794_63797289471067.txt % % check any matching XC_ to this confirmation % since this is the entry gate, could be multiple % in time sequenced % false !Test.Purch "Month" !Test.Plan %%% 200 !Test.Free .015 !Test.Psms .0375 !Test.Pmms 1000 !Test.Prefill empty ofpurch empty { "XC_" textwild nextfile ? "nextfp" log)( reading % % has to match order checkout code from confput % _Order.Chk found? { % % this pre-checkout xc code matches % "trial subscription" found? { "Trial" !Test.Plan %%% 50 !Test.Free 500 !Test.Prefill _Test.Date 1 "m" Time.Add !Test.Next } if "monthly subscription" found? { "Month" !Test.Plan %%% 200 !Test.Free 1000 !Test.Prefill .015 !Test.Psms .0375 !Test.Pmms _Test.Date 1 "m" Time.Add !Test.Next } if "3 month subscription" found? { "Quarter" !Test.Plan %%% 600 !Test.Free 2775 !Test.Prefill .013 !Test.Psms .036 !Test.Pmms _Test.Date 3 "m" Time.Add !Test.Next } if "6 month subscription" found? { "Semi" !Test.Plan %%% 1200 !Test.Free 5250 !Test.Prefill .012 !Test.Psms .034 !Test.Pmms _Test.Date 6 "m" Time.Add !Test.Next } if "yearly subscription" found? { "Year" !Test.Plan %%% 2500 !Test.Free 9600 !Test.Prefill .01 !Test.Psms .03 !Test.Pmms _Test.Date 1 "y" Time.Add !Test.Next } if % % get the possible purchasers phone number % second term2 !Install.Subject % % analyze the purchase for which membership this applies to % ------ install code 1658936885857-58729 % % stack: purch-dir xc-seed xc-body % "install code " right$ " " left$ "-" slice !Test.Random !Test.Stamp dup !Test.Pfile % % check the install codes with the confput info % _Test.Random _Install.Random eq$ _Test.Stamp _Install.Stamp eq$ and !Test.Purch } { pop } ifelse % % stack: purch-dir xc-seed % % keep cycling through even if xc found, need to pick up % the latest one % } loop filing) _Test.Purch "purchsetestA" log)( { % % there is at least one XC_ match, % process the info for the TWI request for a new number % % check the pool of recycled numbers for a matching area code to issue % % Register_1661703045794_68827.xtx % empty !Install.AreaCode "Register_" ".xtx" ext*reg _Cond.Indep { % % always issue users phone number as twilio number % % the Test. vars are set from working with this customer purchase % _Test.Stamp !Install.Stamp _Test.Random !Install.Random _Install.Phone !Install.Sms 0 !Install.ProvTry empty !Install.SmsUri empty !Install.SmsFbUri empty !Install.SmsSid empty "Install.Random" sval "Install.Stamp" sval "Install.ProvTry" sval "Install.SmsUri" sval "Install.SmsFbUri" sval "Install.Sms" sval "Install.SmsSid" sval *cndawipu "Number_" inst$ & text oftwil write *cndawnum } { % % check for desired area code in recycle % _Install.AreaCode "areacode" log)( any? { % % there is an areacode present, so valid registration % &"" textwild empty !Install.Number % % there is a matching reg % "Recyc" oftwil folder empty { nextfile ? "nextfr" log)( % % have an available recycled number % assign it immediately as the number % execing dup filename !Install.Number finaled true ? } loop filing) _Install.Number "recyc" log)( any? { % % issue this number directly % it is xtx because of finaled in loop above % "Recyc" oftwil folder ^ &".xtx" exec$ % % the Test. vars are set from working with this customer purchase % _Test.Stamp !Install.Stamp _Test.Random !Install.Random empty "Install.Random" sval "Install.Stamp" sval "Install.ProvTry" sval "Install.SmsUri" sval "Install.SmsFbUri" sval "Install.Sms" sval "Install.SmsSid" sval *cndawipu "Number_" inst$ & text oftwil write } { % % no recycled, must provision a new Twilio number % empty "Install.Random" sval "Install.Stamp" sval "Install.Subject" sval % % a new twilio phone number will be provisioned from the aamg account % the .vtv file remains as a residue of the eventual numbered process % "TWI_" inst$ & &".vtv" oftwil "txter" log)( % % the TWI_*.txt file will be processed for new twilio number issuance % residue textover } ifelse *cndawnum } { % % no matching reg % } ifelse } ifelse % % stack: dir seed % finaled % % final out the matching XC also % _Test.Pfile ofpurch ".xtx" overext } { % % no XC match, flag the confput file as a problem % % stack: dir seed % filing ".err" overext } ifelse % % exit after the confput processed % true ? } loop filing)