Payload Validation
|
:
|
'products' => 'required|array',
'products.*.name' => 'required|string',
'products.*.productId' => 'nullable|string',
'products.*.rate' => 'required|numeric',
'products.*.tax' => 'required|numeric',
'products.*.amount' => 'required|numeric',
'grandTotal' => 'required|numeric',
'additionalText' => 'nullable|string',
|
Example Payload
|
:
|
{
"products": {
"0": {
"name": "Charge QA",
"productId": null,
"rate": 1500,
"tax": "0",
"amount": 1500
}
},
"grandTotal": 1500,
"additionalText" : "My additional Text for charge"
}
|
Response Structure
|
:
|
// Success
{
"status_code": 202,
"status_message": "OK",
"message": "reservationChargedSuccessfully",
"is_data": true,
"data": {
"uuid": "String"
}
}
// Errors
{
"status_code": 417,
"status_message": "Client Error",
"message": "payloadValidationErrors",
"is_error": true,
"errors": "Array"
}
{
"status_code": 404,
"status_message": "Not Found",
"message": "reservationNotFound",
"is_data": false,
"data": null
}
{
"status_code": 404,
"status_message": "Not Found",
"message": "paymentCardNotFound",
"is_data": false,
"data": null
}
{
"status_code": 400,
"status_message": "Conflict of Business Logic",
"message": "paymentChargeRunwayExceed",
"is_data": false,
"data": null
}
{
"status_code": 400,
"status_message": "Conflict of Business Logic",
"message": "paymentChargeDeadlineExceed",
"is_data": false,
"data": null
}
{
"status_code": 500,
"status_message": "Internal Dependency Error",
"message": "internalErrorOccurredPleaseTryAgainLater",
"is_error": true,
"errors": "Array"
}
{
"status_code": 510,
"status_message": "Execution Exception Occurred",
"message": "somethingWentWrong",
"is_error": true,
"errors": "Array"
}
|
Example Response
|
:
|
{
"status_code": 202,
"status_message": "OK",
"message": "reservationChargedSuccessfully",
"is_data": true,
"data": {
"uuid": "CHA12345678"
]
}
|