Skip to content

Commit

Permalink
fix(uphold): use crypto_withdrawals capability for transfer permission (
Browse files Browse the repository at this point in the history
  • Loading branch information
HashEngineering authored Jan 4, 2024
1 parent db3985f commit b958570
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion integrations/uphold/ERRORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ Error: 403
```json
{
"error": {
"capability": "withdrawals",
"capability": "crypto_withdrawals",
"code": "forbidden",
"message": "Quote not allowed due to capability constraints",
"requirements": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ suspend fun UpholdClient.revokeAccessToken() {
}

suspend fun UpholdClient.checkCapabilities() {
val operation = "withdrawals"
val operation = "crypto_withdrawals"
val response = service.getCapabilities(operation)
response.ensureSuccessful()
val capability = response.body()
Expand Down Expand Up @@ -207,7 +207,7 @@ fun UpholdClient.createDashAddress(cardId: String) {
}

fun UpholdClient.getWithdrawalRequirements(): List<String> {
val result = requirements["withdrawals"]
val result = requirements["crypto_withdrawals"]
return result ?: emptyList()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ private Date convertISO8601Date(String date) {

// 403
// {
// "capability":"withdrawals",
// "capability":"crypto_withdrawals",
// "code":"forbidden",
// "message":"Quote not allowed due to capability constraints",
// "requirements":[],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class UpholdClientTest {
listOf()
)

val actualResponse = api.getCapabilities("withdrawals")
val actualResponse = api.getCapabilities("crypto_withdrawals")
assertEquals(expected, actualResponse.body())
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class UpholdErrorTest {

val thirdError = """
{
"capability": "withdrawals",
"capability": "crypto_withdrawals",
"code": "forbidden",
"message": "Quote not allowed due to capability constraints",
"requirements": [],
Expand Down

0 comments on commit b958570

Please sign in to comment.