mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-23 20:48:43 +00:00
Allow stripe error codes to be upgraded to decline codes.
This commit is contained in:
committed by
Cody Henthorne
parent
1a657a7a19
commit
123fb95916
@@ -194,10 +194,13 @@ class StripeApi(
|
|||||||
return response
|
return response
|
||||||
} else {
|
} else {
|
||||||
val body = response.body()?.string()
|
val body = response.body()?.string()
|
||||||
|
val errorCode = parseErrorCode(body)
|
||||||
|
val declineCode = parseDeclineCode(body) ?: StripeDeclineCode.getFromCode(errorCode)
|
||||||
|
|
||||||
throw StripeError.PostError(
|
throw StripeError.PostError(
|
||||||
response.code(),
|
response.code(),
|
||||||
parseErrorCode(body),
|
errorCode,
|
||||||
parseDeclineCode(body)
|
declineCode
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user