-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated API from documentation release
- Loading branch information
1 parent
701ee4a
commit 64e71fd
Showing
19 changed files
with
300 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
api-specs/checkout/examples/payments/cancelPaymentAction.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"action": "cancelPayment" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"actions": [ | ||
{ | ||
"action": "capturePayment", | ||
"amount": { | ||
"centAmount": 10000, | ||
"currencyCode": "EUR" | ||
} | ||
} | ||
] | ||
} |
7 changes: 7 additions & 0 deletions
7
api-specs/checkout/examples/payments/capturePaymentAction.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"action": "capturePayment", | ||
"amount": { | ||
"centAmount": 10000, | ||
"currencyCode": "EUR" | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
api-specs/checkout/examples/payments/capturePaymentResponse.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
7 changes: 7 additions & 0 deletions
7
api-specs/checkout/examples/payments/refundPaymentAction.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"action": "refundPayment", | ||
"amount": { | ||
"centAmount": 10000, | ||
"currencyCode": "EUR" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#%RAML 1.0 Library | ||
usage: Common data types. | ||
(annotations.package): common | ||
(annotations.beta): true | ||
|
||
uses: | ||
annotations: annotations.raml | ||
|
||
types: | ||
Region: | ||
description: | | ||
The Region in which the Checkout application is [hosted](/../checkout/installing-checkout#regions-and-hosts). | ||
enum: | ||
- europe-west1.gcp | ||
- us-central1.gcp | ||
(annotations.enumDescriptions): | ||
europe-west1.gcp: | | ||
for Europe (Google Cloud, Belgium) | ||
us-central1.gcp: | | ||
for North America (Google Cloud, Iowa) | ||
Amount: | ||
description: | | ||
The amount related to a [payment action](ctp:checkout:type:PaymentAction). | ||
properties: | ||
centAmount: | ||
type: integer | ||
description: | | ||
Amount in the smallest indivisible unit of a currency, such as: | ||
* Cents for EUR and USD, pence for GBP, or centime for CHF (5 CHF is specified as `500`). | ||
* The value in the major unit for currencies without minor units, like JPY (5 JPY is specified as `5`). | ||
currencyCode: | ||
type: string | ||
description: | | ||
Currency code compliant to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). | ||
pattern: ^[A-Z]{3}$ | ||
PaymentOperation: | ||
type: string | ||
description: | | ||
The possible values for a [payment action](ctp:checkout:type:PaymentAction). | ||
(annotations.enumDescriptions): | ||
capturePayment: | | ||
[Captures](ctp:checkout:type:CapturePaymentAction) the given [Payment](/../api/projects/payments#payment) amount. | ||
refundPayment: | | ||
[Refunds](ctp:checkout:type:RefundPaymentAction) the given Payment amount. | ||
cancelPayment: | | ||
[Cancels](ctp:checkout:type:CancelPaymentAction) an authorized Payment. | ||
enum: | ||
- capturePayment | ||
- refundPayment | ||
- cancelPayment | ||
PaymentAction: | ||
description: | | ||
Depending on the action specified, Checkout requests the [Payment Service Provider](/../checkout/configuring-checkout#supported-payment-service-providers) to capture, refund, or cancel the authorization for the given Payment. | ||
properties: | ||
action: | ||
type: PaymentOperation | ||
description: | | ||
Action to execute for the given Payment. | ||
amount?: | ||
type: Amount | ||
description: | | ||
Amount to be captured or refunded. |
15 changes: 15 additions & 0 deletions
15
api-specs/checkout/types/payments/cancelPaymentAction.raml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#%RAML 1.0 DataType | ||
(annotations.package): Payments | ||
(annotations.beta): true | ||
type: object | ||
displayName: CancelPaymentAction | ||
discriminator: action | ||
discriminatorValue: cancelPayment | ||
example: !include ../../../checkout/examples/payments/cancelPaymentAction.json | ||
description: | | ||
Requests to [cancel the authorization](/payments-lifecycle#authorization-cancellation) for a Payment. Checkout will cancel the [Payment](/../api/projects/payments#payment) and will request the PSP to proceed with the financial process to cancel the authorization. | ||
You cannot request to cancel the authorization for a Payment that has already been [captured](/payments-lifecycle#payment-capture). | ||
properties: | ||
action: | ||
type: string |
17 changes: 17 additions & 0 deletions
17
api-specs/checkout/types/payments/capturePaymentAction.raml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#%RAML 1.0 DataType | ||
(annotations.package): Payments | ||
(annotations.beta): true | ||
type: object | ||
displayName: CapturePaymentAction | ||
discriminator: action | ||
discriminatorValue: capturePayment | ||
example: !include ../../../checkout/examples/payments/capturePaymentAction.json | ||
description: | | ||
Requests to [capture](/payments-lifecycle#payment-capture) the given amount from the customer. Checkout will request the PSP to proceed with the financial process to capture the amount. | ||
properties: | ||
action: | ||
type: string | ||
amount: | ||
description: | | ||
Amount to be captured. It must be less than or equal to the [authorized](/payments-lifecycle#authorization) amount. | ||
type: common.Amount |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#%RAML 1.0 DataType | ||
(annotations.package): error | ||
(annotations.beta): true | ||
type: object | ||
displayName: ErrorObject | ||
discriminator: code | ||
description: This is the representation of a single error. | ||
properties: | ||
code: | ||
type: string | ||
description: | | ||
Error identifier. | ||
message: | ||
type: string | ||
description: | | ||
Plain text description of the cause of the error. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#%RAML 1.0 DataType | ||
(annotations.package): error | ||
(annotations.beta): true | ||
type: ErrorObject | ||
displayName: GeneralError | ||
discriminatorValue: General | ||
description: | | ||
Returned when a server-side problem occurs. If you encounter this error, report it using the [Support Portal](https://commercetools.atlassian.net/servicedesk/customer/portal/30). | ||
properties: | ||
code: | ||
type: string | ||
message: | ||
type: string | ||
description: | | ||
Description about any known details of the problem, for example, `"Write operations are temporarily unavailable"`. |
15 changes: 15 additions & 0 deletions
15
api-specs/checkout/types/payments/error/MultipleActionsNotAllowedError.raml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#%RAML 1.0 DataType | ||
(annotations.package): error | ||
(annotations.beta): true | ||
type: ErrorObject | ||
displayName: MultipleActionsNotAllowedError | ||
discriminatorValue: MultipleActionsNotAllowed | ||
description: | | ||
Returned when `actions` in the request body contains more than one object. | ||
properties: | ||
code: | ||
type: string | ||
message: | ||
type: string | ||
description: | | ||
`"Actions accepts only one action at time. Array size must be 1."` |
19 changes: 19 additions & 0 deletions
19
api-specs/checkout/types/payments/error/RequiredFieldError.raml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#%RAML 1.0 DataType | ||
(annotations.package): error | ||
(annotations.beta): true | ||
type: ErrorObject | ||
displayName: RequiredFieldError | ||
discriminatorValue: RequiredField | ||
description: | | ||
Returned when a value is not defined for a required field. | ||
properties: | ||
code: | ||
type: string | ||
message: | ||
type: string | ||
description: | | ||
`"A value is required for field $field."` | ||
field: | ||
type: string | ||
description: | | ||
Name of the field missing the value. |
15 changes: 15 additions & 0 deletions
15
api-specs/checkout/types/payments/error/ResourceNotFoundError.raml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#%RAML 1.0 DataType | ||
(annotations.package): error | ||
(annotations.beta): true | ||
type: ErrorObject | ||
displayName: ResourceNotFoundError | ||
discriminatorValue: ResourceNotFound | ||
description: | | ||
Returned when the resource addressed by the request URL does not exist. | ||
properties: | ||
code: | ||
type: string | ||
message: | ||
type: string | ||
description: | | ||
`"The Resource with ID $resourceId was not found."` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#%RAML 1.0 DataType | ||
(annotations.package): Payments | ||
(annotations.beta): true | ||
type: object | ||
displayName: Payment | ||
properties: | ||
actions: | ||
type: common.PaymentAction[] | ||
minItems: 1 | ||
maxItems: 1 | ||
description: | | ||
Action to execute for the given Payment. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#%RAML 1.0 DataType | ||
(annotations.package): Payments | ||
(annotations.beta): true | ||
type: object | ||
displayName: Amount | ||
properties: | ||
centAmount: number | ||
currencyCode: string |
17 changes: 17 additions & 0 deletions
17
api-specs/checkout/types/payments/refundPaymentAction.raml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#%RAML 1.0 DataType | ||
(annotations.package): Payments | ||
(annotations.beta): true | ||
type: object | ||
displayName: RefundPaymentAction | ||
discriminator: action | ||
discriminatorValue: refundPayment | ||
example: !include ../../../checkout/examples/payments/refundPaymentAction.json | ||
description: | | ||
Requests to [refund](/payments-lifecycle#refund) the given amount to the customer. Checkout will request the PSP to proceed with the financial process to refund the amount. | ||
properties: | ||
action: | ||
type: string | ||
amount?: | ||
description: | | ||
Amount to be refunded. It must be less than or equal to the [captured](/payments-lifecycle#payment-capture) amount. | ||
type: common.Amount |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters