Open BlackbitDevs opened 1 year ago
Merging #34 (cffe266) into master (cfe08dc) will increase coverage by
0.00%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## master #34 +/- ##
=========================================
Coverage 99.84% 99.85%
- Complexity 427 428 +1
=========================================
Files 110 110
Lines 1321 1348 +27
=========================================
+ Hits 1319 1346 +27
Misses 2 2
Impacted Files | Coverage Δ | |
---|---|---|
src/Action/StatusSessionAction.php | 100.00% <100.00%> (ø) |
... and 19 files with indirect coverage changes
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
Hello @BlackbitDevs, thank you very much for this PR.
From what I can see in your Session object, the PaymentIntent
is a full object instead of a simple ID, do you make a specific API call or this come from your shop Payment->details
?
Are you able to fix the build by removing the tests about the payment status ?
Hello @BlackbitDevs, thank you very much for this PR.
From what I can see in your Session object, the
PaymentIntent
is a full object instead of a simple ID, do you make a specific API call or this come from your shopPayment->details
?
Hello @Prometee this API call came from shop (CoreShop bundle for Pimcore)
Are you able to fix the build by removing the tests about the payment status ?
Not sure. Can you suggest how to better do this?
Hi @BlackbitDevs !
It's kind of weird the format you have in response, can you check your Stripe dashboard to see if you are using an old API version ? https://dashboard.stripe.com/developers (bottom of the page "API version".
Also can you check you are using the lastest version of this Payum lib ?
About the tests, one file is responsible to the change you made : https://github.com/FLUX-SE/PayumStripe/blob/master/tests/Action/StatusSessionActionTest.php. You can first read it to see what to change. I'm here to help you understand it.
Hi @Prometee API version is [2022-11-15] Default Latest
payum/payum - versions : * 1.7.3
After some digging, this behaviour is not possible unless Stripe has an issue with your account or something is altering the Stripe API response in your code.
Here is the Stripe Open API specifications for this field (those specs generate the stripe/stripe-php
package):
components:
schemas:
checkout.session:
properties:
payment_status:
description: >-
The payment status of the Checkout Session, one of `paid`, `unpaid`,
or `no_payment_required`.
You can use this value to decide when to fulfill your customer's
order.
enum:
- no_payment_required
- paid
- unpaid
type: string
required:
- payment_status
I git blame those line to see when the field has been introduced and it was done by this commit : https://github.com/stripe/openapi/commit/dd2806425f9d2212b6c1191ffb0f65b1af71b70c (Sep 2, 2020)
So clearly according to those specifications, the payment_status
field can't be null
at this point.
After paying on Stripe and going back to the website, I had the following error:
FluxSE\PayumStripe\Action\StatusSessionAction::isCaptureStatus(): Argument #2 ($paymentStatus) must be of type string, null given, called in /var/www/html/sylius/ecommerce/vendor/flux-se/payum-stripe/src/Action/StatusSessionAction.php on line 28
This PR seemed to fix the issue but after applying the changes, it caused other problems. I don't think the changes in this PR are revelant as updating the plugin to the version 2.0.11 fixed my issue.
According to the latest API Stripe version now "payment_status" present not for all requests. When you try get data about payment
POST /v1/payment_pages/cs_test_a1mwvpJk6c4mLg......
API will return data without "payment_status"