Fix cancel task to not cancel order, standardize OTP messages

- Cancel Task now leaves order untouched (customer can pay another way)
- Standardized SMS text to "Your Payfrit code is:" across all endpoints

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
John Mizerek 2026-02-17 11:11:37 -08:00
parent 43afe9ae8c
commit fc310c35cf
3 changed files with 4 additions and 11 deletions

View file

@ -99,7 +99,7 @@ try {
try { try {
smsResult = application.twilioObj.sendSMS( smsResult = application.twilioObj.sendSMS(
recipientNumber: "+1" & phone, recipientNumber: "+1" & phone,
messageBody: "Your Payfrit login code is: " & otp messageBody: "Your Payfrit code is: " & otp
); );
smsMessage = smsResult.success ? "Login code sent" : "SMS failed - please try again"; smsMessage = smsResult.success ? "Login code sent" : "SMS failed - please try again";
} catch (any smsErr) { } catch (any smsErr) {

View file

@ -136,7 +136,7 @@ try {
// Send via SMS // Send via SMS
try { try {
if (structKeyExists(application, "twilioObj")) { if (structKeyExists(application, "twilioObj")) {
smsMessage = "Your Payfrit login code is: " & code & ". It expires in 10 minutes."; smsMessage = "Your Payfrit code is: " & code;
application.twilioObj.sendSMS(to=qUser.ContactNumber, message=smsMessage); application.twilioObj.sendSMS(to=qUser.ContactNumber, message=smsMessage);
} }
} catch (any smsErr) { } catch (any smsErr) {

View file

@ -194,15 +194,8 @@
<cfset orderUpdated = false> <cfset orderUpdated = false>
<cfif qTask.OrderID GT 0> <cfif qTask.OrderID GT 0>
<cfif CancelOrder> <cfif CancelOrder>
<!--- Cancel order: Set status to 6 (Cancelled), no financial processing ---> <!--- Cancel task only: leave order untouched so customer can pay another way --->
<cfset queryTimed(" <cfset orderCancelled = false>
UPDATE Orders
SET StatusID = 6,
PaymentStatus = 'cancelled',
LastEditedOn = NOW()
WHERE ID = ?
", [ { value = qTask.OrderID, cfsqltype = "cf_sql_integer" } ], { datasource = "payfrit" })>
<cfset orderCancelled = true>
<cfelseif isCashTask> <cfelseif isCashTask>
<!--- Cash task: Set to status 1 (Submitted/Paid) to trigger kitchen flow ---> <!--- Cash task: Set to status 1 (Submitted/Paid) to trigger kitchen flow --->
<!--- Kitchen will then move to 2, then 3 (which creates delivery task) ---> <!--- Kitchen will then move to 2, then 3 (which creates delivery task) --->