Skip to content

Commit 8261f5b

Browse files
author
WorldlineConnect
committed
Release 7.3.0.
1 parent 60631ce commit 8261f5b

File tree

6 files changed

+143
-6
lines changed

6 files changed

+143
-6
lines changed

.github/workflows/api-docs.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,20 @@ jobs:
1919
- name: Setup PHP
2020
uses: shivammathur/setup-php@v2
2121
with:
22-
php-version: '5.6'
23-
- name: Install apigen
24-
run: composer global require apigen/apigen
22+
php-version: '7.4'
23+
- name: Cache Composer packages
24+
id: composer-cache
25+
uses: actions/cache@v4
26+
with:
27+
path: vendor
28+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
29+
restore-keys: |
30+
${{ runner.os }}-php-
31+
- name: Install dependencies
32+
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
33+
working-directory: code
2534
- name: Build API docs
26-
run: apigen generate -s lib,src -d docs --deprecated --no-source-code --title 'Worldline Connect PHP SDK'
35+
run: mkdir -p docs && docker run --rm -v "$GITHUB_WORKSPACE/code:/workspace" -w /workspace -u `id -u`:`id -g` apigen/apigen
2736
working-directory: code
2837
- name: Checkout pages
2938
uses: actions/checkout@v4

lib/Worldline/Connect/Sdk/Communication/MetadataProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
class MetadataProvider
1414
{
15-
const SDK_VERSION = '7.2.0';
15+
const SDK_VERSION = '7.3.0';
1616

1717
/** @var string */
1818
private $integrator;
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
<?php
2+
/*
3+
* This class was auto-generated from the API references found at
4+
* https://apireference.connect.worldline-solutions.com/
5+
*/
6+
namespace Worldline\Connect\Sdk\V1\Domain;
7+
8+
use UnexpectedValueException;
9+
use Worldline\Connect\Sdk\Domain\DataObject;
10+
11+
/**
12+
* @package Worldline\Connect\Sdk\V1\Domain
13+
*/
14+
class CybersourceDecisionManager extends DataObject
15+
{
16+
/**
17+
* @var string
18+
*/
19+
public $clauseName = null;
20+
21+
/**
22+
* @var int
23+
*/
24+
public $fraudScore = null;
25+
26+
/**
27+
* @var string
28+
*/
29+
public $policyApplied = null;
30+
31+
/**
32+
* @var string[]
33+
*/
34+
public $reasonCodes = null;
35+
36+
/**
37+
* @return object
38+
*/
39+
public function toObject()
40+
{
41+
$object = parent::toObject();
42+
if (!is_null($this->clauseName)) {
43+
$object->clauseName = $this->clauseName;
44+
}
45+
if (!is_null($this->fraudScore)) {
46+
$object->fraudScore = $this->fraudScore;
47+
}
48+
if (!is_null($this->policyApplied)) {
49+
$object->policyApplied = $this->policyApplied;
50+
}
51+
if (!is_null($this->reasonCodes)) {
52+
$object->reasonCodes = [];
53+
foreach ($this->reasonCodes as $element) {
54+
if (!is_null($element)) {
55+
$object->reasonCodes[] = $element;
56+
}
57+
}
58+
}
59+
return $object;
60+
}
61+
62+
/**
63+
* @param object $object
64+
* @return $this
65+
* @throws UnexpectedValueException
66+
*/
67+
public function fromObject($object)
68+
{
69+
parent::fromObject($object);
70+
if (property_exists($object, 'clauseName')) {
71+
$this->clauseName = $object->clauseName;
72+
}
73+
if (property_exists($object, 'fraudScore')) {
74+
$this->fraudScore = $object->fraudScore;
75+
}
76+
if (property_exists($object, 'policyApplied')) {
77+
$this->policyApplied = $object->policyApplied;
78+
}
79+
if (property_exists($object, 'reasonCodes')) {
80+
if (!is_array($object->reasonCodes) && !is_object($object->reasonCodes)) {
81+
throw new UnexpectedValueException('value \'' . print_r($object->reasonCodes, true) . '\' is not an array or object');
82+
}
83+
$this->reasonCodes = [];
84+
foreach ($object->reasonCodes as $element) {
85+
$this->reasonCodes[] = $element;
86+
}
87+
}
88+
return $this;
89+
}
90+
}

src/Worldline/Connect/Sdk/V1/Domain/FraudResults.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
*/
1414
class FraudResults extends DataObject
1515
{
16+
/**
17+
* @var CybersourceDecisionManager
18+
*/
19+
public $cybersourceDecisionManager = null;
20+
1621
/**
1722
* @var string
1823
*/
@@ -34,6 +39,9 @@ class FraudResults extends DataObject
3439
public function toObject()
3540
{
3641
$object = parent::toObject();
42+
if (!is_null($this->cybersourceDecisionManager)) {
43+
$object->cybersourceDecisionManager = $this->cybersourceDecisionManager->toObject();
44+
}
3745
if (!is_null($this->fraudServiceResult)) {
3846
$object->fraudServiceResult = $this->fraudServiceResult;
3947
}
@@ -54,6 +62,13 @@ public function toObject()
5462
public function fromObject($object)
5563
{
5664
parent::fromObject($object);
65+
if (property_exists($object, 'cybersourceDecisionManager')) {
66+
if (!is_object($object->cybersourceDecisionManager)) {
67+
throw new UnexpectedValueException('value \'' . print_r($object->cybersourceDecisionManager, true) . '\' is not an object');
68+
}
69+
$value = new CybersourceDecisionManager();
70+
$this->cybersourceDecisionManager = $value->fromObject($object->cybersourceDecisionManager);
71+
}
5772
if (property_exists($object, 'fraudServiceResult')) {
5873
$this->fraudServiceResult = $object->fraudServiceResult;
5974
}

src/Worldline/Connect/Sdk/V1/Domain/MicrosoftFraudResults.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ class MicrosoftFraudResults extends DataObject
3838
*/
3939
public $policyApplied = null;
4040

41+
/**
42+
* @var string[]
43+
*/
44+
public $reasonCodes = null;
45+
4146
/**
4247
* @var string
4348
*/
@@ -69,6 +74,14 @@ public function toObject()
6974
if (!is_null($this->policyApplied)) {
7075
$object->policyApplied = $this->policyApplied;
7176
}
77+
if (!is_null($this->reasonCodes)) {
78+
$object->reasonCodes = [];
79+
foreach ($this->reasonCodes as $element) {
80+
if (!is_null($element)) {
81+
$object->reasonCodes[] = $element;
82+
}
83+
}
84+
}
7285
if (!is_null($this->trueIpAddress)) {
7386
$object->trueIpAddress = $this->trueIpAddress;
7487
}
@@ -101,6 +114,15 @@ public function fromObject($object)
101114
if (property_exists($object, 'policyApplied')) {
102115
$this->policyApplied = $object->policyApplied;
103116
}
117+
if (property_exists($object, 'reasonCodes')) {
118+
if (!is_array($object->reasonCodes) && !is_object($object->reasonCodes)) {
119+
throw new UnexpectedValueException('value \'' . print_r($object->reasonCodes, true) . '\' is not an array or object');
120+
}
121+
$this->reasonCodes = [];
122+
foreach ($object->reasonCodes as $element) {
123+
$this->reasonCodes[] = $element;
124+
}
125+
}
104126
if (property_exists($object, 'trueIpAddress')) {
105127
$this->trueIpAddress = $object->trueIpAddress;
106128
}

tests/Worldline/Connect/Sdk/CommunicatorTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ public function testApiRequestGet()
4242
$this->defaultCommunicator->get($this->defaultResponseClassMap, $relativeUri, $clientMetaInfo, $findParams);
4343
}
4444

45-
public function testExceptionInvalidUrl()
45+
// skipped, as Connect now returns a JSON error response for invalid URLs, including non-numeric payment product ids
46+
public function skipExceptionInvalidUrl()
4647
{
4748
try {
4849
$relativeUri = sprintf('/v1/%s/foo', $this->getMerchantId());

0 commit comments

Comments
 (0)