Allow stripe error codes to be upgraded to decline codes.
This commit is contained in:
parent
1a657a7a19
commit
123fb95916
1 changed files with 5 additions and 2 deletions
|
@ -194,10 +194,13 @@ class StripeApi(
|
|||
return response
|
||||
} else {
|
||||
val body = response.body()?.string()
|
||||
val errorCode = parseErrorCode(body)
|
||||
val declineCode = parseDeclineCode(body) ?: StripeDeclineCode.getFromCode(errorCode)
|
||||
|
||||
throw StripeError.PostError(
|
||||
response.code(),
|
||||
parseErrorCode(body),
|
||||
parseDeclineCode(body)
|
||||
errorCode,
|
||||
declineCode
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue