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

Error body serialization fails for insufficient_capabilities_for_transfer #636

Open
dyc3 opened this issue Nov 11, 2024 · 0 comments · May be fixed by #637
Open

Error body serialization fails for insufficient_capabilities_for_transfer #636

dyc3 opened this issue Nov 11, 2024 · 0 comments · May be fixed by #637
Labels
bug Something isn't working

Comments

@dyc3
Copy link

dyc3 commented Nov 11, 2024

Describe the bug

My integration made a request to POST /v1/transfers and get back this response:

{
  "error": {
    "code": "insufficient_capabilities_for_transfer",
    "message": "Your destination account needs to have at least one of the following capabilities enabled: transfers, crypto_transfers, legacy_payments",
    "request_log_url": "https://dashboard.stripe.com/test/logs/req_cyVXKUT1GV30oN?t=1731361723",
    "type": "invalid_request_error"
  }
}

This causes the async-stripe library to return a StripeError::JSONSerialization instead of StripeError::Stripe.

To Reproduce

  1. Create a connected account, but don't give it the transfers capability. I think not doing the onboarding for the connected account will also not give it any capabilities.
  2. Create a transfer to that connected account
  3. Receive error from Stripe
  4. Library fails to parse error.

Expected behavior

It should parse the error correctly and return the right type of error. Preferably, I think the ErrorCode enum should have an Unknown(String) variant so that cases like this can be worked around by users without an crate update.

Code snippets

No response

OS

linux, ubuntu 20.04

Rust version

1.82

Library version

async-stripe 0.39.1

API version

2023-10-16

Additional context

Directly related to: #384

I'm willing to contribute a fix for this.

@dyc3 dyc3 added the bug Something isn't working label Nov 11, 2024
dyc3 added a commit to dyc3/async-stripe that referenced this issue Nov 11, 2024
@dyc3 dyc3 linked a pull request Nov 11, 2024 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant