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
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
fa9cc27
feat(backend): incoming paymentm igrations approved or canceled fields
golobitch Jul 30, 2024
d9ec7e5
feat(incoming-payment): option to approve incoming payment
golobitch Jul 30, 2024
6767fbf
chore(graphql): generate new graphql fiels for dependencies
golobitch Jul 30, 2024
e4fbc3c
feat(incoming-payment): possibility to cancel incoming payment
golobitch Jul 30, 2024
c28d430
chore(graphql): generate new graphql fiels for dependencies due to ca…
golobitch Jul 30, 2024
076af94
feat(config): backend to introduce env variables for actionable incom…
golobitch Jul 31, 2024
57b2526
fix(config): pool vs poll typo
golobitch Aug 8, 2024
c2ab248
feat(incoming-payment): poll incoming payment
golobitch Aug 8, 2024
dcb31a1
feat(incoming-payment): new error code + linting
golobitch Aug 10, 2024
e434637
test(incoming-payment): check approvedAt and cancelledAt
golobitch Aug 10, 2024
9dd6606
docs(bruno): approve and cancel incoming payment
golobitch Aug 11, 2024
ea46b1e
Update packages/backend/src/open_payments/payment/incoming/service.te…
golobitch Aug 12, 2024
7ff5178
feat(incoming-payment): error log
golobitch Aug 13, 2024
5259f5c
refactor(dependencies): axios to 1.7.4
golobitch Aug 14, 2024
5ef9991
fix(incoming-payment): add log if ip is not approved or cancelled
golobitch Aug 15, 2024
26d8178
fix(incoming-payment): check other fields before approving or cancell…
golobitch Aug 16, 2024
aad8fa5
test(incoming-payment): add additional tests
golobitch Aug 16, 2024
629b7b6
feat(incoming-payment): new error code
golobitch Aug 20, 2024
e13eccf
feat(bruno): update approve and cancel ip
golobitch Aug 20, 2024
3a4838b
feat(incoming-payment): lint + add missing resolvers
golobitch Aug 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
meta {
name: Approve Incoming Payment
type: graphql
seq: 47
}

post {
url: {{RafikiGraphqlHost}}/graphql
body: graphql
auth: none
}

body:graphql {
mutation ApproveIncomingPayment($input: ApproveIncomingPaymentInput!) {
approveIncomingPayment(input:$input) {
id
approvedAt
golobitch marked this conversation as resolved.
Show resolved Hide resolved
}
}
}

body:graphql:vars {
{
"input": {
"id": "{{incomingPaymentId}}"
}
}
}

script:pre-request {
const scripts = require('./scripts');

scripts.addApiSignatureHeader();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
meta {
name: Cancel Incoming Payment
type: graphql
seq: 48
}

post {
url:
body: graphql
auth: none
}

body:graphql {
mutation CancelIncomingPayment($input: CancelIncomingPaymentInput!) {
cancelIncomingPayment(input: $input) {
payment {
id
}
}
}

}

body:graphql:vars {
{
"input": {
"id": "{{incomingPaymentId}}"
}
}
}

script:pre-request {
const scripts = require('./scripts');

scripts.addApiSignatureHeader();
}
56 changes: 56 additions & 0 deletions localenv/mock-account-servicing-entity/generated/graphql.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
exports.up = function (knex) {
return knex.schema.alterTable('incomingPayments', (table) => {
table.timestamp('approvedAt').nullable()
table.timestamp('cancelledAt').nullable()
})
}

/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
exports.down = function (knex) {
return knex.schema.alterTable('incomingPayments', (table) => {
table.dropColumn('approvedAt')
table.dropColumn('cancelledAt')
})
}
12 changes: 12 additions & 0 deletions packages/backend/src/config/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,18 @@ export const Config = {

incomingPaymentWorkers: envInt('INCOMING_PAYMENT_WORKERS', 1),
incomingPaymentWorkerIdle: envInt('INCOMING_PAYMENT_WORKER_IDLE', 200), // milliseconds
pollIncomingPaymentCreatedWebhook: envBool(
'POLL_INCOMING_PAYMENT_CREATED_WEBHOOK',
false
),
incomingPaymentCreatedPollTimeout: envInt(
'INCOMING_PAYMENT_CREATED_POLL_TIMEOUT_MS',
10000
), // milliseconds
incomingPaymentCreatedPollFrequency: envInt(
'INCOMING_PAYMENT_CREATED_POLL_FREQUENCY_MS',
1000
), // milliseconds

webhookWorkers: envInt('WEBHOOK_WORKERS', 1),
webhookWorkerIdle: envInt('WEBHOOK_WORKER_IDLE', 200), // milliseconds
Expand Down
3 changes: 2 additions & 1 deletion packages/backend/src/graphql/errors/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ export enum GraphQLErrorCode {
Inactive = 'INACTIVE',
InternalServerError = 'INTERNAL_SERVER_ERROR',
NotFound = 'NOT_FOUND',
Conflict = 'CONFLICT'
Conflict = 'CONFLICT',
Timeout = 'TIMEOUT'
}
Loading
Loading