Skip to content

Commit 8555cc2

Browse files
authored
Merge pull request #463 from AuthorizeNet/future
Future
2 parents e1acf55 + 2b27d10 commit 8555cc2

14 files changed

+198
-7
lines changed

.github/workflows/php-workflow.yml

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Authorize.net PHP CI
2+
on:
3+
push:
4+
pull_request:
5+
workflow_dispatch:
6+
env:
7+
sdk_php: 'sdk-php'
8+
sample_code_php: 'sample-code-php'
9+
jobs:
10+
workflow-job:
11+
defaults:
12+
run:
13+
shell: bash
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
operating-system: [ubuntu-latest, macos-latest, windows-latest]
18+
php-version: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
19+
runs-on: ${{matrix.operating-system}}
20+
env:
21+
PHP_VERSION: ${{matrix.php-version}}
22+
steps:
23+
- name: Creating separate folders for SDK and Sample Codes
24+
run: |
25+
rm -rf $sdk_php
26+
rm -rf $sample_code_php
27+
mkdir $sdk_php $sample_code_php
28+
29+
- name: Checkout authorizenet/sdk-php
30+
uses: actions/checkout@v4
31+
with:
32+
path: ${{env.sdk_php}}
33+
34+
- name: Checkout authorizenet/sample-code-php
35+
uses: actions/checkout@v4
36+
with:
37+
repository: 'authorizenet/sample-code-php'
38+
ref: 'future' # Remove this line before pushing to master branch
39+
path: ${{env.sample_code_php}}
40+
41+
- name: Setup PHP
42+
id: php-setup
43+
uses: shivammathur/setup-php@v2
44+
with:
45+
php-version: ${{matrix.php-version}}
46+
extensions: mbstring, curl, openssl, zip
47+
48+
- name: Composer Validation
49+
run: |
50+
cd $sdk_php
51+
composer validate
52+
53+
if [[ ${{env.PHP_VERSION}} == "5.6" || ${{env.PHP_VERSION}} == "7.0" ]]; then
54+
echo "PHPUNIT_VERSION=$(echo 5.6.* | cut -c 1-6)" >> "$GITHUB_ENV"
55+
elif [[ ${{env.PHP_VERSION}} == "7.1" ]]; then
56+
echo "PHPUNIT_VERSION=$(echo 5.7.* | cut -c 1-6)" >> "$GITHUB_ENV"
57+
elif [[ ${{env.PHP_VERSION}} == "7.2" ]]; then
58+
echo "PHPUNIT_VERSION=$(echo 8.5.* | cut -c 1-6)" >> "$GITHUB_ENV"
59+
else
60+
echo "PHPUNIT_VERSION=$(echo 9.5.* | cut -c 1-6)" >> "$GITHUB_ENV"
61+
fi
62+
63+
# Cannot use ${{env.PHPUNIT_VERSION}} in the same step where it is defined
64+
# Refer: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#example-of-writing-an-environment-variable-to-github_env
65+
66+
- name: Composer Update
67+
run: |
68+
cd $sdk_php
69+
composer require "phpunit/phpunit:${{env.PHPUNIT_VERSION}}" --no-update --dev
70+
composer update --prefer-dist
71+
72+
- name: Unit Testing
73+
run: |
74+
cd $sdk_php
75+
cp -R lib ../$sample_code_php/
76+
cp -R vendor ../$sample_code_php/
77+
cd ../$sample_code_php
78+
vendor/phpunit/phpunit/phpunit TestRunner.php .

AnetApiSchema.xsd

+3
Original file line numberDiff line numberDiff line change
@@ -1716,6 +1716,7 @@
17161716
</xs:element>
17171717
<xs:element name="defaultPaymentProfile" type="xs:boolean" minOccurs="0"/>
17181718
<xs:element name="subsequentAuthInformation" type="anet:subsequentAuthInformation" minOccurs="0" maxOccurs="1"/>
1719+
<xs:element name="excludeFromAccountUpdater" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
17191720
</xs:sequence>
17201721
</xs:extension>
17211722
</xs:complexContent>
@@ -1757,6 +1758,7 @@
17571758
</xs:restriction>
17581759
</xs:simpleType>
17591760
</xs:element>
1761+
<xs:element name="excludeFromAccountUpdater" type="xs:boolean" minOccurs="0"/>
17601762
</xs:sequence>
17611763
</xs:extension>
17621764
</xs:complexContent>
@@ -4335,6 +4337,7 @@ Payment Profile Type.
43354337
</xs:restriction>
43364338
</xs:simpleType>
43374339
</xs:element>
4340+
<xs:element name="excludeFromAccountUpdater" type="xs:boolean" minOccurs="0"/>
43384341
</xs:sequence>
43394342
</xs:complexType>
43404343
<xs:complexType name="arrayOfCustomerPaymentProfileListItemType">

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Authorize.Net PHP SDK
22

