I didn’t see where this Spree::Payment is created ...
# support
l
I didn’t see where this Spree::Payment is created (not from the solidus_stripe code it seems), and to be fair I don’t understand why the spree payment is created before an intent. It seems more logical to crate a payment in pending state from the moment the intent has been confirmed.
e
👋 I think it’s fine to post here About the spree/payment creation as you pointed out it can work both ways, we opted for this implementation because: • we wanted to be as vanilla as possible with the current solidus flow (which will create the payment after the payment step using the form data provided in there) • we though spree/payment with its logs which are visible in the admin was a good starting point for debugging weird situation that the customer service will eventually need to face this is clearly a trade off and we fully appreciate that there are pros and cons to it I’m also interested in what drove you to not use a payment, if you did it for any specific reason or was just the most natural implementation
l
“which will create the payment after the payment step” ?! are you sure ? you need the intent to render the Stripe Element form, for you need the spree payment before you land on the checkout payment step, no ?
for abandonned cart, it feel weird to fill the db with Spree::Payment object in intial “checkout” state even if no payment or intent has been process, but maybe that’s the normal behaviour to the “raw” solidus.
I don’t mind whichever solution, just trying to understand if my modification should be part of our custom code or is it something that can be added to the gem
if needed a screenshot where everything happen (taken from another ticket dont look at the error)

https://user-images.githubusercontent.com/824936/238882271-2d1017c6-3173-4b31-8193-79f1f0d55fec.png

e
are you sure?
You’re right on this, it was necessary to have the intent before showing the form, but a recent API came out of beta just before released that allowed showing the PaymentElement without a payment-intent or setup-intent. I think that is the piece I forgot to mention
l
oh ! I didn’t see that ! ok thanks
e
this is one of the documentation entry point for that API if I’m not mistaken https://stripe.com/docs/payments/build-a-two-step-confirmation
that allowed to scrap a lot of code that only existed to work around that requirement which was a bit unnatural in the solidus flow
l
ah yes I saw the work around that… I didn’t look closely at this because we skip confirmation step in our case. Thanks I’ll see if it requires changes on my side or not.
e
🙌 let me know if I can help in any other way and keep us posted on issues or proposals coming from your experience with the extension, that’s very valuable 🙏
l
thanks, it a lot more clear 👍 If I had to start now integrating Stripe, I would implement our workflow differently to be closer to your workflow and to do a bit less custom code.
indeed, your workflow is cleaner
e
😅 we just wished it came out of beta at the beginning of the implementation instead of just before releasing, but it felt good to delete all of that code ✂️
l
it’s fine it was just that we work these previous months in parrallel, you on the gem, and us on our custom workflow. So I was trying to use as soon as possible the gem even if it was still in development. That was the risk.
💯 1