Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
sherrer
64 Posts |
Posted - 2004-03-11 : 13:05:55
|
| Has anyone out there used Payflow Pro to connect to verisign using T-SQL? I can connect to it with no problem using the COM object from VB, but I am having problems using SQL Server. Currently, I am using my local machine to run SQL Server which is also the machine that I used to connect with VB. Here is the code...DECLARE @object intDECLARE @hr intDECLARE @src varchar(255), @desc varchar(255)DECLARE @Context intDECLARE @ParamList varchar(255)DECLARE @ParamListLen intDECLARE @Response varchar(255)EXEC @hr = sp_OACreate 'PFProCOMControl.PFProCOMControl.1', @object OUTprint 'call result: ' + convert(varchar(50),@hr)print 'object token: ' + convert(varchar(50),@object)IF @hr <> 0BEGIN EXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUT SELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@desc RETURNENDELSEBEGIN --Creat Context EXEC @hr = sp_OAMethod @object, 'CreateContext', @Context OUT, 'test-payflow.verisign.com', 443, 30, '', 0, '', '' IF @hr <> 0 BEGIN EXEC sp_OAGetErrorInfo @object RETURN END else print 'Context Created: ' + convert(varchar(50),@Context) --Submit transaction SET @ParamList = 'USER=user&VENDOR=vendor&PARTNER=verisign&PWD=password&TRXTYPE=S&TENDER=C&ACCT=5105105105105100&EXPDATE=1209&AMT=1.23&ZIP=12345' SET @ParamListLen = LEN(@ParamList) EXEC @hr = sp_OAMethod @object, 'SubmitTransaction', @Response OUT, @Context, @ParamList, @ParamListLen IF @hr <> 0 BEGIN EXEC sp_OAGetErrorInfo @object RETURN END else print 'Verisign Response: ' + convert(varchar(50),@Response) --destroy context EXEC @hr = sp_OAMethod @object, 'DestroyContext', NULL , @Context IF @hr <> 0 BEGIN EXEC sp_OAGetErrorInfo @object RETURN END else print 'Context Destroyed' --destroy object EXEC @hr = sp_OADestroy @object IF @hr <> 0 BEGIN EXEC sp_OAGetErrorInfo @object RETURN END else print 'Object Destroyed'ENDAnd the results...call result: 0object token: 16711422Context Created: 269290928Verisign Response: RESULT=-1&RESPMSG=Failed to connect to hostContext DestroyedObject DestroyedThanks. |
|
|
|
|
|
|
|