Skip to content

Commit

Permalink
Merge pull request #38 from AuthorizeNet/future
Browse files Browse the repository at this point in the history
Merge future in for release 1.8.3
  • Loading branch information
ramittal committed Dec 19, 2014
2 parents bc1a27f + 701291f commit 022eab8
Show file tree
Hide file tree
Showing 402 changed files with 25,199 additions and 39 deletions.
17 changes: 17 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
language: php

php:
- 5.5
- 5.6

before_script:
- pecl install xmldiff
# - echo "xdebug.max_nesting_level=1000" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- composer install --prefer-dist --dev

# script: vendor/phpunit/phpunit/phpunit --coverage-clover=coverage.clover

# after_script:
# - wget https://scrutinizer-ci.com/ocular.phar
# - php ocular.phar code-coverage:upload --format=php-clover coverage.clover

6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Authorize.Net PHP SDK
======================

[![Build Status]
(https://travis-ci.org/AuthorizeNet/sdk-php.png?branch=future)]
(https://travis-ci.org/AuthorizeNet/sdk-php)

## License
Proprietary, see the provided `license.md`.

Expand Down Expand Up @@ -35,7 +39,7 @@ require 'path/to/anet_php_sdk/autoload.php';
```

## Authentication
To authenticate with the Authorize.Net API you will need to retrieve your API Login ID & Transaction Key from the [`Merchant Interface`](https://account.authorize.net/). You can find these details in the Settings section.
To authenticate with the Authorize.Net API you will need to retrieve your API Login ID and Transaction Key from the [`Merchant Interface`](https://account.authorize.net/). You can find these details in the Settings section.
If you need a sandbox account you can sign up for one really easily [`here`](https://developer.authorize.net/sandbox/).

Once you have your keys simply plug them into the appropriate variables as per the samples below.
Expand Down
2 changes: 2 additions & 0 deletions autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@

if (isset($classMap[$className])) {
include $classMap[$className];
} else {
echo 'Class not loaded: ' . $className;
}
});
401 changes: 400 additions & 1 deletion classmap.php

Large diffs are not rendered by default.

14 changes: 11 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@
"php": "~5.3",
"ext-curl": "*",
"ext-json": "*",
"ext-simplexml": "*"
"ext-simplexml": "*",
"ext-xmlwriter": "*",
"jms/serializer": "*"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"phpmd/phpmd": "~2.0"
"phpmd/phpmd": "~2.0",
"goetas/xsd2php":"2.*@dev",
"goetas/xsd-reader":"2.*@dev"
},
"suggest": {
"phpdocumentor/phpdocumentor": "For generating API documentation"
Expand All @@ -23,5 +27,9 @@
},
"autoload-dev": {
"classmap": ["tests"]
}
},
"repositories": [{
"type": "vcs",
"url": "https://github.com/goetas/serializer.git"
}]
}
76 changes: 76 additions & 0 deletions genclass.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#!/bin/bash

# sudo apt-get install php5-curl
# composer install

#create directories that do not exist
apidir=lib/net/authorize/api/contract/v1
#net.authorize.api.contract.v1.
if [ -d "$apidir" ]; then
rm -r "$apidir"
fi
mkdir -p "$apidir"
echo Make sure the ns-dest uses destination as: $apidir
logfile=./xsdgen.log
echo `date` > $logfile
echo Generating PHP Classes >> $logfile
vendor/goetas/xsd2php/bin/xsd2php.php convert:php \
--ns-dest='net.authorize.api.contract.v1.;lib/net/authorize/api/contract/v1' \
--ns-map='http://www.w3.org/2001/XMLSchema;W3/XMLSchema/2001/' \
--ns-map='AnetApi/xml/v1/schema/AnetApiSchema.xsd;net.authorize.api.contract.v1' \
./AnetApiSchema.xsd >> $logfile 2>> $logfile
echo Generation of PHP Classes complete >> $logfile

jmsdir=lib/net/authorize/api/yml/v1
if [ -d "$jmsdir" ]; then
rm -r "$jmsdir"
fi
mkdir -p "$jmsdir"
echo Generating Serializers for Classes >> $logfile
vendor/goetas/xsd2php/bin/xsd2php.php convert:jms-yaml \
--ns-dest='net.authorize.api.contract.v1.;lib/net/authorize/api/yml/v1' \
--ns-map='http://www.w3.org/2001/XMLSchema;W3/XMLSchema/2001/' \
--ns-map='AnetApi/xml/v1/schema/AnetApiSchema.xsd;net.authorize.api.contract.v1' \
./AnetApiSchema.xsd >> $logfile
echo Generator output is in file: $logfile

#GOOD
# vendor/goetas/xsd2php/bin/xsd2php.php convert:php \
# --ns-dest='net.authorize.api.contract.v1.;lib/net/authorize/api/contract/v1' \
# --ns-map='http://www.w3.org/2001/XMLSchema;W3/XMLSchema/2001/' \
# --ns-map='AnetApi/xml/v1/schema/AnetApiSchema.xsd;net.authorize.api.contract.v1' \
# /home/ramittal/AnetApiSchema.xsd >> $logfile
#Old good
# vendor/goetas/xsd2php/bin/xsd2php.php convert:php \
# --ns-dest='net.authorize.api.contract.v1.;lib/net/authorize/api/contract/v1' \
# --ns-map='http://www.w3.org/2001/XMLSchema;W3/XMLSchema/2001/' \
# --ns-map='AnetApi/xml/v1/schema/AnetApiSchema.xsd;net.authorize.api.contract.v1' \
# /home/ramittal/AnetApiSchema.xsd
#
# jmsdir=lib/net/authorize/api/jms/v1
# mkdir -p $jmsdir
# rm -r $jmsdir\*
# Do not want JMS serializer
# echo Generating Serializers for Classes >> $logfile
# vendor/goetas/xsd2php/bin/xsd2php.php convert:jms-yaml \
# --ns-dest='net.authorize.api.contract.v1.;lib/net/authorize/api/jms/v1' \
# --ns-map='http://www.w3.org/2001/XMLSchema;W3/XMLSchema/2001/' \
# --ns-map='AnetApi/xml/v1/schema/AnetApiSchema.xsd;net.authorize.api.contract.v1' \
# /home/ramittal/AnetApiSchema.xsd >> $logfile
#DOOG


#--alias-map='Vendor/Project/CustomDateClass; http://www.opentravel.org/OTA/2003/05#CustomOTADateTimeFormat'

# symfony/console suggests installing symfony/event-dispatcher ()
# symfony/console suggests installing psr/log (For using the console logger)
# phpunit/php-code-coverage suggests installing ext-xdebug (>=2.2.1)
# phpunit/phpunit suggests installing phpunit/php-invoker (~1.1)
# symfony/dependency-injection suggests installing symfony/proxy-manager-bridge (Generate service proxies to lazy load them)

# ----------------
# zendframework/zend-stdlib suggests installing zendframework/zend-serializer (Zend\Serializer component)
# zendframework/zend-stdlib suggests installing zendframework/zend-servicemanager (To support hydrator plugin manager usage)
# zendframework/zend-code suggests installing doctrine/common (Doctrine\Common >=2.1 for annotation features)
# symfony/console suggests installing symfony/event-dispatcher ()
# symfony/console suggests installing psr/log (For using the console logger)
6 changes: 2 additions & 4 deletions lib/AuthorizeNetARB.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@
*/
class AuthorizeNetARB extends AuthorizeNetRequest
{

const LIVE_URL = "https://api.authorize.net/xml/v1/request.api";
const SANDBOX_URL = "https://apitest.authorize.net/xml/v1/request.api";


private $_request_type;
private $_request_payload;

Expand Down Expand Up @@ -99,7 +97,7 @@ public function cancelSubscription($subscriptionId)
*
* @return AuthorizeNetARB_Response
*/
public function getSubscriptionList(AuthorizeNet_GetSubscriptionList $subscriptionList)
public function getSubscriptionList(AuthorizeNetGetSubscriptionList $subscriptionList)
{
$this->_request_type = "GetSubscriptionListRequest";
$this->_request_payload .= $subscriptionList->getXml();
Expand Down Expand Up @@ -168,7 +166,7 @@ public function getSubscriptionId()
*/
public function getSubscriptionStatus()
{
return $this->_getElementContents("Status");
return $this->_getElementContents("status");
}

}
9 changes: 9 additions & 0 deletions lib/net/authorize/api/constants/ANetEnvironment.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php
namespace net\authorize\api\constants;

class ANetEnvironment
{
const CUSTOM = "http://ww730vsmbu114.visa.com";
const SANDBOX = "https://apitest.authorize.net";
const PRODUCTION = "https://api.authorize.net";
}
72 changes: 72 additions & 0 deletions lib/net/authorize/api/contract/v1/ANetApiRequestType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?php

namespace net\authorize\api\contract\v1;

/**
* Class representing ANetApiRequestType
*
*
* XSD Type: ANetApiRequest
*/
class ANetApiRequestType
{

/**
* @property \net\authorize\api\contract\v1\MerchantAuthenticationType
* $merchantAuthentication
*/
private $merchantAuthentication = null;

/**
* @property string $refId
*/
private $refId = null;

/**
* Gets as merchantAuthentication
*
* @return \net\authorize\api\contract\v1\MerchantAuthenticationType
*/
public function getMerchantAuthentication()
{
return $this->merchantAuthentication;
}

/**
* Sets a new merchantAuthentication
*
* @param \net\authorize\api\contract\v1\MerchantAuthenticationType
* $merchantAuthentication
* @return self
*/
public function setMerchantAuthentication(\net\authorize\api\contract\v1\MerchantAuthenticationType $merchantAuthentication)
{
$this->merchantAuthentication = $merchantAuthentication;
return $this;
}

/**
* Gets as refId
*
* @return string
*/
public function getRefId()
{
return $this->refId;
}

/**
* Sets a new refId
*
* @param string $refId
* @return self
*/
public function setRefId($refId)
{
$this->refId = $refId;
return $this;
}


}

97 changes: 97 additions & 0 deletions lib/net/authorize/api/contract/v1/ANetApiResponseType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<?php

namespace net\authorize\api\contract\v1;

/**
* Class representing ANetApiResponseType
*
*
* XSD Type: ANetApiResponse
*/
class ANetApiResponseType
{

/**
* @property string $refId
*/
private $refId = null;

/**
* @property \net\authorize\api\contract\v1\MessagesType $messages
*/
private $messages = null;

/**
* @property string $sessionToken
*/
private $sessionToken = null;

/**
* Gets as refId
*
* @return string
*/
public function getRefId()
{
return $this->refId;
}

/**
* Sets a new refId
*
* @param string $refId
* @return self
*/
public function setRefId($refId)
{
$this->refId = $refId;
return $this;
}

/**
* Gets as messages
*
* @return \net\authorize\api\contract\v1\MessagesType
*/
public function getMessages()
{
return $this->messages;
}

/**
* Sets a new messages
*
* @param \net\authorize\api\contract\v1\MessagesType $messages
* @return self
*/
public function setMessages(\net\authorize\api\contract\v1\MessagesType $messages)
{
$this->messages = $messages;
return $this;
}

/**
* Gets as sessionToken
*
* @return string
*/
public function getSessionToken()
{
return $this->sessionToken;
}

/**
* Sets a new sessionToken
*
* @param string $sessionToken
* @return self
*/
public function setSessionToken($sessionToken)
{
$this->sessionToken = $sessionToken;
return $this;
}


}

Loading

0 comments on commit 022eab8

Please sign in to comment.