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:
parent
43afe9ae8c
commit
fc310c35cf
3 changed files with 4 additions and 11 deletions
|
|
@ -99,7 +99,7 @@ try {
|
|||
try {
|
||||
smsResult = application.twilioObj.sendSMS(
|
||||
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";
|
||||
} catch (any smsErr) {
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ try {
|
|||
// Send via SMS
|
||||
try {
|
||||
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);
|
||||
}
|
||||
} catch (any smsErr) {
|
||||
|
|
|
|||
|
|
@ -194,15 +194,8 @@
|
|||
<cfset orderUpdated = false>
|
||||
<cfif qTask.OrderID GT 0>
|
||||
<cfif CancelOrder>
|
||||
<!--- Cancel order: Set status to 6 (Cancelled), no financial processing --->
|
||||
<cfset queryTimed("
|
||||
UPDATE Orders
|
||||
SET StatusID = 6,
|
||||
PaymentStatus = 'cancelled',
|
||||
LastEditedOn = NOW()
|
||||
WHERE ID = ?
|
||||
", [ { value = qTask.OrderID, cfsqltype = "cf_sql_integer" } ], { datasource = "payfrit" })>
|
||||
<cfset orderCancelled = true>
|
||||
<!--- Cancel task only: leave order untouched so customer can pay another way --->
|
||||
<cfset orderCancelled = false>
|
||||
<cfelseif isCashTask>
|
||||
<!--- Cash task: Set to status 1 (Submitted/Paid) to trigger kitchen flow --->
|
||||
<!--- Kitchen will then move to 2, then 3 (which creates delivery task) --->
|
||||
|
|
|
|||
Reference in a new issue