Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(uphold): use crypto_withdrawals capability for transfer permission #1243

Merged
merged 1 commit into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading