Skip to content
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
13 changes: 8 additions & 5 deletions api/src/main/scala/app/softnetwork/payment/api/SoftPayApi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,17 @@ trait SoftPayApi[SD <: SessionData with SessionDataDecorator[SD]] extends SoftPa
override implicit def system: ActorSystem[_] = sys
}

def paymentAccountToJdbcProcessorStream: ActorSystem[_] => PaymentAccountToJdbcProcessStream
def paymentAccountToJdbcProcessorStream
: ActorSystem[_] => Option[PaymentAccountToJdbcProcessStream] =
_ => None

def transactionToJdbcProcessorStream: ActorSystem[_] => TransactionToJdbcProcessorStream

override def paymentEventProcessorStreams: ActorSystem[_] => Seq[EventProcessorStream[_]] = sys =>
super.paymentEventProcessorStreams(sys) :+ paymentAccountToJdbcProcessorStream(
sys
) :+ transactionToJdbcProcessorStream(sys)
override def paymentEventProcessorStreams: ActorSystem[_] => Seq[EventProcessorStream[_]] =
sys =>
super.paymentEventProcessorStreams(sys) ++
paymentAccountToJdbcProcessorStream(sys).toSeq :+
transactionToJdbcProcessorStream(sys)

implicit def sessionConfig: SessionConfig = Settings.Session.DefaultSessionConfig

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,16 @@ object SoftPayEndpointsPostgresLauncher
override protected def manager: SessionManager[JwtClaims] = SessionManagers.jwt

override def paymentAccountToJdbcProcessorStream
: ActorSystem[_] => PaymentAccountToJdbcProcessStream = sys =>
new PaymentAccountToJdbcProcessStream
with JdbcJournalProvider
with JdbcOffsetProvider
with PostgresProfile {
override implicit def system: ActorSystem[_] = sys

override lazy val config: Config = SoftPayEndpointsPostgresLauncher.this.config
}
: ActorSystem[_] => Option[PaymentAccountToJdbcProcessStream] = sys =>
Some(
new PaymentAccountToJdbcProcessStream
with JdbcJournalProvider
with JdbcOffsetProvider
with PostgresProfile {
override implicit def system: ActorSystem[_] = sys
override lazy val config: Config = SoftPayEndpointsPostgresLauncher.this.config
}
)

