-
Notifications
You must be signed in to change notification settings - Fork 145
Description
Description
When I call the abort API to cancel an ongoing payment in the test environment, an error occurs: the Adyen API returns a string instead of the expected JSON object. However, the JSON conversion is handled within the SDK of com.adyen:adyen-java-api-library:29.0.0. This issue has not been observed in the production environment; it only started occurring in the test environment on November 19th and is 100% reproducible. Additionally, I cannot find any logs related to the abort operation in the balance-platform.
Steps to reproduce
- Call the /payments API to make a payment
- Before the payment is completed, call the /abort API to cancel the payment.
Actual behavior
abort error: type=JsonSyntaxException, message=java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 2 path $
See https://github.com/google/gson/blob/main/Troubleshooting.md#unexpected-json-structure
Expected behavior
The Adyen abort API should return a 200 status with the correct response payload.
Code snippet or screenshots (if applicable)
private suspend fun abortPayment(payment: OrderingPayment): Either<OrderingError, Unit> = Either.catch {
val abortServiceId = RandomStringUtils.randomAlphanumeric(10)
withTags(payment.logTags()) {
LOG.debug { "Aborting transaction, saleId=${payment.saleId}, abortServiceId=${abortServiceId}, paymentServiceId=${payment.serviceId}, category=${payment.category}" }
}
val abortRequest = TerminalAPIRequestBuilder(payment.saleId, abortServiceId, payment.terminalPoiId).withAbortRequest(
AbortRequest().apply {
abortReason = "MerchantAbort"
messageReference = MessageReference().apply {
messageCategory = payment.messageCategory
saleID = payment.saleId
serviceID = payment.serviceId
poiid = payment.terminalPoiId
}
}
).build()
withContext(Dispatchers.IO) { api.sync(abortRequest) }
Unit.right()
}.getOrElse { e ->
withTags(payment.logTags()) {
LOG.exception(e) { "Error while aborting payment for order: ${payment.idempotencyUuid}" }
}
OrderingError.RemoteError(e).left()
}Adyen Java API Library version
29.0.0
Java version
21
Operating System
Linux
Additional context
Time of occurrence (approx.): 2025-11-25T09:10:23.346390179Z
Parameter example: saleId=S1F2-000158243353990, serviceId=91h0rgz4y4, category=Payment