RE: Marty Yantzie - COM Object help- have working .asp example - Paymentech

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It looks like PHP cannot set name based index arrays.  I modified the
code to look like this, fixing a few issues in his code.

<? 
 $trans = new COM("Paymentech.Transaction")or die("Unable to instanciate
Payment Transaction");
 $trans->Type = 'CC.Authorize';
 $trans->Field['MessageType']='AC';
 $trans->Field['MerchantID']='1234567890123';
 $trans->Field['BIN']='000002';
 $trans->Field['AccountNum']='1234567890123'; 


 $Resp = $trans->Process();
?>

This results in the following error:
[10-Dec-2004 22:23:43] PHP Warning:  (null)(): Invoke() failed:
Exception occurred.
 <b>Source</b>: Paymentech.Transaction.1 <b>Description</b>:
FieldException: [BIN] missing value in
C:\Inetpub\wwwroot\payment\purchase.php4 on line 10

I asked the merchant company and they sent me an example that uses XML
posting so I will try that instead of the COM object.

Though has anyone else run into this issue with COM objects in PHP?

Charles



-----Original Message-----
From: Bowden, Zeb [mailto:zbowden@xxxxxx] 
Sent: Monday, December 13, 2004 7:19 AM
To: Charles P. Killmer
Subject: RE:  Marty Yantzie - COM Object help- have working
.asp example - Paymentech

Looks to me like you're on the right track ... Where's it failing?
 

-----Original Message-----
From: Charles P. Killmer [mailto:charlesk@xxxxxxxxxxxxxxxxxxxxx]
Sent: Friday, December 10, 2004 4:28 PM
To: php-windows@xxxxxxxxxxxxx
Subject: Re:  Marty Yantzie - COM Object help- have working
.asp example - Paymentech

Marty Yantzie  wrote a question about Paymenttech and php back in July
of 2003.  Marty did you ever get this figured out.  
 
Anybody else, has anyone else run into problems with this?
 
 
Original Message:
I am trying to setup an small ecommerece site. I would like to use php
to accomplish this. I have been able to get the .asp example to work
fine but am having trouble getting the asp converted to php. Am i
heading in the right direction? Any ideas? 


Here is a trimmed version of the PHP that I am trying to use. 


<? 
 $trans = new COM("Paymentech.Transaction")or die("Unable to instanciate

Payment Transaction");
 $trans->Type = 'CC.Authorize';
 $trans->Field('MessageType')='AC;
 $trans->Field('MerchantID')='1234567890123';
 $trans->Field('BIN')='000002';
 $trans->Field('AccountNum')='1234567890123'; 


 $Resp = $trans->Process();
?>
------------------------------------------------------------------------

-----
Here is the ASP that works 


<% 
 Dim trans 
 Set trans = Server.CreateObject ("Paymentech.Transaction") 
  
    trans.Type = "CC.Authorize" 
    trans.Field("MessageType") = "A" 
   
    trans.Field("MerchantID") = Request("MerchantID") 
    trans.Field("BIN") = Request("BIN") 
    trans.Field("AccountNum") = Request("AccountNum") 
    trans.Field("OrderID") = Request("OrderID") 
    trans.Field("Amount") = Request("Amount") 
    trans.Field("Exp") = Request("ExpDate") 
    trans.Field("AVSname") = Request("AVSName") 
    trans.Field("AVSaddress1") = Request("AVSAddress1") 
    trans.Field("AVScity") = Request("AVScity") 
    trans.Field("AVSstate") = Request("AVSstate") 
    trans.Field("AVSzip") = Request("AVSzip") 
    trans.Field("Comments") = Request("Comments") 
    trans.Field("ShippingRef") = Request("ShippingRef") 
      
 Set Resp = trans.Process () 
%> 


 
Charles Killmer
Netgain Technology
CharlesK@xxxxxxxxxxxxxxxxxxxxx
Office: (320) 251-4700 ext 107
 

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux