The DoAuthorize is called when the Checkout method is called on the Basket object.
Code: Select all
CheckoutResponse checkoutResponse = Token.Instance.User.Basket.Checkout(checkoutRequest);
The Payment object is already saved in to the Database by the time DoAuthorize is called. The AccountData has some values.
Code: Select all
exec sp_executesql N'INSERT INTO ac_Payments (OrderId, SubscriptionId, PaymentMethodId, PaymentMethodName, ReferenceNumber, Amount, CurrencyCode, PaymentDate, PaymentStatusId, PaymentStatusReason, CompletedDate, EncryptedAccountData, ReCrypt) VALUES (@OrderId, @SubscriptionId, @PaymentMethodId, @PaymentMethodName, @ReferenceNumber, @Amount, @CurrencyCode, @PaymentDate, @PaymentStatusId, @PaymentStatusReason, @CompletedDate, @EncryptedAccountData, @ReCrypt); SELECT Scope_Identity()',N'@PaymentId int,@OrderId int,@SubscriptionId int,@PaymentMethodId int,@PaymentMethodName nvarchar(14),@ReferenceNumber nvarchar(11),@Amount decimal(5,2),@CurrencyCode nvarchar(3),@PaymentDate datetime,@PaymentStatusId smallint,@PaymentStatusReason nvarchar(4000),@CompletedDate datetime,@EncryptedAccountData nvarchar(22),@ReCrypt bit',@PaymentId=0,@OrderId=32,@SubscriptionId=NULL,@PaymentMethodId=8,@PaymentMethodName=N'XYZ Credit',@ReferenceNumber=N'1N-0119-FOO',@Amount=181.29,@CurrencyCode=N'USD',@PaymentDate='2010-03-31 20:31:19:380',@PaymentStatusId=0,@PaymentStatusReason=NULL,@CompletedDate=NULL,@EncryptedAccountData=N'CustomerPO=1N-0119-FOO',@ReCrypt=0
The DoAuthorize method is then called where the Payment properties are read. It then returns the Transaction object.
Somewhere after the DoAuthorize ends and Checkout finishes the Payment Object is updated again.
Code: Select all
exec sp_executesql N'UPDATE ac_Payments SET OrderId = @OrderId, SubscriptionId = @SubscriptionId, PaymentMethodId = @PaymentMethodId, PaymentMethodName = @PaymentMethodName, ReferenceNumber = @ReferenceNumber, Amount = @Amount, CurrencyCode = @CurrencyCode, PaymentDate = @PaymentDate, PaymentStatusId = @PaymentStatusId, PaymentStatusReason = @PaymentStatusReason, CompletedDate = @CompletedDate, EncryptedAccountData = @EncryptedAccountData, ReCrypt = @ReCrypt WHERE PaymentId = @PaymentId',N'@PaymentId int,@OrderId int,@SubscriptionId int,@PaymentMethodId int,@PaymentMethodName nvarchar(14),@ReferenceNumber nvarchar(11),@Amount decimal(5,2),@CurrencyCode nvarchar(3),@PaymentDate datetime,@PaymentStatusId smallint,@PaymentStatusReason nvarchar(4000),@CompletedDate datetime,@EncryptedAccountData nvarchar(4000),@ReCrypt bit',@PaymentId=41,@OrderId=32,@SubscriptionId=NULL,@PaymentMethodId=8,@PaymentMethodName=N'XYZ Credit',@ReferenceNumber=N'1N-0119-FOO',@Amount=181.29,@CurrencyCode=N'USD',@PaymentDate='2010-03-31 20:31:19:380',@PaymentStatusId=5,@PaymentStatusReason=NULL,@CompletedDate='2010-03-31 20:31:19:473',@EncryptedAccountData=NULL,@ReCrypt=0
This time the AccountData is set to NULL.
Is the AccountData property is read & updated from the Transaction object which is returned from the DoAuthorize method??
Thanks.