diff --git a/api/auth/sendOTP.cfm b/api/auth/sendOTP.cfm index 871800a..c059c7f 100644 --- a/api/auth/sendOTP.cfm +++ b/api/auth/sendOTP.cfm @@ -130,19 +130,28 @@ try { }, { datasource: "payfrit" }); } - // Send OTP via Twilio - smsResult = application.twilioObj.sendSMS( - recipientNumber: "+1" & phone, - messageBody: "Your Payfrit verification code is: " & otp - ); + // Send OTP via Twilio (if available) + smsMessage = "Code saved (SMS skipped in dev)"; + devOTP = otp; // Return OTP in dev mode for testing - smsStatus = smsResult.success ? "sent" : "failed: " & smsResult.message; + if (structKeyExists(application, "twilioObj")) { + try { + smsResult = application.twilioObj.sendSMS( + recipientNumber: "+1" & phone, + messageBody: "Your Payfrit verification code is: " & otp + ); + smsMessage = smsResult.success ? "Verification code sent" : "SMS failed - please try again"; + if (smsResult.success) devOTP = ""; // Don't leak OTP in production + } catch (any smsErr) { + smsMessage = "SMS error: " & smsErr.message; + } + } writeOutput(serializeJSON({ "OK": true, "UUID": userUUID, - "MESSAGE": smsResult.success ? "Verification code sent" : "SMS failed but code created - contact support", - "SMS_STATUS": smsStatus + "MESSAGE": smsMessage, + "DEV_OTP": devOTP })); } catch (any e) { diff --git a/portal/signup.html b/portal/signup.html new file mode 100644 index 0000000..8da0902 --- /dev/null +++ b/portal/signup.html @@ -0,0 +1,834 @@ + + + + + + Get Started - Payfrit + + + + +
+
+ + + +
+ + + +
+ + +
+ + + + + Back + + + + + +
+ + +
+ + + + + Back + + +
+

Almost there!

+

Tell us a bit about yourself

+
+ + +
+
+
+ + + +