-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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(payments): incoming payment requests aren't supposed to be in 'initiated' state (only outgoing are) #37447
fix(payments): incoming payment requests aren't supposed to be in 'initiated' state (only outgoing are) #37447
Conversation
…itiated' state (only outgoing are)
… in 'initiated' state (only outgoing are)
ef53a0f
to
1d58996
Compare
…ment-request-status
@s-aga-r I beleive this PR also survives the refactorings unaltered. 🙏 |
Codecov Report
@@ Coverage Diff @@
## develop #37447 +/- ##
===========================================
- Coverage 67.33% 67.32% -0.01%
===========================================
Files 757 757
Lines 60147 60163 +16
===========================================
+ Hits 40497 40507 +10
- Misses 19650 19656 +6
|
…ment-request-status
Status 'Initiated' is reserved for Outward Payment Requests and was a semantic error in previour versions. | ||
""" | ||
|
||
if frappe.reload_doc("accounts", "doctype", "Payment Request"): |
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.
This patch will never execute because it's in post section where it's already reloaded.
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.
Oh damn, sry! Is this the right fix? #38045
Context
As can be seen from the
on_submit
of payment requests, the "Initiated" status is semantically reserved for outgoing payments.However, the gateway integration had misunderstood that semnatics and wongly used "Initiated" status to signify "Requested" instead of using "Requested".
This is in further confustion to the "iniation" status of the Integration Request that is triggered from a payment request.
Likely the original author confounded these and wanted to express that the Integration Request may have been initiated. However, this is a question that lies entierly within the domain an lifecycle of the payment gateway integarion and can therefore not be dealt with from the payment request itself.
As a consequence of this error, users would find:
While user shoul consistently find:
Proposed Solution
Impact
This wrong semantic assignation has been a significant source of misunderstanding while working with the codebase and implementing a payment gateway myself.
Just with this error removed, things would become a lot more consistent and clear to the developer and user alike.