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 PaymentIntent cancelation #245

Conversation

Patrick-Kladek
Copy link
Contributor

Description

While using this library I noticed canceling a payment intent was not possible. More specifically was the cancellation_reason not supported. After checking the docs I've updated the enum and can confirm it works now.

Tasks

  • update PaymentIntentCancellationReason enum

Infos for Reviewer

I'm using the Payment Intent in combination with Stripe Connect. I couldn't verify if the behavior is different with another stripe product, however it says the same in the documentation here: https://stripe.com/docs/api/payment_intents/cancel

Here is the error returned from the API:

The cancellation_reason provided in the request is not a valid user provided reason. 
Please try canceling again with one of duplicate`, `fraudulent`, `requested_by_customer`
or `abandoned.

{
  "cancellation_reason": "automatic"
}

Copy link
Member

@Andrewangeta Andrewangeta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment.

@Andrewangeta Andrewangeta merged commit f9e727a into vapor-community:main Feb 7, 2024
9 of 11 checks passed
@Patrick-Kladek
Copy link
Contributor Author

I wasn't aware that this enum was used for decoding responses. Thanks for fixing and merging this.

@Patrick-Kladek Patrick-Kladek deleted the bugfix/payment-intent-cancelation branch February 7, 2024 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants