Skip to content

Commit

Permalink
Merge branch 'main' into 2879/mk/updated-balances
Browse files Browse the repository at this point in the history
  • Loading branch information
mkurapov committed Aug 23, 2024
2 parents 2a61215 + 175a7cf commit fe5c167
Show file tree
Hide file tree
Showing 32 changed files with 1,751 additions and 65 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
meta {
name: Approve Incoming Payment
type: graphql
seq: 47
}

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

body:graphql {
mutation ApproveIncomingPayment($input: ApproveIncomingPaymentInput!) {
approveIncomingPayment(input:$input) {
payment {
id
}
}
}
}

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: {{PeerGraphqlHost}}/graphql
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')
})
}
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('grants', (table) => {
table.dropUnique(['authServerId', 'accessType', 'accessActions'])
table.timestamp('deletedAt').nullable()
})
}

/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
exports.down = function (knex) {
return knex.schema.alterTable('grants', (table) => {
table.unique(['authServerId', 'accessType', 'accessActions'])
table.dropColumn('deletedAt')
})
}
4 changes: 4 additions & 0 deletions packages/backend/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ import {
} from './open_payments/wallet_address/middleware'

import { LoggingPlugin } from './graphql/plugin'
import { GrantService } from './open_payments/grant/service'
import { AuthServerService } from './open_payments/authServer/service'
export interface AppContextData {
logger: Logger
container: AppContainer
Expand Down Expand Up @@ -232,6 +234,8 @@ export interface AppServices {
incomingPaymentService: Promise<IncomingPaymentService>
remoteIncomingPaymentService: Promise<RemoteIncomingPaymentService>
receiverService: Promise<ReceiverService>
grantService: Promise<GrantService>
authServerService: Promise<AuthServerService>
streamServer: Promise<StreamServer>
webhookService: Promise<WebhookService>
quoteService: Promise<QuoteService>
Expand Down
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

0 comments on commit fe5c167

Please sign in to comment.