You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

512 lines
35 KiB

  1. USE [FastMoneyPro_Remit]
  2. GO
  3. /****** Object: StoredProcedure [dbo].[proc_online_customer_login] Script Date: 2/6/2024 5:20:57 PM ******/
  4. SET ANSI_NULLS ON
  5. GO
  6. SET QUOTED_IDENTIFIER ON
  7. GO
  8. ALTER PROC [dbo].[proc_online_customer_login]
  9. @flag VARCHAR(50)
  10. ,@customerEmail VARCHAR(100) = NULL
  11. ,@customerPassword VARCHAR(255) = NULL
  12. ,@country VARCHAR(50) = NULL
  13. ,@ipAddress VARCHAR(100) = NULL
  14. ,@lockReason VARCHAR(500) = NULL
  15. ,@UserInfoDetail VARCHAR(MAX) = NULL
  16. ,@sessionId VARCHAR(60) = NULL
  17. ,@checkCountry VARCHAR(50) = NULL
  18. ,@password VARCHAR(50) = NULL
  19. ,@idType VARCHAR(50) = NULL
  20. ,@idNumber VARCHAR(50) = NULL
  21. ,@LogInfo VARCHAR(MAX) = NULL
  22. AS
  23. -----------------------------------------------------
  24. -- #101 - Mobile Changes , #361 - Multi-Lingual
  25. -----------------------------------------------------
  26. SET NOCOUNT ON;
  27. SET XACT_ABORT ON;
  28. BEGIN TRY
  29. DECLARE
  30. @UserData VARCHAR(200)
  31. ,@lastPwdChangedOn DATETIME
  32. ,@forceChangePwd CHAR(1)
  33. ,@pwdChangeDays VARCHAR(20)
  34. ,@msg VARCHAR(2000)
  35. ,@pwdChangeWarningDays VARCHAR(5)
  36. ,@lastLoginDate DATETIME
  37. DECLARE @email VARCHAR(100)
  38. ,@customerPwd VARCHAR(50)
  39. ,@isActive CHAR(1)
  40. ,@onlineUser CHAR(1)
  41. ,@isLocked VARCHAR(1)
  42. ,@ccountry VARCHAR(50)
  43. ,@customerStatus CHAR(1)
  44. ,@loginAttempt INT
  45. ,@existingCustomer INT
  46. ,@CreatedFrom varchar(50)
  47. IF @flag = 'check-id'
  48. BEGIN
  49. IF EXISTS(SELECT FULLNAME FROM CUSTOMERMASTER (NOLOCK) WHERE IDNUMBER = @idNumber) OR
  50. EXISTS(SELECT 'x' FROM dbo.CustomerMasterTemp AS CM(NOLOCK) WHERE IDNUMBER = @idNumber AND createdBy IS NOT NULL)
  51. BEGIN
  52. SELECT 1 ERRORCODE,'Already exists!' MSG,NULL
  53. RETURN
  54. END
  55. SELECT 0 ERRORCODE,'Success' MSG,NULL
  56. RETURN
  57. END
  58. IF @flag = 'checkIp'
  59. BEGIN
  60. IF NOT EXISTS( SELECT COUNTRYNAME FROM COUNTRYMASTER WITH (NOLOCK)
  61. WHERE ISNULL(allowOnlineCustomer,'N')='Y' AND upper(COUNTRYNAME)=upper(@checkCountry))
  62. BEGIN
  63. SELECT 1 ERRORCODE,'NOT AVAILABLE' MSG,NULL
  64. RETURN
  65. END
  66. ELSE
  67. BEGIN
  68. SELECT 0 ERRORCODE,'AVAILABLE' MSG,NULL
  69. END
  70. END
  71. IF @flag = 'l'
  72. BEGIN
  73. IF NOT EXISTS(SELECT 'x' FROM customerMaster WITH(NOLOCK) WHERE email=@customerEmail)
  74. BEGIN
  75. SELECT 1 errorCode, 'Login Failed - Invalid username or password!' msg, @customerEmail id
  76. RETURN
  77. END
  78. SELECT @email=email,
  79. @customerPwd=customerPassword,
  80. @isActive=isactive,
  81. @onlineUser=onlineuser,
  82. @isLocked=isLocked,
  83. @ccountry=country,
  84. @customerStatus=customerStatus,
  85. @lastLoginDate=lastLoginTs,
  86. @loginAttempt = ISNULL(invalidAttemptCount, 0),
  87. @existingCustomer= ISNULL(isexistingcustomer,0),
  88. @CreatedFrom= createdfrom
  89. FROM customerMaster WITH (NOLOCK)
  90. WHERE email=@customerEmail and ISNULL(onlineUser, 'N')='Y'
  91. SET @UserData ='User: '+ @customerEmail +' User Type:Online User'
  92. DECLARE @attemptsCount INT, @InvalidReason VARCHAR(80), @InvalidMsg VARCHAR(100)
  93. SELECT TOP 1 @attemptsCount = loginAttemptCount FROM passwordFormat WITH(NOLOCK)
  94. IF( @existingCustomer=1 and (@customerPwd IS NULL OR @customerPwd=''))
  95. BEGIN
  96. SELECT 3 errorCode, 'Login Failed. Please click forgot Password to set new password.' msg, @customerEmail id, @attemptsCount ac
  97. SET @UserInfoDetail = 'Reason = Login fails, Invalid password.-:::-'+@UserInfoDetail
  98. EXEC proc_applicationLogs
  99. @flag='login',
  100. @logType='Login fails',
  101. @createdBy = @customerEmail,
  102. @Reason='INFICARE USER',
  103. @UserData = @UserData,
  104. @fieldValue = @UserInfoDetail,
  105. @IP = @ipAddress
  106. RETURN
  107. END
  108. IF( @CreatedFrom='C' and (@customerPwd IS NULL OR @customerPwd=''))
  109. BEGIN
  110. SELECT 3 errorCode, 'Login Failed. Please click forgot Password to set new password.' msg, @customerEmail id, @attemptsCount ac
  111. SET @UserInfoDetail = 'Reason = Login fails, Invalid password.-:::-'+@UserInfoDetail
  112. EXEC proc_applicationLogs
  113. @flag='login',
  114. @logType='Login fails',
  115. @createdBy = @customerEmail,
  116. @Reason='CORE USER',
  117. @UserData = @UserData,
  118. @fieldValue = @UserInfoDetail,
  119. @IP = @ipAddress
  120. RETURN
  121. END
  122. IF (ISNULL(@isLocked, 'N') IN ('B', 'Y')) OR ((@loginAttempt - @attemptsCount) = -1)
  123. BEGIN
  124. SET @UserInfoDetail = 'Reason = Too many wrong attempts .-:::-' + @UserInfoDetail
  125. SELECT 1 errorCode, 'Login Failed - Too many wrong attempts, please contact GME Support!' msg, @customerEmail id, @attemptsCount ac
  126. EXEC proc_applicationLogs
  127. @flag='login',
  128. @logType='Login fails',
  129. @createdBy = @customerEmail,
  130. @Reason= 'Reason = Too many wrong attempts.',
  131. @UserData = @UserData,
  132. @fieldValue = @UserInfoDetail,
  133. @IP = @ipAddress
  134. RETURN
  135. END
  136. PRINT @customerPwd
  137. IF (@customerPwd <> dbo.FNAEncryptString(@customerPassword))
  138. BEGIN
  139. SET @UserInfoDetail = 'Reason = Incorrect password .-:::-' + @UserInfoDetail
  140. SET @loginAttempt = @loginAttempt + 1
  141. UPDATE customerMaster SET invalidAttemptCount = @loginAttempt--, isLocked = CASE WHEN @loginAttempt > @attemptsCount THEN 'B' ELSE 'N' END
  142. WHERE email = @customerEmail and ISNULL(onlineUser, 'N')='Y'
  143. SET @InvalidReason = CASE WHEN @loginAttempt > @attemptsCount THEN 'Number of invalid password attempts exceeded!' ELSE 'Invalid Password' END
  144. SET @InvalidMsg = 'Login Failed - you have ' + CAST((@attemptsCount - @loginAttempt) AS VARCHAR) + ' Attempts Left'
  145. SELECT 1 errorCode, @InvalidMsg msg, @customerEmail id, @attemptsCount ac
  146. EXEC proc_applicationLogs
  147. @flag='login',
  148. @logType='Login fails',
  149. @createdBy = @customerEmail,
  150. @Reason= @InvalidReason,
  151. @UserData = @UserData,
  152. @fieldValue = @UserInfoDetail,
  153. @IP = @ipAddress
  154. RETURN
  155. END
  156. IF (ISNULL(@onlineUser, 'N') = 'N')
  157. BEGIN
  158. SELECT 2 errorCode, 'User is not an Online User' msg, @customerEmail id, @attemptsCount ac
  159. SET @UserInfoDetail = 'Reason = Login fails, Invalid password.-:::-'+@UserInfoDetail
  160. EXEC proc_applicationLogs
  161. @flag='login',
  162. @logType='Login fails',
  163. @createdBy = @customerEmail,
  164. @Reason='Not online User',
  165. @UserData = @UserData,
  166. @fieldValue = @UserInfoDetail,
  167. @IP = @ipAddress
  168. RETURN
  169. END
  170. DECLARE @vPenny CHAR(1),@vCustomerId BIGINT
  171. --SELECT @vCustomerId=CM.customerId , @vPenny = CASE WHEN CM.createdDate < '2018-12-19 11:00:00' THEN 'N' WHEN ISNULL(CC.action,'REQ') = 'REQ' THEN 'Y' ELSE 'N' END
  172. --from customerMaster CM (nolock)
  173. --LEFT JOIN TblCustomerBankVerification CC (nolock) ON CM.customerId = CC.customerId
  174. --WHERE CM.email = @customerEmail
  175. --IF @vPenny = 'Y'
  176. --BEGIN
  177. -- SELECT 1000 errorCode, 'User redirect to penny test verification' mes, @vCustomerId id
  178. -- SET @UserInfoDetail = 'Reason = Login fails, User redirect to penny test verification.-:::-'+@UserInfoDetail
  179. -- EXEC proc_applicationLogs
  180. -- @flag='login',
  181. -- @logType='Login fails',
  182. -- @createdBy = @customerEmail,
  183. -- @Reason='Penny test verification',
  184. -- @UserData = @UserData,
  185. -- @fieldValue = @UserInfoDetail,
  186. -- @IP = @ipAddress
  187. -- RETURN
  188. --END
  189. IF (ISNULL(@isActive, 'Y') = 'N')
  190. BEGIN
  191. SELECT 1 errorCode, 'Your account is Inactive. Please, contact GME Support Team.' msg, @customerEmail id
  192. SET @UserInfoDetail = 'Reason = Login fails, Your account is Inactive. Please, contact your administrator.-:::-'+@UserInfoDetail
  193. EXEC proc_applicationLogs
  194. @flag='login',
  195. @logType='Login fails',
  196. @createdBy = @customerEmail,
  197. @Reason='User is not active ',
  198. @UserData = @UserData,
  199. @fieldValue = @UserInfoDetail,
  200. @IP = @ipAddress
  201. RETURN
  202. END
  203. --IF EXISTS (SELECT 'x' FROM customerMaster (NOLOCK) WHERE email=@customerEmail AND approvedBy IS NULL AND approvedDate IS NULL)
  204. --BEGIN
  205. -- SELECT 1 errorCode, 'Login Failed - Customer registration verification pending please visit nearest GME branch to get verified!' msg, @customerEmail id
  206. -- RETURN
  207. --END
  208. UPDATE customerMaster SET
  209. sessionId=@sessionId
  210. ,lastLoginTs = GETDATE()
  211. ,invalidAttemptCount = 0
  212. WHERE email = @customerEmail and ISNULL(onlineUser, 'N')='Y'
  213. DECLARE @mobileNo VARCHAR(16)
  214. SET @mobileNo = REPLACE(@mobileNo,' ','')
  215. SET @mobileNo = REPLACE(@mobileNo,'-','')
  216. SET @mobileNo = REPLACE(@mobileNo,'+','')
  217. SET @mobileNo = LEFT(@mobileNo,16)
  218. DECLARE @clientUseCode VARCHAR(10), @clientId VARCHAR(50), @clientSecret VARCHAR(50), @accessToken VARCHAR(400), @gmeBankCode VARCHAR(3), @gmeAccountNo VARCHAR(20)
  219. SELECT @clientUseCode = DBO.DECRYPTDB(clientUseCode), @clientId = DBO.DECRYPTDB(clientId), @clientSecret = DBO.DECRYPTDB(clientSecret)
  220. , @accessToken = accessToken, @gmeAccountNo = accountNum, @gmeBankCode = bankCodeStd
  221. FROM KFTC_GME_MASTER (NOLOCK)
  222. SELECT
  223. TOP 1
  224. 0 errorCode
  225. ,'Login success.' msg
  226. ,cu.customerId Id
  227. ,username = cu.email
  228. ,fullName = cu.fullName
  229. ,country = cm.countryName
  230. ,agent_branch_code=cu.branchId
  231. ,agentcode=cu.agentId
  232. ,date_format=NULL
  233. ,limitPerTran=0
  234. ,GMT_value=NULL
  235. ,currencyType=NULL
  236. ,extra_rate_bank=NULL
  237. ,cash_ledger_id=NULL
  238. ,@attemptsCount [ac]
  239. ,sessionTimeOutPeriod=NULL
  240. ,lastLoginTs=GETDATE()
  241. ,cm.countryId
  242. ,[address] = cu.city +'-Provience,South Korea'
  243. ,[address2]=cu.[address2]
  244. ,homePhone=cu.homePhone
  245. ,mobile=cu.mobile
  246. ,cm.countryCode
  247. ,utcTime=8
  248. ,mobile= @mobileNo
  249. ,city=cu.city
  250. ,postalCode=cu.postalCode
  251. ,membershipId=membershipId
  252. ,sdv.detailTitle idType
  253. ,cu.idNumber
  254. ,isForcedPwdChange = ISNULL(isForcedPwdChange,0)
  255. ,customerStatus
  256. ,cu.walletAccountNo
  257. ,primaryBankName=CASE WHEN cu.customerType='11048' THEN 'Mutual savings bank(050)' ELSE 'Kwangju Bank (034)' END
  258. ,nativeCountry = cm1.countryName
  259. ,nativeCountryId = cm1.countryId
  260. ,nativeCountryCode = cm1.countryCode
  261. ,occupation = sd.detailTitle
  262. ,idExpiryDate = CASE WHEN cu.idType='8008' THEN '2059-12-12' ELSE FORMAT(cu.idExpiryDate,'MM/dd/yyyy') END
  263. ,birthDate = FORMAT(cu.dob,'MM/dd/yyyy')
  264. ,accessToken = KFTC.accessToken
  265. ,clientUseCode = @clientUseCode
  266. ,clientId = @clientId
  267. ,clientSecret = @clientSecret
  268. ,gmeAccessToken = @accessToken
  269. ,gmeBankCode = @gmeBankCode
  270. ,gmeAccountNum = @gmeAccountNo
  271. ,rewardPoints= DBO.FNA_GET_AVAILABLE_BALANCE_POINTS(cu.customerId)
  272. ,IsEmailVerified = ISNULL(isEmailVerified,0)
  273. ,cu.SelfieDoc
  274. FROM customerMaster cu WITH(NOLOCK)
  275. LEFT JOIN countryMaster cm WITH (NOLOCK) ON cm.countryId=cu.country
  276. LEFT JOIN countryMaster cm1 with(nolock) on cm1.countryId = cu.nativeCountry
  277. left join staticDataValue sdv with (nolock) on sdv.valueId=cu.idType
  278. left join staticDataValue sd with(nolock) on sd.valueId = cu.occupation
  279. LEFT JOIN dbo.vwBankLists vwbank WITH (NOLOCK) ON cu.bankName=vwbank.rowid
  280. LEFT JOIN KFTC_CUSTOMER_MASTER KFTC(NOLOCK) ON KFTC.customerId = CU.customerId
  281. WHERE cu.email= @customerEmail
  282. and ISNULL(cu.onlineUser, 'N')='Y'
  283. EXEC proc_applicationLogs
  284. @flag='login',
  285. @logType='Login',
  286. @createdBy = @customerEmail,
  287. @Reason='Login',
  288. @UserData = @UserData,
  289. @fieldValue = @UserInfoDetail,
  290. @IP = @ipAddress
  291. END
  292. ELSE IF @flag = 'loc'
  293. BEGIN
  294. UPDATE customerMaster SET
  295. isLocked = 'Y'
  296. WHERE email= @customerEmail and ISNULL(onlineUser, 'N')='Y'
  297. INSERT INTO userLockHistory(userName, lockReason, createdBy, createdDate)
  298. SELECT @customerEmail, @lockReason, 'system',GETDATE()
  299. SELECT 0 errorCode, 'Your account has been locked. Please, contact your administrator.' mes, @customerEmail id
  300. END
  301. ELSE IF @flag='availbal'
  302. BEGIN
  303. SELECT ISNULL(availableBalance, 0.00) AS availableBalance FROM dbo.customerMaster(nolock)
  304. WHERE email=@customerEmail
  305. --SELECT 0 errorCode,ISNULL(a.clr_bal_amt, 0.00) AS availableBalance
  306. --FROM dbo.customerMaster c(nolock)
  307. --INNER JOIN FastMoneyPro_account.dbo.ac_master a(nolock) ON A.acct_num = c.walletAccountNo
  308. --WHERE c.email = @customerEmail
  309. END
  310. ELSE IF @flag='checkpin'
  311. BEGIN
  312. DECLARE @TXN_PIN VARCHAR(30)
  313. IF NOT EXISTS(SELECT 'X' FROM customerMaster WITH (NOLOCK)
  314. WHERE username=@customerEmail and ISNULL(onlineUser, 'N')='Y')
  315. BEGIN
  316. SELECT @email=email,
  317. @customerPwd=customerPassword,
  318. @isActive=isactive,
  319. @onlineUser=onlineuser,
  320. @isLocked=isLocked,
  321. @ccountry=country,
  322. @customerStatus=customerStatus,
  323. @lastLoginDate=lastLoginTs,
  324. @loginAttempt = ISNULL(invalidAttemptPinCount, 0),
  325. @TXN_PIN = txnPin
  326. FROM customerMaster WITH (NOLOCK)
  327. WHERE username=@customerEmail and ISNULL(onlineUser, 'N')='Y'
  328. END
  329. ELSE
  330. BEGIN
  331. SELECT @email=email,
  332. @customerPwd=customerPassword,
  333. @isActive=isactive,
  334. @onlineUser=onlineuser,
  335. @isLocked=isLocked,
  336. @ccountry=country,
  337. @customerStatus=customerStatus,
  338. @lastLoginDate=lastLoginTs,
  339. @loginAttempt = ISNULL(invalidAttemptPinCount, 0),
  340. @TXN_PIN = txnPin
  341. FROM customerMaster WITH (NOLOCK)
  342. WHERE username=@customerEmail and ISNULL(onlineUser, 'N')='Y'
  343. END
  344. IF (ISNULL(@password, '') = ISNULL(@TXN_PIN, '-1'))
  345. BEGIN
  346. UPDATE customerMaster SET
  347. invalidAttemptPinCount = 0
  348. WHERE username = @customerEmail and ISNULL(onlineUser, 'N')='Y'
  349. SELECT 0 errorCode, 'Success' msg, @customerEmail id
  350. RETURN;
  351. END
  352. SELECT TOP 1 @attemptsCount = loginAttemptCount FROM passwordFormat WITH(NOLOCK)
  353. IF (ISNULL(@isLocked, 'N') IN ('B', 'Y')) OR ((@loginAttempt - @attemptsCount) = -1)
  354. BEGIN
  355. SELECT 18 errorCode, 'Too many wrong attempts, please contact JME Support!' mes, @customerEmail id
  356. EXEC proc_applicationLogs
  357. @flag='login',
  358. @logType='Send Transaction',
  359. @createdBy = @customerEmail,
  360. @Reason= 'Reason = Too many wrong attempts sending transaaction.'
  361. RETURN
  362. END
  363. IF (ISNULL(@password, '') <> ISNULL(@TXN_PIN, '-1'))
  364. BEGIN
  365. SET @UserInfoDetail = 'Reason = Incorrect PIN .-:::-' + @UserInfoDetail
  366. SET @loginAttempt = @loginAttempt + 1
  367. UPDATE customerMaster SET invalidAttemptPinCount = @loginAttempt, isLocked = CASE WHEN @loginAttempt > @attemptsCount THEN 'B' ELSE 'N' END
  368. WHERE username = @customerEmail and ISNULL(onlineUser, 'N')='Y'
  369. SET @InvalidReason = CASE WHEN @loginAttempt > @attemptsCount THEN 'Number of invalid PIN attempts exceeded!' ELSE 'Invalid PIN' END
  370. SET @InvalidMsg = 'Send txn Failed - Invalid PIN, you have ' + CAST((@attemptsCount - @loginAttempt) AS VARCHAR) + ' Attempts Left'
  371. SELECT 20 errorCode, @InvalidMsg mes, @customerEmail id
  372. EXEC proc_applicationLogs
  373. @flag='login',
  374. @logType='Send Transaction',
  375. @createdBy = @customerEmail,
  376. @Reason= 'Reason = wrong transaction PIN.'
  377. RETURN
  378. END
  379. END
  380. ELSE IF @flag='checkpass'
  381. BEGIN
  382. IF NOT EXISTS(SELECT 'X' FROM customerMaster WITH (NOLOCK)
  383. WHERE username=@customerEmail and ISNULL(onlineUser, 'N')='Y')
  384. BEGIN
  385. SELECT @email=email,
  386. @customerPwd=customerPassword,
  387. @isActive=isactive,
  388. @onlineUser=onlineuser,
  389. @isLocked=isLocked,
  390. @ccountry=country,
  391. @customerStatus=customerStatus,
  392. @lastLoginDate=lastLoginTs,
  393. @loginAttempt = ISNULL(invalidAttemptCount, 0),
  394. @TXN_PIN = txnPin
  395. FROM customerMaster WITH (NOLOCK)
  396. WHERE username=@customerEmail and ISNULL(onlineUser, 'N')='Y'
  397. END
  398. ELSE
  399. BEGIN
  400. SELECT @email=email,
  401. @customerPwd=customerPassword,
  402. @isActive=isactive,
  403. @onlineUser=onlineuser,
  404. @isLocked=isLocked,
  405. @ccountry=country,
  406. @customerStatus=customerStatus,
  407. @lastLoginDate=lastLoginTs,
  408. @loginAttempt = ISNULL(invalidAttemptCount, 0),
  409. @TXN_PIN = txnPin
  410. FROM customerMaster WITH (NOLOCK)
  411. WHERE username=@customerEmail and ISNULL(onlineUser, 'N')='Y'
  412. END
  413. IF (@customerPwd = dbo.FNAEncryptString(@password))
  414. BEGIN
  415. UPDATE customerMaster SET
  416. invalidAttemptCount = 0
  417. WHERE username = @customerEmail and ISNULL(onlineUser, 'N')='Y'
  418. SELECT 0 errorCode, 'Success' msg, @customerEmail id
  419. RETURN;
  420. END
  421. SELECT TOP 1 @attemptsCount = loginAttemptCount FROM passwordFormat WITH(NOLOCK)
  422. IF (ISNULL(@isLocked, 'N') IN ('B', 'Y')) OR ((@loginAttempt - @attemptsCount) = -1)
  423. BEGIN
  424. SELECT 9 errorCode, 'Too many wrong attempts, please contact GME Support!' mes, @customerEmail id
  425. EXEC proc_applicationLogs
  426. @flag='login',
  427. @logType='Send Transaction',
  428. @createdBy = @customerEmail,
  429. @Reason= 'Reason = Too many wrong attempts sending transaaction.'
  430. RETURN
  431. END
  432. IF (@customerPwd <> dbo.FNAEncryptString(@password))
  433. BEGIN
  434. SET @UserInfoDetail = 'Reason = Incorrect password .-:::-' + @UserInfoDetail
  435. SET @loginAttempt = @loginAttempt + 1
  436. UPDATE customerMaster SET invalidAttemptCount = @loginAttempt, isLocked = CASE WHEN @loginAttempt > @attemptsCount THEN 'B' ELSE 'N' END
  437. WHERE email = @customerEmail and ISNULL(onlineUser, 'N')='Y'
  438. SET @InvalidReason = CASE WHEN @loginAttempt > @attemptsCount THEN 'Number of invalid password attempts exceeded!' ELSE 'Invalid Password' END
  439. SET @InvalidMsg = 'Login Failed - Invalid Password, you have ' + CAST((@attemptsCount - @loginAttempt) AS VARCHAR) + ' Attempts Left'
  440. SELECT 1 errorCode, @InvalidMsg mes, @customerEmail id
  441. EXEC proc_applicationLogs
  442. @flag='login',
  443. @logType='Send Transaction',
  444. @createdBy = @customerEmail,
  445. @Reason= 'Reason = wrong transaction password.'
  446. RETURN
  447. END
  448. END
  449. END TRY
  450. BEGIN CATCH
  451. IF @@TRANCOUNT > 0
  452. ROLLBACK TRANSACTION
  453. DECLARE @errorMessage VARCHAR(MAX)
  454. SET @errorMessage = ERROR_MESSAGE()
  455. EXEC proc_errorHandler 1, @errorMessage,NULL
  456. END CATCH