﻿USE [AIADatabaseV5]
GO
/****** Object:  StoredProcedure [dbo].[EC_InsertPaymentTransaction]    Script Date: 2/1/2018 12:15:55 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- ===================================================================
-- Author:		Magic
-- Create date: 27-May-2009
-- Description:	To insert record into PaymentTransactionDetail table
-- ===================================================================

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[EC_InsertPaymentTransaction]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[EC_InsertPaymentTransaction]
GO

CREATE PROCEDURE [dbo].[EC_InsertPaymentTransaction]
	-- Add the parameters for the stored procedure here
	@iTransactionId varchar(20), @iEditionId varchar(20), @iSubscriptionPlanId varchar(20), @iUserId varchar(20), @sFirstName varchar(50)='',
	@sLastName varchar(50) = '', @sStreet varchar(100)='', @sCity varchar(50) = '', @sState varchar(50),
	@sZip varchar(20), @sCountry varchar(50), @sEmail varchar(50), @sAmount money, @sPaymentStatus varchar(20)
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	--SET NOCOUNT ON;
	
	INSERT INTO PaymentTransactionDetail (TransactionId, EditionId, SubscriptionPlanId, UserId, FirstName,
	LastName, Street, City, State, Zip, Country, Email, Amount, PurchaseDate, PaymentStatus)
	VALUES (@iTransactionId, @iEditionId, @iSubscriptionPlanId, @iUserId, @sFirstName, @sLastName, @sStreet, 
	@sCity, @sState, @sZip, @sCountry,@sEmail,@sAmount, GETDATE(), @sPaymentStatus)
	
END

GO
