-
Notifications
You must be signed in to change notification settings - Fork 302
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
Refactor Lunar transactions to use payment checks DTO #1767
Refactor Lunar transactions to use payment checks DTO #1767
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@alecritson I think we need an entry in the upgrade docs, as I presume this will be breaking if someone has made their own payment driver? |
Scrap that, I can see it's on the abstract class. So not needed. |
Currently there isn't a standard way for Lunar to show what payment checks were successful, such as Address checks or Security code checks. Although it does make somewhat of an attempt, due to all payment providers being different it is leading to a lot of false positives.
This PR looks to introduce
PaymentChecks
andPaymentCheck
Data Transfer Objects which allow each payment driver to return what payment checks have taken place, what the message was and whether it was successful.Usage is via the
Transaction
model like so:For developers who have implemented their own payment type they will need to implement the
getPaymentChecks
method and interpret the meta data on the transaction accordingly. If a payment driver doesn't store this information they don't need to do anything since a base method is implements in theAbstractPaymentDriver
.An implementation may look like the following (snippet from Stripe payment driver):