Skip to content

Commit

Permalink
commonalities_alignment_errors_and_endpoint_versions
Browse files Browse the repository at this point in the history
  • Loading branch information
PedroDiez committed Jun 21, 2024
1 parent 9377d6c commit 8c230ba
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 70 deletions.
113 changes: 69 additions & 44 deletions code/API_definitions/carrier_billing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ externalDocs:
url: https://github.com/camaraproject/
x-camara-commonalities: 0.4.0
servers:
- url: "{apiRoot}/carrier-billing/v0"
- url: "{apiRoot}/carrier-billing/v0.3"
variables:
apiRoot:
default: http://localhost:9091
Expand Down Expand Up @@ -214,6 +214,8 @@ paths:
$ref: "#/components/responses/PaymentPermissionDenied403"
"409":
$ref: "#/components/responses/Generic409"
"422":
$ref: "#/components/responses/PaymentUnprocessable422"
"500":
$ref: "#/components/responses/Generic500"
"503":
Expand Down Expand Up @@ -409,6 +411,8 @@ paths:
code: ALREADY_EXISTS
status: 409
message: "Another session is created for the same UE"
"422":
$ref: "#/components/responses/PaymentUnprocessable422"
"500":
$ref: "#/components/responses/Generic500"
"503":
Expand Down Expand Up @@ -514,6 +518,8 @@ paths:
$ref: "#/components/responses/Generic404"
"409":
$ref: "#/components/responses/PaymentConfirmConflict409"
"422":
$ref: "#/components/responses/PaymentSecondStepUnprocessable422"
"500":
$ref: "#/components/responses/Generic500"
"503":
Expand Down Expand Up @@ -561,6 +567,8 @@ paths:
$ref: "#/components/responses/Generic404"
"409":
$ref: "#/components/responses/PaymentCancelConflict409"
"422":
$ref: "#/components/responses/PaymentSecondStepUnprocessable422"
"500":
$ref: "#/components/responses/Generic500"
"503":
Expand Down Expand Up @@ -1608,10 +1616,7 @@ components:
description: |-
Client does not have sufficient permission.
In addition to regular PERMISSION_DENIED scenario other scenarios may exist:
- Phone Number is required ("code": "CARRIER_BILLING.PHONE_NUMBER_REQUIRED","message": "Phone Number is required").
- Phone Number provided not matching Access Token context ("code": "CARRIER_BILLING.INVALID_TOKEN_CONTEXT","message": "Phone Number does not match with Access Token context").
- Unauthorized amount requested ("code": "CARRIER_BILLING.UNAUTHORIZED_AMOUNT","message": "Unauthorized amount requested").
- Accumulated threshold amount for the user's mobile account overpassed ("code": "CARRIER_BILLING.USER_AMOUNT_THRESHOLD_OVERPASSED","message": "Unathorized payment request. Accumulated user mobile payments overpass account amount threshold").
- Phone Number provided not matching Access Token context ("code": "INVALID_TOKEN_CONTEXT","message": "Phone Number does not match with Access Token context").
- Payment denied by business ("code": "CARRIER_BILLING.PAYMENT_DENIED","message": "Payment denied by business").
headers:
x-correlator:
Expand All @@ -1627,30 +1632,12 @@ components:
status: 403
code: PERMISSION_DENIED
message: "Operation not allowed: ..."
PhoneNumberRequired:
summary: Phone Number is required
value:
status: 403
code: CARRIER_BILLING.PHONE_NUMBER_REQUIRED
message: "Phone Number not provided and cannot be obtained from Access Token context"
PhoneNumberMismatch:
summary: Phone Number provided not matching Access Token context
value:
status: 403
code: CARRIER_BILLING.INVALID_TOKEN_CONTEXT
code: INVALID_TOKEN_CONTEXT
message: "Phone Number does not match with Access Token context"
UnauthorizedAmount:
summary: Unauthorized amount requested
value:
status: 403
code: CARRIER_BILLING.UNAUTHORIZED_AMOUNT
message: "Unauthorized amount requested"
UserMobileAccumulatedThresholdAmountOverpassed:
summary: Accumulated threshold amount for the user's mobile account overpassed
value:
status: 403
code: CARRIER_BILLING.USER_AMOUNT_THRESHOLD_OVERPASSED
message: "Unathorized payment request. Accumulated user mobile payments overpass account amount threshold"
PaymentDenied:
summary: Payment denied by business
value:
Expand All @@ -1661,8 +1648,7 @@ components:
description: |-
Client does not have sufficient permission.
In addition to regular PERMISSION_DENIED scenario other scenarios may exist:
- Phone Number is required ("code": "CARRIER_BILLING.PHONE_NUMBER_REQUIRED","message": "Phone Number is required").
- Phone Number provided not matching Access Token context ("code": "CARRIER_BILLING.INVALID_TOKEN_CONTEXT","message": "Phone Number does not match with Access Token context").
- Phone Number provided not matching Access Token context ("code": "INVALID_TOKEN_CONTEXT","message": "Phone Number does not match with Access Token context").
- Payment denied by business ("code": "CARRIER_BILLING.PAYMENT_DENIED","message": "Payment denied by business").
headers:
x-correlator:
Expand All @@ -1678,17 +1664,11 @@ components:
status: 403
code: PERMISSION_DENIED
message: "Operation not allowed: ..."
PhoneNumberRequired:
summary: Phone Number is required
value:
status: 403
code: CARRIER_BILLING.PHONE_NUMBER_REQUIRED
message: "Phone Number not provided and cannot be obtained from Access Token context"
PhoneNumberMismatch:
summary: Phone Number provided not matching Access Token context
value:
status: 403
code: CARRIER_BILLING.INVALID_TOKEN_CONTEXT
code: INVALID_TOKEN_CONTEXT
message: "Phone Number does not match with Access Token context"
PaymentDenied:
summary: Payment denied by business
Expand All @@ -1700,8 +1680,7 @@ components:
description: |-
Client does not have sufficient permission.
In addition to regular PERMISSION_DENIED scenario other scenarios may exist:
- Phone Number is required ("code": "CARRIER_BILLING.PHONE_NUMBER_REQUIRED","message": "Phone Number is required").
- Phone Number provided not matching Access Token context ("code": "CARRIER_BILLING.INVALID_TOKEN_CONTEXT","message": "Phone Number does not match with Access Token context").
- Phone Number provided not matching Access Token context ("code": "INVALID_TOKEN_CONTEXT","message": "Phone Number does not match with Access Token context").
headers:
x-correlator:
$ref: "#/components/headers/x-correlator"
Expand All @@ -1716,23 +1695,17 @@ components:
status: 403
code: PERMISSION_DENIED
message: "Operation not allowed: ..."
PhoneNumberRequired:
summary: Phone Number is required
value:
status: 403
code: CARRIER_BILLING.PHONE_NUMBER_REQUIRED
message: "Phone Number not provided and cannot be obtained from Access Token context"
PhoneNumberMismatch:
summary: Phone Number provided not matching Access Token context
value:
status: 403
code: CARRIER_BILLING.INVALID_TOKEN_CONTEXT
code: INVALID_TOKEN_CONTEXT
message: "Phone Number does not match with Access Token context"
PaymentReadPermissionDenied403:
description: |-
Client does not have sufficient permission.
In addition to regular PERMISSION_DENIED scenario other scenarios may exist:
- Phone Number cannot be deducted from access token context ("code": "CARRIER_BILLING.INVALID_TOKEN_CONTEXT","message": "User phone number cannot be deducted from access token context").
- Phone Number cannot be deducted from access token context ("code": "INVALID_TOKEN_CONTEXT","message": "User phone number cannot be deducted from access token context").
headers:
x-correlator:
$ref: "#/components/headers/x-correlator"
Expand All @@ -1751,7 +1724,7 @@ components:
summary: Phone Number cannot be deducted from access token context
value:
status: 403
code: CARRIER_BILLING.INVALID_TOKEN_CONTEXT
code: INVALID_TOKEN_CONTEXT
message: "User phone number cannot be deducted from access token context"
Generic404:
description: Resource Not Found
Expand Down Expand Up @@ -1854,6 +1827,58 @@ components:
code: GONE
status: 410
message: Use in notifications flow to allow API Consumer to indicate that its callback is no longer available
PaymentUnprocessable422:
description: |-
Client indicates content that is understable by the Server but unable to be processed.
Scenarios that may exist:
- Phone Number is required ("code": "CARRIER_BILLING.PHONE_NUMBER_REQUIRED","message": "Phone Number is required").
- Unauthorized amount requested ("code": "CARRIER_BILLING.UNAUTHORIZED_AMOUNT","message": "Unauthorized amount requested").
- Accumulated threshold amount for the user's mobile account overpassed ("code": "CARRIER_BILLING.USER_AMOUNT_THRESHOLD_OVERPASSED","message": "Unathorized payment request. Accumulated user mobile payments overpass account amount threshold").
headers:
x-correlator:
$ref: "#/components/headers/x-correlator"
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
examples:
PhoneNumberRequired:
summary: Phone Number is required
value:
status: 422
code: CARRIER_BILLING.PHONE_NUMBER_REQUIRED
message: "Phone Number not provided and cannot be obtained from Access Token context"
UnauthorizedAmount:
summary: Unauthorized amount requested
value:
status: 422
code: CARRIER_BILLING.UNAUTHORIZED_AMOUNT
message: "Unauthorized amount requested"
UserMobileAccumulatedThresholdAmountOverpassed:
summary: Accumulated threshold amount for the user's mobile account overpassed
value:
status: 422
code: CARRIER_BILLING.USER_AMOUNT_THRESHOLD_OVERPASSED
message: "Unathorized payment request. Accumulated user mobile payments overpass account amount threshold"
PaymentSecondStepUnprocessable422:
description: |-
Client indicates content that is understable by the Server but unable to be processed.
Scenarios that may exist:
- Phone Number is required ("code": "CARRIER_BILLING.PHONE_NUMBER_REQUIRED","message": "Phone Number is required").
headers:
x-correlator:
$ref: "#/components/headers/x-correlator"
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
examples:
PhoneNumberRequired:
summary: Phone Number is required
value:
status: 422
code: CARRIER_BILLING.PHONE_NUMBER_REQUIRED
message: "Phone Number not provided and cannot be obtained from Access Token context"
Generic429:
description: Too Many Requests
headers:
Expand Down
52 changes: 26 additions & 26 deletions code/API_definitions/carrier_billing_refund.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ externalDocs:
url: https://github.com/camaraproject/
x-camara-commonalities: 0.4.0
servers:
- url: "{apiRoot}/carrier-billing-refund/v0"
- url: "{apiRoot}/carrier-billing-refund/v0.1"
variables:
apiRoot:
default: http://localhost:9091
Expand Down Expand Up @@ -1053,12 +1053,9 @@ components:
description: |-
Client does not have sufficient permission.
In addition to regular PERMISSION_DENIED scenario other scenarios may exist:
- Phone Number cannot be deducted from Access Token context (3-legged scenario) ("code": "CARRIER_BILLING_REFUND.INVALID_TOKEN_CONTEXT","message": "User phone number cannot be deducted from Access Token context").
- Unauthorized refund amount requested ("code": "CARRIER_BILLING_REFUND.UNAUTHORIZED_AMOUNT","message": "Unauthorized amount requested").
- Accumulated threshold refund amount for the user's mobile account overpassed ("code": "CARRIER_BILLING_REFUND.USER_AMOUNT_THRESHOLD_OVERPASSED","message": "Unathorized refund request. Accumulated user mobile refunds overpass account amount threshold").
- Phone Number cannot be deducted from Access Token context (3-legged scenario) ("code": "INVALID_TOKEN_CONTEXT","message": "User phone number cannot be deducted from Access Token context").
- Refund denied by business ("code": "CARRIER_BILLING_REFUND.REFUND_DENIED","message": "Refund denied by business").
- Payment not eligible for Refund (e.g. Payment conditions agreed do not allow refund) ("code": "CARRIER_BILLING_REFUND.PAYMENT_NOT_ELIGIBLE_FOR_REFUND","message": "Payment not eligible for refund").
- Payment is not in suitable status for refund ("code": "CARRIER_BILLING_REFUND.INVALID_PAYMENT_STATUS","message": "Payment is not yet completed").
headers:
x-correlator:
$ref: "#/components/headers/x-correlator"
Expand All @@ -1077,20 +1074,8 @@ components:
summary: Phone Number cannot be deducted from Access Token context (3-legged scenario)
value:
status: 403
code: CARRIER_BILLING.INVALID_TOKEN_CONTEXT
code: INVALID_TOKEN_CONTEXT
message: "User phone number cannot be deducted from Access Token context"
UnauthorizedRefundAmount:
summary: Unauthorized refund amount requested
value:
status: 403
code: CARRIER_BILLING_REFUND.UNAUTHORIZED_AMOUNT
message: "Unauthorized amount requested"
UserMobileAccumulatedThresholdRefundAmountOverpassed:
summary: Accumulated threshold refund amount for the user's mobile account overpassed
value:
status: 403
code: CARRIER_BILLING_REFUND.USER_AMOUNT_THRESHOLD_OVERPASSED
message: "Unathorized refund request. Accumulated user mobile payments overpass account amount threshold"
RefundDenied:
summary: Refund denied by business
value:
Expand All @@ -1103,17 +1088,11 @@ components:
status: 403
code: CARRIER_BILLING_REFUND.PAYMENT_NOT_ELIGIBLE_FOR_REFUND
message: "Payment not eligible for refund"
InvalidPaymentStatus:
summary: Payment is not in suitable status for refund
value:
status: 403
code: CARRIER_BILLING_REFUND.INVALID_PAYMENT_STATUS
message: "Payment is not yet completed"
RefundReadPermissionDenied403:
description: |-
Client does not have sufficient permission.
In addition to regular PERMISSION_DENIED scenario other scenarios may exist:
- Phone Number cannot be deducted from access token context ("code": "CARRIER_BILLING_REFUND.INVALID_TOKEN_CONTEXT","message": "User phone number cannot be deducted from Access Token context").
- Phone Number cannot be deducted from access token context ("code": "INVALID_TOKEN_CONTEXT","message": "User phone number cannot be deducted from Access Token context").
headers:
x-correlator:
$ref: "#/components/headers/x-correlator"
Expand All @@ -1132,7 +1111,7 @@ components:
summary: Phone Number cannot be deducted from access token context
value:
status: 403
code: CARRIER_BILLING_REFUND.INVALID_TOKEN_CONTEXT
code: INVALID_TOKEN_CONTEXT
message: "User phone number cannot be deducted from Access Token context"
Generic404:
description: Resource Not Found
Expand Down Expand Up @@ -1164,6 +1143,9 @@ components:
description: |-
Client indicates content that is understable by the Server but unable to be processed.
Scenarios considered:
- Unauthorized refund amount requested ("code": "CARRIER_BILLING_REFUND.UNAUTHORIZED_AMOUNT","message": "Unauthorized amount requested").
- Accumulated threshold refund amount for the user's mobile account overpassed ("code": "CARRIER_BILLING_REFUND.USER_AMOUNT_THRESHOLD_OVERPASSED","message": "Unathorized refund request. Accumulated user mobile refunds overpass account amount threshold").
- Payment is not in suitable status for refund ("code": "CARRIER_BILLING_REFUND.INVALID_PAYMENT_STATUS","message": "Payment is not yet completed").
- Property `isTaxIncluded` has not the same value as related Payment ("code": "CARRIER_BILLING_REFUND.TAXES_MANAGEMENT_MISMATCH","message": "Inconsistent isTaxIncluded value with regards to related payment.").
- Refund details provided are inconsistent with regards to the related Payment ("code": "CARRIER_BILLING_REFUND.REFUND_DETAILS_MISMATCH","message": "Inconsistent refundDetails information with regards to related payment.").
headers:
Expand All @@ -1174,6 +1156,24 @@ components:
schema:
$ref: "#/components/schemas/ErrorInfo"
examples:
UnauthorizedRefundAmount:
summary: Unauthorized refund amount requested
value:
status: 422
code: CARRIER_BILLING_REFUND.UNAUTHORIZED_AMOUNT
message: "Unauthorized amount requested"
UserMobileAccumulatedThresholdRefundAmountOverpassed:
summary: Accumulated threshold refund amount for the user's mobile account overpassed
value:
status: 422
code: CARRIER_BILLING_REFUND.USER_AMOUNT_THRESHOLD_OVERPASSED
message: "Unathorized refund request. Accumulated user mobile payments overpass account amount threshold"
InvalidPaymentStatus:
summary: Payment is not in suitable status for refund
value:
status: 422
code: CARRIER_BILLING_REFUND.INVALID_PAYMENT_STATUS
message: "Payment is not yet completed"
TaxesManagementMismatch:
summary: Property `isTaxIncluded` has not the same value as related Payment
value:
Expand Down

0 comments on commit 8c230ba

Please sign in to comment.