Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions .github/workflows/php-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Authorize.net PHP CI
on:
push:
pull_request:
workflow_dispatch:
env:
sdk_php: 'sdk-php'
sample_code_php: 'sample-code-php'
jobs:
workflow-job:
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, macos-latest, windows-latest]
php-version: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
runs-on: ${{matrix.operating-system}}
env:
PHP_VERSION: ${{matrix.php-version}}
steps:
- name: Creating separate folders for SDK and Sample Codes
run: |
rm -rf $sdk_php
rm -rf $sample_code_php
mkdir $sdk_php $sample_code_php

- name: Checkout authorizenet/sdk-php
uses: actions/checkout@v4
with:
path: ${{env.sdk_php}}

- name: Checkout authorizenet/sample-code-php
uses: actions/checkout@v4
with:
repository: 'authorizenet/sample-code-php'
ref: 'future' # Remove this line before pushing to master branch
path: ${{env.sample_code_php}}

- name: Setup PHP
id: php-setup
uses: shivammathur/setup-php@v2
with:
php-version: ${{matrix.php-version}}
extensions: mbstring, curl, openssl, zip

- name: Composer Validation
run: |
cd $sdk_php
composer validate

if [[ ${{env.PHP_VERSION}} == "5.6" || ${{env.PHP_VERSION}} == "7.0" ]]; then
echo "PHPUNIT_VERSION=$(echo 5.6.* | cut -c 1-6)" >> "$GITHUB_ENV"
elif [[ ${{env.PHP_VERSION}} == "7.1" ]]; then
echo "PHPUNIT_VERSION=$(echo 5.7.* | cut -c 1-6)" >> "$GITHUB_ENV"
elif [[ ${{env.PHP_VERSION}} == "7.2" ]]; then
echo "PHPUNIT_VERSION=$(echo 8.5.* | cut -c 1-6)" >> "$GITHUB_ENV"
else
echo "PHPUNIT_VERSION=$(echo 9.5.* | cut -c 1-6)" >> "$GITHUB_ENV"
fi

# Cannot use ${{env.PHPUNIT_VERSION}} in the same step where it is defined
# Refer: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#example-of-writing-an-environment-variable-to-github_env

- name: Composer Update
run: |
cd $sdk_php
composer require "phpunit/phpunit:${{env.PHPUNIT_VERSION}}" --no-update --dev
composer update --prefer-dist

- name: Unit Testing
run: |
cd $sdk_php
cp -R lib ../$sample_code_php/
cp -R vendor ../$sample_code_php/
cd ../$sample_code_php
vendor/phpunit/phpunit/phpunit TestRunner.php .
3 changes: 3 additions & 0 deletions AnetApiSchema.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -1716,6 +1716,7 @@
</xs:element>
<xs:element name="defaultPaymentProfile" type="xs:boolean" minOccurs="0"/>
<xs:element name="subsequentAuthInformation" type="anet:subsequentAuthInformation" minOccurs="0" maxOccurs="1"/>
<xs:element name="excludeFromAccountUpdater" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
Expand Down Expand Up @@ -1757,6 +1758,7 @@
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="excludeFromAccountUpdater" type="xs:boolean" minOccurs="0"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
Expand Down Expand Up @@ -4335,6 +4337,7 @@ Payment Profile Type.
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="excludeFromAccountUpdater" type="xs:boolean" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="arrayOfCustomerPaymentProfileListItemType">
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Authorize.Net PHP SDK