3-
[![Travis CI Status](https://travis-ci.org/AuthorizeNet/sdk-php.svg?branch=master)](https://travis-ci.org/AuthorizeNet/sdk-php)
4-
[![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)
3+
[![Authorize.net PHP CI](https://github.com/AuthorizeNet/sdk-php/actions/workflows/php-workflow.yml/badge.svg?branch=master)](https://github.com/AuthorizeNet/sdk-php/actions/workflows/php-workflow.yml)
54
[![Packagist Stable Version](https://poser.pugx.org/authorizenet/authorizenet/v/stable.svg)](https://packagist.org/packages/authorizenet/authorizenet)
65

76
## Requirements

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "authorizenet/authorizenet",
33
"type": "library",
4-
"version": "2.0.3",
4+
"version": "2.0.4",
55
"description": "Official PHP SDK for Authorize.Net",
66
"keywords": ["authorizenet", "authorize.net", "payment", "ecommerce"],
77
"license": "proprietary",

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

+27
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ class CustomerPaymentProfileListItemType implements \JsonSerializable
4646
*/
4747
private $originalAuthAmount = null;
4848

49+
/**
50+
* @property boolean $excludeFromAccountUpdater
51+
*/
52+
private $excludeFromAccountUpdater = null;
53+
4954
/**
5055
* Gets as defaultPaymentProfile
5156
*
@@ -200,6 +205,28 @@ public function setOriginalAuthAmount($originalAuthAmount)
200205
return $this;
201206
}
202207

208+
/**
209+
* Gets as excludeFromAccountUpdater
210+
*
211+
* @return boolean
212+
*/
213+
public function getExcludeFromAccountUpdater()
214+
{
215+
return $this->excludeFromAccountUpdater;
216+
}
217+
218+
/**
219+
* Sets a new excludeFromAccountUpdater
220+
*
221+
* @param boolean $excludeFromAccountUpdater
222+
* @return self
223+
*/
224+
public function setExcludeFromAccountUpdater($excludeFromAccountUpdater)
225+
{
226+
$this->excludeFromAccountUpdater = $excludeFromAccountUpdater;
227+
return $this;
228+
}
229+
203230

204231
// Json Serialize Code
205232
#[\ReturnTypeWillChange]

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

+27
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ class CustomerPaymentProfileMaskedType extends CustomerPaymentProfileBaseType im
5757
*/
5858
private $originalAuthAmount = null;
5959

60+
/**
61+
* @property boolean $excludeFromAccountUpdater
62+
*/
63+
private $excludeFromAccountUpdater = null;
64+
6065
/**
6166
* Gets as customerProfileId
6267
*
@@ -289,6 +294,28 @@ public function setOriginalAuthAmount($originalAuthAmount)
289294
return $this;
290295
}
291296

297+
/**
298+
* Gets as excludeFromAccountUpdater
299+
*
300+
* @return boolean
301+
*/
302+
public function getExcludeFromAccountUpdater()
303+
{
304+
return $this->excludeFromAccountUpdater;
305+
}
306+
307+
/**
308+
* Sets a new excludeFromAccountUpdater
309+
*
310+
* @param boolean $excludeFromAccountUpdater
311+
* @return self
312+
*/
313+
public function setExcludeFromAccountUpdater($excludeFromAccountUpdater)
314+
{
315+
$this->excludeFromAccountUpdater = $excludeFromAccountUpdater;
316+
return $this;
317+
}
318+
292319

293320
// Json Serialize Code
294321
#[\ReturnTypeWillChange]

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

+27
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ class CustomerPaymentProfileType extends CustomerPaymentProfileBaseType implemen
3737
*/
3838
private $subsequentAuthInformation = null;
3939

40+
/**
41+
* @property boolean $excludeFromAccountUpdater
42+
*/
43+
private $excludeFromAccountUpdater = null;
44+
4045
/**
4146
* Gets as payment
4247
*
@@ -148,6 +153,28 @@ public function setSubsequentAuthInformation(\net\authorize\api\contract\v1\Subs
148153
return $this;
149154
}
150155

156+
/**
157+
* Gets as excludeFromAccountUpdater
158+
*
159+
* @return boolean
160+
*/
161+
public function getExcludeFromAccountUpdater()
162+
{
163+
return $this->excludeFromAccountUpdater;
164+
}
165+
166+
/**
167+
* Sets a new excludeFromAccountUpdater
168+
*
169+
* @param boolean $excludeFromAccountUpdater
170+
* @return self
171+
*/
172+
public function setExcludeFromAccountUpdater($excludeFromAccountUpdater)
173+
{
174+
$this->excludeFromAccountUpdater = $excludeFromAccountUpdater;
175+
return $this;
176+
}
177+
151178

152179
// Json Serialize Code
153180
#[\ReturnTypeWillChange]

lib/net/authorize/api/controller/CreateCustomerProfileFromTransactionController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class CreateCustomerProfileFromTransactionController extends ApiOperationBase
88
{
99
public function __construct(AnetApiRequestType $request)
1010
{
11-
$responseType = 'net\authorize\api\contract\v1\CreateCustomerProfileFromTransactionResponse';
11+
$responseType = 'net\authorize\api\contract\v1\CreateCustomerProfileResponse';
1212
parent::__construct($request, $responseType);
1313
}
1414

lib/net/authorize/api/controller/GetTransactionListForCustomerController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class GetTransactionListForCustomerController extends ApiOperationBase
88
{
99
public function __construct(AnetApiRequestType $request)
1010
{
11-
$responseType = 'net\authorize\api\contract\v1\GetTransactionListForCustomerResponse';
11+
$responseType = 'net\authorize\api\contract\v1\GetTransactionListResponse';
1212
parent::__construct($request, $responseType);
1313
}
1414

lib/net/authorize/api/yml/v1/CustomerPaymentProfileListItemType.yml

+10
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,13 @@ net\authorize\api\contract\v1\CustomerPaymentProfileListItemType:
7070
getter: getOriginalAuthAmount
7171
setter: setOriginalAuthAmount
7272
type: float
73+
excludeFromAccountUpdater:
74+
expose: true
75+
access_type: public_method
76+
serialized_name: excludeFromAccountUpdater
77+
xml_element:
78+
namespace: AnetApi/xml/v1/schema/AnetApiSchema.xsd
79+
accessor:
80+
getter: getExcludeFromAccountUpdater
81+
setter: setExcludeFromAccountUpdater
82+
type: boolean

lib/net/authorize/api/yml/v1/CustomerPaymentProfileMaskedType.yml

+10
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,13 @@ net\authorize\api\contract\v1\CustomerPaymentProfileMaskedType:
9595
getter: getOriginalAuthAmount
9696
setter: setOriginalAuthAmount
9797
type: float
98+
excludeFromAccountUpdater:
99+
expose: true
100+
access_type: public_method
101+
serialized_name: excludeFromAccountUpdater
102+
xml_element:
103+
namespace: AnetApi/xml/v1/schema/AnetApiSchema.xsd
104+
accessor:
105+
getter: getExcludeFromAccountUpdater
106+
setter: setExcludeFromAccountUpdater
107+
type: boolean

lib/net/authorize/api/yml/v1/CustomerPaymentProfileType.yml

+10
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,13 @@ net\authorize\api\contract\v1\CustomerPaymentProfileType:
5050
getter: getSubsequentAuthInformation
5151
setter: setSubsequentAuthInformation
5252
type: net\authorize\api\contract\v1\SubsequentAuthInformationType
53+
excludeFromAccountUpdater:
54+
expose: true
55+
access_type: public_method
56+
serialized_name: excludeFromAccountUpdater
57+
xml_element:
58+
namespace: AnetApi/xml/v1/schema/AnetApiSchema.xsd
59+
accessor:
60+
getter: getExcludeFromAccountUpdater
61+
setter: setExcludeFromAccountUpdater
62+
type: boolean

lib/net/authorize/util/Log.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ private function checkPropertyAndMask($prop, $obj){
160160

161161
if(strcmp($prop->getName(),$sensitiveField->tagName)==0)
162162
{
163-
$prop->setValue($obj,preg_replace($inputPattern,$inputReplacement,$prop->getValue($obj)));
163+
$prop->setValue($obj,preg_replace($inputPattern,$inputReplacement,$prop->getValue($obj) ? $prop->getValue($obj) : ""));
164164
return $prop->getValue($obj);
165165
}
166166
}

lib/net/authorize/util/classes.json

+1-1
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)