eltrino / magento2-stripe-payments Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
Hello Hyva team,
Just came across this repository. From a brief look at the code, this seems to depend on older versions of v3.x of the Stripe module. In the older versions, a PaymentIntent was required in order to render the PaymentElement. I can see that a dummy PI is created in a custom get_client_secret API endpoint, and this can create duplicate, incomplete payments in the Stripe dashboard. Additionally, I can see that the flow is to first confirm the payment on the client side, and then place the order. If the order placement fails, and a re-attempt to place the order is made, then this could create a problem with duplicate payments.
I would recommend that the implementation changes so that deferred intents are utilized. With deferred intents, the PaymentElement can be rendered without a payment intent, and a payment method token can be generated in a standalone way, without creating an incomplete payment in the Stripe dashboard.
Here is the documentation on how to use deferred intents: https://stripe.com/docs/connectors/adobe-commerce/custom-storefront#tokenize-payment-method.
This will improve performance by dropping the get_client_secret and refresh_payment_intent API calls, and would additionally shift the payment confirmation to the server side, right before the order is saved.
Additionally, the minimum version dependency for the Stripe module would need to be v3.4 or newer, which is the version that introduced deferred intents.
The provided examples at https://stripe.com/docs/connectors/adobe-commerce/custom-storefront are based on the GraphQL API, however there is an equivalent example for Magento's REST API in the module's examples/ directory.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.