override def transactionToJdbcProcessorStream
: ActorSystem[_] => TransactionToJdbcProcessorStream = sys =>
Expand All @@ -51,7 +52,6 @@ object SoftPayEndpointsPostgresLauncher
with JdbcOffsetProvider
with PostgresProfile {
override implicit def system: ActorSystem[_] = sys

override lazy val config: Config = SoftPayEndpointsPostgresLauncher.this.config
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,16 @@ object SoftPayRoutesPostgresLauncher
override protected def manager: SessionManager[JwtClaims] = SessionManagers.jwt

override def paymentAccountToJdbcProcessorStream
: ActorSystem[_] => PaymentAccountToJdbcProcessStream = sys =>
new PaymentAccountToJdbcProcessStream
with JdbcJournalProvider
with JdbcOffsetProvider
with PostgresProfile {
override implicit def system: ActorSystem[_] = sys

override lazy val config: Config = SoftPayRoutesPostgresLauncher.this.config
}
: ActorSystem[_] => Option[PaymentAccountToJdbcProcessStream] = sys =>
Some(
new PaymentAccountToJdbcProcessStream
with JdbcJournalProvider
with JdbcOffsetProvider
with PostgresProfile {
override implicit def system: ActorSystem[_] = sys
override lazy val config: Config = SoftPayRoutesPostgresLauncher.this.config
}
)

override def transactionToJdbcProcessorStream
: ActorSystem[_] => TransactionToJdbcProcessorStream = sys =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,17 @@ object SoftPayWithSchedulerEndpointsPostgresLauncher
override protected def manager: SessionManager[JwtClaims] = SessionManagers.jwt

override def paymentAccountToJdbcProcessorStream
: ActorSystem[_] => PaymentAccountToJdbcProcessStream = sys =>
new PaymentAccountToJdbcProcessStream
with JdbcJournalProvider
with JdbcOffsetProvider
with PostgresProfile {
override implicit def system: ActorSystem[_] = sys

override lazy val config: Config = SoftPayWithSchedulerEndpointsPostgresLauncher.this.config
}
: ActorSystem[_] => Option[PaymentAccountToJdbcProcessStream] = sys =>
Some(
new PaymentAccountToJdbcProcessStream
with JdbcJournalProvider
with JdbcOffsetProvider
with PostgresProfile {
override implicit def system: ActorSystem[_] = sys
override lazy val config: Config =
SoftPayWithSchedulerEndpointsPostgresLauncher.this.config
}
)

override def transactionToJdbcProcessorStream
: ActorSystem[_] => TransactionToJdbcProcessorStream = sys =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,16 @@ object SoftPayWithSchedulerRoutesPostgresLauncher
override protected def manager: SessionManager[JwtClaims] = SessionManagers.jwt

override def paymentAccountToJdbcProcessorStream
: ActorSystem[_] => PaymentAccountToJdbcProcessStream = sys =>
new PaymentAccountToJdbcProcessStream
with JdbcJournalProvider
with JdbcOffsetProvider
with PostgresProfile {
override implicit def system: ActorSystem[_] = sys

override lazy val config: Config = SoftPayWithSchedulerRoutesPostgresLauncher.this.config
}
: ActorSystem[_] => Option[PaymentAccountToJdbcProcessStream] = sys =>
Some(
new PaymentAccountToJdbcProcessStream
with JdbcJournalProvider
with JdbcOffsetProvider
with PostgresProfile {
override implicit def system: ActorSystem[_] = sys
override lazy val config: Config = SoftPayWithSchedulerRoutesPostgresLauncher.this.config
}
)

override def transactionToJdbcProcessorStream
: ActorSystem[_] => TransactionToJdbcProcessorStream = sys =>
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ThisBuild / organization := "app.softnetwork"

name := "payment"

ThisBuild / version := "0.9.2"
ThisBuild / version := "0.9.3"

ThisBuild / scalaVersion := scala212

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
CREATE TABLE IF NOT EXISTS transaction (
id VARCHAR(255) NOT NULL PRIMARY KEY,
order_uuid VARCHAR(255) NOT NULL,
nature VARCHAR(20) NOT NULL,
transaction_type VARCHAR(30) NOT NULL,
status VARCHAR(50) NOT NULL,
amount INTEGER NOT NULL,
currency VARCHAR(3) NOT NULL DEFAULT 'EUR',
fees INTEGER NOT NULL DEFAULT 0,
result_code VARCHAR(50) NOT NULL,
result_message TEXT NOT NULL,
author_id VARCHAR(255) NOT NULL,
payment_type VARCHAR(20) NOT NULL DEFAULT 'CARD',
created_date TIMESTAMP NOT NULL,
last_updated TIMESTAMP NOT NULL,
payment_method_id VARCHAR(255),
redirect_url TEXT,
reason_message TEXT,
credited_wallet_id VARCHAR(255),
credited_user_id VARCHAR(255),
debited_wallet_id VARCHAR(255),
debited_user_id VARCHAR(255),
mandate_id VARCHAR(255),
pre_authorization_id VARCHAR(255),
recurring_pay_in_registration_id VARCHAR(255),
external_reference VARCHAR(255),
pre_authorization_validated BOOLEAN,
pre_authorization_canceled BOOLEAN,
pre_authorization_expired BOOLEAN,
pre_authorization_debited_amount INTEGER,
return_url TEXT,
paypal_payer_email VARCHAR(255),
idempotency_key VARCHAR(255),
client_id VARCHAR(255),
payment_client_secret TEXT,
payment_client_data TEXT,
payment_client_return_url TEXT,
source_transaction_id VARCHAR(255),
transfer_amount INTEGER,
pre_registration_id VARCHAR(255),
paypal_payer_id VARCHAR(255),
pay_in_id VARCHAR(255),
deleted BOOLEAN NOT NULL DEFAULT FALSE
);

CREATE INDEX idx_transaction_order_uuid ON transaction(order_uuid);
CREATE INDEX idx_transaction_author_id ON transaction(author_id);
CREATE INDEX idx_transaction_status ON transaction(status);
CREATE INDEX idx_transaction_type ON transaction(transaction_type);
CREATE INDEX idx_transaction_client_id ON transaction(client_id);
CREATE INDEX idx_transaction_recurring ON transaction(recurring_pay_in_registration_id);
CREATE INDEX idx_transaction_payment_type ON transaction(payment_type);
Loading
Loading