[![Travis CI Status](https://travis-ci.org/AuthorizeNet/sdk-php.svg?branch=master)](https://travis-ci.org/AuthorizeNet/sdk-php)
[![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)
[![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)
[![Packagist Stable Version](https://poser.pugx.org/authorizenet/authorizenet/v/stable.svg)](https://packagist.org/packages/authorizenet/authorizenet)

## Requirements
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "authorizenet/authorizenet",
"type": "library",
"version": "2.0.3",
"version": "2.0.4",
"description": "Official PHP SDK for Authorize.Net",
"keywords": ["authorizenet", "authorize.net", "payment", "ecommerce"],
"license": "proprietary",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ class CustomerPaymentProfileListItemType implements \JsonSerializable
*/
private $originalAuthAmount = null;

/**
* @property boolean $excludeFromAccountUpdater
*/
private $excludeFromAccountUpdater = null;

/**
* Gets as defaultPaymentProfile
*
Expand Down Expand Up @@ -200,6 +205,28 @@ public function setOriginalAuthAmount($originalAuthAmount)
return $this;
}

/**
* Gets as excludeFromAccountUpdater
*
* @return boolean
*/
public function getExcludeFromAccountUpdater()
{
return $this->excludeFromAccountUpdater;
}

/**
* Sets a new excludeFromAccountUpdater
*
* @param boolean $excludeFromAccountUpdater
* @return self
*/
public function setExcludeFromAccountUpdater($excludeFromAccountUpdater)
{
$this->excludeFromAccountUpdater = $excludeFromAccountUpdater;
return $this;
}


// Json Serialize Code
#[\ReturnTypeWillChange]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ class CustomerPaymentProfileMaskedType extends CustomerPaymentProfileBaseType im
*/
private $originalAuthAmount = null;

/**
* @property boolean $excludeFromAccountUpdater
*/
private $excludeFromAccountUpdater = null;

/**
* Gets as customerProfileId
*
Expand Down Expand Up @@ -289,6 +294,28 @@ public function setOriginalAuthAmount($originalAuthAmount)
return $this;
}

/**
* Gets as excludeFromAccountUpdater
*
* @return boolean
*/
public function getExcludeFromAccountUpdater()
{
return $this->excludeFromAccountUpdater;
}

/**
* Sets a new excludeFromAccountUpdater
*
* @param boolean $excludeFromAccountUpdater
* @return self
*/
public function setExcludeFromAccountUpdater($excludeFromAccountUpdater)
{
$this->excludeFromAccountUpdater = $excludeFromAccountUpdater;
return $this;
}


// Json Serialize Code
#[\ReturnTypeWillChange]
Expand Down
27 changes: 27 additions & 0 deletions lib/net/authorize/api/contract/v1/CustomerPaymentProfileType.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ class CustomerPaymentProfileType extends CustomerPaymentProfileBaseType implemen
*/
private $subsequentAuthInformation = null;

/**
* @property boolean $excludeFromAccountUpdater
*/
private $excludeFromAccountUpdater = null;

/**
* Gets as payment
*
Expand Down Expand Up @@ -148,6 +153,28 @@ public function setSubsequentAuthInformation(\net\authorize\api\contract\v1\Subs
return $this;
}

/**
* Gets as excludeFromAccountUpdater
*
* @return boolean
*/
public function getExcludeFromAccountUpdater()
{
return $this->excludeFromAccountUpdater;
}

/**
* Sets a new excludeFromAccountUpdater
*
* @param boolean $excludeFromAccountUpdater
* @return self
*/
public function setExcludeFromAccountUpdater($excludeFromAccountUpdater)
{
$this->excludeFromAccountUpdater = $excludeFromAccountUpdater;
return $this;
}


// Json Serialize Code
#[\ReturnTypeWillChange]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class CreateCustomerProfileFromTransactionController extends ApiOperationBase
{
public function __construct(AnetApiRequestType $request)
{
$responseType = 'net\authorize\api\contract\v1\CreateCustomerProfileFromTransactionResponse';
$responseType = 'net\authorize\api\contract\v1\CreateCustomerProfileResponse';
parent::__construct($request, $responseType);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class GetTransactionListForCustomerController extends ApiOperationBase
{
public function __construct(AnetApiRequestType $request)
{
$responseType = 'net\authorize\api\contract\v1\GetTransactionListForCustomerResponse';
$responseType = 'net\authorize\api\contract\v1\GetTransactionListResponse';
parent::__construct($request, $responseType);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,13 @@ net\authorize\api\contract\v1\CustomerPaymentProfileListItemType:
getter: getOriginalAuthAmount
setter: setOriginalAuthAmount
type: float
excludeFromAccountUpdater:
expose: true
access_type: public_method
serialized_name: excludeFromAccountUpdater
xml_element:
namespace: AnetApi/xml/v1/schema/AnetApiSchema.xsd
accessor:
getter: getExcludeFromAccountUpdater
setter: setExcludeFromAccountUpdater
type: boolean
10 changes: 10 additions & 0 deletions lib/net/authorize/api/yml/v1/CustomerPaymentProfileMaskedType.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,13 @@ net\authorize\api\contract\v1\CustomerPaymentProfileMaskedType:
getter: getOriginalAuthAmount
setter: setOriginalAuthAmount
type: float
excludeFromAccountUpdater:
expose: true
access_type: public_method
serialized_name: excludeFromAccountUpdater
xml_element:
namespace: AnetApi/xml/v1/schema/AnetApiSchema.xsd
accessor:
getter: getExcludeFromAccountUpdater
setter: setExcludeFromAccountUpdater
type: boolean
10 changes: 10 additions & 0 deletions lib/net/authorize/api/yml/v1/CustomerPaymentProfileType.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,13 @@ net\authorize\api\contract\v1\CustomerPaymentProfileType:
getter: getSubsequentAuthInformation
setter: setSubsequentAuthInformation
type: net\authorize\api\contract\v1\SubsequentAuthInformationType
excludeFromAccountUpdater:
expose: true
access_type: public_method
serialized_name: excludeFromAccountUpdater
xml_element:
namespace: AnetApi/xml/v1/schema/AnetApiSchema.xsd
accessor:
getter: getExcludeFromAccountUpdater
setter: setExcludeFromAccountUpdater
type: boolean
2 changes: 1 addition & 1 deletion lib/net/authorize/util/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ private function checkPropertyAndMask($prop, $obj){

if(strcmp($prop->getName(),$sensitiveField->tagName)==0)
{
$prop->setValue($obj,preg_replace($inputPattern,$inputReplacement,$prop->getValue($obj)));
$prop->setValue($obj,preg_replace($inputPattern,$inputReplacement,$prop->getValue($obj) ? $prop->getValue($obj) : ""));
return $prop->getValue($obj);
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/net/authorize/util/classes.json

Large diffs are not rendered by default.