Skip to content

Commit 022eab8

Browse files
committed
Merge pull request #38 from AuthorizeNet/future
Merge future in for release 1.8.3
2 parents bc1a27f + 701291f commit 022eab8

402 files changed

Lines changed: 25199 additions & 39 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.travis.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
language: php
2+
3+
php:
4+
- 5.5
5+
- 5.6
6+
7+
before_script:
8+
- pecl install xmldiff
9+
# - echo "xdebug.max_nesting_level=1000" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
10+
- composer install --prefer-dist --dev
11+
12+
# script: vendor/phpunit/phpunit/phpunit --coverage-clover=coverage.clover
13+
14+
# after_script:
15+
# - wget https://scrutinizer-ci.com/ocular.phar
16+
# - php ocular.phar code-coverage:upload --format=php-clover coverage.clover
17+

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
Authorize.Net PHP SDK
22
======================
33

4+
[![Build Status]
5+
(https://travis-ci.org/AuthorizeNet/sdk-php.png?branch=future)]
6+
(https://travis-ci.org/AuthorizeNet/sdk-php)
7+
48
## License
59
Proprietary, see the provided `license.md`.
610

@@ -35,7 +39,7 @@ require 'path/to/anet_php_sdk/autoload.php';
3539
```
3640

3741
## Authentication
38-
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.
42+
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.
3943
If you need a sandbox account you can sign up for one really easily [`here`](https://developer.authorize.net/sandbox/).
4044

4145
Once you have your keys simply plug them into the appropriate variables as per the samples below.

autoload.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@
1414

1515
if (isset($classMap[$className])) {
1616
include $classMap[$className];
17+
} else {
18+
echo 'Class not loaded: ' . $className;
1719
}
1820
});

classmap.php

Lines changed: 400 additions & 1 deletion
Large diffs are not rendered by default.

composer.json

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,15 @@
99
"php": "~5.3",
1010
"ext-curl": "*",
1111
"ext-json": "*",
12-
"ext-simplexml": "*"
12+
"ext-simplexml": "*",
13+
"ext-xmlwriter": "*",
14+
"jms/serializer": "*"
1315
},
1416
"require-dev": {
1517
"phpunit/phpunit": "~4.0",
16-
"phpmd/phpmd": "~2.0"
18+
"phpmd/phpmd": "~2.0",
19+
"goetas/xsd2php":"2.*@dev",
20+
"goetas/xsd-reader":"2.*@dev"
1721
},
1822
"suggest": {
1923
"phpdocumentor/phpdocumentor": "For generating API documentation"
@@ -23,5 +27,9 @@
2327
},
2428
"autoload-dev": {
2529
"classmap": ["tests"]
26-
}
30+
},
31+
"repositories": [{
32+
"type": "vcs",
33+
"url": "https://github.com/goetas/serializer.git"
34+
}]
2735
}

genclass.sh

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#!/bin/bash
2+
3+
# sudo apt-get install php5-curl
4+
# composer install
5+
6+
#create directories that do not exist
7+
apidir=lib/net/authorize/api/contract/v1
8+
#net.authorize.api.contract.v1.
9+
if [ -d "$apidir" ]; then
10+
rm -r "$apidir"
11+
fi
12+
mkdir -p "$apidir"
13+
echo Make sure the ns-dest uses destination as: $apidir
14+
logfile=./xsdgen.log
15+
echo `date` > $logfile
16+
echo Generating PHP Classes >> $logfile
17+
vendor/goetas/xsd2php/bin/xsd2php.php convert:php \
18+
--ns-dest='net.authorize.api.contract.v1.;lib/net/authorize/api/contract/v1' \
19+
--ns-map='http://www.w3.org/2001/XMLSchema;W3/XMLSchema/2001/' \
20+
--ns-map='AnetApi/xml/v1/schema/AnetApiSchema.xsd;net.authorize.api.contract.v1' \
21+
./AnetApiSchema.xsd >> $logfile 2>> $logfile
22+
echo Generation of PHP Classes complete >> $logfile
23+
24+
jmsdir=lib/net/authorize/api/yml/v1
25+
if [ -d "$jmsdir" ]; then
26+
rm -r "$jmsdir"
27+
fi
28+
mkdir -p "$jmsdir"
29+
echo Generating Serializers for Classes >> $logfile
30+
vendor/goetas/xsd2php/bin/xsd2php.php convert:jms-yaml \
31+
--ns-dest='net.authorize.api.contract.v1.;lib/net/authorize/api/yml/v1' \
32+
--ns-map='http://www.w3.org/2001/XMLSchema;W3/XMLSchema/2001/' \
33+
--ns-map='AnetApi/xml/v1/schema/AnetApiSchema.xsd;net.authorize.api.contract.v1' \
34+
./AnetApiSchema.xsd >> $logfile
35+
echo Generator output is in file: $logfile
36+
37+
#GOOD
38+
# vendor/goetas/xsd2php/bin/xsd2php.php convert:php \
39+
# --ns-dest='net.authorize.api.contract.v1.;lib/net/authorize/api/contract/v1' \
40+
# --ns-map='http://www.w3.org/2001/XMLSchema;W3/XMLSchema/2001/' \
41+
# --ns-map='AnetApi/xml/v1/schema/AnetApiSchema.xsd;net.authorize.api.contract.v1' \
42+
# /home/ramittal/AnetApiSchema.xsd >> $logfile
43+
#Old good
44+
# vendor/goetas/xsd2php/bin/xsd2php.php convert:php \
45+
# --ns-dest='net.authorize.api.contract.v1.;lib/net/authorize/api/contract/v1' \
46+
# --ns-map='http://www.w3.org/2001/XMLSchema;W3/XMLSchema/2001/' \
47+
# --ns-map='AnetApi/xml/v1/schema/AnetApiSchema.xsd;net.authorize.api.contract.v1' \
48+
# /home/ramittal/AnetApiSchema.xsd
49+
#
50+
# jmsdir=lib/net/authorize/api/jms/v1
51+
# mkdir -p $jmsdir
52+
# rm -r $jmsdir\*
53+
# Do not want JMS serializer
54+
# echo Generating Serializers for Classes >> $logfile
55+
# vendor/goetas/xsd2php/bin/xsd2php.php convert:jms-yaml \
56+
# --ns-dest='net.authorize.api.contract.v1.;lib/net/authorize/api/jms/v1' \
57+
# --ns-map='http://www.w3.org/2001/XMLSchema;W3/XMLSchema/2001/' \
58+
# --ns-map='AnetApi/xml/v1/schema/AnetApiSchema.xsd;net.authorize.api.contract.v1' \
59+
# /home/ramittal/AnetApiSchema.xsd >> $logfile
60+
#DOOG
61+
62+
63+
#--alias-map='Vendor/Project/CustomDateClass; http://www.opentravel.org/OTA/2003/05#CustomOTADateTimeFormat'
64+
65+
# symfony/console suggests installing symfony/event-dispatcher ()
66+
# symfony/console suggests installing psr/log (For using the console logger)
67+
# phpunit/php-code-coverage suggests installing ext-xdebug (>=2.2.1)
68+
# phpunit/phpunit suggests installing phpunit/php-invoker (~1.1)
69+
# symfony/dependency-injection suggests installing symfony/proxy-manager-bridge (Generate service proxies to lazy load them)
70+
71+
# ----------------
72+
# zendframework/zend-stdlib suggests installing zendframework/zend-serializer (Zend\Serializer component)
73+
# zendframework/zend-stdlib suggests installing zendframework/zend-servicemanager (To support hydrator plugin manager usage)
74+
# zendframework/zend-code suggests installing doctrine/common (Doctrine\Common >=2.1 for annotation features)
75+
# symfony/console suggests installing symfony/event-dispatcher ()
76+
# symfony/console suggests installing psr/log (For using the console logger)

lib/AuthorizeNetARB.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@
1616
*/
1717
class AuthorizeNetARB extends AuthorizeNetRequest
1818
{
19-
2019
const LIVE_URL = "https://api.authorize.net/xml/v1/request.api";
2120
const SANDBOX_URL = "https://apitest.authorize.net/xml/v1/request.api";
2221

23-
2422
private $_request_type;
2523
private $_request_payload;
2624

@@ -99,7 +97,7 @@ public function cancelSubscription($subscriptionId)
9997
*
10098
* @return AuthorizeNetARB_Response
10199
*/
102-
public function getSubscriptionList(AuthorizeNet_GetSubscriptionList $subscriptionList)
100+
public function getSubscriptionList(AuthorizeNetGetSubscriptionList $subscriptionList)
103101
{
104102
$this->_request_type = "GetSubscriptionListRequest";
105103
$this->_request_payload .= $subscriptionList->getXml();
@@ -168,7 +166,7 @@ public function getSubscriptionId()
168166
*/
169167
public function getSubscriptionStatus()
170168
{
171-
return $this->_getElementContents("Status");
169+
return $this->_getElementContents("status");
172170
}
173171

174172
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
namespace net\authorize\api\constants;
3+
4+
class ANetEnvironment
5+
{
6+
const CUSTOM = "http://ww730vsmbu114.visa.com";
7+
const SANDBOX = "https://apitest.authorize.net";
8+
const PRODUCTION = "https://api.authorize.net";
9+
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<?php
2+
3+
namespace net\authorize\api\contract\v1;
4+
5+
/**
6+
* Class representing ANetApiRequestType
7+
*
8+
*
9+
* XSD Type: ANetApiRequest
10+
*/
11+
class ANetApiRequestType
12+
{
13+
14+
/**
15+
* @property \net\authorize\api\contract\v1\MerchantAuthenticationType
16+
* $merchantAuthentication
17+
*/
18+
private $merchantAuthentication = null;
19+
20+
/**
21+
* @property string $refId
22+
*/
23+
private $refId = null;
24+
25+
/**
26+
* Gets as merchantAuthentication
27+
*
28+
* @return \net\authorize\api\contract\v1\MerchantAuthenticationType
29+
*/
30+
public function getMerchantAuthentication()
31+
{
32+
return $this->merchantAuthentication;
33+
}
34+
35+
/**
36+
* Sets a new merchantAuthentication
37+
*
38+
* @param \net\authorize\api\contract\v1\MerchantAuthenticationType
39+
* $merchantAuthentication
40+
* @return self
41+
*/
42+
public function setMerchantAuthentication(\net\authorize\api\contract\v1\MerchantAuthenticationType $merchantAuthentication)
43+
{
44+
$this->merchantAuthentication = $merchantAuthentication;
45+
return $this;
46+
}
47+
48+
/**
49+
* Gets as refId
50+
*
51+
* @return string
52+
*/
53+
public function getRefId()
54+
{
55+
return $this->refId;
56+
}
57+
58+
/**
59+
* Sets a new refId
60+
*
61+
* @param string $refId
62+
* @return self
63+
*/
64+
public function setRefId($refId)
65+
{
66+
$this->refId = $refId;
67+
return $this;
68+
}
69+
70+
71+
}
72+
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<?php
2+
3+
namespace net\authorize\api\contract\v1;
4+
5+
/**
6+
* Class representing ANetApiResponseType
7+
*
8+
*
9+
* XSD Type: ANetApiResponse
10+
*/
11+
class ANetApiResponseType
12+
{
13+
14+
/**
15+
* @property string $refId
16+
*/
17+
private $refId = null;
18+
19+
/**
20+
* @property \net\authorize\api\contract\v1\MessagesType $messages
21+
*/
22+
private $messages = null;
23+
24+
/**
25+
* @property string $sessionToken
26+
*/
27+
private $sessionToken = null;
28+
29+
/**
30+
* Gets as refId
31+
*
32+
* @return string
33+
*/
34+
public function getRefId()
35+
{
36+
return $this->refId;
37+
}
38+
39+
/**
40+
* Sets a new refId
41+
*
42+
* @param string $refId
43+
* @return self
44+
*/
45+
public function setRefId($refId)
46+
{
47+
$this->refId = $refId;
48+
return $this;
49+
}
50+
51+
/**
52+
* Gets as messages
53+
*
54+
* @return \net\authorize\api\contract\v1\MessagesType
55+
*/
56+
public function getMessages()
57+
{
58+
return $this->messages;
59+
}
60+
61+
/**
62+
* Sets a new messages
63+
*
64+
* @param \net\authorize\api\contract\v1\MessagesType $messages
65+
* @return self
66+
*/
67+
public function setMessages(\net\authorize\api\contract\v1\MessagesType $messages)
68+
{
69+
$this->messages = $messages;
70+
return $this;
71+
}
72+
73+
/**
74+
* Gets as sessionToken
75+
*
76+
* @return string
77+
*/
78+
public function getSessionToken()
79+
{
80+
return $this->sessionToken;
81+
}
82+
83+
/**
84+
* Sets a new sessionToken
85+
*
86+
* @param string $sessionToken
87+
* @return self
88+
*/
89+
public function setSessionToken($sessionToken)
90+
{
91+
$this->sessionToken = $sessionToken;
92+
return $this;
93+
}
94+
95+
96+
}
97+

0 commit comments

Comments
 (0)