Skip to content

Commit 468c8b5

Browse files
authored
Merge pull request #3 from AuthorizeNet/master
sync up with parent
2 parents 488eb9a + 7db567d commit 468c8b5

15 files changed

Lines changed: 550 additions & 116 deletions

README.md

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
Authorize.Net PHP SDK
22
======================
33

4-
[![Travis](https://img.shields.io/travis/AuthorizeNet/sdk-php/master.svg)]
5-
(https://travis-ci.org/AuthorizeNet/sdk-php)
4+
[![Travis](https://img.shields.io/travis/AuthorizeNet/sdk-php/master.svg)](https://travis-ci.org/AuthorizeNet/sdk-php)
65
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/AuthorizeNet/sdk-php/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/AuthorizeNet/sdk-php/?branch=master)
76
[![Packagist](https://img.shields.io/packagist/v/authorizenet/authorizenet.svg)](https://packagist.org/packages/authorizenet/authorizenet)
87

@@ -44,37 +43,28 @@ Alternatively, we provide a custom `SPL` autoloader:
4443
require 'path/to/anet_php_sdk/autoload.php';
4544
```
4645

47-
**Issue with PHP 7:** *You may get below error when run the composer update with PHP 7. To get rid of this error, use `composer update --ignore-platform-reqs`*
48-
```php
49-
Problem 1
50-
- Installation request for authorizenet/authorizenet 1.8.6.2 -> satisfiable
51-
by authorizenet/authorizenet[1.8.6.2].
52-
- authorizenet/authorizenet 1.8.6.2 requires php ~5.3 -> your PHP version (7
53-
.0.3RC1) or value of "config.platform.php" in composer.json does not satisfy that requirement.
54-
```
55-
5646
## Authentication
5747
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.
5848
If you need a sandbox account you can sign up for one really easily [`here`](https://developer.authorize.net/sandbox/).
5949

6050
Once you have your keys simply plug them into the appropriate variables, as per the below code dealing with the authentication part of the flow.
6151

6252
...
63-
````php
53+
```php
6454
use net\authorize\api\contract\v1 as AnetAPI;
65-
````
55+
```
6656
...
67-
````php
57+
```php
6858
$merchantAuthentication = new AnetAPI\MerchantAuthenticationType();
6959
$merchantAuthentication->setName("YOURLOGIN");
7060
$merchantAuthentication->setTransactionKey("YOURKEY");
71-
````
61+
```
7262
...
7363

74-
````php
64+
```php
7565
$request = new AnetAPI\CreateTransactionRequest();
7666
$request->setMerchantAuthentication($merchantAuthentication);
77-
````
67+
```
7868
...
7969

8070
## Usage Examples
@@ -87,7 +77,7 @@ Apart from this README, you can find details and examples of using the SDK in th
8777
### Quick Usage Example (with Charge Credit Card - Authorize and Capture)
8878
Note: The following is a php console application. Ensure that you can invoke the php command from command line.
8979
- Save the below code to a php file named, say, `charge-credit-card.php`
90-
- Open command prompt and navigate to your sdk folder ( if want to run from a different folder, modify the `require` statement to have the full path to the sdk e.g. `require 'c:/anet-sdk-php/vendor/autoload.php'` in place of `require 'vendor/autoload.php'` )
80+
- Open command prompt and navigate to your SDK folder ( if want to run from a different folder, modify the `require` statement to have the full path to the SDK e.g. `require 'c:/anet-sdk-php/vendor/autoload.php'` in place of `require 'vendor/autoload.php'` )
9181
- Update dependecies - e.g., With composer, type `composer update`
9282
- Type `php [<path to folder containing the php file>\]charge-credit-card.php`
9383

@@ -148,7 +138,7 @@ $response = $controller->executeWithApiResponse( \net\authorize\api\constants\AN
148138

149139
## Logging
150140

151-
SDK generates log with masking for sensitive data like credit card, expiration dates. The provided levels for logging are
141+
The SDK generates a log with masking for sensitive data like credit card, expiration dates. The provided levels for logging are
152142
`debug`, `info`, `warn`, `error`. Add ````use \net\authorize\util\LogFactory;````. Logger can be initialized using `$logger = LogFactory::getLog(get_class($this));`
153143
The default log file `phplog` gets generated in the current folder. The subsequent logs are appended to the same file, unless the execution folder is changed, and a new log file is generated.
154144

@@ -158,7 +148,7 @@ The default log file `phplog` gets generated in the current folder. The subseque
158148
- Logging using formatting `$logger->debugFormat("Integer: %d, Float: %f, Xml-Request: %s\n", array(100, 1.29f, $xmlRequest));`
159149

160150
### Customizing Sensitive Tags
161-
A local copy of [AuthorizedNetSensitiveTagsConfig.json](/lib/net/authorize/util/ANetSensitiveFields.php) gets generated when code invoking the logger first gets executed. The local file can later be edited by developer to re-configure what is masked and what is visible (*Do not edit the json in sdk*).
151+
A local copy of [AuthorizedNetSensitiveTagsConfig.json](/lib/net/authorize/util/ANetSensitiveFields.php) gets generated when code invoking the logger first gets executed. The local file can later be edited by developer to re-configure what is masked and what is visible. (*Do not edit the JSON in the SDK*).
162152
- For each element of the `sensitiveTags` array,
163153
- `tagName` field corresponds to the name of the property in object, or xml-tag that should be hidden entirely ( *XXXX* shown if no replacement specified ) or masked (e.g. showing the last 4 digits of credit card number).
164154
- `pattern`[<sup>[Note]</sup>](#regex-note) and `replacement`[<sup>[Note]</sup>](#regex-note) can be left `""`, if the default is to be used (as defined in [Log.php](/lib/net/authorize/util/Log.php)). `pattern` gives the regex to identify, while `replacement` defines the visible part.

lib/net/authorize/api/constants/ANetEnvironment.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ class ANetEnvironment
77
const SANDBOX = "https://apitest.authorize.net";
88
const PRODUCTION = "https://api2.authorize.net";
99

10-
const VERSION = "1.9.2";
10+
const VERSION = "1.9.3";
1111
}

lib/net/authorize/api/contract/v1/GetCustomerProfileRequest.php

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ class GetCustomerProfileRequest extends ANetApiRequestType
1313
*/
1414
private $customerProfileId = null;
1515

16+
/**
17+
* @property string $merchantCustomerId
18+
*/
19+
private $merchantCustomerId = null;
20+
21+
/**
22+
* @property string $email
23+
*/
24+
private $email = null;
25+
1626
/**
1727
* @property boolean $unmaskExpirationDate
1828
*/
@@ -36,7 +46,51 @@ public function getCustomerProfileId()
3646
*/
3747
public function setCustomerProfileId($customerProfileId)
3848
{
39-
$this->customerProfileId = $customerProfileId;
49+
$this->customerProfileId = $customerProfileId;
50+
return $this;
51+
}
52+
53+
/**
54+
* Gets as merchantCustomerId
55+
*
56+
* @return string
57+
*/
58+
public function getMerchantCustomerId()
59+
{
60+
return $this->merchantCustomerId;
61+
}
62+
63+
/**
64+
* Sets a new merchantCustomerId
65+
*
66+
* @param string $merchantCustomerId
67+
* @return self
68+
*/
69+
public function setMerchantCustomerId($merchantCustomerId)
70+
{
71+
$this->merchantCustomerId = $merchantCustomerId;
72+
return $this;
73+
}
74+
75+
/**
76+
* Gets as email
77+
*
78+
* @return string
79+
*/
80+
public function getEmail()
81+
{
82+
return $this->email;
83+
}
84+
85+
/**
86+
* Sets a new email
87+
*
88+
* @param string $email
89+
* @return self
90+
*/
91+
public function setEmail($email)
92+
{
93+
$this->email = $email;
4094
return $this;
4195
}
4296

@@ -58,7 +112,7 @@ public function getUnmaskExpirationDate()
58112
*/
59113
public function setUnmaskExpirationDate($unmaskExpirationDate)
60114
{
61-
$this->unmaskExpirationDate = $unmaskExpirationDate;
115+
$this->unmaskExpirationDate = $unmaskExpirationDate;
62116
return $this;
63117
}
64118

lib/net/authorize/api/contract/v1/GetTransactionDetailsResponse.php

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ class GetTransactionDetailsResponse extends ANetApiResponseType
1313
*/
1414
private $transaction = null;
1515

16+
/**
17+
* @property string $clientId
18+
*/
19+
private $clientId = null;
20+
21+
/**
22+
* @property string $transrefId
23+
*/
24+
private $transrefId = null;
25+
1626
/**
1727
* Gets as transaction
1828
*
@@ -35,6 +45,49 @@ public function setTransaction(\net\authorize\api\contract\v1\TransactionDetails
3545
return $this;
3646
}
3747

48+
/**
49+
* Gets as clientId
50+
*
51+
* @return string
52+
*/
53+
public function getClientId()
54+
{
55+
return $this->clientId;
56+
}
3857

39-
}
58+
/**
59+
* Sets a new clientId
60+
*
61+
* @param string $clientId
62+
* @return self
63+
*/
64+
public function setClientId($clientId)
65+
{
66+
$this->clientId = $clientId;
67+
return $this;
68+
}
4069

70+
/**
71+
* Gets as transrefId
72+
*
73+
* @return string
74+
*/
75+
public function getTransrefId()
76+
{
77+
return $this->transrefId;
78+
}
79+
80+
/**
81+
* Sets a new transrefId
82+
*
83+
* @param string $transrefId
84+
* @return self
85+
*/
86+
public function setTransrefId($transrefId)
87+
{
88+
$this->transrefId = $transrefId;
89+
return $this;
90+
}
91+
92+
93+
}
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
<?php
2+
3+
namespace net\authorize\api\contract\v1;
4+
5+
/**
6+
* Class representing GetTransactionListForCustomerRequest
7+
*/
8+
class GetTransactionListForCustomerRequest extends ANetApiRequestType
9+
{
10+
11+
/**
12+
* @property string $customerProfileId
13+
*/
14+
private $customerProfileId = null;
15+
16+
/**
17+
* @property string $customerPaymentProfileId
18+
*/
19+
private $customerPaymentProfileId = null;
20+
21+
/**
22+
* @property \net\authorize\api\contract\v1\TransactionListSortingType $sorting
23+
*/
24+
private $sorting = null;
25+
26+
/**
27+
* @property \net\authorize\api\contract\v1\PagingType $paging
28+
*/
29+
private $paging = null;
30+
31+
/**
32+
* Gets as customerProfileId
33+
*
34+
* @return string
35+
*/
36+
public function getCustomerProfileId()
37+
{
38+
return $this->customerProfileId;
39+
}
40+
41+
/**
42+
* Sets a new customerProfileId
43+
*
44+
* @param string $customerProfileId
45+
* @return self
46+
*/
47+
public function setCustomerProfileId($customerProfileId)
48+
{
49+
$this->customerProfileId = $customerProfileId;
50+
return $this;
51+
}
52+
53+
/**
54+
* Gets as customerPaymentProfileId
55+
*
56+
* @return string
57+
*/
58+
public function getCustomerPaymentProfileId()
59+
{
60+
return $this->customerPaymentProfileId;
61+
}
62+
63+
/**
64+
* Sets a new customerPaymentProfileId
65+
*
66+
* @param string $customerPaymentProfileId
67+
* @return self
68+
*/
69+
public function setCustomerPaymentProfileId($customerPaymentProfileId)
70+
{
71+
$this->customerPaymentProfileId = $customerPaymentProfileId;
72+
return $this;
73+
}
74+
75+
/**
76+
* Gets as sorting
77+
*
78+
* @return \net\authorize\api\contract\v1\TransactionListSortingType
79+
*/
80+
public function getSorting()
81+
{
82+
return $this->sorting;
83+
}
84+
85+
/**
86+
* Sets a new sorting
87+
*
88+
* @param \net\authorize\api\contract\v1\TransactionListSortingType $sorting
89+
* @return self
90+
*/
91+
public function setSorting(\net\authorize\api\contract\v1\TransactionListSortingType $sorting)
92+
{
93+
$this->sorting = $sorting;
94+
return $this;
95+
}
96+
97+
/**
98+
* Gets as paging
99+
*
100+
* @return \net\authorize\api\contract\v1\PagingType
101+
*/
102+
public function getPaging()
103+
{
104+
return $this->paging;
105+
}
106+
107+
/**
108+
* Sets a new paging
109+
*
110+
* @param \net\authorize\api\contract\v1\PagingType $paging
111+
* @return self
112+
*/
113+
public function setPaging(\net\authorize\api\contract\v1\PagingType $paging)
114+
{
115+
$this->paging = $paging;
116+
return $this;
117+
}
118+
119+
120+
}
121+

0 commit comments

Comments
 (0)