Changes for page Problems

Last modified by Asbjørn Ulsberg on 2018/07/05 12:48
From empty
To version 12.1
edited by Helge Dahl
on 2017/06/12 10:21
Change comment: There is no comment for this version

Summary

Details

Page properties
Title
... ... @@ -1,0 +1,1 @@
1 +Problems
Parent
... ... @@ -1,0 +1,1 @@
1 +Panels.PayExCheckoutNavigation
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.XWikiGuest
1 +xwiki:XWiki.hde
Default language
... ... @@ -1,0 +1,1 @@
1 +en
Content
... ... @@ -1,0 +1,74 @@
1 +**Table of contents**
2 +
3 +{{toc/}}
4 +
5 +When performing requests against the PayEx Checkout API, problems might occur. All problems will be served in the form of an {{code}}application/problem+json{{/code}} ([[RFC 7807 Problem Detail>>https://tools.ietf.org/html/rfc7807]]) response. All problem responses will have a common structure, with the following properties:
6 +
7 += Properties =
8 +
9 +|(% style="text-align:right" %)**Property** |=(% style="width: 1119px;" %)Description|=(% style="text-align:center" %)Use*
10 +|(% style="text-align:right" %){{code}}type{{/code}}
11 +(% style="color:LightGrey" %)string|(% style="width:1119px" %)(((
12 +A URL describing the type of problem that occurred. To be treated as an exception class type. Can be trusted to not change between different instances of the same problem type.
13 +)))|(% style="color:#2bb461; text-align:center" %)✓
14 +|(% style="text-align:right" %){{code}}title{{/code}}
15 +(% style="color:LightGrey" %)string|(% style="width:1119px" %)(((
16 +The human readable title of the problem.
17 +)))|(% style="color:red; text-align:center" %)✗
18 +|(% style="text-align:right" %){{code}}status{{/code}}
19 +(% style="color:LightGrey" %)int|(% style="width:1119px" %)(((
20 +The HTTP status code of the response, included as a convenience for logging, etc.
21 +)))|(% style="color:#2bb461; text-align:center" %)✓
22 +|(% style="text-align:right" %){{code}}detail{{/code}}
23 +(% style="color:LightGrey" %)string|(% style="width:1119px" %)The human readable detail explaining the source of the problem and, if any, which actions you can perform to remedy the problem.|(% style="color:red; text-align:center" %)✗
24 +|(% style="text-align:right" %){{code}}instance{{/code}}
25 +(% style="color:LightGrey" %)string
26 +(optional)|(% style="width:1119px" %)An optional identifier of the instance of the problem that occurred, useful for PayEx Support when debugging what the source of the problem might be. |(% style="color:red; text-align:center" %)✗
27 +|(% style="text-align:right" %){{code}}problems{{/code}}
28 +(% style="color:LightGrey" %)array
29 +(optional) |(% style="width:1119px" %)(((
30 +An optional array of objects containing details about which JSON fields or similar in the request that had errors and a description of what the error was.
31 +
32 +{{code language="JavaScript"}}
33 +{
34 + "name": "...",
35 + "description": "..."
36 +}
37 +{{/code}}
38 +)))|(% style="color:#2bb461; text-align:center" %)✓
39 +
40 +***Use: **Whether hard coded, programmatic use of values in this property is encouraged or not.
41 +
42 += Request Problems =
43 +
44 +Request problems within the HTTP status code range of {{code}}400{{/code}} to {{code}}499{{/code}} indicates that the request contains an error that needs to be fixed before the request can be retried against the PayEx Checkout API. Below is an example of a problem response you might get from PayEx Checkout:
45 +
46 +{{code language="JavaScript"}}
47 +{
48 + "type": "https://api.payex.com/psp/checkout/problems/validation",
49 + "title": "Validation error",
50 + "status": 400,
51 + "detail": "There was 1 error in the request. Please correct the problem(s) and repeat the request.",
52 + "instance": "1337",
53 + "problems": [
54 + {
55 + "name": "reference",
56 + "description": "The field reference must be a string with a maximum length of 40."
57 + }
58 + ]
59 +}
60 +{{/code}}
61 +
62 += Server Problems =
63 +
64 +Request problems within the HTTP status code range of {{code}}500{{/code}} to {{code}}599{{/code}} indicates that an unexpected error occurred in the server that it was unable to gracefully recover from. Below is an example of a problem response you might get from PayEx Checkout:
65 +
66 +{{code language="JavaScript"}}
67 +{
68 + "type": "https://api.payex.com/psp/checkout/problems/validation",
69 + "title": "An unexpected error occurred",
70 + "status": 500,
71 + "detail": "An unexpected error occurred. Please contact support.ecom@payex.com with the value of the instance field (1337) to have the problem resolved",
72 + "instance": "1337",
73 +}
74 +{{/code}}