php-windows Digest 13 Dec 2004 14:17:57 -0000 Issue 2504
Topics (messages 25149 through 25149):
Re: Marty Yantzie - COM Object help- have working .asp example - Paymentech
25149 by: Charles P. Killmer
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
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:[EMAIL PROTECTED]
Sent: Monday, December 13, 2004 7:19 AM
To: Charles P. Killmer
Subject: RE: [PHP-WIN] 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:[EMAIL PROTECTED]
Sent: Friday, December 10, 2004 4:28 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] 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
[EMAIL PROTECTED]
Office: (320) 251-4700 ext 107
--- End Message ---