stripe/stripe-cli

`payment_method.detached` event trigger doesn't work

Opened this issue · 1 comments

The more information we have the easier it is for us to help. Feel free to remove any sections that might not apply

Issue

Describe what happened and what you were trying to do

Triggering the payment_method.detached event using the CLI (v1.20.0) doesn't work.

It fails with the following error:

Trigger failed: Request failed, status=404, body={
  "error": {
    "code": "resource_missing",
    "doc_url": " https://stripe.com/docs/error-codes/resource-misssing",
    "message" "No such PaymentMethod: '${payment_method_attach.id}'; It's possible this PaymentMethod exists on one of your connected accounts, in which case you should retry this request on that connected account. Learn more at https://stripe.com/docs/connect/authentication",
    "param": "payment_method",
    "request_log_url": <redacted>,
    "type": "invalid_request_error"
  }
}

Expected Behavior

Tell us what you expected to happen

The payment method detach API call to work which would eventually result in the payment_method.detached event being triggered

Steps to reproduce

What are the steps we can take to reproduce this and verify it's fixed?

Try running the following command Stripe CLI command:

stripe trigger payment_method.detached

I've already created a PR which I believe would fix the issue: #1207