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

fix(payments): fix after sdk testing from the team #284

Merged
merged 2 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Expand Up @@ -2,8 +2,14 @@ DO $$
BEGIN
IF (SELECT count(*) FROM information_schema.tables WHERE table_schema ='transfers' AND table_name ='transfer_initiation') > 0
THEN
INSERT INTO payment_initiations (id, connector_id, reference, created_at, scheduled_at, description, type, amount, asset, source_account_id, destination_account_id, metadata)
SELECT id, connector_id, reference, created_at, COALESCE(scheduled_at, '0001-01-01 00:00:00+00'::timestamp without time zone) as scheduled_at, description, type+1 as type, amount, asset, source_account_id, destination_account_id, metadata from transfers.transfer_initiation
INSERT INTO payment_initiations (id, connector_id, reference, created_at, scheduled_at, description, amount, asset, source_account_id, destination_account_id, metadata, type)
SELECT id, connector_id, reference, created_at, COALESCE(scheduled_at, '0001-01-01 00:00:00+00'::timestamp without time zone) as scheduled_at, description, amount, asset, source_account_id, destination_account_id, metadata,
CASE type+1
WHEN 1 THEN 'TRANSFER'
WHEN 2 THEN 'PAYOUT'
ELSE 'UNKNOWN'
END as type
from transfers.transfer_initiation
ON CONFLICT (id) DO NOTHING;
END IF;
END;
Expand Down
1 change: 1 addition & 0 deletions internal/storage/migrations/migrations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ func testTransferInitiationsMigrations() testmigrations.Hook {

exists, err := db.NewSelect().TableExpr("payment_initiations").
Where("id = ?", "eyJDb25uZWN0b3JJRCI6eyJQcm92aWRlciI6Im1vbmV5Y29ycCIsIlJlZmVyZW5jZSI6IjdkNGU1MjM3LTNjMDktNDUwZS04ODY5LTI2YzA2MGFmMjM3NyJ9LCJSZWZlcmVuY2UiOiJ0ZXN0In0").
Where("type = ?", models.PAYMENT_INITIATION_TYPE_PAYOUT).
Exists(ctx)
require.NoError(t, err)
require.True(t, exists)
Expand Down
1 change: 0 additions & 1 deletion openapi/v1-2/v1-2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1877,7 +1877,6 @@ components:
- name
- createdAt
- country
- connectorID
properties:
id:
type: string
Expand Down
Loading