Posted by mattq1982 on March 26, 2009 at 9:41pm
| Project: | UC NAB Transact |
| Version: | 6.x-1.0-beta1 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
Are there any plans to develop this module for Drupal 6.x?
Comments
#1
this is my first attempt at updating a module from Drupal 5 to Drupal 6, so sorry if it is totally wrong!!! i have made very few changes (3 or 4 to be exact), and it seems to be working for me, but if anyone else would like to give it a go that would be great.
#2
I thought I would just share my experiences with this module. I saved my client having to have an eWay account by hooking up with their NAB Transact account using this.
The module update by mattq1985 worked perfectly in Drupal 6 until I updated Ubercart from 6.x-2.0-beta5 to 6.x-2.0-rc6. After the update it returned the PHP error:
PHP Fatal error: Class 'JSimpleXML' not found in /Applications/MAMP/htdocs/plum/sites/all/modules/uc_nab_transact/uc_nab_transact.module on line 130
It turns out that the file simplexml.php located in ubercart/uc_store/includes is no longer included in Ubercart. After I brought the file simplexml.php across from the previous version of Ubercart everything worked perfectly again.
#3
Interesting. In that case, I bet we can simply replace the line referencing JSimpleXML with SimpleXML and leave behind that file.
#4
The fix in #2 no longer seems to work for Beta7 so I've tried replacing the JSimpleXML with a SimpleXML version. Not being a coder, I've tried adjusting the code with things like:
<?php$xml = new SimpleXMLElement($response);
$xml = $xml->$response->data;
?>
which returns the following when clicking Submit Order
"Payment failed for order 479: Credit card payment declined: Failed to parse the XML API request or response."
Failed XML parse response:
<?xml version="1.0" encoding="UTF-8"?><NABTransactMessage><MessageInfo><messageID>6da9003b743b65f4c0ccd295cc484e</messageID><messageTimestamp>20092010231206428000+660</messageTimestamp><apiVersion>xml-4.2</apiVersion></MessageInfo><RequestType>Payment</RequestType><MerchantInfo><merchantID>ABK0010</merchantID></MerchantInfo><Status><statusCode>000</statusCode><statusDescription>Normal</statusDescription></Status><Payment><TxnList count="1"><Txn ID="1"><txnType>0</txnType><txnSource>23</txnSource><amount>4642</amount><currency>AUD</currency><purchaseOrderNo>ABA479</purchaseOrderNo><approved>No</approved><responseCode>05</responseCode><responseText>Do Not Honour</responseText><thinlinkResponseCode>200</thinlinkResponseCode><thinlinkResponseText>000</thinlinkResponseText><thinlinkEventStatusCode>000</thinlinkEventStatusCode><thinlinkEventStatusText>Normal</thinlinkEventStatusText><settlementDate>20091021</settlementDate><txnID>619278</txnID><authID> </authID><CreditCardInfo><pan>401288...881</pan><expiryDate>01/17</expiryDate><cardType>6</cardType><cardDescription>Visa</cardDescription></CreditCardInfo></Txn></TxnList></Payment></NABTransactMessage>
Or:
<?php$xml = simplexml_load_string($response->data);
?>
Which returns a similar error. What kind of code do we need to put in here?
#5
Hi,
Here's the slightly modified module. It's working perfectly on our production site. Give it a try.
Deployed Environment :
PHP v5.2.6
Drupal v6.13
Ubercart v2.2
Hope that helps
#6
Excited about this one!
Where should I copy and paste?
thanks in advance
#7
Thanks for this guys.
I've just started working on the 6.x branch. A release is now available.
Testing will be appreciated.
Cheers
#8
Will this take care of the NAB hpp (hosted payments page) that is hosted at NAB?