Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

code formatting

  • Loading branch information...
commit 4e40968296a8eec96d499f5d90d683de34d17d79 1 parent 3cc1e51
@aporat aporat authored
Showing with 16 additions and 12 deletions.
  1. +14 −10 src/Services/ACHDirect.php
  2. +2 −2 src/Services/ACHDirect/Transaction.php
View
24 src/Services/ACHDirect.php
@@ -47,7 +47,8 @@ class Services_ACHDirect
* @param string $apiLoginID
* @param string $secureTransactionKey
*/
- public function __construct($merchantID, $apiLoginID, $secureTransactionKey, $environment = 'live') {
+ public function __construct($merchantID, $apiLoginID, $secureTransactionKey, $environment = 'live')
+ {
$this->_merchantID = $merchantID;
$this->_apiLoginID = $apiLoginID;
$this->_secureTransactionKey = $secureTransactionKey;
@@ -68,7 +69,8 @@ public function __construct($merchantID, $apiLoginID, $secureTransactionKey, $en
/**
* @see http://www.paymentsgateway.com/developerDocumentation/Integration/webservices/merchantservice.aspx#gettransactionauthticket
*/
- private function generateAuthToken() {
+ private function generateAuthToken()
+ {
$time = time();
$multiplied = $time * 10000000; //adjust to microseconds
$addedtime = $multiplied + 621355968000000000; //adjust date from epoch to .net. not exact but close.
@@ -90,8 +92,8 @@ private function generateAuthToken() {
* @see http://www.paymentsgateway.com/developerDocumentation/Integration/webservices/merchantservice.aspx#GetTransaction
* @param string $transactionID
*/
- public function getTransaction($transactionID) {
-
+ public function getTransaction($transactionID)
+ {
$params = array(
"ticket" => $this->generateAuthToken(),
"MerchantID" =>$this->_merchantID,
@@ -120,7 +122,8 @@ public function getTransaction($transactionID) {
* @param Zend_Date $startDate
* @param Zend_Date $endDate
*/
- public function searchTransactions(Zend_Date $startDate, Zend_Date $endDate) {
+ public function searchTransactions(Zend_Date $startDate, Zend_Date $endDate)
+ {
$range = new Services_ACHDirect_Range();
$range->MerchantIDs = $this->_merchantID;
$range->StartDate = $startDate->toString('YYYY-MM-dd');
@@ -147,8 +150,8 @@ public function searchTransactions(Zend_Date $startDate, Zend_Date $endDate) {
*
* @param Zend_Date $date
*/
- public function searchTransactionsByDay(Zend_Date $date) {
-
+ public function searchTransactionsByDay(Zend_Date $date)
+ {
$params = array(
'ticket' => $this->generateAuthToken(),
'MerchantID' => $this->_merchantID,
@@ -191,8 +194,8 @@ public function searchTransactionsByDay(Zend_Date $date) {
* @see http://www.paymentsgateway.com/developerDocumentation/Integration/webservices/merchantservice.aspx#GetTransaction
* @param string $transactionID
*/
- public function searchSettleActivity(Zend_Date $startDate, Zend_Date $endDate) {
-
+ public function searchSettleActivity(Zend_Date $startDate, Zend_Date $endDate)
+ {
$range = new Services_ACHDirect_Range();
$range->MerchantIDs = $this->_merchantID;
$range->StartDate = $startDate->toString('YYYY-MM-dd');
@@ -218,7 +221,8 @@ public function searchSettleActivity(Zend_Date $startDate, Zend_Date $endDate) {
* @param unknown_type $key
* @param unknown_type $data
*/
- protected function hmac ($key, $data) {
+ protected function hmac ($key, $data)
+ {
$b = 64; // byte length for md5
if (strlen($key) > $b) {
View
4 src/Services/ACHDirect/Transaction.php
@@ -7,8 +7,8 @@ class Services_ACHDirect_Transaction
/**
* get the payment type (credit card or echeck)
*/
- public function paymentType() {
-
+ public function paymentType()
+ {
if ($this->AccountType == "C" || $this->AccountType == "S") {
return Services_ACHDirect_Transaction::ECHECK;
} else {
Please sign in to comment.
Something went wrong with that request. Please try again.