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.

55 lines
1.5 KiB

1 year ago
  1. USE [FastMoneyPro_Remit]
  2. GO
  3. /****** Object: StoredProcedure [dbo].[proc_online_customerValidation] Script Date: 7/4/2019 11:35:48 AM ******/
  4. DROP PROCEDURE [dbo].[proc_online_customerValidation]
  5. GO
  6. /****** Object: StoredProcedure [dbo].[proc_online_customerValidation] Script Date: 7/4/2019 11:35:48 AM ******/
  7. SET ANSI_NULLS ON
  8. GO
  9. SET QUOTED_IDENTIFIER ON
  10. GO
  11. CREATE PROC [dbo].[proc_online_customerValidation]
  12. @flag VARCHAR(50)
  13. ,@user VARCHAR(100)
  14. ,@senderId VARCHAR(50) = NULL
  15. AS
  16. SET NOCOUNT ON;
  17. SET XACT_ABORT ON;
  18. BEGIN TRY
  19. BEGIN
  20. DECLARE @idExpiryDate DATETIME
  21. ,@createdDate DATETIME
  22. IF @flag='checkUser'
  23. BEGIN
  24. SELECT TOP 1
  25. @senderId = customerId ,
  26. @idExpiryDate = idExpiryDate ,
  27. @createdDate = createdDate
  28. FROM customerMaster WITH ( NOLOCK )
  29. WHERE email = @user;
  30. IF ( @idExpiryDate < GETDATE() )
  31. BEGIN
  32. DECLARE @msg VARCHAR(250)= 'Your provided photo id has been expired. Please contact GME Support Team by writing email to support@gmeremit.com or call on +44 (0) 20 8861 2264.'
  33. EXEC proc_errorHandler '0', @msg, @senderId
  34. RETURN;
  35. END;
  36. EXEC proc_errorHandler '0', 'User is valid to do transaction.', @senderId
  37. END
  38. END
  39. END TRY
  40. BEGIN CATCH
  41. IF @@TRANCOUNT<>0
  42. ROLLBACK TRANSACTION
  43. DECLARE @errorMessage VARCHAR(MAX)
  44. SET @errorMessage = ERROR_MESSAGE()
  45. EXEC proc_errorHandler 1, @errorMessage, @user
  46. END CATCH
  47. GO