-
Notifications
You must be signed in to change notification settings - Fork 168
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 error with missing payment method on 3DS payments #159
Open
miholeus
wants to merge
2
commits into
thephpleague:master
Choose a base branch
from
miholeus:confirm-payment-intent
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
118 changes: 118 additions & 0 deletions
118
tests/Message/PaymentIntents/Mock/ConfirmIntentMissingPaymentMethod.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
HTTP/1.1 400 Bad Request | ||
Server: nginx | ||
Date: Sun, 17 Oct 2019 19:51:15 GMT | ||
Content-Type: application/json;charset=utf-8 | ||
Content-Length: 3674 | ||
Connection: keep-alive | ||
Cache-Control: no-cache, no-store | ||
Access-Control-Max-Age: 300 | ||
Access-Control-Allow-Credentials: true | ||
|
||
{ | ||
"error": { | ||
"code": "payment_intent_unexpected_state", | ||
"doc_url": "https://stripe.com/docs/error-codes/payment-intent-unexpected-state", | ||
"message": "You cannot confirm this PaymentIntent because it's missing a payment method. To confirm the PaymentIntent with cus_G0fHJ1TaSxY7lF, specify a payment method attached to this customer along with the customer ID.", | ||
"payment_intent": { | ||
"id": "pi_1FUdwbG3M98oE4tVVQMhEldb", | ||
"object": "payment_intent", | ||
"amount": 7000, | ||
"amount_capturable": 0, | ||
"amount_received": 0, | ||
"application": null, | ||
"application_fee_amount": null, | ||
"canceled_at": null, | ||
"cancellation_reason": null, | ||
"capture_method": "automatic", | ||
"charges": { | ||
"object": "list", | ||
"data": [ | ||
], | ||
"has_more": false, | ||
"total_count": 0, | ||
"url": "/v1/charges?payment_intent=pi_1FUdwbG3M98oE4tVVQMhEldb" | ||
}, | ||
"client_secret": "pi_1FUdwbG3M98oE4tVVQMhEldb_secret_PY30Txaeht6iqEUsWjqqQ1yY1", | ||
"confirmation_method": "manual", | ||
"created": 1571337809, | ||
"currency": "usd", | ||
"customer": "cus_G0fHJ1TaSxY7lF", | ||
"description": null, | ||
"invoice": null, | ||
"last_payment_error": { | ||
"code": "payment_intent_authentication_failure", | ||
"doc_url": "https://stripe.com/docs/error-codes/payment-intent-authentication-failure", | ||
"message": "The provided PaymentMethod has failed authentication. You can provide payment_method_data or a new PaymentMethod to attempt to fulfill this PaymentIntent again.", | ||
"payment_method": { | ||
"id": "card_1FUdwaG3M98oE4tV2O1uDpvH", | ||
"object": "payment_method", | ||
"billing_details": { | ||
"address": { | ||
"city": "New Jersey", | ||
"country": "US", | ||
"line1": "New Jersey Turnpike", | ||
"line2": null, | ||
"postal_code": "00701", | ||
"state": "NJ" | ||
}, | ||
"email": null, | ||
"name": "Brad Fitz", | ||
"phone": null | ||
}, | ||
"card": { | ||
"brand": "visa", | ||
"checks": { | ||
"address_line1_check": "pass", | ||
"address_postal_code_check": "pass", | ||
"cvc_check": "pass" | ||
}, | ||
"country": "IE", | ||
"exp_month": 11, | ||
"exp_year": 2023, | ||
"fingerprint": "Cb549Jvs1wPUfTWb", | ||
"funding": "credit", | ||
"generated_from": null, | ||
"last4": "3220", | ||
"three_d_secure_usage": { | ||
"supported": true | ||
}, | ||
"wallet": null | ||
}, | ||
"created": 1571337808, | ||
"customer": "cus_G0fHJ1TaSxY7lF", | ||
"livemode": false, | ||
"metadata": { | ||
}, | ||
"type": "card" | ||
}, | ||
"type": "invalid_request_error" | ||
}, | ||
"livemode": false, | ||
"metadata": { | ||
}, | ||
"next_action": null, | ||
"on_behalf_of": null, | ||
"payment_method": null, | ||
"payment_method_options": { | ||
"card": { | ||
"installments": null, | ||
"request_three_d_secure": "automatic" | ||
} | ||
}, | ||
"payment_method_types": [ | ||
"card" | ||
], | ||
"receipt_email": null, | ||
"review": null, | ||
"setup_future_usage": null, | ||
"shipping": null, | ||
"source": null, | ||
"statement_descriptor": null, | ||
"statement_descriptor_suffix": null, | ||
"status": "requires_payment_method", | ||
"transfer_data": null, | ||
"transfer_group": null | ||
}, | ||
"type": "invalid_request_error" | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add some explanation why and how to use this new param - either in the description in top of file:
omnipay-stripe/src/Message/PaymentIntents/ConfirmPaymentIntentRequest.php
Line 9 in f60aed2
or above this if.
Would be good if you can add link from official Stripe doc about it.