Columns
| Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | |||
|---|---|---|---|---|---|---|---|---|---|---|---|
| id | uuid | 2147483647 | gen_random_uuid() |
|
|
||||||
| practice_id | text | 2147483647 | null |
|
|
||||||
| location_id | text | 2147483647 | √ | null |
|
|
|||||
| patient_id | text | 2147483647 | √ | null |
|
|
|||||
| invoice_id | text | 2147483647 | √ | null |
|
|
|||||
| checkout_id | text | 2147483647 | √ | null |
|
|
|||||
| payment_gateway_config_id | uuid | 2147483647 | null |
|
|
||||||
| gateway | text | 2147483647 | null |
|
|
||||||
| gateway_environment | text | 2147483647 | null |
|
|
||||||
| payment_method_type | text | 2147483647 | null |
|
|
||||||
| amount_cents | int4 | 10 | null |
|
|
||||||
| currency_code | bpchar | 3 | 'USD'::bpchar |
|
|
||||||
| status | text | 2147483647 | 'pending'::text |
|
|
||||||
| idempotency_key | text | 2147483647 | √ | null |
|
|
|||||
| gateway_idempotency_key | uuid | 2147483647 | null |
|
|
||||||
| gateway_transaction_id | text | 2147483647 | √ | null |
|
|
|||||
| gateway_status | text | 2147483647 | √ | null |
|
|
|||||
| gateway_response | text | 2147483647 | √ | null |
|
|
|||||
| gateway_response_code | int4 | 10 | √ | null |
|
|
|||||
| gateway_response_message | text | 2147483647 | √ | null |
|
|
|||||
| processor_id | text | 2147483647 | √ | null |
|
|
|||||
| submitted_at | timestamptz | 35,6 | √ | null |
|
|
|||||
| metadata | jsonb | 2147483647 | '{}'::jsonb |
|
|
||||||
| created_at | timestamptz | 35,6 | now() |
|
|
||||||
| updated_at | timestamptz | 35,6 | now() |
|
|
Indexes
| Constraint Name | Type | Sort | Column(s) |
|---|---|---|---|
| native_payment_transactions_pkey | Primary key | Asc | id |
| native_payment_transactions_gateway_idx | Performance | Asc/Asc | gateway + gateway_transaction_id |
| native_payment_transactions_idempotency_unique | Must be unique | Asc/Asc | practice_id + idempotency_key |
| native_payment_transactions_invoice_idx | Performance | Asc/Asc/Desc | practice_id + invoice_id + created_at |
| native_payment_transactions_patient_idx | Performance | Asc/Asc/Desc | practice_id + patient_id + created_at |
Check Constraints
| Constraint Name | Constraint |
|---|---|
| native_payment_transactions_gateway_check | ((gateway = 'fluidpay'::text)) |
| native_payment_transactions_gateway_environment_check | ((gateway_environment = ANY (ARRAY['sandbox'::text, 'production'::text]))) |
| native_payment_transactions_status_check | ((status = ANY (ARRAY['pending'::text, 'approved'::text, 'declined'::text, 'gateway_declined'::text, 'processor_error'::text, 'gateway_error'::text]))) |
| native_payment_transactions_currency_code_check | ((currency_code ~ '^[A-Z]{3}$'::text)) |
| native_payment_transactions_payment_method_type_check | ((payment_method_type = 'card_token'::text)) |
| native_payment_transactions_practice_id_check | ((practice_id <> ''::text)) |
| native_payment_transactions_amount_cents_check | ((amount_cents > 0)) |


