Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 921d5f6

Browse files
authored
Merge pull request #1536 from magento-mpi/PR-Signifyd
[MPI] Move Signifyd to CE
2 parents 9db4501 + 2cc8a1c commit 921d5f6

File tree

196 files changed

+16525
-119
lines changed

Some content is hidden

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

196 files changed

+16525
-119
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Signifyd\Api;
7+
8+
/**
9+
* Signifyd case creation interface
10+
*
11+
* Interface of service for new Signifyd case creation and registering it on Magento side.
12+
* Implementation should send request to Signifyd API and create new entity in Magento.
13+
*
14+
* @api
15+
* @since 100.2.0
16+
*/
17+
interface CaseCreationServiceInterface
18+
{
19+
/**
20+
* Create new case for order with specified id.
21+
*
22+
* @param int $orderId
23+
* @return bool
24+
* @throws \Magento\Framework\Exception\NotFoundException If order does not exists
25+
* @throws \Magento\Framework\Exception\AlreadyExistsException If case for $orderId already exists
26+
* @since 100.2.0
27+
*/
28+
public function createForOrder($orderId);
29+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Signifyd\Api;
7+
8+
/**
9+
* Signifyd management interface
10+
* Allows to performs operations with Signifyd cases.
11+
*
12+
* @api
13+
* @since 100.2.0
14+
*/
15+
interface CaseManagementInterface
16+
{
17+
/**
18+
* Creates new Case entity linked to order id.
19+
*
20+
* @param int $orderId
21+
* @return \Magento\Signifyd\Api\Data\CaseInterface
22+
* @throws \Magento\Framework\Exception\NotFoundException If order does not exists
23+
* @throws \Magento\Framework\Exception\AlreadyExistsException If case for $orderId already exists
24+
* @since 100.2.0
25+
*/
26+
public function create($orderId);
27+
28+
/**
29+
* Gets Case entity associated with order id.
30+
*
31+
* @param int $orderId
32+
* @return \Magento\Signifyd\Api\Data\CaseInterface|null
33+
* @since 100.2.0
34+
*/
35+
public function getByOrderId($orderId);
36+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Signifyd\Api;
7+
8+
/**
9+
* Signifyd Case repository interface
10+
*
11+
* @api
12+
* @since 100.2.0
13+
*/
14+
interface CaseRepositoryInterface
15+
{
16+
/**
17+
* Saves case entity.
18+
*
19+
* @param \Magento\Signifyd\Api\Data\CaseInterface $case
20+
* @return \Magento\Signifyd\Api\Data\CaseInterface
21+
* @since 100.2.0
22+
*/
23+
public function save(\Magento\Signifyd\Api\Data\CaseInterface $case);
24+
25+
/**
26+
* Gets case entity by order id.
27+
*
28+
* @param int $id
29+
* @return \Magento\Signifyd\Api\Data\CaseInterface
30+
* @since 100.2.0
31+
*/
32+
public function getById($id);
33+
34+
/**
35+
* Gets entity by Signifyd case id.
36+
*
37+
* @param int $caseId
38+
* @return \Magento\Signifyd\Api\Data\CaseInterface|null
39+
* @since 100.2.0
40+
*/
41+
public function getByCaseId($caseId);
42+
43+
/**
44+
* Deletes case entity.
45+
*
46+
* @param \Magento\Signifyd\Api\Data\CaseInterface $case
47+
* @return bool
48+
* @since 100.2.0
49+
*/
50+
public function delete(\Magento\Signifyd\Api\Data\CaseInterface $case);
51+
52+
/**
53+
* Gets list of case entities.
54+
*
55+
* @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria
56+
* @return \Magento\Signifyd\Api\Data\CaseSearchResultsInterface
57+
* @since 100.2.0
58+
*/
59+
public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria);
60+
}
Lines changed: 235 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,235 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Signifyd\Api\Data;
7+
8+
use Magento\Signifyd\Model\SignifydGateway\Gateway;
9+
10+
/**
11+
* Signifyd Case entity interface
12+
*
13+
* @api
14+
* @see https://www.signifyd.com/docs/api/#/reference/cases/retrieve-a-case/get-a-case
15+
* @since 100.2.0
16+
*/
17+
interface CaseInterface
18+
{
19+
/**#@+
20+
* Constants for case available statuses
21+
*/
22+
const STATUS_OPEN = Gateway::STATUS_OPEN;
23+
const STATUS_PENDING = 'PENDING';
24+
const STATUS_PROCESSING = Gateway::STATUS_PROCESSING;
25+
const STATUS_FLAGGED = Gateway::STATUS_FLAGGED;
26+
const STATUS_DISMISSED = Gateway::STATUS_DISMISSED;
27+
/**#@-*/
28+
29+
/**#@+
30+
* Constants for guarantee available statuses
31+
*/
32+
const GUARANTEE_APPROVED = Gateway::GUARANTEE_APPROVED;
33+
const GUARANTEE_DECLINED = Gateway::GUARANTEE_DECLINED;
34+
const GUARANTEE_PENDING = Gateway::GUARANTEE_PENDING;
35+
const GUARANTEE_CANCELED = Gateway::GUARANTEE_CANCELED;
36+
const GUARANTEE_IN_REVIEW = Gateway::GUARANTEE_IN_REVIEW;
37+
const GUARANTEE_UNREQUESTED = Gateway::GUARANTEE_UNREQUESTED;
38+
/**#@-*/
39+
40+
/**#@+
41+
* Constants for case available review dispositions
42+
*/
43+
const DISPOSITION_GOOD = Gateway::DISPOSITION_GOOD;
44+
const DISPOSITION_FRAUDULENT = Gateway::DISPOSITION_FRAUDULENT;
45+
const DISPOSITION_UNSET = Gateway::DISPOSITION_UNSET;
46+
/**#@-*/
47+
48+
/**
49+
* Returns local case entity identifier.
50+
*
51+
* @return int
52+
* @since 100.2.0
53+
*/
54+
public function getEntityId();
55+
56+
/**
57+
* Sets local case entity id.
58+
*
59+
* @param int $id
60+
* @return $this
61+
* @since 100.2.0
62+
*/
63+
public function setEntityId($id);
64+
65+
/**
66+
* Returns Signifyd case identifier.
67+
*
68+
* @return int
69+
* @since 100.2.0
70+
*/
71+
public function getCaseId();
72+
73+
/**
74+
* Sets Signifyd case id.
75+
*
76+
* @param int $id
77+
* @return $this
78+
* @since 100.2.0
79+
*/
80+
public function setCaseId($id);
81+
82+
/**
83+
* Returns value, which indicates if a guarantee can be requested for a case.
84+
* Returns null if state of guarantee eligible does not set yet.
85+
*
86+
* @return boolean|null
87+
* @since 100.2.0
88+
*/
89+
public function isGuaranteeEligible();
90+
91+
/**
92+
* Sets value-indicator about guarantee availability for a case.
93+
*
94+
* @param bool $guaranteeEligible
95+
* @return $this
96+
* @since 100.2.0
97+
*/
98+
public function setGuaranteeEligible($guaranteeEligible);
99+
100+
/**
101+
* Returns decision state of the guarantee.
102+
*
103+
* @return string
104+
* @since 100.2.0
105+
*/
106+
public function getGuaranteeDisposition();
107+
108+
/**
109+
* Sets decision state of the guarantee.
110+
*
111+
* @param string $disposition
112+
* @return $this
113+
* @since 100.2.0
114+
*/
115+
public function setGuaranteeDisposition($disposition);
116+
117+
/**
118+
* Returns case status.
119+
*
120+
* @return string
121+
* @since 100.2.0
122+
*/
123+
public function getStatus();
124+
125+
/**
126+
* Sets case status.
127+
*
128+
* @param string $status
129+
* @return $this
130+
* @since 100.2.0
131+
*/
132+
public function setStatus($status);
133+
134+
/**
135+
* Returns value, which indicates the likelihood that the order is fraud.
136+
*
137+
* @return int
138+
* @since 100.2.0
139+
*/
140+
public function getScore();
141+
142+
/**
143+
* Sets risk level value.
144+
*
145+
* @param int $score
146+
* @return $this
147+
* @since 100.2.0
148+
*/
149+
public function setScore($score);
150+
151+
/**
152+
* Get order id for a case.
153+
*
154+
* @return int
155+
* @since 100.2.0
156+
*/
157+
public function getOrderId();
158+
159+
/**
160+
* Sets order id for a case.
161+
*
162+
* @param int $orderId
163+
* @return $this
164+
* @since 100.2.0
165+
*/
166+
public function setOrderId($orderId);
167+
168+
/**
169+
* Returns data about a team associated with a case.
170+
*
171+
* @return array
172+
* @since 100.2.0
173+
*/
174+
public function getAssociatedTeam();
175+
176+
/**
177+
* Sets team data associated with a case.
178+
*
179+
* @param array $team
180+
* @return $this
181+
* @since 100.2.0
182+
*/
183+
public function setAssociatedTeam(array $team);
184+
185+
/**
186+
* Returns disposition of an agent's opinion after reviewing the case.
187+
*
188+
* @return string
189+
* @since 100.2.0
190+
*/
191+
public function getReviewDisposition();
192+
193+
/**
194+
* Sets case disposition.
195+
*
196+
* @param string $disposition
197+
* @return $this
198+
* @since 100.2.0
199+
*/
200+
public function setReviewDisposition($disposition);
201+
202+
/**
203+
* Returns creation datetime for a case.
204+
*
205+
* @return string
206+
* @since 100.2.0
207+
*/
208+
public function getCreatedAt();
209+
210+
/**
211+
* Sets creation datetime for a case.
212+
*
213+
* @param string $datetime in DATE_ATOM format
214+
* @return $this
215+
* @since 100.2.0
216+
*/
217+
public function setCreatedAt($datetime);
218+
219+
/**
220+
* Returns updating datetime for a case.
221+
*
222+
* @return string
223+
* @since 100.2.0
224+
*/
225+
public function getUpdatedAt();
226+
227+
/**
228+
* Sets updating datetime for a case.
229+
*
230+
* @param string $datetime in DATE_ATOM format
231+
* @return $this
232+
* @since 100.2.0
233+
*/
234+
public function setUpdatedAt($datetime);
235+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Signifyd\Api\Data;
7+
8+
use Magento\Framework\Api\SearchResultsInterface;
9+
10+
/**
11+
* Retrieve and set list of case entities.
12+
*
13+
* @api
14+
* @since 100.2.0
15+
*/
16+
interface CaseSearchResultsInterface extends SearchResultsInterface
17+
{
18+
/**
19+
* Gets collection of case entities.
20+
*
21+
* @return \Magento\Signifyd\Api\Data\CaseInterface[]
22+
* @since 100.2.0
23+
*/
24+
public function getItems();
25+
26+
/**
27+
* Sets collection of case entities.
28+
*
29+
* @param \Magento\Signifyd\Api\Data\CaseInterface[] $items
30+
* @return $this
31+
* @since 100.2.0
32+
*/
33+
public function setItems(array $items);
34+
}

0 commit comments

Comments
 (0)