All Downloads are FREE. Search and download functionalities are using the official Maven repository.

sql.payments-postgres.sql Maven / Gradle / Ivy

Go to download

A standard set of utilities that makes it easy to build systems that need users, billing, etc giving the usefulness of a PaaS with the control of a local application

There is a newer version: 0.5.11
Show newest version
create table credit_card_transaction (
id BIGSERIAL,
created_on timestamp,
created_by bigint,
state varchar(16) NOT NULL DEFAULT 'INITIAL',
amount INTEGER,
organization_key bigint,
recurring_schedule_key bigint,
schedule_iteration INTEGER,
merchant_account_key INTEGER,
unique_id varchar(255),
retained boolean NOT NULL DEFAULT false,
ref_authorize_returned_id varchar(255),
token varchar(255),
order_id bigint,
description varchar(255),
authorize_started timestamp,
authorize_completed timestamp,
capture_started timestamp,
capture_completed timestamp,
vault_started timestamp,
vault_completed timestamp,
credit_card_brand varchar(16),
credit_card_number_masked varchar(20),
expiration_month INTEGER,
expiration_year INTEGER,
vault_returned_id varchar(255),
vault_response text,
authorize_returned_id varchar(255),
authorize_response text,
capture_returned_id varchar(255),
capture_response text,
result varchar(20),
result_message text,
PRIMARY KEY ("id")
);

CREATE TABLE merchant_account (
id BIGSERIAL,
created_on timestamp,
created_by bigint,
name varchar(255),
provider varchar(255),
token varchar(255),
type varchar(16) NOT NULL DEFAULT 'SPREEDLY',
third_party_vault boolean,
hidden boolean NOT NULL DEFAULT false,
credentials text,
PRIMARY KEY ("id")
);

CREATE INDEX credit_card_transaction_unique_id ON credit_card_transaction USING BTREE (unique_id);
CREATE INDEX credit_card_transaction_recurring_schedule_key ON credit_card_transaction USING BTREE (recurring_schedule_key);
CREATE INDEX credit_card_transaction_order_id ON credit_card_transaction USING BTREE (order_id);

ALTER TABLE merchant_account ADD COLUMN organization_key bigint;
CREATE INDEX merchant_account_organization_key ON merchant_account USING BTREE (organization_key);

CREATE TABLE recurring_schedule (
id BIGSERIAL,
created_on timestamp,
created_by bigint,
order_id bigint,
amount int,
payment_method_token varchar(255),
merchant_account_id bigint,
organization_id bigint,
total_payments int,
completed_payments int,
suspended boolean NOT NULL DEFAULT false,
interval_type varchar(10) NOT NULL DEFAULT 'MONTHLY',
interval_anniversary int,
PRIMARY KEY ("id")
);

CREATE TABLE recurring_schedule_log (
id BIGSERIAL,
created_on timestamp,
created_by bigint,
interval_type varchar(10) NOT NULL DEFAULT 'MONTHLY',
date_started timestamp,
date_completed timestamp,
schedules_json text,
PRIMARY KEY ("id")
);






© 2015 - 2024 Weber Informatics LLC | Privacy Policy