Skip to content
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

feat(incoming-payment): make it actionable #2827

Merged
merged 20 commits into from
Aug 21, 2024

Conversation

golobitch
Copy link
Collaborator

@golobitch golobitch commented Jul 30, 2024

Changes proposed in this pull request

  • backend migration that will add approvedAt and cancelledAt columns to the incomingPayments table
  • approveIncomingPayment mutation that accepts incoming payment id and if this payment is in the database and in PENDING state, it will update it's approvedAt field to current time.
  • cancellIncomingPaymentmutation that accepts incoming payment id and if this payment is in the database and in PENDING state it will update it's cancelledAt field to current time.

Context

fixes #2811

Checklist

  • Related issues linked using fixes #number
  • Tests added/updated
  • Documentation added
  • Make sure that all checks pass
  • Bruno collection updated

This change will add two new table columns in the incomingPayments table on the backend service. ASE
will be able to call cancel or approve incoming payment GraphQL API, and the timestamp of the call
will be save in the database under these two fields. Normally, both of these two fields are
optional.
This commit introduces possibility, to approve incoming payment through Admin API. API can be called
with existing incoming payment as ID. Rafiki will fetch the incoming payment and update it's
approvedAt field in the database. In case that payment does not exists or that it is not in the
PENDING state, appropriate error is returned.

#2811
@golobitch golobitch self-assigned this Jul 30, 2024
@github-actions github-actions bot added type: tests Testing related pkg: backend Changes in the backend package. pkg: frontend Changes in the frontend package. type: source Changes business logic pkg: mock-ase pkg: mock-account-service-lib labels Jul 30, 2024
Copy link

netlify bot commented Jul 30, 2024

Deploy Preview for brilliant-pasca-3e80ec canceled.

Name Link
🔨 Latest commit 3a4838b
🔍 Latest deploy log https://app.netlify.com/sites/brilliant-pasca-3e80ec/deploys/66c4e3f367359600081eda44

@golobitch golobitch marked this pull request as draft July 30, 2024 21:29
It will be possible to cancel incoming payment due to some requirements. Rafiki just need to get a
call to cancel incoming payment, with the payment ID. If transaction is in PENDING state and it is
in the database, then it will get updated. It's cancelledAt field will be set  to current time.

#2811
@golobitch golobitch changed the title feature(incoming-payment): make it actionable feat(incoming-payment): make it actionable Jul 31, 2024
…ing payments

Introduced three new env variables that will set the behaviour of actionable incoming payments. One
env variable will define if polling will be done, meaning that it will wait for the incoming payment
to be accepted or rejected, and other two env variables defines timeout for polling and polling
frequency
@golobitch golobitch force-pushed the feature/2811-actionable-incoming-payments branch from 3bf19d6 to 076af94 Compare July 31, 2024 22:01
@golobitch golobitch force-pushed the feature/2811-actionable-incoming-payments branch from d214173 to 130314b Compare August 10, 2024 21:58
@golobitch golobitch force-pushed the feature/2811-actionable-incoming-payments branch from 130314b to d666e81 Compare August 10, 2024 22:00
@golobitch golobitch force-pushed the feature/2811-actionable-incoming-payments branch from d666e81 to e434637 Compare August 10, 2024 22:55
@golobitch golobitch marked this pull request as ready for review August 10, 2024 22:57
@golobitch
Copy link
Collaborator Author

I will also add bruno collection to approve or cancel incoming payment through Admin API. Tomorrow :)

@golobitch golobitch force-pushed the feature/2811-actionable-incoming-payments branch from fe7f430 to f39d329 Compare August 14, 2024 19:45
@golobitch golobitch force-pushed the feature/2811-actionable-incoming-payments branch from f39d329 to 7ff5178 Compare August 14, 2024 20:44
Our builds are failing due to Trivy scanner. Trivy scanner actually found that our Axios version
v1.6.8 has a vulnerability - CVE-2024-39338. This was fixed in version 1.7.4, hence, the upgrade.

fix #2860
@github-actions github-actions bot added the pkg: auth Changes in the GNAP auth package. label Aug 14, 2024
@mkurapov
Copy link
Contributor

mkurapov commented Aug 20, 2024

@tadejgolobic some formatting fixes needed

ah I see you are still testing

@golobitch
Copy link
Collaborator Author

@tadejgolobic some formatting fixes needed

ah I see you are still testing

Yeah, I did a push from different computer, where I did not have all the changes ... now it should be everything

@golobitch golobitch merged commit b0adb34 into main Aug 21, 2024
42 checks passed
@golobitch golobitch deleted the feature/2811-actionable-incoming-payments branch August 21, 2024 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: auth Changes in the GNAP auth package. pkg: backend Changes in the backend package. pkg: frontend Changes in the frontend package. pkg: mock-account-service-lib pkg: mock-ase type: source Changes business logic type: tests Testing related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Actionable incoming payments
3 participants